Suppose there is an application which uses
docker-compose to run
and you want to try it in swarm mode.
First of all you need to initialize swarm nodes.
When you start to use Docker, at some point there will be a question - where is all my space. Most of it is occupied by containers, images and dangling volumes.
An easy way to clean is to use Docker garbage collection by Spotify and
docker volume rm commands. I have an alias for this.
alias docker-gc='docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /etc:/etc -e GRACE_PERIOD_SECONDS=172800 spotify/docker-gc && docker volume rm $(docker volume ls -qf dangling=true)'
On mac sometimes it’s easier to remove all, for this you need to remove
Docker.qcow2 in the
~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux folder. You can find this path in the
Docker -> Preferences -> Advanced dialog.
I have nginx as a proxy for a python application. To launch them I have a docker-compose.
When you work on the backend part of django or flask project and there are many static files, sometimes the development server becomes slow. In this case it’s possible to use nginx as reverse proxy to serve static. I’m using nginx in docker and the configuration is quite simple.
© 2018 Andrey Zhukov's Tech Blog.