A collection of Dockerfiles.
This is a collection of dockerfiles that keep clean code.
Available dockerfiles are supported the following tools:
- prettier: It's an opinionated code formatter, see the documents.
- yamllint: It's a linter for YAML files, see the documents.
- markdownlint: It's a style checker and lint tool for Markdown files, see the documents.
- jsonlint: It's a JSON parser and validator, see the documents.
These are useful tools, but there is no official image. Therefore, this repository creates and distributes these lightweight images.
You can pull from Docker Hub or GitHub Packages, whichever you prefer. Using prettier as an example, pull as the following commands.
Docker Hub:
docker pull tmknom/prettier
GitHub Packages:
docker pull ghcr.io/tmknom/dockerfiles/prettier
The following shows how to use it when pulled from Docker Hub.
docker run --rm -v $(pwd):/work tmknom/prettier --check --parser=markdown README.md
For more information, see prettier/README.md.
docker run --rm -v $(pwd):/work tmknom/yamllint -- .
For more information, see yamllint/README.md.
docker run --rm -v $(pwd):/work tmknom/markdownlint -- .
For more information, see markdownlint/README.md.
docker run --rm -v $(pwd):/work tmknom/jsonlint --compact --quiet foo.json
For more information, see jsonlint/README.md.
- linux/amd64
- linux/arm64
Click to see details
- Create
<image_name>/
directory - Define docker image:
Dockerfile
,entrypoint.sh
,.dockerignore
- Manage package file:
package.json
orrequirements.txt
- Create
.github/tests/<image_name>/
directory - Write test script:
test.sh
- Add test fixtures:
valid_<extension>.txt
andinvalid_<extension>.txt
- Create release action:
.github/workflows/release-<image_name>.yml
- Configure version updates for dependencies:
.github/dependabot.yml
- Write details for the new docker image:
<image_name>/README.md
- Update description and append usage:
README.md
Run the following command:
make test
Then pull image from Docker Hub and GitHub Packages, and run test scripts.
When create a pull request, the following workflows are executed automatically at GitHub Actions.
- Update Dockerfile or package management file
- Commit, push, and create a pull request
- After merged, run Workflows with
release-
prefix automatically at GitHub Actions
Then, publishes Docker images to Docker Hub and GitHub Packages. ๐
Use Dependabot version updates. For more information, see dependabot.yml.
Stored environment secrets for the following environments in this repository.
Reference from releasing workflows such as .github/workflows/release-prettier.yml
.
DOCKERHUB_TOKEN
: Personal access token used to log against Docker Hub.
Run the following command to bump up.
make bump
This command will execute the following steps:
- Update VERSION
- Commit, push, and create a pull request
- Open the web browser automatically for reviewing pull request
Then review and merge, so the release is ready to go.
Run the following command to publish a new tag at GitHub.
make release
Finally, we can use the new version! ๐
See CHANGELOG.md.
Apache 2 Licensed. See LICENSE for full details.