nui / chisel-cutter

Base image for build smallest image with chisel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chisel-cutter

Base image for building distroless docker image using chisel

This is repository for ghcr.io/nui/chisel-cutter image which you can use as base image as following Dockerfile

ARG rootfs=/rootfs

# step 1: build root filesystem
FROM ghcr.io/nui/chisel-cutter:main as builder

ARG rootfs
WORKDIR $rootfs
RUN chisel cut \
        --release ubuntu-22.04 \
        --root $rootfs  \
        base-files_base \
        base-files_release-info \
        base-passwd_data \
        busybox_bins \
        libgcc-s1_libs \
        tzdata_etc \
        tzdata_eurasia
# /cutter directory contains help script for working with distroless image
RUN /cutter/add-user-and-group 1000 nonroot

# step 2: copy generated filesystem as a root filesystem for scratch image
FROM scratch
ARG rootfs
# copy everything create by chisel as new root filesystem
COPY --from=builder /rootfs /

How to build this image locally

docker build -t chisel-cutter --platform linux/amd64 -f docker/Dockerfile .

About

Base image for build smallest image with chisel


Languages

Language:Shell 70.8%Language:Dockerfile 29.2%