Makedockfile provides useful commands for development and CI/CD.
In development, building and running your Docker image can be done with just a make up command.
Also, it makes it easier to pass environment variables, expose ports and bind mount volumes thanks to .conf config files.
Execute make help to see the full command list.
On the CI/CD side, it enforces tagging good practices such as:
- not using
:latesttag - one tag per branch
- one tag per version
- one tag per commit
It is also possible to create a Dockerfile.test file to execute unit or integration tests from your image with make test.
Have a look at example/Dockerfile.test to see an example.
Everything is customizable into Makedockfile.conf, and locally into Makedockfile.dist.conf (not versioned).
Please see the documentation directly into the Makefile.
cd your_project
wget -q -i https://raw.githubusercontent.com/Thomvaill/Makedockfile/master/wget.txt
rm wget.txt
echo "\nMakedockfile.dist.conf\nMakedockfile.out\n" >> .gitignore- Add
docker buildxsupport - Add the
print-image-namecommand
- Add the
latest-tagtarget to release the image with the:latesttag
- Replace "/" by "-" in Docker tag from branch name
- Fixes
mktempon Alpine Linux
- Makefile inspired from mpneuried's gist
- François Zaninotto for his self-documented Makefile
This project is licensed under the MIT license, Copyright (c) 2019 Thomas Vaillant. For more information see LICENSE file.