docker build 时传入动态参数

[root@fangjike temp]# cat Dockerfile 
FROM python:2.7-slim

COPY startup.sh /opt

RUN chmod +x /opt/startup.sh

ARG envType=default_value
ENV envType ${envType}

CMD ["/opt/startup.sh","${envType}"]

# docker build -t yellow:2.0 --build-arg envType=dev .
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐