oapi-type-definitions-extra.../dockerfile

25 lines
684 B
Plaintext

FROM golang:alpine AS builder
# Set necessary environmet variables needed for our image
ENV GO111MODULE=on \
GOOS=linux \
GOARCH=amd64 \
CGO_ENABLED=0
WORKDIR /build
# Add the required build libraries
# Copy and download dependency using go mod
ADD ./src/go.* /build/
RUN go mod download
# Copy sources to build container
ADD ./src /build/
# Build the application
WORKDIR /build
RUN ls -al
RUN go build -a -tags musl -o /build/app
######################################
FROM golang:alpine
LABEL AUTHOR="Linuxcode"
#RUN apk --no-cache add curl
COPY --from=builder /build/app /custom/app
RUN go install golang.org/x/tools/cmd/goimports@latest
ENTRYPOINT [ "/custom/app" ]