dockerfiles
Dockerfiles for many of the images hosted at my username on Docker Hub.
Background
There are several utilities that I would like to use but for which either Docker images aren't published, or I don't want to have to trust their images.
Instead of finding some random image that someone else wrote for the utility, most are simple enough to replicate minimally and self-publish.
Usage
All Docker images are built with GitHub Actions and pushed to Docker Hub on merge to main.
To do something locally, you can use make:
$ make build-curl # builds the docker image for `curl` subdirectory
$ make test-curl # builds the docker image for `curl` subdirectory and runs tests
$ make dive-curl # builds the docker image for `curl` subdirectory and opens the resulting image in `dive` (to inspect filesystem)
$ make publish-curl # builds the docker image for `curl` subdirectory and publishes to Docker HubAdding a New Image
To create a new image, all you need to do is:
- Create the subdirectory for your project (it will map to
parkr/$diras the image name), withDockerfile,VERSION, andtest.shfiles. - Fill out the
VERSIONfile for your desired version. It can be a Git SHA-1, a semver version, etc. - Write the
Dockerfileto accept a build argumentVERSIONand use that to fetch the program at the given version. When you want the default branch of a project, be sure to uselatestinVERSION, and map that to the default branch in yourDockerfile. - Write
test.shto exit 1 if the Docker image isn't working. This might be a DockerHEALTHCHECKthat you verify is healthy upon starting the image, or maybe it's as simple as making sure the utility file is installed and executable. - Add the entries to
.github/actionsfiles. Copying a pre-existing utility's actions/steps in the file will help. Let's keep these files alphabetical. - Push to a feature branch.
- Verify tests pass, then merge.
License
This repository uses the MIT License.