Skip to content

Instantly share code, notes, and snippets.

@rshsmi
Created June 21, 2016 21:09
Show Gist options
  • Save rshsmi/9b965d76dd37c28dc0d14704c029a6b5 to your computer and use it in GitHub Desktop.
Save rshsmi/9b965d76dd37c28dc0d14704c029a6b5 to your computer and use it in GitHub Desktop.
Dockerfile to add multiple line to file - it is useful to "docker cp" a conf file
$ cat Dockerfile
FROM centos:7
RUN mkdir /work
RUN echo <<< EOL\
line 1, \
line 2, \
line 3, \
line 4 \
line ... \
EOL >> /etc/myconfig.conf;
# Build the container and tag it then:
$ docker cp $(docker ps -a -q):/etc/myconfig.conf /tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment