https://github.com/thomvaill/Makedockfile
A simple Makefile to build your Docker images π
https://github.com/thomvaill/Makedockfile
Last synced: 4 months ago
JSON representation
A simple Makefile to build your Docker images π
- Host: GitHub
- URL: https://github.com/thomvaill/Makedockfile
- Owner: thomvaill
- License: mit
- Created: 2019-12-04T08:28:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T13:23:34.000Z (about 2 years ago)
- Last Synced: 2024-11-30T07:43:22.373Z (5 months ago)
- Language: Shell
- Homepage:
- Size: 118 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- jimsghstars - thomvaill/Makedockfile - A simple Makefile to build your Docker images π (Shell)
README
# Makedockfile
[](https://travis-ci.com/Thomvaill/Makedockfile)
[](https://opensource.org/licenses/MIT)## Purpose
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 `:latest` tag
- one tag per branch
- one tag per version
- one tag per commitIt 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](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](src/Makefile).## Quick start
```bash
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
```## Changelog
### Version 1.2.0
- Add [`docker buildx`](https://docs.docker.com/buildx/working-with-buildx/) support
- Add the `print-image-name` command### Version 1.1.0
- Add the `latest-tag` target to release the image with the `:latest` tag
### Version 1.0.2
- Replace "/" by "-" in Docker tag from branch name
### Version 1.0.1
- Fixes `mktemp` on Alpine Linux
## Acknowledgments
- Makefile inspired from [mpneuried's gist](https://gist.github.com/mpneuried/0594963ad38e68917ef189b4e6a269db)
- François Zaninotto for his [self-documented Makefile](https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html)## License
This project is licensed under the MIT license, Copyright (c) 2019 Thomas Vaillant. For more information see [LICENSE](LICENSE) file.