Skip to content

Commit

Permalink
Fixing the dockerfile to run as non-root user (kserve#2687)
Browse files Browse the repository at this point in the history
Signed-off-by: Chirag Patel <[email protected]>
Co-authored-by: Chirag Patel <[email protected]>
  • Loading branch information
chirag-orbittec and Chirag Patel authored Feb 13, 2023
1 parent 9bd6375 commit 3c9cafe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion agent.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY cmd/ cmd/
RUN CGO_ENABLED=0 GOOS=linux go build -a -o agent ./cmd/agent

# Copy the inference-agent into a thin image
FROM gcr.io/distroless/static:latest
FROM gcr.io/distroless/static:nonroot
COPY third_party/ third_party/
WORKDIR /ko-app
COPY --from=builder /go/src/github.com/kserve/kserve/agent /ko-app/
Expand Down
2 changes: 1 addition & 1 deletion router.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY cmd/ cmd/
RUN CGO_ENABLED=0 go build -a -o router ./cmd/router

# Copy the inference-router into a thin image
FROM gcr.io/distroless/static:latest
FROM gcr.io/distroless/static:nonroot
COPY third_party/ third_party/
WORKDIR /ko-app
COPY --from=builder /go/src/github.com/kserve/kserve/router /ko-app/
Expand Down
2 changes: 1 addition & 1 deletion tools/tf2openapi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY go.sum go.sum
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o tf2openapi ./tools/tf2openapi/cmd

# Copy tf2openapi into a thin image
FROM gcr.io/distroless/static:latest
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY third_party/ third_party/
COPY --from=builder /go/src/github.com/kserve/kserve/tf2openapi .
Expand Down

0 comments on commit 3c9cafe

Please sign in to comment.