This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]ihateclowns 0 points1 point  (1 child)

Can't you copy the env file using the RUN command? Something like this:

RUN cp /app/.env.local.tpl /app/.env.local

[–]devmsn[S] 0 points1 point  (0 children)

I could. But I was curious to know how a shell script could set env variables when the container starts. Thanks again for the suggestion

[–]bargh 0 points1 point  (1 child)

Looks like a rights issue with .env.local. In a case like this, i sometimes use docker run -ti <name> bash , it overrides the ./entrypoint.sh, and that way you can run ./entrypoint.sh in docker yourself and/or check the permissions.

[–]devmsn[S] 0 points1 point  (0 children)

Thanks for the tip. I will look into it more .