Hsi*_*sao 15 linux ubuntu docker dockerfile docker-compose
我有一个Dockerfile,有这样的语法 COPY ["Gemfile", "Gemfile.lock", "Procfile", ".env", "/huginn/"]
我RUN /bin/bash -l -c "ls -a"
用来检查文件应对状态,我发现.env文件不要复制到图像.
我将.env文件名更改为test.env并使用COPY ["Gemfile", "Gemfile.lock", "Procfile", "test.env", "/huginn/"]
,然后它工作,test.env被复制到图像.
谁知道为什么?任何解决方案都可以让COPY
docker 支持.env文件名?
pl_*_*ock 20
如果你有.dockerignore
文件,那么它可能是你添加到忽略隐藏文件,如.git
,.vagrant
等.
如果.dockerfile
忽略隐藏文件,则可以启用不忽略或更改文件名.
.dockerignore 文件文档中有一个声明:
Note: For historical reasons, the pattern . is ignored.
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
8818 次 |
最近记录: |