Top Related Projects
Bootstrap Kubernetes the hard way. No scripts.
Primary source of truth for the Docker "Official Images" program
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
A tool for exploring each layer in a docker image
🥑 Language focused docker images, minus the operating system.
Dockerfile linter, validate inline bash, written in Haskell
Quick Overview
jessfraz/dockerfiles is a GitHub repository containing a collection of Dockerfiles for various applications and tools. It provides pre-configured Docker container definitions for a wide range of software, making it easier for users to run applications in isolated environments without complex setup processes.
Pros
- Extensive collection of Dockerfiles for numerous applications
- Well-maintained and regularly updated
- Simplifies the process of running applications in containers
- Includes Dockerfiles for both common and niche software
Cons
- Some Dockerfiles may not be optimized for production use
- Potential security risks if not properly vetted before use
- May require additional configuration for specific use cases
- Limited documentation for some of the more complex setups
Getting Started
To use a Dockerfile from this repository:
-
Clone the repository:
git clone https://github.com/jessfraz/dockerfiles.git
-
Navigate to the desired application's directory:
cd dockerfiles/<application_name>
-
Build the Docker image:
docker build -t <image_name> .
-
Run the container:
docker run -it --rm <image_name>
Note: Replace <application_name>
with the name of the application you want to use, and <image_name>
with a name for your Docker image.
Competitor Comparisons
Bootstrap Kubernetes the hard way. No scripts.
Pros of kubernetes-the-hard-way
- Provides a comprehensive, step-by-step guide for setting up Kubernetes manually
- Offers deep insights into Kubernetes components and architecture
- Valuable for learning and understanding Kubernetes internals
Cons of kubernetes-the-hard-way
- Focused solely on Kubernetes, less versatile than dockerfiles
- More time-consuming to set up and maintain
- Not suitable for production environments
Code comparison
kubernetes-the-hard-way:
kubectl create secret generic kubernetes-the-hard-way \
--from-literal="mykey=mydata"
dockerfiles:
FROM debian:jessie
RUN apt-get update && apt-get install -y \
aufs-tools \
automake \
build-essential \
curl \
dpkg-sig
Summary
kubernetes-the-hard-way is an educational resource focused on manual Kubernetes setup, providing in-depth understanding of the platform. dockerfiles, on the other hand, offers a collection of Dockerfiles for various applications, making it more versatile for containerization needs.
kubernetes-the-hard-way is ideal for those wanting to learn Kubernetes internals, while dockerfiles is better suited for quickly containerizing different applications. The code examples highlight their different focuses: kubernetes-the-hard-way demonstrates Kubernetes-specific commands, while dockerfiles shows how to create Docker images for various applications.
Primary source of truth for the Docker "Official Images" program
Pros of official-images
- Officially maintained by Docker, ensuring high-quality and up-to-date images
- Comprehensive coverage of popular programming languages and frameworks
- Rigorous testing and security scanning processes
Cons of official-images
- Limited customization options for specific use cases
- Slower update cycle for new software versions
- Less variety in niche or specialized tools
Code Comparison
dockerfiles:
FROM debian:jessie
RUN apt-get update && apt-get install -y \
curl \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
CMD ["curl"]
official-images:
FROM debian:bullseye-slim
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
netbase \
wget \
; \
rm -rf /var/lib/apt/lists/*
Key Differences
- dockerfiles focuses on minimal, single-purpose images
- official-images provides more comprehensive base images
- dockerfiles offers a wider range of specialized tools
- official-images emphasizes standardization and best practices
Use Cases
dockerfiles:
- Developers seeking lightweight, customized containers
- Experimenting with various tools and configurations
official-images:
- Production environments requiring stable, well-maintained images
- Standardized development workflows across teams
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
Pros of Moby
- Larger, more comprehensive project with broader scope and functionality
- Actively maintained by Docker, Inc. with frequent updates and contributions
- Extensive documentation and community support
Cons of Moby
- More complex codebase, potentially harder for newcomers to navigate
- Heavier resource footprint due to its comprehensive nature
- Steeper learning curve for contributors
Code Comparison
Dockerfiles:
FROM debian:sid
RUN apt-get update && apt-get install -y \
firefox-esr \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
Moby:
func (daemon *Daemon) containerStart(container *container.Container, checkpoint string, checkpointDir string, resetRestartManager bool) (err error) {
container.Lock()
defer container.Unlock()
if container.Running {
return nil
}
// ... (additional code)
}
Summary
Dockerfiles focuses on providing a collection of Dockerfiles for various applications, making it easier for users to containerize specific software. Moby, on the other hand, is the open-source foundation of the Docker platform, offering a more comprehensive set of tools and components for container-based systems. While Dockerfiles is simpler and more accessible for basic containerization needs, Moby provides a more robust and feature-rich environment for advanced container orchestration and management.
A tool for exploring each layer in a docker image
Pros of dive
- Focused tool for analyzing Docker image layers
- Interactive CLI interface for exploring image contents
- Provides detailed efficiency analysis and wasted space detection
Cons of dive
- Limited to image analysis, not a collection of Dockerfiles
- Requires installation and setup, not just cloning a repository
- May have a steeper learning curve for beginners
Code comparison
dive:
func analyzeImageEfficiency(image *image.Image) (float64, error) {
totalSize := image.Size()
wastedSize := calculateWastedSpace(image)
efficiency := 1 - (float64(wastedSize) / float64(totalSize))
return efficiency, nil
}
dockerfiles:
FROM debian:jessie
RUN apt-get update && apt-get install -y \
curl \
wget \
&& rm -rf /var/lib/apt/lists/*
CMD ["bash"]
Summary
dive is a specialized tool for analyzing Docker images, offering interactive exploration and efficiency insights. dockerfiles, on the other hand, is a collection of pre-built Dockerfiles for various applications. While dive provides in-depth analysis, dockerfiles offers ready-to-use configurations. The choice between them depends on whether you need image analysis or a library of Dockerfiles for different purposes.
🥑 Language focused docker images, minus the operating system.
Pros of distroless
- Minimalistic base images with significantly reduced attack surface
- Optimized for security and smaller image sizes
- Officially maintained by Google, ensuring regular updates and support
Cons of distroless
- Limited flexibility due to minimal included tools and utilities
- Steeper learning curve for developers accustomed to full-featured base images
- May require additional configuration for certain applications
Code Comparison
distroless example:
FROM gcr.io/distroless/java:11
COPY --from=build /app/target/myapp.jar /app.jar
CMD ["java", "-jar", "/app.jar"]
dockerfiles example:
FROM debian:buster-slim
RUN apt-get update && apt-get install -y openjdk-11-jre-headless
COPY target/myapp.jar /app.jar
CMD ["java", "-jar", "/app.jar"]
The distroless example uses a minimal Java base image, while the dockerfiles example uses a full Debian-based image with Java installed. The distroless approach results in a smaller, more secure image, but may require additional steps for complex applications. The dockerfiles approach offers more flexibility and easier debugging but at the cost of a larger image size and potential security vulnerabilities.
Dockerfile linter, validate inline bash, written in Haskell
Pros of Hadolint
- Focused on Dockerfile linting and best practices
- Provides automated static analysis for Dockerfiles
- Integrates well with CI/CD pipelines for continuous Dockerfile validation
Cons of Hadolint
- Limited to Dockerfile analysis, not a collection of ready-to-use Dockerfiles
- Requires additional setup and integration into development workflows
- May produce false positives or miss context-specific optimizations
Code Comparison
Hadolint (example usage):
docker run --rm -i hadolint/hadolint < Dockerfile
Dockerfiles (example Dockerfile):
FROM debian:sid
RUN apt-get update && apt-get install -y \
firefox \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
Summary
Hadolint is a specialized tool for linting Dockerfiles, offering automated checks for best practices and potential issues. It's well-suited for integration into development pipelines but focuses solely on analysis.
Dockerfiles, on the other hand, provides a collection of pre-built Dockerfiles for various applications. It offers ready-to-use configurations but doesn't include built-in linting or validation.
The choice between the two depends on whether you need a linting tool for your own Dockerfiles (Hadolint) or a repository of pre-configured Dockerfiles for different applications (Dockerfiles).
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
dockerfiles
This is a repo to hold various Dockerfiles for images I create.
Table of Contents
About
Almost all of these live on dockerhub under jess. Because you cannot use notary with autobuilds on dockerhub I also build these continuously on a private registry at r.j3ss.co for public download. (You're welcome.)
Resources
My dotfiles
You may also want to checkout my dotfiles, specifically the aliases for all these files which are here: github.com/jessfraz/dotfiles/blob/master/.dockerfunc.
Contributing
I try to make sure each Dockerfile has a command at the top to document running it, if a file you are looking at does not have a command, please pull request it!
Using the Makefile
$ make help
build Builds all the dockerfiles in the repository.
dockerfiles Tests the changes to the Dockerfiles build.
image Build a Dockerfile (ex. DIR=telnet).
latest-versions Checks all the latest versions of the Dockerfile contents.
run Run a Dockerfile from the command at the top of the file (ex. DIR=telnet).
shellcheck Runs the shellcheck tests on the scripts.
test Runs the tests on the repository.
Top Related Projects
Bootstrap Kubernetes the hard way. No scripts.
Primary source of truth for the Docker "Official Images" program
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
A tool for exploring each layer in a docker image
🥑 Language focused docker images, minus the operating system.
Dockerfile linter, validate inline bash, written in Haskell
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot