3

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?

poy
  • 10,063
  • 9
  • 49
  • 74
Mazzy
  • 13,354
  • 43
  • 126
  • 207
  • 1
    You need to install ca-certificates: `apk add --no-cache ca-certificates`. –  Nov 08 '18 at 16:31

2 Answers2

8

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.

poy
  • 10,063
  • 9
  • 49
  • 74
1

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/*
Jed Huo
  • 11
  • 3