This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1502 from snoby/master
Fully featured small Dockerfile
- Loading branch information
Showing
1 changed file
with
12 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |