Create image
- create a docker file
FROM Ubuntu
RUN apt-get updates
RUN apt-get install python
RUN pip install flask
RUN pip install flask-mysql
COPY . /opt/source-code
ENTRYPOINT FLASK_APP=/opt/source-code/app.py flask run
- build image
docker build Dockerfile -t container/app
- make it avaliable
docker push container/app
CMD
docker run ubuntu [COMMNAD]
docker run ubuntu sleep 5
docker ps
write command in the docker file
- docker file : ubuntu-sleeper
FROM Ubuntu
CMD sleep 5
docker build ubuntu-sleeper .
docker run ubuntu-sleeper
entry point and cmd
FROM uBUNTU
ENTRYPOINT ["sleep"]
CMD ["5"]
// overwrite the cmd in docker file
docker run ubuntu-sleeper 5
In this case, if only run docker run ubuntu-sleeper, it will sleep 5 second.