Skip to content

Commit

Permalink
fix: run as root user, prevent permission error
Browse files Browse the repository at this point in the history
  • Loading branch information
tiamo committed Sep 19, 2023
1 parent 37f91db commit 47d9c62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ FROM cgr.dev/chainguard/static:latest

WORKDIR /app

COPY --from=build --chown=nonroot:nonroot /app/svt-agent /app
COPY ./ansible/ ./ansible
COPY --from=build /app/svt-agent /app
# The "nonroot" user does not have the necessary permissions to connect to the Docker socket.
#COPY --from=build --chown=nonroot:nonroot /app/svt-agent /app
USER root

ENTRYPOINT ["/app/svt-agent"]

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ do_install() {
IP_ADDR=$(hostname -I | cut -f1 -d' ')

say "Starting docker container..."
CONTAINER_ID="$(docker run -d -it --privileged --restart=always --name $CONTAINER_NAME \
CONTAINER_ID="$(docker run -d -it --restart=always --name $CONTAINER_NAME \
--hostname $CONTAINER_NAME \
--log-opt max-size=10m \
--log-opt max-file=5 \
Expand Down

0 comments on commit 47d9c62

Please sign in to comment.