Skip to content

Dockerfile instructions: FROM, WORKDIR, COPY, RUN, EXPOSE, USER

Select an icon to see what it is.

Step 1 of 6

FROM chooses the starting point

FROM names the base image, here alpine, and every later instruction builds on top of it. The base image's layers become the bottom of your image, and FROM adds none of its own. Pick a small, maintained base, such as a -slim or alpine variant of an official image.

$ docker build -t idemo .
PrevNext

Dockerfile (read through the build session)

FROM alpine
WORKDIR /app
COPY app.sh .
RUN chmod +x app.sh
EXPOSE 3000
USER nobody
CMD ["./app.sh"]