Issue
I have a Dockerfile and there is a syntax like this COPY ["Gemfile", "Gemfile.lock", "Procfile", ".env", "/huginn/"]
I use RUN /bin/bash -l -c "ls -a"
to check file cope status, I find .env file doen't be copied to the image.
I change the .env file name to test.env and use COPY ["Gemfile", "Gemfile.lock", "Procfile", "test.env", "/huginn/"]
, then it work, test.env is copied to the image.
Anyone know why is? And any solution can let docker support COPY
.env file name?
Solution
If you have .dockerignore
file then it might be you added to ignore hidden files like .git
, .vagrant
etc.
If .dockerfile
ignoring hidden files then either you can enable to not ignore or change file name.
For more info about .dockerignore file
Answered By - pl_rock Answer Checked By - Marie Seifert (WPSolving Admin)