Docker 🐋 quick guide
Posted on 18 Oct, 2020
Remove docker image.
Remove docker container.
Build a docker image with a name.
Run a container.
Stop a container.
Run a container in detach mode (run in background).
For the love of God always add a
-d
while running a container. Speaking this from experience.If you don't run in detach mode, you won't be able to Ctrl+C (or exit), instead use Ctrl+PC (yes the P key and C key).
List docker volumes.
Remove docker volume.
Check port mapping.
Starting a docker container
The first two letters of CONTAINER_ID can be provided as an argument too.
Run a command inside container.
Check history of an image.
Connect to local port inside container.
Docker Compose
Tip: Alias
docker-compose
to an alias likedc
to make your life better
Build and run containers.
Start compose in detached mode
Stop containers.
Check logs/console messages.
To clear log output, use
cmd + k
, orctrl + k
List all containers.
Docker Quick Steals
Run a postgres container.
Get psql using
Last updated