Skip to main content

Dockerfile ↔ plaintext doc with Code to instruct Docker on how to build Docker Container Image

FROM ubuntu:20.04

RUN apt-get install sl

ENV PORT=8080

CMD ["echo", "to set default command to echo when container runs"]

FROM

to set OS version to pull from CDN

RUN

to run Shell command

ENV

to set Environment Variable to persist on image run

CMD []

to set default command on Container run

ADD

COPY

to copy new files/dir from <src> to Container fs <dest>

ENTRYPOINT

VOLUME

EXPOSE

to expose Port (TCP|UDP) for Container to listen at Runtime

References