Use Dockerfile to build an image

General steps:

1. Prepare the environment on which you need to run commands

2. Add the command to be run to the image to be built

3. Run the command

E.g:

FROM python:2.7
LABEL maintainer="[email protected]"
RUN pip install flask

COPY app.py /app/

WORKDIR /app
EXPOSE 5000

CMD ["python", "app.py"]

 

Published 25 original articles · Like2 · Visits 20,000+

Guess you like

Origin blog.csdn.net/longjuanfengzc/article/details/89335213