From c43c5692f549b18340ac8ebca5e42c7a7eccdd49 Mon Sep 17 00:00:00 2001 From: Jose Manuel Ferrer Mosteiro Date: Tue, 21 Jan 2020 17:01:46 +0100 Subject: [PATCH 1/3] Use golang instead alpine Using alpine image docker build returns an error: ``` Step 3/8 : RUN go get -d github.com/optiopay/klar ---> Running in 6562fdf69543 package github.com/quay/clair/v3/pkg/commonerr: cannot find package "github.com/quay/clair/v3/pkg/commonerr" in any of: /usr/local/go/src/github.com/quay/clair/v3/pkg/commonerr (from $GOROOT) /go/src/github.com/quay/clair/v3/pkg/commonerr (from $GOPATH) package github.com/quay/clair/v3/pkg/pagination: cannot find package "github.com/quay/clair/v3/pkg/pagination" in any of: /usr/local/go/src/github.com/quay/clair/v3/pkg/pagination (from $GOROOT) /go/src/github.com/quay/clair/v3/pkg/pagination (from $GOPATH) ``` --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 713dd9d..72a0a7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM golang:1.8-alpine as builder +FROM golang as builder -RUN apk --update add git; +#RUN apk --update add git; RUN go get -d github.com/optiopay/klar RUN go build ./src/github.com/optiopay/klar From 1976f0f0a2024c3bbfdad84d538ce4c0bb510dd8 Mon Sep 17 00:00:00 2001 From: Jose Manuel Ferrer Mosteiro Date: Wed, 22 Jan 2020 16:37:29 +0100 Subject: [PATCH 2/3] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 72a0a7b..7dd252c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,9 @@ FROM golang as builder RUN go get -d github.com/optiopay/klar RUN go build ./src/github.com/optiopay/klar -FROM alpine:3.8 +FROM debian -RUN apk add --no-cache ca-certificates +#RUN apk add --no-cache ca-certificates COPY --from=builder /go/klar /klar ENTRYPOINT ["/klar"] From a6dbd1065664fef72feeda1592e170fc055c053c Mon Sep 17 00:00:00 2001 From: Jose Manuel Ferrer Mosteiro Date: Wed, 22 Jan 2020 17:33:22 +0100 Subject: [PATCH 3/3] Update Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 7dd252c..7f91d6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ RUN go build ./src/github.com/optiopay/klar FROM debian #RUN apk add --no-cache ca-certificates +RUN apt-get update;apt-get -y install ca-certificates;apt-get clean COPY --from=builder /go/klar /klar ENTRYPOINT ["/klar"]