Docker Introduction
Docker is a system to build containers and ship them to server. When Meteor is installed in a docker container, everything needed to run a meteor app is in the container. To run a meteor app on a new machine, download the meteor container and start it with docker.
- Install
- Run ‘Hello World’
- Docker commands
Run all the commands below as root.
1- Install (Debian Jessie)
Install the package from apt, this is an older docker version:
docker.io is in debian unstable, add this line your apt/source.list:
deb http://debian.lth.se/debian/ unstable mainapt-get update
apt-get install docker.ioOr download the docker binary from the web:
wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker
chmod +x /usr/bin/dockerNow, you can remove the unstable source from your apt/source.list.
2- Run ‘Hello World’
docker run ubuntu:14.04 /bin/echo ‘Hello world’This command does the following steps:
- download the image of ubuntu 14.04 from docker hub
- create and start a container
- run the command /bin/echo ‘Hello world’ in the container
Docker hub is a public repository of docker images, lots of software is already packaged in docker images. Just run the command docker run image_name to start using them.
3- Docker commands
docker psLists running containers
docker ps -aLists all containers
docker stop containerStops a container
docker run -t -i ubuntu:14.04 /bin/bashOpens a terminal in an ubuntu container. Option -t is for terminal Option -i is for interactive
Futher reading: see docker docs