[docs.docker.com] Docker CLI - command list
[docs.docker.com] - Dockerfile reference
builds Docker images from a Dockerfile and a “context”. A build’s context is the set of files located in the specified PATH or URL. Usually current dir.
# build then tag the resulting image.
# The repository name will be vieux/apache
# and the tag will be 2.0
docker build -t vieux/apache:2.0 .
# use specific file for the build instructions
# instead of Dockerfile
docker build -f Dockerfile.debug .
The docker run command
That is, docker run is equivalent to the
A stopped container can be restarted with all its previous changes intact using docker start
docker run --name test -it debian
This example runs a container named test using the debian:latest image.
docker ps -a --no-trunc --format "{{.ID}}: {{.Command}}" | awk '{print substr($1,0,6), $2}'
docker inspect 123abc
docker logs 123abc
docker cp 123abc:/usr/local/apache2/conf/httpd.conf .
[docs.docker.com] Overlay - publish ports
# Map TCP port 443 in the container to port 3131 on the overlay network
docker run -p 3131:443
Containers leverage and share the host kernel. Build locally, deploy to the cloud.
An image is an executable package that includes everything needed to run an application
A container is a runtime instance of an image
what the image becomes in memory when executed (that is, an image with state, or a user process)
[bitnami] How to use bitnami images, redis example
/var/lib/docker/
docs.docker.com/storage/volumes/
--mount consists of multiple key-value pairs, separated by commas and each consisting of a <key>=<value> tuple.
bind
, volume
, or tmpfs
source
, src
)destination
, dst
, target
)If you start a container with a volume that does not yet exist, Docker creates the volume for you