Skip to content

Commit b426eb2

Browse files
committed
fix: fix build
1 parent 13f2100 commit b426eb2

2 files changed

Lines changed: 29 additions & 21 deletions

File tree

Dockerfile

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ FROM alpine:latest AS mydumper-builder
44
ARG MYDUMPER_VERSION="0.21.1-1"
55
RUN apk add --no-cache \
66
curl \
7+
ca-certificates \
78
cmake \
89
make \
910
g++ \
1011
glib-dev \
1112
pcre-dev \
1213
zlib-dev \
13-
mariadb-dev
14+
mariadb-dev && \
15+
update-ca-certificates
1416
RUN cd /tmp && \
1517
curl -fLO "https://github.com/mydumper/mydumper/archive/refs/tags/v${MYDUMPER_VERSION}.tar.gz" && \
1618
tar xzf "v${MYDUMPER_VERSION}.tar.gz" && \
1719
cd "mydumper-${MYDUMPER_VERSION}" && \
18-
cmake . && \
20+
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 . && \
1921
make && \
2022
make install
2123

@@ -36,16 +38,17 @@ RUN cd /tmp && \
3638

3739
# Stage 3: Download sqlpackage
3840
FROM alpine:latest AS sqlpackage-downloader
39-
RUN apk add --no-cache wget unzip
41+
RUN apk add --no-cache wget unzip ca-certificates && update-ca-certificates
4042
WORKDIR /tmp
41-
RUN wget https://aka.ms/sqlpackage-linux && \
43+
RUN wget --tries=10 --retry-connrefused --waitretry=2 https://aka.ms/sqlpackage-linux && \
4244
unzip sqlpackage-linux -d /opt/sqlpackage && \
4345
chmod +x /opt/sqlpackage/sqlpackage
4446

4547
# Stage 4: Download influx CLI
4648
FROM alpine:latest AS influx-downloader
4749
ARG INFLUX_CLI_VERSION=2.7.5
48-
RUN apk add --no-cache curl
50+
RUN apk add --no-cache curl ca-certificates && update-ca-certificates
51+
WORKDIR /tmp
4952
RUN case "$(uname -m)" in \
5053
x86_64) arch=amd64 ;; \
5154
aarch64) arch=arm64 ;; \
@@ -54,13 +57,17 @@ RUN case "$(uname -m)" in \
5457
curl -fLO "https://dl.influxdata.com/influxdb/releases/influxdb2-client-${INFLUX_CLI_VERSION}-linux-${arch}.tar.gz" && \
5558
tar xzf "influxdb2-client-${INFLUX_CLI_VERSION}-linux-${arch}.tar.gz" && \
5659
mkdir -p /influx-bin && \
57-
cp influx /influx-bin/influx
60+
if [ -f influx ]; then \
61+
cp influx /influx-bin/influx; \
62+
else \
63+
cp influxdb2-client-*/influx /influx-bin/influx; \
64+
fi
5865

5966
# Stage 5: Download etcdctl
6067
FROM alpine:latest AS etcd-downloader
6168
# https://github.com/etcd-io/etcd/tags
6269
ARG ETCD_VER="v3.6.6"
63-
RUN apk add --no-cache curl
70+
RUN apk add --no-cache curl ca-certificates && update-ca-certificates
6471
RUN case "$(uname -m)" in \
6572
x86_64) arch=amd64 ;; \
6673
aarch64) arch=arm64 ;; \
@@ -75,7 +82,7 @@ RUN case "$(uname -m)" in \
7582
FROM alpine:latest AS foundationdb-downloader
7683
# https://github.com/apple/foundationdb/releases
7784
ARG FDB_VERSION="7.3.69"
78-
RUN apk add --no-cache curl
85+
RUN apk add --no-cache curl ca-certificates && update-ca-certificates
7986
RUN mkdir -p /fdb-bin && \
8087
case "$(uname -m)" in \
8188
x86_64) \
@@ -100,25 +107,27 @@ RUN mkdir -p /fdb-bin && \
100107
esac
101108

102109
# Stage 6: Build web assets
103-
FROM node:24-alpine AS web-builder
110+
FROM node:20-alpine AS web-builder
104111
WORKDIR /build/web
105-
# Install git (required by some yarn dependencies)
106-
RUN apk add --no-cache git
112+
# Install git and certificates
113+
RUN apk add --no-cache git ca-certificates && update-ca-certificates
114+
# Enable pnpm via corepack
115+
RUN corepack enable && corepack prepare pnpm@latest --activate
107116
# Copy web package files
108-
COPY web/package.json web/yarn.lock* ./
117+
COPY web/package.json web/pnpm-lock.yaml* ./
109118
# Install dependencies
110-
RUN yarn install --frozen-lockfile
119+
RUN pnpm install --frozen-lockfile
111120
# Copy web source
112121
COPY web/ ./
113122
# Build web assets
114-
RUN yarn build
123+
RUN pnpm build
115124

116125
# Stage 7: Build gobackup
117-
FROM golang:1.25-alpine AS gobackup-builder
126+
FROM golang:1.24-alpine AS gobackup-builder
118127
ARG VERSION=dev
119128
WORKDIR /build
120-
# Install build dependencies
121-
RUN apk add --no-cache git
129+
# Install build dependencies and certificates
130+
RUN apk add --no-cache git ca-certificates && update-ca-certificates
122131
# Copy go mod files first for better caching
123132
COPY go.mod go.sum ./
124133
RUN go mod download
@@ -128,7 +137,7 @@ COPY . .
128137
COPY --from=web-builder /build/web/dist ./web/dist
129138
# Build with optimizations for minimal binary size
130139
RUN CGO_ENABLED=0 GOOS=linux go build \
131-
-ldflags="-s -w -X main.Version=${VERSION}" \
140+
-ldflags="-s -w -X 'main.version=${VERSION}'" \
132141
-trimpath \
133142
-o gobackup \
134143
.
@@ -157,7 +166,6 @@ RUN apk add --no-cache \
157166
coreutils \
158167
# there is no pbzip2 yet
159168
lzip \
160-
xz-dev \
161169
lzop \
162170
xz \
163171
# pixz is in edge atm

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ test:
33
test\:all:
44
@sh tests/test.sh
55
build_web:
6-
cd web; yarn && yarn build
6+
cd web; pnpm install && pnpm build
77
perform:
88
@go run main.go -- perform -m demo -c ./gobackup_test.yml
99
run:
@@ -13,4 +13,4 @@ start:
1313
build: build_web
1414
go build -o dist/gobackup
1515
dev:
16-
cd web && yarn dev
16+
cd web && pnpm dev

0 commit comments

Comments
 (0)