Skip to content

Commit

Permalink
add user and set permissions/workdir for ocb
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgopack4 committed Oct 9, 2024
1 parent 6e9d1ae commit 62ecba8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
21 changes: 12 additions & 9 deletions cmd/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM golang:alpine
FROM golang:1.23-alpine3.20
RUN apk --update add ca-certificates

WORKDIR /build
ARG SERVICE_NAME=ocb

# Copy default builder config and ocb binary into the container
COPY builder-config.yaml /build/builder-config.yaml
COPY --chmod=755 ocb /build/ocb
RUN addgroup --gid 1001 -S ${SERVICE_NAME} && \
adduser -G ${SERVICE_NAME} --shell /bin/false --disabled-password \
-H --uid 1001 ${SERVICE_NAME} && \
chown ${SERVICE_NAME}:${SERVICE_NAME} /usr/local/go/bin

ENTRYPOINT [ "./ocb"]
# default arguments to use provided builder config file from documentation;
# replace if using a different file location or file name
CMD [ "--config", "builder-config.yaml" ]
USER ${SERVICE_NAME}
WORKDIR /home/${SERVICE_NAME}

COPY --chmod=755 ocb /usr/local/bin/ocb
ENTRYPOINT [ "ocb" ]
13 changes: 0 additions & 13 deletions cmd/builder/builder-config.yaml

This file was deleted.

0 comments on commit 62ecba8

Please sign in to comment.