簡單的 Dockerfile
# Base image
FROM python:2.7-alpine
# Metadata
MAINTAINER John Doe <johndoe@example.com>
# System-level dependencies
RUN apk add --update \
ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/cache/apk/*
# App dependencies
COPY requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
# App codebase
WORKDIR /app
COPY . ./
# Configs
ENV DEBUG true
EXPOSE 5000
CMD ["python", "app.py"]
MAINTAINER 將在 Docker 1.13 中棄用,應該使用 LABEL 替換。 ( 來源 )
示例:LABEL Maintainer =“John Doe johndoe@example.com”