Skip to main content

Cheat Sheet

docker pull <image> -> Download image on its latest version from docker hub
docker images -> Lists images
docker run <image> -> Starts container attached. If local image not found, it downloads it
docker run -d <image> -> Starts container detached
docker run <image>:<version> -> Starts container in specific version
docker run -p<accessible_port>:<internal_port> -> Binds a port from the service within docker (internal_port)) to an accessible_port
docker ps -> Shows running containers
docker ps -a -> Shows running and stopped conatiners containers
docker stop <ID> -> Stop container ID of container (get it from docker ps)
docker start <ID> -> Start container previously stopped. ID of container (get it from docker ps -a)

 

Docker failing to start

Check the error running it in debug mode:

dockerd --debug

In case the error is something like:
failed to start daemon: Error initializing network controller: Error creating default "bridge" network: Failed to program NAT chain: ZONE_CONFLICT: 'docker0' already bound to a zone

Run:

sudo firewall-cmd --permanent --zone=trusted --remove-interface=docker0
sudo firewall-cmd --permanent --zone=FedoraWorkstation --remove-masquerade
sudo firewall-cmd --reload
sudo systemctl restart docker