Skip to content

Commit

Permalink
fix: Add permissions in DockerFile (#188)
Browse files Browse the repository at this point in the history
<!-- Thank you for your contribution. Before you submit the pull
request:
1. Follow contributing guidelines, templates, the recommended Git
workflow, and any related documentation.
2. Read and submit the required Contributor Licence Agreements
(https://github.com/kyma-project/community/blob/main/CONTRIBUTING.md#agreements-and-licenses).
3. Test your changes and attach their results to the pull request.
4. Update the relevant documentation.

If the pull request requires a decision, follow the [decision-making
process](https://github.com/kyma-project/community/blob/main/governance.md)
and replace the PR template with the [decision record
template](https://github.com/kyma-project/community/blob/main/.github/ISSUE_TEMPLATE/decision-record.md).
-->

**Description**

Changes proposed in this pull request:

- Fix permissions in DockerFile in preparation for the migration to ADO 

**Related issue(s)**

https://github.com/orgs/kyma-project/projects/30/views/15?pane=issue&itemId=60682205
  • Loading branch information
nesmabadr authored May 6, 2024
1 parent 8c853c3 commit b1c9eb8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ FROM golang:1.22.2-alpine as builder
ARG TARGETOS
ARG TARGETARCH

WORKDIR /workspace
WORKDIR /template-operator
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# Copy the go source
COPY main.go main.go
COPY api api/
COPY controllers controllers/
COPY module-data module-data/
RUN chmod 755 module-data/

# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
Expand All @@ -28,8 +30,9 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -ldflags
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
COPY module-data module-data/

COPY --chown=65532:65532 --from=builder /template-operator/manager .
COPY --chown=65532:65532 --from=builder /template-operator/module-data module-data/
USER 65532:65532

ENTRYPOINT ["/manager"]

0 comments on commit b1c9eb8

Please sign in to comment.