Docker

[docs.docker.com] Docker CLI - command list

[docs.docker.com] - Dockerfile reference

Docker build

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 .

Docker run

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.

Inne

Docker PS - formatting

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

Docker container, docker image

[docs.docker] get started

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)

Get Docker CE for Ubuntu

[bitnami] How to use bitnami images, redis example

/var/lib/docker/

Docker Volumes

docs.docker.com/storage/volumes/

--mount consists of multiple key-value pairs, separated by commas and each consisting of a <key>=<value> tuple.

If you start a container with a volume that does not yet exist, Docker creates the volume for you