Skip to content

Instantly share code, notes, and snippets.

@foxx
Created February 5, 2015 13:46
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 foxx/0305f9f7ebe65b246c6c to your computer and use it in GitHub Desktop.
Save foxx/0305f9f7ebe65b246c6c to your computer and use it in GitHub Desktop.
Code snippet for docker blog post
$ cat Dockerfile.base
FROM dockerfile/ubuntu
RUN apt-get update -y
CMD ENVNAME=<ENVNAME> runsomething
$ cat Dockerfile.debug
FROM iops/example:base
CMD something --debug
$ cat Dockerfile.release
FROM iops/example:base
CMD something
$ cat Makefile
buildbase:
# Build docker container for base image
cat Dockerfile.base > ./Dockerfile
docker build -t iops/example:base .
rm -f ./Dockerfile
builddebug: buildbase
cat container/Dockerfile.debug > ./Dockerfile
sed -i 's/<ENVNAME>/debug/g' ./Dockerfile
docker build -t iops/example:dev .
rm -f ./Dockerfile
buildrelease: buildbase
cat container/Dockerfile.prod > ./Dockerfile
sed -i 's/<ENVNAME>/release/g' ./Dockerfile
docker build -t iops/example:release .
rm -f ./Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment