Created
July 16, 2015 23:54
-
-
Save flashvoid/009564d65f1c040fbc2c to your computer and use it in GitHub Desktop.
Embedding envs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void@tahr:~/docker/etest$ cat Dockerfile | |
FROM ubuntu | |
RUN useradd -m user | |
RUN echo 'export TOKEN=ok' >> /home/user/.bashrc | |
USER user | |
void@tahr:~/docker/etest$ docker build -t local/test . | |
Sending build context to Docker daemon 2.048 kB | |
Sending build context to Docker daemon | |
Step 0 : FROM ubuntu | |
---> 6d4946999d4f | |
Step 1 : RUN useradd -m user | |
---> Running in 55ccbdacf781 | |
---> 8842ca9ce9de | |
Removing intermediate container 55ccbdacf781 | |
Step 2 : RUN echo 'export TOKEN=ok' >> /home/user/.bashrc | |
---> Running in 5b227b3070cb | |
---> cbfd43878a32 | |
Removing intermediate container 5b227b3070cb | |
Step 3 : USER user | |
---> Running in 77631a64f4ae | |
---> 2c0b3c30d9c6 | |
Removing intermediate container 77631a64f4ae | |
Successfully built 2c0b3c30d9c6 | |
void@tahr:~/docker/etest$ docker run -it --rm -u user local/test bash -ic 'echo $TOKEN' | |
ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment