Docker commands

List of useful docker commands:

A container is an instance of an image.

Install :

Check this docker hub repo:

[code language=”bash”]
# Show available docker images
docker images

# Download image
docker pull debian

# Delete image
docker image rm <IMAGE_ID>

# Show containers
docker ps -a

# Create container from image
docker run -it –name="<CONTAINER_NAME>" <IMAGE_ID>
# You can forward ports with -p <HOST_PORT>:<CONTAINER_PORT>
# You can mount folders with -v /host/dir:/container/dest

# Delete container
docker rm <CONTAINER_ID>

# Run image interactively (creates container and removes it on exit)
docker run -it –rm=true <IMAGE_ID>

# Build docker image from Dockerfile, will be accessible by name <IMAGE_NAME>
docker build -t <IMAGE_NAME> .

# Stop container
docker stop <CONTAINER_ID>

# List volumes
docker volume ls

# Rename container

# Add docker network
docker network create –subnet= <NETWORK_NAME>

# List docker networks
docker network list

# Delete docker network
docker network remove <NETWORK_ID>

# Start container with given IP in given network
docker run –net <NETWORK_NAME> –ip -it –rm=true <IMAGE_NAME>

# Start container with given host name
docker run -it –rm=true -h <HOST_NAME> <IMAGE_NAME>

This seems a nice UI for docker:
[code language=”bash”]
docker run -d -p 10086:10086 -v /var/run/docker.sock:/var/run/docker.sock tobegit3hub/seagull
Then go to