Files
ortools-clone/cmake/docker/debian/dotnet.Dockerfile
2020-03-31 12:35:35 +02:00

42 lines
1.3 KiB
Docker

FROM ortools:debian_swig AS env
# see: https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-debian10
RUN apt-get update -qq \
&& apt-get install -yq wget gpg apt-transport-https \
&& wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg \
&& mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ \
&& wget -q https://packages.microsoft.com/config/debian/10/prod.list \
&& mv prod.list /etc/apt/sources.list.d/microsoft-prod.list \
&& apt-get update -qq \
&& apt-get install -yq dotnet-sdk-3.1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Trigger first run experience by running arbitrary cmd
RUN dotnet --info
FROM env AS devel
WORKDIR /home/lib
COPY . .
FROM devel AS build
RUN cmake -S. -Bbuild -DBUILD_DEPS=ON -DBUILD_DOTNET=ON
RUN cmake --build build --target all
RUN cmake --build build --target install
FROM build AS test
RUN cmake --build build --target test
FROM env AS install_env
COPY --from=build /usr/local /usr/local/
FROM install_env AS install_devel
WORKDIR /home/sample
COPY ci/sample .
FROM install_devel AS install_build
RUN cmake -S. -Bbuild -DBUILD_DOTNET=ON
RUN cmake --build build --target all -v
RUN cmake --build build --target install
FROM install_build AS install_test
RUN cmake --build build --target test