Skip to content

Commit 266f0d5

Browse files
committed
chore(sdk): use Debian's Docker Hardened Image
Using trivy to scan vulnerabilities in Docker images, we found that: BEFORE: Total: 97 (UNKNOWN: 2, LOW: 82, MEDIUM: 13, HIGH: 0, CRITICAL: 0) AFTER : Total: 88 (UNKNOWN: 2, LOW: 76, MEDIUM: 10, HIGH: 0, CRITICAL: 0)
1 parent a8e8ec6 commit 266f0d5

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

packages/sdk/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ FROM base AS foundry
6666
ARG FOUNDRY_VERSION
6767
ARG TARGETARCH
6868
ARG TARGETOS
69+
WORKDIR /usr/local/bin
6970
RUN <<EOF
7071
mkdir -p /usr/local/bin
7172
curl -fsSL https://github.com/foundry-rs/foundry/releases/download/v${FOUNDRY_VERSION}/foundry_v${FOUNDRY_VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz \
@@ -130,12 +131,10 @@ ARG DEBIAN_FRONTEND=noninteractive
130131
RUN <<EOF
131132
apt-get install -y --no-install-recommends \
132133
libslirp0 \
133-
lua5.4
134-
rm -rf /var/lib/apt/lists/*
135-
EOF
134+
lua5.4 \
135+
passwd
136136

137-
RUN <<EOF
138-
set -e
137+
# create cartesi user
139138
useradd \
140139
--comment "cartesi user" \
141140
--no-create-home \
@@ -145,6 +144,9 @@ useradd \
145144
--uid 102 \
146145
--user-group \
147146
cartesi
147+
148+
apt-get remove -y --purge passwd
149+
rm -rf /var/lib/apt/lists/*
148150
EOF
149151

150152
# Install cartesi-machine emulator
@@ -305,9 +307,7 @@ apt-get install -y --no-install-recommends \
305307
liblzo2-2 \
306308
libslirp0 \
307309
locales \
308-
lua5.4 \
309-
xxd \
310-
xz-utils
310+
xxd
311311
rm -rf /var/lib/apt/lists/*
312312
EOF
313313

packages/sdk/docker-bake.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ target "default" {
88
args = {
99
ALTO_VERSION = "1.2.5"
1010
ALTO_PACKAGE_VERSION = "0.0.18"
11-
CARTESI_BASE_IMAGE = "docker.io/library/debian:trixie-20260223-slim@sha256:1d3c811171a08a5adaa4a163fbafd96b61b87aa871bbc7aa15431ac275d3d430"
12-
CARTESI_DEVNET_VERSION = "2.0.0-alpha.10"
11+
CARTESI_BASE_IMAGE = "dhi.io/debian-base:trixie-dev@sha256:2166e2eaef0651c9ad21de6ab5a34fda12541d89bccf7bcb0a94afceb1b1541b"
12+
CARTESI_DEVNET_VERSION = "2.0.0-alpha.9"
1313
CARTESI_IMAGE_KERNEL_VERSION = "0.20.0"
1414
CARTESI_LINUX_KERNEL_VERSION = "6.5.13-ctsi-1-v0.20.0"
1515
CARTESI_MACHINE_EMULATOR_VERSION = "0.19.0"

packages/sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"private": true,
44
"version": "0.12.0-alpha.35",
55
"scripts": {
6-
"build": "docker buildx bake --load --metadata-file=build.json"
6+
"build": "docker buildx bake --load --metadata-file=build.json",
7+
"digest-update": "../../.github/scripts/update-image-digests.sh ./docker-bake.hcl"
78
}
89
}

0 commit comments

Comments
 (0)