Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit b1c46a3

Browse files
author
Oliver Weichhold
authored
Merge pull request #1502 from snoby/master
Fully featured small Dockerfile
2 parents 2311784 + a5c7f4b commit b1c46a3

File tree

1 file changed

+12
-40
lines changed

1 file changed

+12
-40
lines changed

Dockerfile

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,16 @@
1-
FROM ubuntu:jammy-20220815 as build
2-
RUN apt-get update
3-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
4-
sudo \
5-
wget \
6-
apt-transport-https \
7-
dotnet-sdk-6.0 \
8-
git \
9-
cmake \
10-
build-essential \
11-
libssl-dev \
12-
pkg-config \
13-
libboost-all-dev \
14-
libsodium-dev \
15-
libzmq3-dev \
16-
libzmq5
17-
18-
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0-jammy as BUILDER
192
WORKDIR /app
20-
RUN mkdir /app/build
3+
RUN apt-get update && \
4+
apt-get -y install cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5 libzmq3-dev golang-go
215
COPY . .
22-
236
WORKDIR /app/src/Miningcore
24-
ENV BUILDIR=/app/build/
25-
RUN dotnet publish -c Release --framework net6.0 -o /app/build/
26-
RUN mkdir /usr/local/miningcore
27-
RUN cp -rf /app/build/* /usr/local/miningcore/
28-
29-
#
30-
# Copy build artifacts into a new image
31-
#
32-
FROM ubuntu:jammy-20220815
33-
RUN mkdir /usr/local/miningcore
34-
WORKDIR /usr/local/miningcore/
35-
COPY --from=build /usr/local/miningcore/ /usr/local/miningcore/
36-
RUN apt update
37-
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
38-
apt-transport-https curl dotnet6 libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5 libzmq3-dev
39-
40-
EXPOSE 4000-4090
41-
42-
ENTRYPOINT ["dotnet","/usr/local/miningcore/Miningcore.dll", "-c","/app/config.json"]
43-
7+
RUN dotnet publish -c Release --framework net6.0 -o ../../build
448

9+
FROM mcr.microsoft.com/dotnet/aspnet:6.0-jammy
10+
WORKDIR /app
11+
RUN apt-get update && \
12+
apt-get install -y libzmq5 libzmq3-dev libsodium-dev curl && \
13+
apt-get clean
14+
EXPOSE 4000-4090
15+
COPY --from=BUILDER /app/build ./
16+
CMD ["./Miningcore", "-c", "config.json" ]

0 commit comments

Comments
 (0)