Skip to content

Commit bc6e443

Browse files
committed
fix(kms): ship CA certificates in the KMS image
1 parent ccbf65b commit bc6e443

4 files changed

Lines changed: 111 additions & 1 deletion

File tree

.github/workflows/docker-build-check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ jobs:
8888
DSTACK_REV=${{ env.DSTACK_REV }}
8989
DSTACK_SRC_URL=${{ env.DSTACK_SRC_URL }}
9090
91+
- name: Verify pinned packages
92+
run: |
93+
dstack/build/shared/verify-pinned-packages.sh dstack-kms-check:latest \
94+
dstack/kms/dstack-app/builder/shared/pinned-packages.txt
95+
9196
- name: Build kms-builder target
9297
run: |
9398
docker buildx build \

dstack/kms/dstack-app/builder/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ RUN cd repo/dstack && cargo build --release -p dstack-kms --target x86_64-unknow
2727
RUN echo "${DSTACK_REV}" > /build/.GIT_REV
2828

2929
FROM debian:bookworm@sha256:0d8498a0e9e6a60011df39aab78534cfe940785e7c59d19dfae1eb53ea59babe
30+
COPY --from=build-shared /pin-packages.sh /build/
31+
COPY ./shared/pinned-packages.txt /build/
32+
WORKDIR /build
33+
# reqwest is built against rustls-platform-verifier, which reads the system
34+
# trust store and errors out when it finds none. The KMS builds its collateral
35+
# and AMD KDS clients eagerly at startup, so a base image without CA
36+
# certificates fails to boot before it serves anything.
37+
RUN ./pin-packages.sh ./pinned-packages.txt && \
38+
apt-get update && \
39+
apt-get install -y --no-install-recommends \
40+
ca-certificates \
41+
&& rm -rf /var/lib/apt/lists/* /var/log/* /var/cache/ldconfig/aux-cache
42+
WORKDIR /
3043
COPY --from=kms-builder /build/repo/dstack/target/x86_64-unknown-linux-musl/release/dstack-kms /usr/local/bin/dstack-kms
3144
COPY --from=kms-builder /build/.GIT_REV /etc/
3245
CMD ["dstack-kms"]

dstack/kms/dstack-app/builder/build-image.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ DSTACK_SRC_URL=${DSTACK_SRC_URL:-https://github.com/Dstack-TEE/dstack.git}
3030
ensure_buildkit
3131

3232
touch "$SHARED_DIR/builder-pinned-packages.txt"
33+
touch "$SHARED_DIR/pinned-packages.txt"
3334

34-
docker_build "$NAME" ""
35+
docker_build "$NAME" "" "$SHARED_DIR/pinned-packages.txt"
3536
docker_build "kms-builder-temp" "kms-builder" "$SHARED_DIR/builder-pinned-packages.txt"
3637

3738
check_clean_tree "$SHARED_DIR"
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
adduser=3.134
2+
apt=2.6.1
3+
base-files=12.4+deb12u11
4+
base-passwd=3.6.1
5+
bash=5.2.15-2+b8
6+
bsdutils=1:2.38.1-5+deb12u3
7+
ca-certificates=20230311+deb12u1
8+
coreutils=9.1-1
9+
dash=0.5.12-2
10+
debconf=1.5.82
11+
debian-archive-keyring=2023.3+deb12u2
12+
debianutils=5.7-0.5~deb12u1
13+
diffutils=1:3.8-4
14+
dpkg=1.21.22
15+
e2fsprogs=1.47.0-2
16+
findutils=4.9.0-4
17+
gcc-12-base:amd64=12.2.0-14+deb12u1
18+
gpgv=2.2.40-1.1
19+
grep=3.8-5
20+
gzip=1.12-1
21+
hostname=3.23+nmu1
22+
init-system-helpers=1.65.2
23+
libacl1:amd64=2.3.1-3
24+
libapt-pkg6.0:amd64=2.6.1
25+
libattr1:amd64=1:2.5.1-4
26+
libaudit-common=1:3.0.9-1
27+
libaudit1:amd64=1:3.0.9-1
28+
libblkid1:amd64=2.38.1-5+deb12u3
29+
libbz2-1.0:amd64=1.0.8-5+b1
30+
libc-bin=2.36-9+deb12u10
31+
libc6:amd64=2.36-9+deb12u10
32+
libcap-ng0:amd64=0.8.3-1+b3
33+
libcap2:amd64=1:2.66-4+deb12u1
34+
libcom-err2:amd64=1.47.0-2
35+
libcrypt1:amd64=1:4.4.33-2
36+
libdb5.3:amd64=5.3.28+dfsg2-1
37+
libdebconfclient0:amd64=0.270
38+
libext2fs2:amd64=1.47.0-2
39+
libffi8:amd64=3.4.4-1
40+
libgcc-s1:amd64=12.2.0-14+deb12u1
41+
libgcrypt20:amd64=1.10.1-3
42+
libgmp10:amd64=2:6.2.1+dfsg1-1.1
43+
libgnutls30:amd64=3.7.9-2+deb12u4
44+
libgpg-error0:amd64=1.46-1
45+
libhogweed6:amd64=3.8.1-2
46+
libidn2-0:amd64=2.3.3-1+b1
47+
liblz4-1:amd64=1.9.4-1
48+
liblzma5:amd64=5.4.1-1
49+
libmd0:amd64=1.0.4-2
50+
libmount1:amd64=2.38.1-5+deb12u3
51+
libnettle8:amd64=3.8.1-2
52+
libp11-kit0:amd64=0.24.1-2
53+
libpam-modules-bin=1.5.2-6+deb12u1
54+
libpam-modules:amd64=1.5.2-6+deb12u1
55+
libpam-runtime=1.5.2-6+deb12u1
56+
libpam0g:amd64=1.5.2-6+deb12u1
57+
libpcre2-8-0:amd64=10.42-1
58+
libseccomp2:amd64=2.5.4-1+deb12u1
59+
libselinux1:amd64=3.4-1+b6
60+
libsemanage-common=3.4-1
61+
libsemanage2:amd64=3.4-1+b5
62+
libsepol2:amd64=3.4-2.1
63+
libsmartcols1:amd64=2.38.1-5+deb12u3
64+
libss2:amd64=1.47.0-2
65+
libssl3:amd64=3.0.18-1~deb12u2
66+
libstdc++6:amd64=12.2.0-14+deb12u1
67+
libsystemd0:amd64=252.38-1~deb12u1
68+
libtasn1-6:amd64=4.19.0-2+deb12u1
69+
libtinfo6:amd64=6.4-4
70+
libudev1:amd64=252.38-1~deb12u1
71+
libunistring2:amd64=1.0-2
72+
libuuid1:amd64=2.38.1-5+deb12u3
73+
libxxhash0:amd64=0.8.1-1
74+
libzstd1:amd64=1.5.4+dfsg2-5
75+
login=1:4.13+dfsg1-1+deb12u1
76+
logsave=1.47.0-2
77+
mawk=1.3.4.20200120-3.1
78+
mount=2.38.1-5+deb12u3
79+
ncurses-base=6.4-4
80+
ncurses-bin=6.4-4
81+
openssl=3.0.18-1~deb12u2
82+
passwd=1:4.13+dfsg1-1+deb12u1
83+
perl-base=5.36.0-7+deb12u2
84+
sed=4.9-1
85+
sysvinit-utils=3.06-4
86+
tar=1.34+dfsg-1.2+deb12u1
87+
tzdata=2025b-0+deb12u1
88+
usr-is-merged=37~deb12u1
89+
util-linux-extra=2.38.1-5+deb12u3
90+
util-linux=2.38.1-5+deb12u3
91+
zlib1g:amd64=1:1.2.13.dfsg-1

0 commit comments

Comments
 (0)