But: there is a pretty steep learning curve.
Docker is like the polyjuice potion from Harry Potter. You mix the potion, add a hair of the other person, and you suddenly look exactly like that other person.
Dockerfile, that is the hair. The DNA that tells exactly what you want it to look like. (She showed how the format looked).
docker buildactually brews the potion. It builds the image according to the instructions in the
Ok. Which images do I have? Image Revelio!:
docker images. Same with
docker container ls.
From that command, you can grap the ID of your running container. If you want
to poke around in that running container, you can do
docker exec -it THE_ID
Stop it? Stupefy!
docker stop THE_ID. But that’s just pause. If it is
Avada kedavra! you want:
docker kill THE_ID.
Very handy: docker-compose. It comes with docker on the mac, for other systems it is an extra download. You have one config file with which you can start multiple containers. It is like Hermione’s magic bag. One small file and you can have it start lots of things.
It is especially handy when you want to talk to, for instance, a postgres
database. With two lines in your
docker-compose.yml, you have a running
postgres in your project. Or an extra celery task server.
Starting up the whole project is easier than with just plain docker:
docker-compose up! Running a command in one of the containers is also
The examples are at https://github.com/williln/docker-hogwarts
Photo explanation: station signs on the way from Utrecht (NL) to Heidelberg (DE).
My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):