-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.snapshots
81 lines (62 loc) · 2.26 KB
/
Dockerfile.snapshots
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
ARG BUILDER_IMAGE="golang:1.22-bookworm" \
TARGET_BASE_IMAGE="alpine:3.20.1" \
GOOS=$TARGETOS \
GOARCH=$TARGETARCH \
PWD=${PWD} \
EXPOSED_PORTS="8545 \
8551 \
8546 \
30303 \
30303/udp \
42069 \
42069/udp \
8080 \
9090 \
6060"
FROM ${BUILDER_IMAGE} AS builder
COPY /build-amd64 /build-amd64/
COPY /build-arm64 /build-arm64/
RUN echo "content of build-amd64:" && ls -l /build-amd64 && \
echo && \
echo "content of build-arm64:" && ls -l /build-arm64
FROM ${BUILDER_IMAGE} AS builder_old
ARG TARGETOS TARGETARCH
ENV GOOS=$TARGETOS \
GOARCH=$TARGETARCH
COPY . /home/erigon
WORKDIR /home/erigon
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
if [ "x${GOARCH}" == "xamd64" ]; then \
export LOCAL_AMDFLAG="GOAMD64=v2"; \
export BUILD_TAGS=nosqlite,noboltdb; \
fi && \
echo "List of env variables:" && \
set && \
make ${LOCAL_AMDFLAG} BUILD_TAGS=${BUILD_TAGS:-nosqlite,noboltdb,nosilkworm} erigon integration rpcdaemon && \
find / -name libsilkworm_capi.so
FROM ${TARGET_BASE_IMAGE} AS ci-cd-main-branch
ARG USER=erigon \
GROUP=erigon \
GOARCH
STOPSIGNAL 2
SHELL ["/bin/bash", "-c"]
RUN --mount=type=bind,from=builder,source=/build-${GOARCH},target=/tmp/erigon \
adduser --group ${GROUP} && \
adduser --system --ingroup ${GROUP} --home /home/${USER} --shell /bin/bash ${USER} && \
apt update -y && \
apt install -y --no-install-recommends ca-certificates && \
apt clean && \
rm -rf /var/lib/apt/lists/* && \
if [ "x${GOARCH}" == "xamd64" ]; then \
echo "Installing libsilkworm_capi.so library to /lib/x86_64-linux-gnu/ in case amd64 architecture:"; \
find /tmp/erigon -name libsilkworm_capi.so -type f | xargs -I % install -m a=r -v % /lib/x86_64-linux-gnu/; \
echo "Done." ; \
fi && \
install -d -o ${USER} -g ${GROUP} /home/${USER}/.local /home/${USER}/.local/share /home/${USER}/.local/share/erigon && \
install -v -o ${USER} -g ${GROUP} /tmp/erigon/erigon /tmp/erigon/integration /tmp/erigon/rpcdaemon /usr/local/bin/
VOLUME [ "/home/${USER}" ]
WORKDIR /home/${USER}
USER ${USER}
EXPOSE ${EXPOSED_PORTS}
ENTRYPOINT [ "/usr/local/bin/erigon" ]