Skip to content

Commit

Permalink
Use busybox-like base image to reduce size
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Mazzotti <[email protected]>
  • Loading branch information
anmazzotti committed Jun 5, 2024
1 parent 3005a75 commit 4c21469
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .obs/dockerfile/Dockerfile.sle-micro-5-5
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@

ARG SLMICRO_VERSION

FROM suse/sl-micro/${SLMICRO_VERSION}/toolbox:latest
FROM suse/sl-micro/${SLMICRO_VERSION}/toolbox:latest as toolbox

# Prepare a busybox base
RUN mkdir -p /busybox && rpm --initdb --root /busybox
RUN zypper --installroot /busybox in --no-recommends -y busybox

ARG CHANNEL_JSON_FILE="sle-micro-5-5.json"

COPY $CHANNEL_JSON_FILE /channel.json

FROM scratch

COPY --from=toolbox /busybox /
COPY --from=toolbox /channel.json /channel.json

USER 10010:10010

# Define labels according to https://en.opensuse.org/Building_derived_containers
Expand Down
11 changes: 10 additions & 1 deletion .obs/dockerfile/Dockerfile.sle-micro-5-5-kvm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@

ARG SLMICRO_VERSION

FROM suse/sl-micro/${SLMICRO_VERSION}/toolbox:latest
FROM suse/sl-micro/${SLMICRO_VERSION}/toolbox:latest as toolbox

# Prepare a busybox base
RUN mkdir -p /busybox && rpm --initdb --root /busybox
RUN zypper --installroot /busybox in --no-recommends -y busybox

ARG CHANNEL_JSON_FILE="sle-micro-5-5-kvm.json"

COPY $CHANNEL_JSON_FILE /channel.json

FROM scratch

COPY --from=toolbox /busybox /
COPY --from=toolbox /channel.json /channel.json

USER 10010:10010

# Define labels according to https://en.opensuse.org/Building_derived_containers
Expand Down
11 changes: 10 additions & 1 deletion .obs/dockerfile/Dockerfile.sle-micro-5-5-rt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@

ARG SLMICRO_VERSION

FROM suse/sl-micro/${SLMICRO_VERSION}/toolbox:latest
FROM suse/sl-micro/${SLMICRO_VERSION}/toolbox:latest as toolbox

# Prepare a busybox base
RUN mkdir -p /busybox && rpm --initdb --root /busybox
RUN zypper --installroot /busybox in --no-recommends -y busybox

ARG CHANNEL_JSON_FILE="sle-micro-5-5-rt.json"

COPY $CHANNEL_JSON_FILE /channel.json

FROM scratch

COPY --from=toolbox /busybox /
COPY --from=toolbox /channel.json /channel.json

USER 10010:10010

# Define labels according to https://en.opensuse.org/Building_derived_containers
Expand Down

0 comments on commit 4c21469

Please sign in to comment.