<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Docker on Random Musings</title><link>https://chengl.com/tags/docker/</link><description>Recent content in Docker on Random Musings</description><generator>Hugo</generator><language>en-us</language><copyright>Cheng Long</copyright><lastBuildDate>Sun, 30 Jul 2017 16:07:37 +0000</lastBuildDate><atom:link href="https://chengl.com/tags/docker/index.xml" rel="self" type="application/rss+xml"/><item><title>Keeping configurations sane for multiple projects on Google Container Engine</title><link>https://chengl.com/post/working-with-multiple-projects-on-gke/</link><pubDate>Sat, 18 Feb 2017 09:27:00 +0000</pubDate><guid>https://chengl.com/post/working-with-multiple-projects-on-gke/</guid><description>&lt;p&gt;In my &lt;a href="https://chengl.com/kubectl-authentication-made-simple/"&gt;previous post&lt;/a&gt;, I present the easist and most secure way to get &lt;code&gt;kubectl&lt;/code&gt; working for one project. But what about mutiple projects? Juggle mutiple projects on Google Container Engine (GKE) can be hard, especially when its configurations are admittedly &lt;a href="https://github.com/kubernetes/kubernetes/issues/20605"&gt;quirky&lt;/a&gt;. This post describes the best practice, in my opinion, to keep configurations sane and easy to switch.&lt;/p&gt;
&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;p&gt;Suppose you have an awesome app that runs on GKE. You probably want to have two different environments &lt;code&gt;staging&lt;/code&gt; and &lt;code&gt;production&lt;/code&gt;, and the environments should be completely isolated. So you create two projects on GKE, &lt;code&gt;awesome-app-staging&lt;/code&gt; and &lt;code&gt;awesome-app-production&lt;/code&gt;, and provisioned resources for each. Now the question is how to effectively switch between the two projects on command line without repeating &lt;a href="https://github.com/kubernetes/kubernetes/issues/20605#issuecomment-218322105"&gt;these commands&lt;/a&gt; over and over again.&lt;/p&gt;</description></item><item><title>Docker Workflow</title><link>https://chengl.com/post/docker-workflow/</link><pubDate>Wed, 25 May 2016 09:07:00 +0000</pubDate><guid>https://chengl.com/post/docker-workflow/</guid><description>&lt;p&gt;In my previous posts, I demoed how to orchestrate Docker with &lt;a href="https://chengl.com/orchestrating-docker-using-swarm/"&gt;Swarm&lt;/a&gt; and &lt;a href="https://chengl.com/orchestrating-docker-with-kubernetes/"&gt;Kubernetes&lt;/a&gt;. They all assume the Docker image &lt;a href="https://hub.docker.com/r/chenglong/simple-node/"&gt;chenglong/simple-node&lt;/a&gt; is already there and ready to be deployed. But how to develop that image in the first place? How to streamline and automate the process of developing it on local machine, building and testing it on Continuous Integration (CI) server, and finally deploying to production?&lt;/p&gt;
&lt;p&gt;This post introduces one possible Docker workflow.&lt;/p&gt;</description></item><item><title>Orchestrating Docker with Kubernetes</title><link>https://chengl.com/post/orchestrating-docker-with-kubernetes/</link><pubDate>Sun, 15 May 2016 09:04:00 +0000</pubDate><guid>https://chengl.com/post/orchestrating-docker-with-kubernetes/</guid><description>&lt;p&gt;This is my second post on Docker orchestration. In &lt;a href="https://chengl.com/orchestrating-docker-using-swarm/"&gt;the first post&lt;/a&gt;, I demonstrated orchestrating Docker with Swarm, Machine, Compose and Consul. This post is to demonstrate orchestrating the same app with Kubernetes and draw comparisons between them. I recommend reading &lt;a href="https://chengl.com/orchestrating-docker-using-swarm/"&gt;that post&lt;/a&gt; before this.&lt;/p&gt;
&lt;h3 id="introduction-to-kubernetes"&gt;Introduction to Kubernetes&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Kubernetes is an open-source system for automating deployment, operations, and scaling of containerized applications.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;It groups containers that make up an application into logical units for easy management and discovery. Kubernetes builds upon &lt;a href="http://queue.acm.org/detail.cfm?id=2898444"&gt;a decade and a half of experience of running production workloads at Google&lt;/a&gt;, combined with best-of-breed ideas and practices from the community.&lt;/p&gt;</description></item><item><title>Orchestrating Docker with Swarm, Machine, Compose and Consul</title><link>https://chengl.com/post/orchestrating-docker-using-swarm/</link><pubDate>Fri, 15 Apr 2016 09:01:00 +0000</pubDate><guid>https://chengl.com/post/orchestrating-docker-using-swarm/</guid><description>&lt;p&gt;With &lt;a href="https://blog.docker.com/2015/11/docker-multi-host-networking-ga/"&gt;multi-host networking ready for production&lt;/a&gt; and &lt;a href="https://blog.docker.com/2015/11/swarm-1-0/"&gt;the announcement of Swarm 1.0&lt;/a&gt;, I think it&amp;rsquo;s time to give Docker a serious try. This post details the steps I took to orchestrate a multi-host and multi-container app.&lt;/p&gt;
&lt;h3 id="architecture"&gt;Architecture&lt;/h3&gt;
&lt;p&gt;&lt;img src="https://chengl.com/content/images/2017/07/Screen-Shot-2016-04-15-at-12-57-55-AM.png" alt="Screen-Shot-2016-04-15-at-12-57-55-AM"&gt;&lt;/p&gt;
&lt;p&gt;This is a simple Node app that uses Redis as database, load balanced by Nginx. Each blue box is a Docker host, which runs several containers. All hosts talk to Consul for service discovery. The cluster has 5 nodes, each serves a specific purpose. We want to easily scale up and down the number of &lt;code&gt;app&lt;/code&gt; containers.&lt;/p&gt;</description></item><item><title>Using Docker for Rails Development</title><link>https://chengl.com/post/using-docker-for-rails-development/</link><pubDate>Sun, 14 Feb 2016 08:49:00 +0000</pubDate><guid>https://chengl.com/post/using-docker-for-rails-development/</guid><description>&lt;h3 id="why"&gt;Why&lt;/h3&gt;
&lt;p&gt;There are many use cases of Docker. I see people primarily using it for Continous Integration and deployment. But Docker is also good for development. The obvious advantages of using Docker for development are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No need to install app dependencies on dev machines. App dependencies are built into Docker images. Hence, the dev machines are not messed up with crazy dependencies. The only dependency needed on dev machines is Docker, nothing else.&lt;/li&gt;
&lt;li&gt;Have a consistent development environment for all developers. No more excuse like &amp;ldquo;&lt;strong&gt;It works on my machine&lt;/strong&gt;&amp;rdquo;!&lt;/li&gt;
&lt;li&gt;Onboard new developers quickly. No need to spend hours setting up new dev machine and configuring it. You only need &lt;code&gt;docker-compose up&lt;/code&gt; and you can start coding.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="prerequisites"&gt;Prerequisites&lt;/h3&gt;
&lt;p&gt;This post will show you how to setup a Ruby on Rails development environment using Docker. My dev machine has&lt;/p&gt;</description></item></channel></rss>