-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 877 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM golang:alpine AS builder
WORKDIR /app
RUN apk add --no-cache git bash
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG BUILT_AT
ARG GIT_COMMIT
ARG VERSION
RUN builtAt=${BUILT_AT:-$(date +'%F %T %z')} && \
gitCommit=${GIT_COMMIT:-$(git log --pretty=format:"%h" -1)} && \
version=${VERSION:-$(git describe --abbrev=0 --tags)} && \
ldflags="\
-w -s \
-X 'github.com/krau/ManyACG/internal/common/version.BuildTime=$builtAt' \
-X 'github.com/krau/ManyACG/internal/common/version.Commit=$gitCommit' \
-X 'github.com/krau/ManyACG/internal/common/version.Version=$version'\
" && \
CGO_ENABLED=0 go build -tags nodynamic -ldflags "$ldflags" -o manyacg
FROM alpine:latest
WORKDIR /opt/manyacg/
RUN apk add --no-cache bash ca-certificates ffmpeg && update-ca-certificates
COPY --from=builder /app/manyacg .
ENTRYPOINT ["./manyacg"]