【发布时间】:2020-03-24 07:17:12
【问题描述】:
我有一个构建器脚本来创建 Docker 映像。在那个构建器脚本中,我将二进制名称作为 build-args 传递。
但是,当我在入口点将它用作:Entrypoint["./"${pkg}] 时,它确实解析了pkg Docker 容器无法运行并显示“./rtspappserver not found”。
这里的rtspappserver 是pkg 名称。我从脚本发送的构建参数在 Dockerfile 中设置为 ENV vars。
以下是 Dockerfile 供参考:
#Download base image ubuntu 18.04
FROM ubuntu:18.04
ARG package_name
ENV TZ=Etc/UTC
ENV pkg=$package_name
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Update and dist-upgrade ubuntu
RUN apt update -y && \
apt dist-upgrade -y && \
apt install -y python-heatclient
WORKDIR /
COPY ${pkg} /
ENTRYPOINT ["./rtspappserver"]
【问题讨论】:
标签: docker dockerfile