Skip to content

Commit c7b16ed

Browse files
committed
patch spindle to give more caps to the container
1 parent a261a4b commit c7b16ed

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

spindle/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ FROM golang:1.24-alpine as builder
22
ENV CGO_ENABLED=1
33

44
WORKDIR /app
5-
RUN apk add gcc musl-dev
5+
RUN apk add gcc musl-dev patch
66
COPY ./core .
7-
RUN go build -o /usr/bin/spindle -ldflags '-s -w -extldflags "-static"' ./cmd/spindle
7+
COPY ./docker.patch ./
8+
RUN patch -p1 < docker.patch && \
9+
go build -o /usr/bin/spindle -ldflags '-s -w -extldflags "-static"' ./cmd/spindle
810

911
FROM alpine:edge
1012
EXPOSE 6555

spindle/docker.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/spindle/engines/nixery/engine.go b/spindle/engines/nixery/engine.go
2+
index 8fc8d785..668b4445 100644
3+
--- a/spindle/engines/nixery/engine.go
4+
+++ b/spindle/engines/nixery/engine.go
5+
@@ -222,7 +222,7 @@ func (e *Engine) SetupWorkflow(ctx context.Context, wid models.WorkflowId, wf *m
6+
},
7+
ReadonlyRootfs: false,
8+
CapDrop: []string{"ALL"},
9+
- CapAdd: []string{"CAP_DAC_OVERRIDE"},
10+
+ CapAdd: []string{"CAP_DAC_OVERRIDE", "CAP_CHOWN", "CAP_FOWNER", "CAP_SETUID", "CAP_SETGID"},
11+
SecurityOpt: []string{"no-new-privileges"},
12+
ExtraHosts: []string{"host.docker.internal:host-gateway"},
13+
}, nil, nil, "")

0 commit comments

Comments
 (0)