我是 docker 的菜鸟,我正在尝试为 python3 构建一个多级 dockerfile
FROM ubuntu:18.04 as base
RUN apt-get -qy update && apt-get install python3 -y
WORKDIR /pydocktest
COPY test.py .
FROM ubuntu:18.04 AS release
WORKDIR /pytest
COPY --from=base /usr/local/bin/ /usr/local/bin/
COPY --from=base /pydocktest .
CMD ["./test.py"]
然后
docker build -t test .
docker run test
输出
standard_init_linux.go:211: exec user process caused "no such file or directory"
但是当我apt -get install python3
在release
零件中运行时,它可以完美运行吗?那么,如果我要重新安装python,为什么需要多阶段对不起,如果我听起来转储