-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.base
27 lines (22 loc) · 908 Bytes
/
Dockerfile.base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
ARG UBUNTU_RELEASE=22.04
# Build the chiselled filesystem based on the desired slices.
FROM --platform=$BUILDPLATFORM ubuntu:$UBUNTU_RELEASE AS builder
ARG UBUNTU_RELEASE
ARG TARGETARCH
# Get chisel binary
ADD "https://github.com/canonical/chisel/releases/download/v0.9.0/chisel_v0.9.0_linux_${TARGETARCH}.tar.gz" chisel.tar.gz
RUN tar -xvf chisel.tar.gz -C /usr/bin/
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates
WORKDIR /rootfs
RUN chisel cut --release ubuntu-$UBUNTU_RELEASE --root /rootfs \
base-files_base \
base-files_release-info \
ca-certificates_data \
libc6_libs
# Make the chiselled filesystem the only thing
# present in the final image.
FROM scratch
COPY --from=builder /rootfs /
# Build base chiselled image
# docker buildx build -f Dockerfile.base --platform linux/arm64,linux/amd64 --tag akoken/chiselled-ubuntu:latest . --load