-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (30 loc) · 820 Bytes
/
Dockerfile
File metadata and controls
41 lines (30 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM golang:1.25-alpine AS build
WORKDIR /go/src/ftso-data-sources
RUN apk add --no-cache \
build-base \
pkgconf \
git \
ca-certificates \
tzdata \
zeromq \
zeromq-dev \
czmq-static \
libzmq-static \
libsodium-static
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ENV CGO_ENABLED=1 \
GOOS=linux \
GOARCH=amd64
RUN go build \
-tags musl \
-ldflags="-w -s -linkmode external -extldflags '-static -lstdc++ -lm -lsodium'" \
-o ftso-data-sources .
# --- Release Stage ---
FROM scratch AS release
WORKDIR /app
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /go/src/ftso-data-sources/ftso-data-sources /ftso-data-sources
ENTRYPOINT ["/ftso-data-sources"]