This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
forked from NethermindEth/nethermind
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile_alpine_arm64
47 lines (37 loc) · 2.12 KB
/
Dockerfile_alpine_arm64
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
##################################################
FROM alpine:3.10 AS secp256k1
WORKDIR /source
RUN apk upgrade && apk add git build-base autoconf automake libtool
RUN git clone https://github.com/bitcoin-core/secp256k1 .
RUN ./autogen.sh
RUN ./configure --enable-module-recovery --enable-experimental --enable-module-ecdh --enable-shared --with-bignum=no
RUN make
RUN strip .libs/libsecp256k1.so
##################################################
FROM alpine:3.10 AS rocksdb
WORKDIR /source
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories
RUN apk upgrade && apk add git build-base linux-headers bash perl snappy-dev@testing
RUN git clone --branch v6.1.2 https://github.com/facebook/rocksdb .
RUN PORTABLE=1 make shared_lib
RUN strip librocksdb.so
##################################################
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic-arm64v8 AS build
WORKDIR /source
COPY . .
RUN apt-get update && apt-get install -y libsnappy-dev libc6-dev libc6 libzstd1 libgflags-dev libssl1.0.0
RUN git submodule update --init src/Dirichlet src/rocksdb-sharp
RUN dotnet publish /source/src/Nethermind/Nethermind.Runner --configuration Release --runtime linux-musl-arm64 --output /artifacts
RUN git describe --tags --long > /artifacts/git-hash
##################################################
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine3.10-arm64v8 AS image
COPY scripts/entrypoint.sh /entrypoint.sh
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
apk upgrade && apk add coreutils gosu@testing snappy-dev@testing && rm -rf /var/cache/apk/* && \
addgroup -g 1337 nethermind && adduser nethermind -u 1337 -D -G nethermind && \
chmod +x /entrypoint.sh && \
mkdir /data
COPY --from=build --chown=nethermind:nethermind /artifacts /nethermind
COPY --from=secp256k1 --chown=nethermind:nethermind /source/.libs/libsecp256k1.so /nethermind/runtimes/linux-x64/native/libsecp256k1.so
COPY --from=rocksdb --chown=nethermind:nethermind /source/librocksdb.so /nethermind/runtimes/linux-arm64/native/librocksdb.so
ENTRYPOINT ["/entrypoint.sh"]