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

25 lines
662 B
Plaintext
Raw Normal View History

2023-01-12 13:49:16 +00:00
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
# Nothing here!
# 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 alpine:3
LABEL AUTHOR="AUTHOR"
#RUN apk --no-cache add curl
USER nobody
COPY --from=builder --chown=nobody /build/app /custom/app
ENTRYPOINT [ "/custom/app" ]