In a previous article we saw an example of a simple CI/CD stack that we are using at TRAXxs.
This article is the first one of a serie dedicated to Docker for AWS.
A couple of days ago, I was happy to receive an invitation to the Docker for AWS beta.
Docker 1.12 introduced the notion of Distributed Application Bundle. As a very happy user of Docker Compose , I was wondering how Compose and DAB were related. Will DAB replace Compose ? Does not seem so. In fact a DAB file can be created from a Compose file and then deployed on a cluster.
Let’s try to see how this is working.
The service deployed was a very basic Node.js application that returns the name of a random city of the world and the ip of the container handling the request. The only usage of this service was to test the services api.
We will now deployed a whole application made of several services as represented below.
The purpose of this article is to explain how to deploy a service on a cluster created with Swarm mode of Docker 1.12
Swarm made easy
One of the biggest changes presented during DockerCon 2016 (gosh… I wish I was there) is the swarm mode of Engine 1.12. What does that mean ? That you can create a swarm cluster out of the box if you have the Docker daemon 1.12 running.
A command as simple as:
$ docker swarm init
is enough to create a Swarm. A Swarm with a single management node but still a Swarm.
When using docker-machine to create a Docker host, it’s very easy to ssh onto the host and play with it.
docker-machine ssh HOSTNAME
When you are using Docker for Mac (like I am), there is no such ssh command out of the box, so… supposed you need to log into the VM that is running on your MAC, how are you supposed to do it ?
All the stuff
- I’m using right now
- I’ve been working with
- I’m interested in
- I’ve been curious about
Only good stuff that I really like playing with.
Thanks to StackShare for the layout
When I started to work at TRAXxs (we are doing some pretty cool stuff there btw 🙂 ), there was a lot of things to put in place to setup our back-end / front-end layers. The cool thing was the possibility to select the technologies we will use… Let’s go Docker, Node.js, Mongo + other cool stuff then (a little bit of Clojure + some Go, as they are languages that Im also very interested in).
At TRAXxs, we are working on connected insole devices. To keep it simple, on the server side (the part I’m in charge) we collect the data, make some analysis and expose it to the clients via api and web front-end. There is, obviously, much more than this but this is a cool summary.
A not so great Dockerfile
Not that long ago, when I needed to dockerize my Node.js application, I used a Dockerfile like the following one.
FROM node:4.4.5 # Copy src files COPY . /app/ # Use /app working directory WORKDIR /app # Expose API port EXPOSE 80 # Build dependencies RUN npm install # Run application CMD ["npm", "start"]