Skip to content

Commit

Permalink
fix: Switch to distroless image in Dockerfile [PC-13119] (#137)
Browse files Browse the repository at this point in the history
## Motivation

Currently, we're missing certificates in our Docker image, so it won't
work.

```
Post "https://accounts.nobl9.com/oauth2/auseg9kiegWKEtJZC416/v1/token": tls: failed to verify certificate: x509: certificate signed by unknown authority
```

## Summary

Switch to
[distroless](https://github.com/GoogleContainerTools/distroless) image
which has certificates baked in.

## Related changes

Similar problem I've encountered recently in another project:
nieomylnieja/go-libyear@c7faae7

## Testing

```shell
make docker
docker run -e SLOCTL_CLIENT_ID=$CLIENT_ID -e SLOCTL_CLIENT_SECRET=$CLIENT_SECRET sloctl get slos
```

## Release Notes

Fixed missing TLS certificates from Docker image.
  • Loading branch information
nieomylnieja committed Jun 6, 2024
1 parent 198c01b commit 2bf6dba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN CGO_ENABLED=0 go build \
-o /artifacts/sloctl \
"${PWD}/cmd/sloctl"

FROM scratch
FROM gcr.io/distroless/static-debian12

COPY --from=builder /artifacts/sloctl /usr/bin/sloctl

Expand Down
1 change: 1 addition & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ignorePaths:
- "**/test_data/**"
- dist/**
words:
- distroless
- dynatrace
- endef
- gobin
Expand Down

0 comments on commit 2bf6dba

Please sign in to comment.