Docker packages the python command in detail


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