-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.multiarch
45 lines (37 loc) · 1.24 KB
/
Dockerfile.multiarch
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
42
43
44
45
# This dockerfile should be run via docker buildx
# Target, build platforms arguments are automatically provided via buildx
FROM --platform=$BUILDPLATFORM golang:1.19.3 as build
ARG TARGETOS
ARG TARGETARCH
ARG buildCommit=unknown
ARG gittag=unknown
ARG buildTime=unknown
ARG builder=unknown
ARG gover=unknown
WORKDIR /geth-indexer
COPY ./assets assets
COPY ./cmd cmd
COPY ./go.mod .
COPY ./go.sum .
COPY ./libs libs
COPY ./main.go .
COPY ./scripts scripts
COPY ./services services
COPY ./types types
COPY ./version version
COPY ./algorand algorand
RUN env GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="\
-X 'github.com/supragya/EtherScope/version.buildCommit=$buildCommit' \
-X 'github.com/supragya/EtherScope/version.gittag=$gittag' \
-X 'github.com/supragya/EtherScope/version.buildTime=$buildtime' \
-X 'github.com/supragya/EtherScope/version.builder=$builder' \
-X 'github.com/supragya/EtherScope/version.gover=$gover'" \
-o build/escope
FROM --platform=$TARGETPLATFORM golang:1.19.3
WORKDIR /geth-indexer
COPY --from=build /geth-indexer/build/escope /geth-indexer/escope
COPY --from=build /geth-indexer/libs libs
ENTRYPOINT \
mkdir -p /.supragya/escope && \
printf "%s" "$CONFIG" > ./config.yaml && \
./escope realtime -c ./config.yaml