【发布时间】:2022-11-19 02:25:34
【问题描述】:
这是我的Dockerfile:
FROM alpine
ENV app_environment="prod"
ARG app_dir
RUN echo ${app_dir}
COPY filecopytest.txt ${app_dir}/filecopy.txt
WORKDIR /
CMD ["sh"]
当我尝试运行docker build --build-arg app_dir="app_dir_arg" --tag arg_env:1.0 --file arg_env . 时,它抛出了这个错误:
[+] Building 0.1s (1/2)
=> [internal] load build definition from arg_env 0.1s
=> => transferring dockerfile: 2B 0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount7787963245/arg_env: no such
file or directory`.
在我现在的目录中,我有一个Dockerfile 和一个名为filecopytest.txt 的txt 文件。
【问题讨论】:
-
尝试在没有
--file arg_env的情况下发出构建命令。
标签: docker