From bdc9a4cc0943c0e03f0b6e3c8a3ba86cdf27906d Mon Sep 17 00:00:00 2001 From: Mithilesh Pawar Date: Mon, 11 Apr 2022 10:43:10 -0400 Subject: [PATCH 1/3] Removing the unused docker file. --- goreleaser/Dockerfile | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 goreleaser/Dockerfile diff --git a/goreleaser/Dockerfile b/goreleaser/Dockerfile deleted file mode 100644 index 173a10469..000000000 --- a/goreleaser/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -FROM golang:1.16.6-alpine3.14 as build-env - -ARG GIT_TOKEN - -ENV GOPRIVATE="" - -# Copy the source from the current directory to the Working Directory inside the container -WORKDIR /app - -RUN apk add --no-cache git \ - && git config \ - --global \ - url."https://api:${GIT_TOKEN}@github.com".insteadOf \ - "https://github.com" - -#Copy go mod and sum files -COPY ../go.mod . -COPY ../go.sum . - -# Get dependancies - will also be cached if we won't change mod/sum -RUN go mod download - -# COPY the source code as the last step -COPY .. . - -# RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o bin/cx cmd/main.go -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPRIVATE="" go build -a -installsuffix cgo -o bin/cx cmd/main.go - -#runtime image -FROM golang:1.16.6-alpine3.14 - -COPY --from=build-env /app/bin/cx /app/bin/cx - -ENTRYPOINT ["/app/bin/cx"] From 726a608a018781d7c5ee37142c11559b883ed506 Mon Sep 17 00:00:00 2001 From: Mithilesh Pawar Date: Mon, 11 Apr 2022 23:24:21 -0400 Subject: [PATCH 2/3] Added User to dockerfile. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0cdc8e13b..16227c7a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM golang:1.17.8 -COPY cx /app/bin/cx +RUN useradd -r -m cxuser +USER cxuser +COPY /bin/cx /app/bin/cx ENTRYPOINT ["/app/bin/cx"] From a444209df8208a5bb2431b9433634307e8141c75 Mon Sep 17 00:00:00 2001 From: Mithilesh Pawar Date: Tue, 12 Apr 2022 01:37:01 -0400 Subject: [PATCH 3/3] Corrected the COPY command in Dockerfile. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 16227c7a6..2443bff8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,6 @@ FROM golang:1.17.8 RUN useradd -r -m cxuser USER cxuser -COPY /bin/cx /app/bin/cx +COPY cx /app/bin/cx ENTRYPOINT ["/app/bin/cx"]