-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
ARG GOLANG_VERSION | ||
ARG TARGETARCH | ||
|
||
# FROM golang:$GOLANG_VERSION as builder | ||
FROM ghcr.io/dopos/golang-alpine:v1.16.10-alpine3.14.2 as builder | ||
ARG TARGETARCH | ||
|
||
WORKDIR /opt/app | ||
|
||
# Cached layer | ||
COPY ./go.mod ./go.sum ./ | ||
|
||
RUN echo "Build for arch $TARGETARCH" | ||
|
||
# Sources dependent layer | ||
COPY ./ ./ | ||
RUN CGO_ENABLED=0 go test -tags test -covermode=atomic -coverprofile=coverage.out ./... | ||
RUN CGO_ENABLED=0 go build -ldflags "-X main.version=`git describe --tags --always`" -a ./cmd/webtail | ||
|
||
FROM scratch | ||
ARG TARGETARCH | ||
|
||
MAINTAINER Alexey Kovrizhkin <[email protected]> | ||
LABEL org.opencontainers.image.description "Tail [log]files via web[sockets]" | ||
|
||
RUN echo "Build for arch $TARGETARCH" | ||
|
||
VOLUME /data | ||
WORKDIR / | ||
COPY --from=builder /opt/app/webtail . | ||
|