From fa4d2fec785c347356ab57fb71df33bb1fb83758 Mon Sep 17 00:00:00 2001 From: cxplay <62034099+cxplay@users.noreply.github.com> Date: Fri, 11 Apr 2025 20:47:23 +0800 Subject: [PATCH] update Dockerfile to remove libsecp256k1 build stage and update build image. --- Dockerfile | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index aea9fa5..6123fcd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1.4 #### Tailwind CSS build stage -FROM node:20 AS tailwindbuilder +FROM node:23-slim AS tailwindbuilder # Set a temporary work directory WORKDIR /app/tailwind @@ -16,7 +16,7 @@ RUN npm install tailwindcss RUN npx tailwind -i base.css -o tailwind-bundle.min.css --minify #### Go build stage -FROM golang:1.23.3-alpine AS gobuilder +FROM golang:1.24.2-alpine AS gobuilder # Add package RUN apk add --no-cache autoconf automake libtool build-base musl-dev git @@ -33,18 +33,9 @@ COPY --from=tailwindbuilder /app/tailwind/tailwind-bundle.min.css ./static/tailw RUN go get github.com/a-h/templ/runtime && \ go run -mod=mod github.com/a-h/templ/cmd/templ generate -# Build secp256k1 -RUN git clone https://github.com/bitcoin-core/secp256k1.git && \ - cd secp256k1 && \ - ./autogen.sh && \ - ./configure --enable-module-extrakeys --enable-module-schnorrsig --prefix=$(pwd)/musl && \ - make install - # Build njump -RUN CGO_CFLAGS="-I$(pwd)/secp256k1/musl/include/" \ - CGO_LDFLAGS="-L$(pwd)/secp256k1/musl/lib" \ - GOOS=linux GOARCH=amd64 CC=$(which musl-gcc) \ - go build -tags libsecp256k1 \ +RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=$(which musl-gcc) \ + go build -tags='libsecp256k1' \ -ldflags="-s -w -linkmode external -extldflags '-static' -X main.compileTimeTs=$(date '+%s')" \ -o main .