From a4ff2dcdaecc15301f39a70c3e7a3447caf5be9e Mon Sep 17 00:00:00 2001 From: Julian Bensch Date: Thu, 12 Jan 2023 16:09:39 +0100 Subject: [PATCH] Updated dockerfile and makefile --- dockerfile | 5 +++-- makefile | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dockerfile b/dockerfile index d6b921b..4734648 100644 --- a/dockerfile +++ b/dockerfile @@ -6,7 +6,7 @@ ENV GO111MODULE=on \ CGO_ENABLED=0 WORKDIR /build # Add the required build libraries -RUN go install golang.org/x/tools/cmd/goimports@latest + # Copy and download dependency using go mod ADD ./src/go.* /build/ RUN go mod download @@ -17,9 +17,10 @@ WORKDIR /build RUN ls -al RUN go build -a -tags musl -o /build/app ###################################### -FROM alpine:3 +FROM golang:alpine LABEL AUTHOR="AUTHOR" #RUN apk --no-cache add curl USER nobody COPY --from=builder --chown=nobody /build/app /custom/app +RUN go install golang.org/x/tools/cmd/goimports@latest ENTRYPOINT [ "/custom/app" ] \ No newline at end of file diff --git a/makefile b/makefile index ff45cea..d6caa60 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ example: go run main.go ./examples/in/ ./examples/out/ example_container: - docker run --rm -v "${PWD}/examples:/examples" gitea.linuxcode.net/linuxcode/oapi-type-definitions-extractor:latest /examples/in /examples/out + docker run --pull always --rm -v "${PWD}/examples:/examples" gitea.linuxcode.net/linuxcode/oapi-type-definitions-extractor:latest /examples/in /examples/out lint: docker run --rm -v "${PWD}/src:/src" golangci/golangci-lint:v1.50 /bin/sh -c "cd /src && golangci-lint run" \ No newline at end of file