Dockerfile
June 29, 2026 ยท View on GitHub
NOT PORTED YET
The build file for a docker image.
- Template
- HariSekhon/Dockerfiles
- Docker Build Best Practices
- Amazing Cache Busting Trick
- Python - Create Smaller Docker Images Using the Builder Pattern
Template
HariSekhon/Templates - Dockerfile
HariSekhon/Dockerfiles
Large repo full of Dockerfiles for different open source technologies full of real world tricks like DockerHub auto-hook scripts to do extra tags, cache busting upon new commits to GitHub repos etc.
:octocat: HariSekhon/Dockerfiles
Docker Build Best Practices
https://docs.docker.com/build/building/best-practices
https://sysdig.com/learn-cloud-native/dockerfile-best-practices/
Amazing Cache Busting Trick
If you're building from GitHub repos that you want to trigger rebuilds upon any change by busting the Docker build cache you can put this in your Dockerfile:
# Cache Bust upon new commits
ADD https://api.github.com/repos/HariSekhon/DevOps-Bash-tools/git/refs/heads/master /.git-hashref
I used this in my HariSekhon/Dockerfiles repo for several of my major GitHub repos like DevOps-Bash-tools and DevOps-Python-tools.
Python - Create Smaller Docker Images Using the Builder Pattern
Use the Python builder pattern to make small Python docker images, see this Medium article.
The code for this is in the Dockerfile template above.