x509 certificate signed by unknown authority - go-pingdom

Viewed 6659

I'm using the Go package pingdom-go to query Pingdom. The application is containerized as this:

FROM alpine:3.8

USER nobody

ADD build/_output/bin/app /usr/local/bin/app

However I get the following error:

Get https://api.pingdom.com/api/2.1/checks/0: x509: certificate signed by unknown authority

I've already tried what suggested here x509 certificate signed by unknown authority but without luck. Any ideas?

2 Answers

So the alpine containers are very minimal, including not having certs. You can either install the certs like @TimCooper suggested:

apk add --no-cache ca-certificates

You can also checkout GoogleContainerTools/distroless. It is minimal but has a few things like certs that make development life a little easier.

add the following cmd to your Dockerfile can fix it.

FROM alpine:3.8

RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
Related