Skip to content

Commit 388fe7f

Browse files
committed
feat: drop s6, run on base-exec
1 parent 657aaab commit 388fe7f

5 files changed

Lines changed: 18 additions & 7 deletions

File tree

‎Containerfile‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ RUN APP_VERSION=${APP_VERSION:-$(fetch -qo - "${UPSTREAM_URL}" | jq -r "${UPSTRE
7373
npm cache clean --force
7474

7575
# Production image
76-
FROM ghcr.io/daemonless/base:${BASE_VERSION}
76+
FROM ghcr.io/daemonless/base-exec:${BASE_VERSION}
7777

7878
ARG FREEBSD_ARCH=amd64
7979
ARG APP_VERSION=""
@@ -116,9 +116,12 @@ RUN ln -sf /usr/local/lib/node_modules/code-server/out/node/entry.js /usr/local/
116116

117117
# Copy root filesystem
118118
COPY root/ /
119+
RUN chmod +x /daemonless/libexec/code-server /daemonless/init.d/*
120+
121+
CMD ["/daemonless/libexec/code-server"]
119122

120123
# Set permissions
121-
RUN chmod +x /etc/services.d/code-server/run /etc/cont-init.d/* /healthz /usr/local/bin/sudo
124+
RUN chmod +x /healthz /usr/local/bin/sudo
122125

123126
ENV HOME="/config"
124127

‎Containerfile.j2‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ RUN APP_VERSION=${APP_VERSION:-$(fetch -qo - "${UPSTREAM_URL}" | jq -r "${UPSTRE
6767
npm cache clean --force
6868

6969
# Production image
70-
FROM ghcr.io/daemonless/base:${BASE_VERSION}
70+
FROM ghcr.io/daemonless/base-exec:${BASE_VERSION}
7171

7272
ARG FREEBSD_ARCH=amd64
7373
ARG APP_VERSION=""
@@ -110,9 +110,12 @@ RUN ln -sf /usr/local/lib/node_modules/code-server/out/node/entry.js /usr/local/
110110

111111
# Copy root filesystem
112112
COPY root/ /
113+
RUN chmod +x /daemonless/libexec/code-server /daemonless/init.d/*
114+
115+
CMD ["/daemonless/libexec/code-server"]
113116

114117
# Set permissions
115-
RUN chmod +x /etc/services.d/code-server/run /etc/cont-init.d/* /healthz /usr/local/bin/sudo
118+
RUN chmod +x /healthz /usr/local/bin/sudo
116119

117120
ENV HOME="/config"
118121

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# The workspace, data and extensions dirs, owned by bsd (as non-root, the
3+
# runtime owns /config).
4+
mkdir -p "${DEFAULT_WORKSPACE:-/config/workspace}" /config/data /config/extensions
5+
if [ "$(id -u)" = 0 ]; then
6+
chown bsd:bsd "${DEFAULT_WORKSPACE:-/config/workspace}" /config/data /config/extensions
7+
fi
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ else
77
AUTH_ARGS=""
88
fi
99

10-
mkdir -p "${DEFAULT_WORKSPACE:-/config/workspace}" /config/data /config/extensions
11-
chown bsd:bsd "${DEFAULT_WORKSPACE:-/config/workspace}" /config/data /config/extensions
1210
cd "${DEFAULT_WORKSPACE:-/config/workspace}"
13-
exec s6-setuidgid bsd code-server \
11+
exec code-server \
1412
--bind-addr 0.0.0.0:8080 \
1513
--user-data-dir /config/data \
1614
--extensions-dir /config/extensions \

0 commit comments

Comments
 (0)