Skip to content

Commit 175e386

Browse files
committed
Specify CGO flags directly for cross compilation on alpine
1 parent 66c256b commit 175e386

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

benchmarker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
FROM golang:1.22-alpine AS builder
22
RUN apk add --no-cache hdf5-dev gcc libc-dev python3 bash g++ musl-dev
3+
ENV CGO_CFLAGS="-I/usr/include"
4+
ENV CGO_LDFLAGS="-L/usr/lib -lhdf5 -lhdf5_hl"
35
WORKDIR /app
46
COPY . .
57
RUN CGO_ENABLED=1 go build -o benchmarker .
68

7-
FROM alpine:latest
9+
FROM golang:1.22-alpine
810
RUN apk add --no-cache hdf5-dev python3 bash
911
WORKDIR /app
1012
COPY --from=builder /app/benchmarker /app/benchmarker

0 commit comments

Comments
 (0)