Last active
June 24, 2020 22:02
-
-
Save fredrikhr/6cae577fcedba6311402c7e4ccefc021 to your computer and use it in GitHub Desktop.
GoogleOrToolsDotnetCore
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
# docker build -t fredrikhr/googleortools-tsp-sample-dotnetcore -f GoogleOrToolsDotnetCore.dockerfile https://gist.github.com/6cae577fcedba6311402c7e4ccefc021.git | |
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic AS build | |
WORKDIR /app/GoogleOrToolsDotnetCore | |
# Install curl | |
RUN set -x \ | |
# APT Update & Upgrade | |
&& apt-get update \ | |
&& apt-get upgrade --yes 2>&1 \ | |
&& apt-get install --yes --no-install-recommends \ | |
apt-transport-https \ | |
curl \ | |
# | |
# Clean up | |
&& apt-get autoremove -y \ | |
&& apt-get clean -y \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN dotnet new console | |
RUN dotnet add package Google.OrTools --version 7.7.7816 | |
RUN rm -v Program.cs \ | |
&& curl -LORJ "https://github.com/google/or-tools/raw/stable/ortools/constraint_solver/samples/Tsp.cs" 2>&1 | |
RUN dotnet build -c Release | |
RUN dotnet publish -c Release -r linux-x64 --no-self-contained | |
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-bionic | |
COPY --from=build /app/GoogleOrToolsDotnetCore/bin/Release/netcoreapp3.1/linux-x64/publish/ /app/GoogleOrToolsDotnetCore | |
CMD [ "/app/GoogleOrToolsDotnetCore/GoogleOrToolsDotnetCore" ] | |
# docker run -it --rm fredrikhr/googleortools-tsp-sample-dotnetcore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment