This repository was 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
Expand file tree
/
Copy pathDockerfile_alpine
More file actions
37 lines (29 loc) · 1.66 KB
/
Dockerfile_alpine
File metadata and controls
37 lines (29 loc) · 1.66 KB
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
##################################################
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.4.6 https://github.com/facebook/rocksdb .
RUN PORTABLE=1 make shared_lib
RUN strip librocksdb.so
##################################################
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build
WORKDIR /source
COPY . .
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories
RUN echo "@v3.8 http://dl-cdn.alpinelinux.org/alpine/v3.8/main/" >> /etc/apk/repositories
RUN apk upgrade && apk add git openssl-dev@testing libssl1.0@v3.8
RUN git submodule update --init src/Dirichlet src/rocksdb-sharp
RUN dotnet publish /source/src/Nethermind/Nethermind.Runner --configuration Release --output /artifacts
RUN git describe --tags --long > /artifacts/git-hash
##################################################
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
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=rocksdb --chown=nethermind:nethermind /source/librocksdb.so /nethermind/librocksdb.so
ENTRYPOINT ["/entrypoint.sh"]