Skip to content

Commit 6567bd8

Browse files
committed
docker-base with homedir similar to builder-base
1 parent 6960ab4 commit 6567bd8

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

duckdb/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN set -ex; \
1515
RUN echo '#!/bin/sh' > /tmp/xdg-open && chmod u+x /tmp/xdg-open
1616

1717
# TODO needs a bit more distro than gcr.io/distroless/base but not this much
18-
FROM --platform=$TARGETPLATFORM yolean/docker-base
18+
FROM --platform=$TARGETPLATFORM yolean/homedir
1919

2020
# TODO note
2121
# Failed to download extension "ui" at URL "http://extensions.duckdb.org/v1.2.1/linux_arm64_gcc4/ui.duckdb_extension.gz" (HTTP 403)

homedir/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM --platform=$TARGETPLATFORM yolean/docker-base \
2+
as base
3+
4+
FROM base as nonroot
5+
WORKDIR /nonroot
6+
RUN set -e; \
7+
mkdir -p home/nonroot/.cache; \
8+
chown root home; chown -R 65532:65534 home/nonroot
9+
10+
FROM base
11+
COPY --from=nonroot /nonroot /

test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if [[ ! -z "$SOURCE_COMMIT" ]]; then
1515
fi
1616
fi
1717

18+
# note that docker-base isn't actually nonroot, we just want to build that first
1819
MULTIARCH_NONROOT="
1920
docker-base
2021
builder-base
@@ -35,6 +36,7 @@ runtime-deno
3536
"
3637

3738
MULTIARCH_TONONROOT="
39+
homedir
3840
java
3941
node
4042
node-kafka

to-nonroot/homedir/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM --platform=$TARGETPLATFORM yolean/homedir:root
2+
3+
# Appends the same nonroot directives as https://github.com/Yolean/kubernetes-kafka/tree/master/nonroot
4+
# i.e. https://github.com/solsson/dockerfiles/tree/native/kafka-nonroot
5+
RUN grep 'nonroot:x:65532' /etc/passwd || \
6+
echo 'nonroot:x:65532:65534:nonroot:/home/nonroot:/usr/sbin/nologin' >> /etc/passwd && \
7+
mkdir -p /home/nonroot && touch /home/nonroot/.bash_history && chown -R 65532:65534 /home/nonroot
8+
USER nonroot:nogroup

0 commit comments

Comments
 (0)