What and Why?
- Docker is an open source virtualization technology that makes it easy to build, test and deploy applications.
- You can ship your applications in a container environment that houses everything your application need to run (configuration, code,…)
Abbreviate
ps
= process status: check running containers (witha
for all)i
= interactive: used indocker exec
ordocker run
t
= terminal: used indocker exec
ordocker run
m
= memoryv
or-volume
: mount volume in/out containers-rm
= remove: create temprarily a container (removed after exit)
Installation
Info
For all platform, please check the official guide
P/S: On MacOS I recommend using Orbstack that is native MacOS and free for Personally uses. It’s really light, fast and simple way to use Linux Machines.
Troubleshooting
Got permission denied while trying to connect to the Docker daemon socket
- Create the docker group:
sudo groupadd docker
- Create the docker group:
sudo usermod -aG docker ${USER}
- Logout and login again Source:https://www.digitalocean.com/community/questions/how-to-fix-docker-got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket
- Create the docker group:
Another application changed your Desktop configurations
- Create symlink for docker-credential-ecr-login: `sudo ln -sf /Applications/Docker.app/Contents/Resources/bin/docker-credential-ecr-login /usr/local/bin/docker-credential-ecr-login Source: https://github.com/docker/for-mac/issues/7109
Some usually commands
Multi-column
Images
Container
Others
Attach/Start/Stop
We can use sometimes interchangeable between <container_id>
and <container_name>
.