mirror of
https://github.com/wneessen/logranger.git
synced 2024-11-23 05:10:50 +01:00
487a0f36d7
Bumps golang from `ff45d87` to `1a47868`. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
34 lines
No EOL
1.1 KiB
Docker
34 lines
No EOL
1.1 KiB
Docker
# SPDX-FileCopyrightText: 2023 Winni Neessen <wn@neessen.dev>
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
## Build first
|
|
FROM golang:alpine@sha256:1a478681b671001b7f029f94b5016aed984a23ad99c707f6a0ab6563860ae2f3 AS builder
|
|
RUN mkdir /builddithur
|
|
ADD cmd/ /builddir/cmd/
|
|
ADD template/ /builddir/template
|
|
ADD *.go /builddir/
|
|
ADD plugins/ /builddir/plugins
|
|
ADD go.mod /builddir/
|
|
ADD go.sum /builddir/
|
|
WORKDIR /builddir
|
|
RUN go mod tidy
|
|
RUN go mod download
|
|
RUN go mod verify
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags \
|
|
'-w -s -extldflags "-static"' \
|
|
-o /builddir/logranger github.com/wneessen/logranger/cmd/server
|
|
|
|
## Create scratch image
|
|
FROM scratch
|
|
LABEL maintainer="wn@neessen.dev"
|
|
COPY ["support-files/passwd", "/etc/passwd"]
|
|
COPY ["support-files/group", "/etc/group"]
|
|
COPY --chown=logranger ["README.md", "/logranger/README.md"]
|
|
COPY --chown=logranger ["etc/logranger.toml", "/etc/logranger/"]
|
|
COPY --from=builder ["/builddir/logranger", "/logranger/logranger"]
|
|
WORKDIR /logranger
|
|
USER logranger
|
|
VOLUME ["/etc/logranger"]
|
|
EXPOSE 9099
|
|
ENTRYPOINT ["/logranger/logranger"] |