12.1 install and clean
sudo apt -y install docker.io
Then you need to add your acount into
## you may need to relogin to let it effect sudo usermod -a -G docker $USER
Docker image takes a lot of space, so remember to clean periodically.
docker system prune docker rmi `docker images -f "dangling=true" -q`
12.2 container (
-dtkeeps the container running in the background
--rmautomatically remove the container
--restart unless-stoppedrestart the container when you restart OS
- after mount, existing files’ user keeps unchanged, while new files belongs to user in the container (usually root). In other words, files produced by the container is very hard to manipulate on host OS.
The technique is firstly used for evading GitHub API limit in installing R packages.↩︎