83 private links
Example project showing how to test Ansible roles with Molecule using Testinfra and a multiscenario approach with Docker, Vagrant & AWS EC2 as infrastructure providers - jonashackt
To explain what's going on: When building, Docker will keep track of the files added with each build step in it's cache. It's storing checksums for each file to skip build steps when they probably don't need to be repeated. E.g. if you would add a python package to the requirements.txt, Docker would notice the invalidated cache because of that checksum and start building again beginning from step 3 (COPY requirements.txt /usr/src/paperless/). Checkout Dockers best practices section for further details.
A side effect of this is, that only your local files are considered. E.g. Docker would not notice a newly uploaded package to PyPI which would be accepted by an cached requirements.txt. (you can use docker build --no-cache=true to force rebuild)
ENTRYPOINT or CMD can be placed anywhere in the Dockerfile, the last occurrence wins for each of them. Since it takes around 2 seconds on my machine to process each of these instructions, I've put them a bit up, so we can profit from another speedup there.
The answer is docker's attach command. So for my example above the solution will:
$ sudo docker attach 665b4a1e17b6 #by ID
or
$ sudo docker attach loving_heisenberg #by Name
$ root@665b4a1e17b6:/#
UPDATE: (docker >= 1.3) Thanks to WiR3D user who suggested another way to get container's shell. If we use attach we can use only one instance of shell. So if we want open new terminal with new instance of container's shell, we just need run the following:
$ sudo docker exec -i -t 665b4a1e17b6 /bin/bash #by ID
or
$ sudo docker exec -i -t loving_heisenberg /bin/bash #by Name
$ root@665b4a1e17b6:/#
Automatically restarts containers which fail healthchecks
Some thoughts in comparing and combingin docker and ansible
Dive into Docker - costs $49, but seems comprehensive
dockerized version of kin calendar to replace sunrise calendar