Skip to content

Commit ea6e84a

Browse files
musl support
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
1 parent 672eb3c commit ea6e84a

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

Dockerfile.linux-amd64-musl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ARG GO_VERSION
2+
FROM gotify/build:$GO_VERSION-linux-amd64
3+
ARG VCS_REF
4+
RUN \
5+
apt-get update && \
6+
apt-get install -y musl-tools
7+
8+
ENV CGO_ENABLED=1
9+
ENV GOOS=linux
10+
ENV GOARCH=amd64
11+
ENV GO_EXTRA_LDFLAGS="-linkmode external -extldflags '-static'"
12+
ENV CC=musl-gcc
13+
14+
LABEL org.opencontainers.image.source="https://github.com/gotify/build" \
15+
org.opencontainers.image.revision=$VCS_REF

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PROJECT=gotify/build
1+
PROJECT=docker.io/gotify/build
22
GO_VERSION?=$(shell cat GO_VERSION)
33
VCS_REF=$(shell git describe --tags --always)
44

@@ -20,6 +20,12 @@ build-linux-amd64:
2020
push-linux-amd64:
2121
docker push ${PROJECT}:${GO_VERSION}-linux-amd64
2222

23+
build-linux-amd64-musl:
24+
docker build --build-arg VCS_REF=${VCS_REF} --build-arg GO_VERSION=${GO_VERSION} -t ${PROJECT}:${GO_VERSION}-linux-amd64-musl -f Dockerfile.linux-amd64-musl .
25+
26+
push-linux-amd64-musl:
27+
docker push ${PROJECT}:${GO_VERSION}-linux-amd64-musl
28+
2329
build-linux-386:
2430
docker build --build-arg VCS_REF=${VCS_REF} --build-arg GO_VERSION=${GO_VERSION} -t ${PROJECT}:${GO_VERSION}-linux-386 -f Dockerfile.linux-386 .
2531

0 commit comments

Comments
 (0)