Skip to content

Commit beee398

Browse files
authored
Merge pull request #307 from dgageot/fix-170
Add a non root user to the docker/cagent image
2 parents 9addbff + bd72f0e commit beee398

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ COPY --from=builder /binaries .
4141

4242
FROM alpine
4343
RUN apk add --no-cache ca-certificates docker-cli
44+
RUN addgroup -S cagent && adduser -S -G cagent cagent
4445
ARG TARGETOS TARGETARCH
4546
ENV DOCKER_MCP_IN_CONTAINER=1
46-
ENTRYPOINT ["/cagent"]
47-
RUN mkdir /data
47+
RUN mkdir /data /work && chmod 777 /data /work
4848
COPY --from=docker/mcp-gateway:v2 /docker-mcp /usr/local/lib/docker/cli-plugins/
4949
COPY --from=builder /binaries/cagent-$TARGETOS-$TARGETARCH /cagent
50+
USER cagent
51+
WORKDIR /work
52+
ENTRYPOINT ["/cagent"]

0 commit comments

Comments
 (0)