docker build \
--progress=plain \
--file Dockerfile.p-airsync \
-t p-airsync:a \
.
docker build \
# Show complete log
--progress=plain \
# Nested dockerfile, useful for monorepos when we want to preserve CWD
--file nested/a/Dockerfile \
# tag can be anything
-t nested:a \
# load .env from file if they're needed for build
$(for i in `cat nested/a/.env`; do out+="--build-arg $i " ; done; echo $out;out="") \
# CWD for Docker build, in a monorepo this should be repo root
.
docker run \
# Automatically remove the container when it exits
--rm \
# Map all inside ports to the host interface
-P \
# L
--env-file nested/a/.env
$TAG_NAME
- ensure
--progress=plain
is on - use log commands, e.g.
RUN ls -r
- bypass failing commands with
|| true
if needed - end with an empty
CMD
sh
into container withdocker run -it $TAG_NAME sh
RUN du -sh -- * | sort -h