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

Commit

Permalink
Merge pull request #1502 from snoby/master
Browse files Browse the repository at this point in the history
Fully featured small Dockerfile
  • Loading branch information
Oliver Weichhold authored Nov 9, 2022
2 parents 2311784 + a5c7f4b commit b1c46a3
Showing 1 changed file with 12 additions and 40 deletions.
52 changes: 12 additions & 40 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,16 @@
FROM ubuntu:jammy-20220815 as build
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
sudo \
wget \
apt-transport-https \
dotnet-sdk-6.0 \
git \
cmake \
build-essential \
libssl-dev \
pkg-config \
libboost-all-dev \
libsodium-dev \
libzmq3-dev \
libzmq5


FROM mcr.microsoft.com/dotnet/sdk:6.0-jammy as BUILDER
WORKDIR /app
RUN mkdir /app/build
RUN apt-get update && \
apt-get -y install cmake build-essential libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5 libzmq3-dev golang-go
COPY . .

WORKDIR /app/src/Miningcore
ENV BUILDIR=/app/build/
RUN dotnet publish -c Release --framework net6.0 -o /app/build/
RUN mkdir /usr/local/miningcore
RUN cp -rf /app/build/* /usr/local/miningcore/

#
# Copy build artifacts into a new image
#
FROM ubuntu:jammy-20220815
RUN mkdir /usr/local/miningcore
WORKDIR /usr/local/miningcore/
COPY --from=build /usr/local/miningcore/ /usr/local/miningcore/
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
apt-transport-https curl dotnet6 libssl-dev pkg-config libboost-all-dev libsodium-dev libzmq5 libzmq3-dev

EXPOSE 4000-4090

ENTRYPOINT ["dotnet","/usr/local/miningcore/Miningcore.dll", "-c","/app/config.json"]

RUN dotnet publish -c Release --framework net6.0 -o ../../build

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

0 comments on commit b1c46a3

Please sign in to comment.