Updated dockerfile and makefile

This commit is contained in:
Julian Bensch 2023-01-12 16:09:39 +01:00
parent 38a9fe0f36
commit a4ff2dcdae
2 changed files with 4 additions and 3 deletions

View File

@ -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" ]

View File

@ -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"