mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-12-06 12:24:44 +00:00
Port #708 into the panel Dockerfile and Dockerfile.worker so uid/gid 10001 resolves to artex-exec in both images (fixing tools such as ssh that require a passwd entry for the running UID) and add the 0.7.1 CHANGELOG entry. Co-authored-by: BaaRai <130491490+BaaRai@users.noreply.github.com>
35 lines
1.4 KiB
Docker
35 lines
1.4 KiB
Docker
# ARTEX isolated per-task worker image (CONTRACT.md §4).
|
|
# Runs as uid/gid 10001, read-only rootfs, cap_drop ALL, no-new-privileges,
|
|
# mounted ONLY with /app/data/tasks/<id>:/workspace:rw and connected ONLY to
|
|
# the per-task internal network artex-task-<id>.
|
|
FROM --platform=$BUILDPLATFORM golang:1.26.11-bookworm@sha256:dc40a13b61304647ed7e5d581d246b86413dfc29d63c6d018310feb93cd98fc0 AS wrap-build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
COPY cmd/artex-exec-wrap/ ./cmd/artex-exec-wrap/
|
|
ARG TARGETOS=linux
|
|
ARG TARGETARCH=amd64
|
|
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -ldflags="-s -w" -o /out/artex-exec-wrap ./cmd/artex-exec-wrap
|
|
|
|
FROM debian:bookworm-slim
|
|
RUN set -eux; \
|
|
apt-get update; \
|
|
apt-get install -y --no-install-recommends \
|
|
bash ca-certificates curl dnsutils git iputils-ping jq netcat-openbsd \
|
|
nmap openssh-client perl python3 procps; \
|
|
rm -rf /var/lib/apt/lists/*; \
|
|
groupadd --gid 10001 artex-exec; \
|
|
useradd --uid 10001 --gid 10001 --home-dir /home/exec --create-home --shell /bin/bash artex-exec; \
|
|
mkdir -p /workspace /home/exec; \
|
|
chown -R 10001:10001 /workspace /home/exec; \
|
|
find / -xdev -perm /6000 -type f -exec chmod a-s {} +
|
|
|
|
COPY --from=wrap-build /out/artex-exec-wrap /usr/local/bin/artex-exec-wrap
|
|
RUN chmod 0755 /usr/local/bin/artex-exec-wrap
|
|
|
|
USER 10001:10001
|
|
WORKDIR /workspace
|
|
ENV HOME=/home/exec \
|
|
LANG=C.UTF-8 \
|
|
TERM=xterm
|
|
CMD ["sleep", "infinity"]
|