All Projects → jpetazzo → Minimage

jpetazzo / Minimage

Minimal Docker images: a collection of Dockerfiles illustrating how to reduce container image size.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Minimage

Bitnami Docker Express
Bitnami Express Docker Compose development environment
Stars: ✭ 63 (-17.11%)
Mutual labels:  containers
Container Security Operator
Identify image vulnerabilities in Kubernetes pods
Stars: ✭ 68 (-10.53%)
Mutual labels:  containers
Alpine Erlang
An alpine image with Erlang installed, intended for releases
Stars: ✭ 73 (-3.95%)
Mutual labels:  containers
Pico
Object Detection and Analysis Made easy using Raspberry Pi, Apache Kafka, AWS Rekognition & Docker
Stars: ✭ 63 (-17.11%)
Mutual labels:  containers
Container Service Extension
Container Service for VMware vCloud Director
Stars: ✭ 66 (-13.16%)
Mutual labels:  containers
Awesome Cloud Native
A curated list for awesome cloud native tools, software and tutorials. - https://jimmysong.io/awesome-cloud-native/
Stars: ✭ 1,157 (+1422.37%)
Mutual labels:  containers
Gena
Generic pseudo-templated containers for C. Written entirely in C89 with design inspired by the C++ STL. /// DOCS ARE SLIGHTLY OUTDATED, PROJECT IS STABLE AND STILL IN ACTIVE DEVELOPMENT
Stars: ✭ 61 (-19.74%)
Mutual labels:  containers
Devops Resources
DevOps resources - Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP
Stars: ✭ 1,194 (+1471.05%)
Mutual labels:  containers
Opencompose
OpenCompose - A higher level abstraction for Kubernetes Resource
Stars: ✭ 66 (-13.16%)
Mutual labels:  containers
Habitus
A build flow tool for Docker.
Stars: ✭ 1,177 (+1448.68%)
Mutual labels:  containers
Cloud Native Labs
The Labs for Cloud Native Roadshow on OpenShift https://www.openshift.com/
Stars: ✭ 64 (-15.79%)
Mutual labels:  containers
Ceph Container
Docker files and images to run Ceph in containers
Stars: ✭ 1,134 (+1392.11%)
Mutual labels:  containers
Tent
Podman (https://podman.io/) based development-only dependency manager for Linux
Stars: ✭ 69 (-9.21%)
Mutual labels:  containers
Firecracker Containerd
firecracker-containerd enables containerd to manage containers as Firecracker microVMs
Stars: ✭ 1,130 (+1386.84%)
Mutual labels:  containers
Dama
a simplified machine learning container platform that helps teams get started with an automated workflow
Stars: ✭ 74 (-2.63%)
Mutual labels:  containers
Cheatsheet Kubernetes A4
📖 Kubernetes CheatSheets In A4
Stars: ✭ 1,121 (+1375%)
Mutual labels:  containers
Cubostratus
Blazingly fast Linux syscall collector
Stars: ✭ 68 (-10.53%)
Mutual labels:  containers
Vpnify
vpnify - transparently route traffic of a process through VPN
Stars: ✭ 74 (-2.63%)
Mutual labels:  containers
Anchore Engine
A service that analyzes docker images and applies user-defined acceptance policies to allow automated container image validation and certification
Stars: ✭ 1,192 (+1468.42%)
Mutual labels:  containers
Tanya
GC-free, high-performance D library: Containers, networking, metaprogramming, memory management, utilities
Stars: ✭ 70 (-7.89%)
Mutual labels:  containers

minimage

Examples and experiments with multi-stage builds, static binaries, and other techniques to obtain MINimal IMAGEs.

This repository contains code samples and Dockerfiles to illustrate a series of blog posts about image size optimization. You can read this series in English: part 1, part 2, part 3; or in French: part 1, part 2, part 3.

Ingredients

This repository contains some sample code:

  • hello.c: hello world in C
  • hello.go: hello world in Go
  • hello.py: hello world in Python
  • hello.rs: hello world in Rust
  • whatsmyip.go: Go code making one HTTP request to canihazip.com

And a bunch of Dockerfiles to build that code.

Wow that's a lot of Dockerfiles

The goal is to show many combinations of build and run stages: do they work? What's the size of the final image?

Each Dockerfile has a pretty long name, with the following convention:

Dockerfile.PROGRAM-TO-BUILD.BUILD-IMAGE[.RUN-IMAGE]

So, for instance, Dockerfile.hello-java.openjdk-8.openjdk-8-jre-alpine means that the Dockerfile builds the hello.java code sample, using openjdk:8 as the build stage, and openjdk:8-jre-alpine as the run stage.

For single-stage builds (like Dockerfile.hello-rust.rust-alpine) there is no RUN-IMAGE.

Sometimes, the name of the Dockerfile also includes special build parameters, for instance:

  • Dockerfile.hello-c.alpine-static.scratch doesn't mean that the build stage is using an image named alpine:static, but that it's using alpine and building the program with extra flags to generate a static binary;
  • Dockerfile.whatsmyip.golang-nocgo.scratch doesn't mean that the build stage is using an image named golang:nocgo, but that it's using golang and building the program with extra options to disable cgo.

Show me the sizes of the images!

If you want to compare the sizes of all these images, you can do:

docker-compose build
docker images minimage | sort

Do these images all work?

No! Some of them won't. This shows that some combinations of build and run images are invalid, for reasons explained in the supporting blog post.

If you want to test these images, you can do:

docker-compose up
docker-compose ps

The images that work will show Exit 0. If you want to check what's wrong with the ones that show something else (like Exit 1 or Exit 127), you can run e.g. docker-compose up whatsmyip.golang.scratch or docker run minimage:whatsmyip.golang.scratch.

Extra info

The Compose file is generated automatically using the script mkcompose.sh.

There are some Dockerfiles that won't even build. These ones have the special extension .err and added to a separate Compose file, because having them in the same Compose file would break the build of the others (Compose stops as soon as one build fails).

Contributing

If you want to add code samples or Dockerfiles, feel free to!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].