Summary of Dockerfiles.
External links:
podman
also reads a Containerfile
(also CPP-processed Containerfile.in
)rm ~/.config/containers/libpod.conf
.dockerignore
file (podman variant?)--cache-from
?.dockerignore
with podman
/buildah
?Needs:
$ docker build . $ docker build dir/ $ docker build -f /path/to/Dockerfile . $ docker build -t automatron . $ docker build -t automatron https://github.com/madflojo/automatron.git $ docker build -t automatron http://example.com/automatron.tar.gz
Dockerfile
and .dockerignore
; they're sent, anyway.**/*.go
, and exceptions using !
FROM
instruction (after possible ARG
directives)$ docker inspect
Two forms:
ENV <key> <value> ENV <key1>=<value1> <key2>=<value2> ...
Set on command line:
$ docker run --env <key>=<value> ...
Two forms:
/bin/sh -c
)Each RUN commits a new image, used in the next step.
To set environment for a single command:
RUN <key>=<value> <command>
.dockerignore
file, see here
COPY
is preferred, except for URLs and tarballs, etc, or if you're redirecting from STDIN where there is no build context; the Dockerfile at the root of the archive will be used as the build context.
Types:
docker run -p/-P
to actually expose ports