From 3bf065b4756ca10aecf5e07e2a1ddb4d58781eea Mon Sep 17 00:00:00 2001 From: "George Adams IV (geowa4)" Date: Sat, 28 Jul 2018 22:04:06 -0400 Subject: [PATCH] Fix certificate error in Docker image. When running `list instances`, I would receive an error `Post https://ssm.us-west-2.amazonaws.com/: x509: failed to load system roots and no roots provided`. Adding `ca-certificates` into the image resolves this issue. I also reordered the directives for the final image to reuse layers. The layers are minimal so you won't notice, but it's a good habit. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f6eb041..c662d08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ ENV ARCH amd64 RUN make build-release FROM alpine -COPY --from=builder /go/src/github.com/itsdalmo/ssm-sh/ssm-sh-linux-amd64 /bin/ssm-sh +RUN apk --no-cache add ca-certificates ENTRYPOINT ["/bin/ssm-sh"] CMD ["--help"] +COPY --from=builder /go/src/github.com/itsdalmo/ssm-sh/ssm-sh-linux-amd64 /bin/ssm-sh