├── hello.py ├── hello.rs ├── Dockerfile.hello-py.python ├── pyds.py ├── Dockerfile.hello-c.gcc ├── Dockerfile.hello-py.python-alpine ├── Dockerfile.hello-rust.rust ├── Dockerfile.hello-go.golang ├── Dockerfile.pyyaml.python ├── hello.c ├── hello.go ├── pyyaml.py ├── Dockerfile.hello-rust.rust-alpine ├── Dockerfile.pyyaml.python-slim ├── Dockerfile.hello-java.openjdk ├── Dockerfile.pyyaml.python-alpine ├── Dockerfile.whatsmyip.golang ├── Dockerfile.hello-c.alpine ├── Dockerfile.hello-java.amazoncorretto ├── Dockerfile.hello-java.openjdk-alpine ├── hello.java ├── Dockerfile.hello-c.gcc.alpine ├── Dockerfile.hello-c.gcc.ubuntu ├── Dockerfile.hello-rust.rust.alpine ├── Dockerfile.hello-rust.rust.debian ├── Dockerfile.hello-c.gcc.scratch ├── Dockerfile.hello-rust.rust.scratch ├── Dockerfile.hello-go.golang.scratch ├── Dockerfile.pyds.python ├── Dockerfile.hello-c.gcc-static.alpine ├── Dockerfile.hello-go.golang.scratch-string ├── Dockerfile.hello-rust.rust-alpine.alpine ├── Dockerfile.hello-rust.rust.busybox-glibc ├── Dockerfile.hello-c.gcc-static.scratch ├── Dockerfile.hello-go.golang.ubuntu-noworkdir.err ├── Dockerfile.pyds.python-slim ├── Dockerfile.hello-go.golang-alpine.alpine ├── Dockerfile.hello-go.golang-alpine.scratch ├── Dockerfile.whatsmyip.golang.alpine ├── Dockerfile.whatsmyip.golang.ubuntu ├── Dockerfile.whatsmyip.golang.busybox ├── Dockerfile.whatsmyip.golang.scratch ├── Dockerfile.hello-c.alpine.alpine ├── Dockerfile.hello-go.golang.ubuntu-workdir ├── Dockerfile.hello-java.openjdk.openjdk-jre ├── Dockerfile.whatsmyip.golang-alpine.alpine ├── Dockerfile.hello-c.alpine-static.scratch ├── Dockerfile.hello-java.openjdk-11.openjdk-11-jre ├── Dockerfile.hello-java.openjdk.openjdk-8-jre-alpine ├── Dockerfile.hello-java.openjdk-8.openjdk-8-jre-alpine ├── Dockerfile.pyds.alpine ├── Dockerfile.whatsmyip.golang.busybox-glibc ├── Dockerfile.whatsmyip.golang-nocgo.scratch ├── docker-compose.err.yaml ├── Dockerfile.pyyaml.python-alpine.python-alpine ├── Dockerfile.hello-java.eclipse-temurin.native-image.scratch ├── Dockerfile.hello-java.openjdk-15-jlink.ubuntu ├── whatsmyip.go ├── Dockerfile.hello-java.openjdk-15-alpine-jlink.alpine ├── mkcompose.sh ├── Dockerfile.pyds.alpine.alpine ├── README.md └── docker-compose.yaml /hello.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | print("Hello, world!") 3 | -------------------------------------------------------------------------------- /hello.rs: -------------------------------------------------------------------------------- 1 | fn main () { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /Dockerfile.hello-py.python: -------------------------------------------------------------------------------- 1 | FROM python 2 | COPY hello.py . 3 | CMD ["./hello.py"] 4 | -------------------------------------------------------------------------------- /pyds.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import matplotlib 3 | import pandas 4 | import numpy 5 | -------------------------------------------------------------------------------- /Dockerfile.hello-c.gcc: -------------------------------------------------------------------------------- 1 | FROM gcc 2 | COPY hello.c . 3 | RUN gcc -o hello hello.c 4 | CMD ["./hello"] 5 | -------------------------------------------------------------------------------- /Dockerfile.hello-py.python-alpine: -------------------------------------------------------------------------------- 1 | FROM python:alpine 2 | COPY hello.py . 3 | CMD ["./hello.py"] 4 | -------------------------------------------------------------------------------- /Dockerfile.hello-rust.rust: -------------------------------------------------------------------------------- 1 | FROM rust 2 | COPY hello.rs . 3 | RUN rustc hello.rs 4 | CMD ["./hello"] 5 | -------------------------------------------------------------------------------- /Dockerfile.hello-go.golang: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY hello.go . 3 | RUN go build hello.go 4 | CMD ["./hello"] 5 | -------------------------------------------------------------------------------- /Dockerfile.pyyaml.python: -------------------------------------------------------------------------------- 1 | FROM python 2 | RUN pip install pyyaml 3 | COPY pyyaml.py . 4 | CMD ./pyyaml.py 5 | -------------------------------------------------------------------------------- /hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main () { 4 | puts("Hello, world!"); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /hello.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main () { 6 | fmt.Println("Hello, world!") 7 | } 8 | -------------------------------------------------------------------------------- /pyyaml.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import yaml 3 | print(yaml.dump(dict(hello=[1,2,3], world="soleil"))) 4 | -------------------------------------------------------------------------------- /Dockerfile.hello-rust.rust-alpine: -------------------------------------------------------------------------------- 1 | FROM rust:alpine 2 | COPY hello.rs . 3 | RUN rustc hello.rs 4 | CMD ["./hello"] 5 | -------------------------------------------------------------------------------- /Dockerfile.pyyaml.python-slim: -------------------------------------------------------------------------------- 1 | FROM python:slim 2 | RUN pip install pyyaml 3 | COPY pyyaml.py . 4 | CMD ./pyyaml.py 5 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.openjdk: -------------------------------------------------------------------------------- 1 | FROM openjdk 2 | COPY hello.java . 3 | RUN javac hello.java 4 | CMD exec java -cp . hello 5 | -------------------------------------------------------------------------------- /Dockerfile.pyyaml.python-alpine: -------------------------------------------------------------------------------- 1 | FROM python:alpine 2 | RUN pip install pyyaml 3 | COPY pyyaml.py . 4 | CMD ./pyyaml.py 5 | -------------------------------------------------------------------------------- /Dockerfile.whatsmyip.golang: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY whatsmyip.go . 3 | RUN go build whatsmyip.go 4 | CMD ["./whatsmyip"] 5 | -------------------------------------------------------------------------------- /Dockerfile.hello-c.alpine: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | RUN apk add build-base 3 | COPY hello.c . 4 | RUN gcc -o hello hello.c 5 | CMD ["./hello"] 6 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.amazoncorretto: -------------------------------------------------------------------------------- 1 | FROM amazoncorretto 2 | COPY hello.java . 3 | RUN javac hello.java 4 | CMD exec java -cp . hello 5 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.openjdk-alpine: -------------------------------------------------------------------------------- 1 | FROM openjdk:alpine 2 | COPY hello.java . 3 | RUN javac hello.java 4 | CMD exec java -cp . hello 5 | -------------------------------------------------------------------------------- /hello.java: -------------------------------------------------------------------------------- 1 | class hello { 2 | public static void main(String [] args) { 3 | System.out.println("Hello, world!"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Dockerfile.hello-c.gcc.alpine: -------------------------------------------------------------------------------- 1 | FROM gcc 2 | COPY hello.c . 3 | RUN gcc -o hello hello.c 4 | FROM alpine 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-c.gcc.ubuntu: -------------------------------------------------------------------------------- 1 | FROM gcc 2 | COPY hello.c . 3 | RUN gcc -o hello hello.c 4 | FROM ubuntu 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-rust.rust.alpine: -------------------------------------------------------------------------------- 1 | FROM rust 2 | COPY hello.rs . 3 | RUN rustc hello.rs 4 | FROM alpine 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-rust.rust.debian: -------------------------------------------------------------------------------- 1 | FROM rust 2 | COPY hello.rs . 3 | RUN rustc hello.rs 4 | FROM debian 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-c.gcc.scratch: -------------------------------------------------------------------------------- 1 | FROM gcc 2 | COPY hello.c . 3 | RUN gcc -o hello hello.c 4 | FROM scratch 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-rust.rust.scratch: -------------------------------------------------------------------------------- 1 | FROM rust 2 | COPY hello.rs . 3 | RUN rustc hello.rs 4 | FROM scratch 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-go.golang.scratch: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY hello.go . 3 | RUN go build hello.go 4 | FROM scratch 5 | COPY --from=0 /go/hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.pyds.python: -------------------------------------------------------------------------------- 1 | FROM python 2 | RUN pip install matplotlib 3 | RUN pip install numpy 4 | RUN pip install pandas 5 | COPY pyds.py . 6 | CMD ["./pyds.py"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-c.gcc-static.alpine: -------------------------------------------------------------------------------- 1 | FROM gcc 2 | COPY hello.c . 3 | RUN gcc -o hello hello.c -static 4 | FROM alpine 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-go.golang.scratch-string: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY hello.go . 3 | RUN go build hello.go 4 | FROM scratch 5 | COPY --from=0 /go/hello . 6 | CMD ./hello 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-rust.rust-alpine.alpine: -------------------------------------------------------------------------------- 1 | FROM rust:alpine 2 | COPY hello.rs . 3 | RUN rustc hello.rs 4 | FROM alpine 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-rust.rust.busybox-glibc: -------------------------------------------------------------------------------- 1 | FROM rust 2 | COPY hello.rs . 3 | RUN rustc hello.rs 4 | FROM busybox:glibc 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-c.gcc-static.scratch: -------------------------------------------------------------------------------- 1 | FROM gcc 2 | COPY hello.c . 3 | RUN gcc -o hello hello.c -static 4 | FROM scratch 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-go.golang.ubuntu-noworkdir.err: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY hello.go . 3 | RUN go build hello.go 4 | FROM ubuntu 5 | COPY --from=0 hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.pyds.python-slim: -------------------------------------------------------------------------------- 1 | FROM python:slim 2 | RUN pip install matplotlib 3 | RUN pip install numpy 4 | RUN pip install pandas 5 | COPY pyds.py . 6 | CMD ["./pyds.py"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-go.golang-alpine.alpine: -------------------------------------------------------------------------------- 1 | FROM golang:alpine 2 | COPY hello.go . 3 | RUN go build hello.go 4 | FROM alpine 5 | COPY --from=0 /go/hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-go.golang-alpine.scratch: -------------------------------------------------------------------------------- 1 | FROM golang:alpine 2 | COPY hello.go . 3 | RUN go build hello.go 4 | FROM scratch 5 | COPY --from=0 /go/hello . 6 | CMD ["./hello"] 7 | -------------------------------------------------------------------------------- /Dockerfile.whatsmyip.golang.alpine: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY whatsmyip.go . 3 | RUN go build whatsmyip.go 4 | FROM alpine 5 | COPY --from=0 /go/whatsmyip . 6 | CMD ["./whatsmyip"] 7 | -------------------------------------------------------------------------------- /Dockerfile.whatsmyip.golang.ubuntu: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY whatsmyip.go . 3 | RUN go build whatsmyip.go 4 | FROM ubuntu 5 | COPY --from=0 /go/whatsmyip . 6 | CMD ["./whatsmyip"] 7 | -------------------------------------------------------------------------------- /Dockerfile.whatsmyip.golang.busybox: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY whatsmyip.go . 3 | RUN go build whatsmyip.go 4 | FROM busybox 5 | COPY --from=0 /go/whatsmyip . 6 | CMD ["./whatsmyip"] 7 | -------------------------------------------------------------------------------- /Dockerfile.whatsmyip.golang.scratch: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY whatsmyip.go . 3 | RUN go build whatsmyip.go 4 | FROM scratch 5 | COPY --from=0 /go/whatsmyip . 6 | CMD ["./whatsmyip"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-c.alpine.alpine: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | RUN apk add build-base 3 | COPY hello.c . 4 | RUN gcc -o hello hello.c 5 | FROM alpine 6 | COPY --from=0 hello . 7 | CMD ["./hello"] 8 | -------------------------------------------------------------------------------- /Dockerfile.hello-go.golang.ubuntu-workdir: -------------------------------------------------------------------------------- 1 | FROM golang 2 | WORKDIR /src 3 | COPY hello.go . 4 | RUN go build hello.go 5 | FROM ubuntu 6 | COPY --from=0 /src/hello . 7 | CMD ["./hello"] 8 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.openjdk.openjdk-jre: -------------------------------------------------------------------------------- 1 | FROM openjdk 2 | COPY hello.java . 3 | RUN javac hello.java 4 | FROM openjdk:jre 5 | COPY --from=0 hello.class . 6 | CMD exec java -cp . hello 7 | -------------------------------------------------------------------------------- /Dockerfile.whatsmyip.golang-alpine.alpine: -------------------------------------------------------------------------------- 1 | FROM golang:alpine 2 | COPY whatsmyip.go . 3 | RUN go build whatsmyip.go 4 | FROM alpine 5 | COPY --from=0 /go/whatsmyip . 6 | CMD ["./whatsmyip"] 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-c.alpine-static.scratch: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | RUN apk add build-base 3 | COPY hello.c . 4 | RUN gcc -o hello hello.c -static 5 | FROM scratch 6 | COPY --from=0 hello . 7 | CMD ["./hello"] 8 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.openjdk-11.openjdk-11-jre: -------------------------------------------------------------------------------- 1 | FROM openjdk:11 2 | COPY hello.java . 3 | RUN javac hello.java 4 | FROM openjdk:11-jre 5 | COPY --from=0 hello.class . 6 | CMD exec java -cp . hello 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.openjdk.openjdk-8-jre-alpine: -------------------------------------------------------------------------------- 1 | FROM openjdk 2 | COPY hello.java . 3 | RUN javac hello.java 4 | FROM openjdk:8-jre-alpine 5 | COPY --from=0 hello.class . 6 | CMD exec java -cp . hello 7 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.openjdk-8.openjdk-8-jre-alpine: -------------------------------------------------------------------------------- 1 | FROM openjdk:8 2 | COPY hello.java . 3 | RUN javac hello.java 4 | FROM openjdk:8-jre-alpine 5 | COPY --from=0 hello.class . 6 | CMD exec java -cp . hello 7 | -------------------------------------------------------------------------------- /Dockerfile.pyds.alpine: -------------------------------------------------------------------------------- 1 | FROM python:alpine 2 | RUN apk add build-base freetype-dev jpeg-dev libzip-dev 3 | RUN pip install matplotlib 4 | RUN pip install numpy 5 | RUN pip install pandas 6 | COPY pyds.py . 7 | CMD ["./pyds.py"] 8 | -------------------------------------------------------------------------------- /Dockerfile.whatsmyip.golang.busybox-glibc: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY whatsmyip.go . 3 | RUN go build whatsmyip.go 4 | FROM busybox:glibc 5 | COPY --from=alpine /etc/ssl /etc/ssl 6 | COPY --from=0 /go/whatsmyip . 7 | CMD ["./whatsmyip"] 8 | -------------------------------------------------------------------------------- /Dockerfile.whatsmyip.golang-nocgo.scratch: -------------------------------------------------------------------------------- 1 | FROM golang 2 | COPY whatsmyip.go . 3 | ENV CGO_ENABLED=0 4 | RUN go build whatsmyip.go 5 | FROM scratch 6 | COPY --from=0 /go/whatsmyip . 7 | COPY --from=0 /etc/ssl /etc/ssl 8 | CMD ["./whatsmyip"] 9 | -------------------------------------------------------------------------------- /docker-compose.err.yaml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | hello-go.golang.ubuntu-noworkdir.err: 4 | image: minimage:hello-go.golang.ubuntu-noworkdir.err 5 | build: 6 | context: . 7 | dockerfile: Dockerfile.hello-go.golang.ubuntu-noworkdir.err 8 | -------------------------------------------------------------------------------- /Dockerfile.pyyaml.python-alpine.python-alpine: -------------------------------------------------------------------------------- 1 | FROM python:alpine 2 | WORKDIR /wheels 3 | RUN pip wheel pyyaml 4 | 5 | FROM python:alpine 6 | COPY --from=0 /wheels /wheels 7 | RUN pip install --no-index --find-links=/wheels pyyaml 8 | COPY pyyaml.py . 9 | CMD ./pyyaml.py 10 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.eclipse-temurin.native-image.scratch: -------------------------------------------------------------------------------- 1 | FROM eclipse-temurin:17 2 | COPY hello.java . 3 | RUN javac hello.java 4 | 5 | FROM ghcr.io/graalvm/native-image 6 | COPY --from=0 hello.class . 7 | RUN native-image hello --no-fallback --static 8 | 9 | FROM scratch 10 | COPY --from=1 /app/hello . 11 | CMD ["./hello"] 12 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.openjdk-15-jlink.ubuntu: -------------------------------------------------------------------------------- 1 | FROM openjdk:15 2 | COPY hello.java . 3 | RUN javac hello.java 4 | RUN jdeps --print-module-deps hello.class > java.modules 5 | RUN jlink --strip-debug --add-modules $(cat java.modules) --output /java 6 | 7 | FROM ubuntu 8 | COPY --from=0 /java /java 9 | COPY --from=0 hello.class . 10 | CMD exec /java/bin/java -cp . hello 11 | -------------------------------------------------------------------------------- /whatsmyip.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "io/ioutil" 4 | import "log" 5 | import "net/http" 6 | import "os" 7 | 8 | func main () { 9 | resp, err := http.Get("https://icanhazip.com/") 10 | if err != nil { 11 | log.Fatal(err) 12 | } 13 | body, err := ioutil.ReadAll(resp.Body) 14 | if err != nil { 15 | log.Fatal(err) 16 | } 17 | os.Stdout.Write(body) 18 | os.Stdout.Write([]byte{'\n'}) 19 | } 20 | -------------------------------------------------------------------------------- /Dockerfile.hello-java.openjdk-15-alpine-jlink.alpine: -------------------------------------------------------------------------------- 1 | FROM openjdk:15-alpine 2 | RUN apk add binutils # for objcopy, needed by jlink 3 | COPY hello.java . 4 | RUN javac hello.java 5 | RUN jdeps --print-module-deps hello.class > java.modules 6 | RUN jlink --strip-debug --add-modules $(cat java.modules) --output /java 7 | 8 | FROM alpine 9 | COPY --from=0 /java /java 10 | COPY --from=0 hello.class . 11 | CMD exec /java/bin/java -cp . hello 12 | -------------------------------------------------------------------------------- /mkcompose.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat >docker-compose.yaml <>$COMPOSEFILE <