mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 10:54:02 +03:00
Update dockerfile
This commit is contained in:
+9
-6
@@ -1,24 +1,27 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# BUILD STAGE
|
# BUILD STAGE
|
||||||
|
|
||||||
FROM alpine:3 AS build
|
FROM golang:1.26-alpine AS build
|
||||||
|
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
ENV GOOS=linux
|
|
||||||
|
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& apk --no-cache --update add \
|
&& apk --no-cache --update add \
|
||||||
bash \
|
bash \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
git \
|
git
|
||||||
mise
|
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& mise trust \
|
&& version="$(git describe --exact-match HEAD 2>/dev/null || git describe --tags --always)" \
|
||||||
&& mise tasks run static
|
&& go build \
|
||||||
|
-trimpath \
|
||||||
|
-mod=readonly \
|
||||||
|
-ldflags="-extldflags '-static' -s -w -X 'main.version=$version'" \
|
||||||
|
-a \
|
||||||
|
-tags netgo
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user