Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@retr0h
Last active June 9, 2017 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save retr0h/94186dd213097f6e5df9ae5cd58cea14 to your computer and use it in GitHub Desktop.
Save retr0h/94186dd213097f6e5df9ae5cd58cea14 to your computer and use it in GitHub Desktop.
FROM alpine:latest
ARG SOME_SECRET_SHIZ
RUN echo $SOME_SECRET_SHIZ > /tmp/secret
# Do something
RUN rm -f /tmp/secret
$ docker build --squash --build-arg SOME_SECRET_SHIZ="$(cat ~/.secret)" -t myalpine .
Sending build context to Docker daemon 2.048 kB
Step 1/4 : FROM alpine:latest
---> a41a7446062d
Step 2/4 : ARG SOME_SECRET_SHIZ
---> Using cache
---> 66f605617eee
Step 3/4 : RUN echo $SOME_SECRET_SHIZ > /tmp/secret
---> Running in a0e33a90b962
---> 662f3d72b784
Removing intermediate container a0e33a90b962
Step 4/4 : RUN rm -f /tmp/secret
---> Running in c54ffdc3b923
---> aff3c0ccb67b
Removing intermediate container c54ffdc3b923
Successfully built aff3c0ccb67b
# docker run -v /var/run/docker.sock:/run/docker.sock -ti -e TERM tomastomecek/sen
{
"ContainerConfig": {
"Entrypoint": null,
"Image": "sha256:662f3d72b78454ea616780683b5089a12e87b4f0147a127796a69b3a69562f03",
"Domainname": "",
"OnBuild": [],
"OpenStdin": false,
"Tty": false,
"Hostname": "9ac68176ac52",
"ArgsEscaped": true,
"Volumes": null,
"StdinOnce": false,
"Cmd": [
"|1",
"SOME_SECRET_SHIZ=oopsie",
"/bin/sh",
"-c",
"rm -f /tmp/secret"
],
"WorkingDir": "",
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Labels": {}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment