Index

dockerfile

build an image from a dockerfile
docker build -f [dockerfile] .
tag the created image
docker build --tag [mytag]:latest -f [dockerfile] .

dockerfile contents

specify original image
FROM ubuntu
run a command on image
RUN date > /tmp/hello
run a command as a specific user
USER [name]
RUN [cmd]
run a command as a specific user in specific group
USER [name]:[group]
RUN [cmd]
set an environment property
ENV [key] [value]

documentation

https://docs.docker.com/engine/reference/builder/
https://docs.docker.com/engine/reference/commandline/build/