LMSouq
server-admin Open

Hidden file .env not copied using Docker COPY

HS
Hsiu Chuan Tsao
1 month ago
3 views
Problem Description
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?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base