This project provides a convention over configuration
universal build Makefile
for docker projects.
This blog post tells all about it.
brew tap ivonet/cli
brew install docker-make
if you use this convention everything should work just fine:
.
├── Makefile
├── makefile.env
├── README.md
├── hello-world
│ └── Dockerfile
├── ngnix
│ └── Dockerfile
├── node
│ ├── Dockerfile
│ ├── VERSION
│ └── src
│ ├── index.js
│ ├── index.html
│ └── angular.js
└── payara
└── Dockerfile
example usage:
mkdir -p example-project/hello-world
cd example-project
echo "FROM busybox\nCMD [\"echo\", \"Hello, world!\"]" >hello-world/Dockerfile
echo "VERSION=1.0\nREGISTRY=$USER">makefile.env
docker-make
# Show help
make help
# make all projects
make build
# make single project
make hello-world
if you put a VERSION
file in a folder with a Dockerfile
and put only a version in it it will override the
default version as described in the makefile.env
if you put a pre-make.sh
script in the folder with a Dockerfile
that is the script that is run by make before
running a docker build.