Files
econet-exporter/Dockerfile
T
rmcguire c481d3f032
Build and Publish / check-chart (push) Successful in 14s
Build and Publish / helm-release (push) Has been skipped
Build and Publish / go-binaries (push) Successful in 2m35s
Build and Publish / container-images (push) Successful in 3m1s
add ca-certs to image
2026-07-04 17:42:03 -04:00

30 lines
635 B
Docker

FROM golang:1-alpine AS build
WORKDIR /app
ENV GO111MODULE=auto CGO_ENABLED=0 GOOS=linux
ARG GOPROXY
ARG GONOSUMDB=gitea.libretechconsulting.com
ARG VER_PKG=gitea.libretechconsulting.com/rmcguire/go-app/pkg/config.Version
ARG VERSION=(devel)
ARG APP_NAME=econet-exporter
COPY ./go.mod ./go.sum ./
RUN go mod download
COPY ./ /app
RUN go build -C . -v -ldflags "-extldflags '-static' -X ${VER_PKG}=${VERSION}" -o ${APP_NAME} .
FROM alpine:latest
ARG APP_NAME=econet-exporter
RUN apk add --no-cache ca-certificates
WORKDIR /app
USER 100:101
COPY --from=build --chown=100:101 /app/${APP_NAME} /app/app
ENTRYPOINT [ "/app/app" ]