Docker packages the python command in detail
- 2020-05-30 21:20:53
- OfStack
Recently, I wrote a crawler in Python. In order to isolate its running environment and make it easy to distribute, I packaged the project into Docker images
Dockerfile
FROM python:2.7.12-alpine
ADD ./src /job
CMD ["python", "/job/main.py"]
Build commands
$ docker build -t job .
run
$ docker run -d --name job job
Relatively simple