Skip to content

Instantly share code, notes, and snippets.

@fed-franz
Created May 24, 2019 09:08
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 fed-franz/e2aa4b1213de6235b43d4faad1115ed4 to your computer and use it in GitHub Desktop.
Save fed-franz/e2aa4b1213de6235b43d4faad1115ed4 to your computer and use it in GitHub Desktop.
Dockerfile Example
# Comment
FROM ubuntu:latest
# Local ENV
ENV init=init.sh
ENV dir1=./dir1 \
dir2=./dir2
# Install from APT
RUN apt-get update
RUN apt-get install --yes curl wget net-tools
# Copy files
WORKDIR /root/
RUN mkdir localdir
COPY $dir1/file localdir/
COPY $init /usr/local/bin/
RUN chmod +x /usr/local/bin/$init
# Expose ports to outside for remote connections
EXPOSE 80
# Then run initial script
# Here you can access ENV variables and do any setup process via Shell script
ENTRYPOINT ["./init.sh"]
#Arguments passed via 'docker run' will be passed to init.sh
CMD [""]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment