Skip to content

Commit

Permalink
Merge pull request #87 from K-Phoen/distroless
Browse files Browse the repository at this point in the history
Use gcr.io/distroless/static:nonroot as base docker image
  • Loading branch information
K-Phoen committed Nov 21, 2021
2 parents e0166a7 + 8c4983f commit 8977b32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ docker run --rm -it -v $(pwd):/workspace kphoen/dark-converter:latest convert-ya
## Converting Grafana JSON dashboard to a Kubernetes manifest

```sh
docker run --rm -it -v $(pwd):/workspace kphoen/dark-converter:latest convert-k8s-manifest -i dashboard.json -o converted-dashboard.yaml --folder Dark --namespace monitoring test-dashboard
docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/workspace kphoen/dark-converter:latest convert-k8s-manifest -i dashboard.json -o converted-dashboard.yaml --folder Dark --namespace monitoring test-dashboard
```

## Integrating with ArgoCD
Expand Down
7 changes: 4 additions & 3 deletions build/Dockerfile-controller
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ COPY . /app

RUN make controller_build

# Run
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot

FROM alpine:3.14
ENTRYPOINT ["/app/dark-controller"]
WORKDIR /app
RUN apk --update --no-cache add ca-certificates=20191127-r5 && update-ca-certificates
USER 65532:65532

COPY --from=build /app/dark-controller /app/dark-controller
7 changes: 4 additions & 3 deletions build/Dockerfile-converter
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ COPY . /app

RUN make converter_build

# Run
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot

FROM alpine:3.14
ENTRYPOINT ["/app/dark-converter"]
WORKDIR /workspace
RUN apk --update --no-cache add ca-certificates=20191127-r5 && update-ca-certificates
USER 65532:65532

COPY --from=build /app/dark-converter /app/dark-converter

0 comments on commit 8977b32

Please sign in to comment.