我的dockerfile如下所示:
FROM python:2.7 as builder
RUN pip install pika
RUN pip install requests
RUN pip install simplejson
RUN pip install datetime
RUN pip install grequests
RUN pip install urllib
RUN pip install pandas
COPY Action.py ./Action.py
COPY UtilFunctions.py ./UtilFunctions.py
WORKDIR /app
COPY . .
FROM apline
WORKDIR /app
COPY --from=builder /app /app
CMD [ "python","-u","./Action.py" ]
建筑时 - > sudo docker build --rm -t rule1-test。
给出以下错误 - >
Step 1 : FROM python:2.7 as builder
Error parsing reference: "python:2.7 as builder" is not a valid repository/tag
Docker版本如下:
Docker version 1.12.6, build 88a4867/1.12.6
此版本不支持多级 我已经使用
在centos机器上安装了docker yum install docker
答案 0 :(得分:4)
多阶段构建是Docker 17.05中的一项新功能,因此您必须将Docker版本更新为17.05或更新版本。