From 7d1ea9f64f8cb8270b02e21f36af1daafeee9940 Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Mon, 26 Feb 2024 10:13:47 -0800 Subject: [PATCH] docker: fix docker build error --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14294c5..ac7f0db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ -FROM docker.io/library/golang:1.20 AS builder +FROM docker.io/library/golang:1.21 AS builder WORKDIR /walletd COPY . . -# build -RUN go build -o bin/ -tags='netgo timetzdata' -trimpath -a -ldflags '-s -w' ./cmd/walletd + +# Enable CGO for sqlite3 support +ENV CGO_ENABLED=1 + +RUN go build -o bin/ -tags='netgo timetzdata' -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/walletd FROM docker.io/library/alpine:3 LABEL maintainer="The Sia Foundation " \