-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use USER
env var in Dockerfile
#155
Conversation
Rather than a line by line review I've made a bunch of edits and pushed a commit with them in. @JeremyTubongbanua the main things I've changed are:
@cconstab can you also review before we merge this please |
Thanks @cpswan Do environment variables work inside of the strings at I got this when I ran a dummy Dockerfile. Output:
Dockerfile: FROM ubuntu
ENV USER='jeremy123'
ENTRYPOINT [ "echo", "Hello, ${USER}" ] Full Docker output: [+] Building 0.0s (5/5) FINISHED
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 111B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:latest 0.0s
=> CACHED [1/1] FROM docker.io/library/ubuntu 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:00784b0f36c3923b9a4b92e2ee891aacf62d2bb60319d1d1bb37d8430de383e1 0.0s
=> => naming to docker.io/library/tmp 0.0s
Hello, ${USER} -it --name tmp |
Good catch @JeremyTubongbanua ENV vars don't work inside an exec style ENTRYPOINT |
What I did
ENV USER=atsign
atsign
with$USER
Was this the correct approach?