Skip to content

Instantly share code, notes, and snippets.

@noemi-dresden
Last active December 24, 2018 09:59
Show Gist options
  • Save noemi-dresden/92fef5124f686edc0dee59802d51993c to your computer and use it in GitHub Desktop.
Save noemi-dresden/92fef5124f686edc0dee59802d51993c to your computer and use it in GitHub Desktop.
Fix x509 error while using docker

x509: failed to load system roots and no roots provided while using docker

When does it happen?

If the base image used to build the docker container does not have the CA certificates and you try to connect with an https or secure connection inside a docker container

How to fix it?

Just install ca cetificate to your container. For example you are using alpine you can do it as follow

FROM alpine:3.6

RUN apk update && apk add ca-certificates

#continue with the rest here

CMD ["/app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment