Skip to content

Commit f6359d7

Browse files
committed
fix(wolfi): Build DX toolbox variant from wolfi-base with SDK tooling
As the Wolfi SDK is built as an appliance, it's missing a few core packages available in wolfi-base that provide a better development experience Additionally, an issue was ran into when building from the SDK image where it will attempt to add a local packages repository that gets hardcoded to `/github/workspace/packages` preventing clean upgrades Instead of building from the SDK, build from wolfi-base and install packages used in the Wolfi SDK image Signed-off-by: RJ Trujillo <eyecantcu@pm.me>
1 parent f8ad109 commit f6359d7

File tree

3 files changed

+48
-25
lines changed

3 files changed

+48
-25
lines changed

.github/workflows/build-wolfi-toolbox.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
env:
99
IMAGE_TAGS: latest
1010
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
11-
SOURCE_IMAGE_REGISTRY: cgr.dev/chainguard
1211

1312
concurrency:
1413
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
@@ -31,18 +30,10 @@ jobs:
3130
- name: Checkout Push to Registry action
3231
uses: actions/checkout@v4
3332

34-
- name: Determine base image
35-
run: |
36-
if [[ "${{ matrix.image_name }}" == "wolfi-toolbox" ]]; then
37-
echo "SOURCE_IMAGE_NAME=wolfi-base" >> $GITHUB_ENV
38-
elif [[ "${{ matrix.image_name }}" == "wolfi-dx-toolbox" ]]; then
39-
echo "SOURCE_IMAGE_NAME=sdk" >> $GITHUB_ENV
40-
fi
41-
4233
- name: Verify base image
4334
uses: EyeCantCU/cosign-action/verify@v0.2.2
4435
with:
45-
containers: ${{ env.SOURCE_IMAGE_NAME }}
36+
containers: wolfi-base
4637
cert-identity: https://github.com/chainguard-images/images/.github/workflows/release.yaml@refs/heads/main
4738
oidc-issuer: https://token.actions.githubusercontent.com
4839
registry: cgr.dev/chainguard
@@ -67,8 +58,7 @@ jobs:
6758
image: ${{ matrix.image_name }}
6859
tags: ${{ env.IMAGE_TAGS }}
6960
build-args: |
70-
SOURCE_IMAGE_NAME=${{ env.SOURCE_IMAGE_NAME }}
71-
SOURCE_IMAGE_REGISTRY=${{ env.SOURCE_IMAGE_REGISTRY }}
61+
IMAGE_NAME=${{ matrix.image_name }}
7262
labels: ${{ steps.meta.outputs.labels }}
7363
oci: false
7464

toolboxes/wolfi-toolbox/Containerfile.wolfi

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
ARG SOURCE_IMAGE_NAME="${SOURCE_IMAGE_NAME:-wolfi-base}"
2-
ARG SOURCE_IMAGE_REGISTRY="${SOURCE_IMAGE_REGISTRY:-cgr.dev/chainguard}"
3-
ARG SOURCE_IMAGE="${SOURCE_IMAGE_REGISTRY}/${SOURCE_IMAGE_NAME}"
4-
5-
FROM $SOURCE_IMAGE:latest
1+
FROM cgr.dev/chainguard/wolfi-base:latest
62
# Thanks to Nuno do Carmo for the initial prototype
73

84
LABEL com.github.containers.toolbox="true" \
95
usage="This image is meant to be used with the Toolbox or Distrobox command" \
106
summary="A blank Wolfi distrobox, suitable for development" \
117
maintainer="jorge.castro@gmail.com"
128

13-
COPY ./toolboxes/wolfi-toolbox/packages.wolfi /toolbox-packages
9+
ARG IMAGE_NAME="${IMAGE_NAME:-wolfi-toolbox}"
10+
11+
COPY ./toolboxes/wolfi-toolbox/packages.wolfi \
12+
./toolboxes/wolfi-toolbox/packages.wolfi-dx \
13+
/tmp
1414

15-
# Remove local repository and update image
16-
RUN sed -i 's/@local.*//g' /etc/apk/repositories \
17-
apk update && \
15+
# Update image
16+
RUN apk update && \
1817
apk upgrade
1918

2019
# Add optional packages
21-
RUN grep -v '^#' /toolbox-packages | xargs apk add
22-
23-
RUN rm /toolbox-packages
24-
20+
RUN grep -v '^#' /tmp/packages.wolfi | xargs apk add && \
21+
if [[ "${IMAGE_NAME}" =~ "dx" ]]; then \
22+
grep -v '^#' /tmp/packages.wolfi-dx | xargs apk add \
23+
; fi
2524

2625
# Get Distrobox-host-exec and host-spawn
2726
RUN git clone https://github.com/89luca89/distrobox.git --single-branch /tmp/distrobox && \
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
alpine-keys
2+
apk-tools
3+
binutils
4+
binutils-gold
5+
bubblewrap
6+
build-base
7+
busybox
8+
ca-certificates-bundle
9+
expat
10+
gcc
11+
glibc
12+
glibc-dev
13+
glibc-locale-posix
14+
gmp
15+
go
16+
isl
17+
libbrotlicommon1
18+
libbrotlidec1
19+
libcrypto3
20+
libcurl4
21+
libgcc
22+
libnghttp2-14
23+
libpcre2-32-0
24+
libssl3
25+
libstdc++
26+
libstdc++-dev
27+
linux-headers
28+
make
29+
mpc
30+
mpfr
31+
ncurses-terminfo-base
32+
pkgconf
33+
wolfi-baselayout
34+
zlib

0 commit comments

Comments
 (0)