From cdfdbc863894a92975edf1ff916c3547570e16f5 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 14 Dec 2023 20:05:41 +0800 Subject: [PATCH] :art: Use golang:alpine to build image --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bf51ffbcc0f..7e0428881ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,13 @@ WORKDIR /go/src/github.com/siyuan-note/siyuan/ ADD . /go/src/github.com/siyuan-note/siyuan/ RUN cd app && npm install -g pnpm && pnpm install && pnpm run build -FROM golang:latest as GO_BUILD +FROM golang:alpine as GO_BUILD WORKDIR /go/src/github.com/siyuan-note/siyuan/ COPY --from=NODE_BUILD /go/src/github.com/siyuan-note/siyuan/ /go/src/github.com/siyuan-note/siyuan/ ENV GO111MODULE=on ENV CGO_ENABLED=1 -RUN cd kernel && go build --tags fts5 -v -ldflags "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod" && \ +RUN apk add --no-cache gcc musl-dev && \ + cd kernel && go build --tags fts5 -v -ldflags "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod" && \ mkdir /opt/siyuan/ && \ mv /go/src/github.com/siyuan-note/siyuan/app/appearance/ /opt/siyuan/ && \ mv /go/src/github.com/siyuan-note/siyuan/app/stage/ /opt/siyuan/ && \