From 9fb17ce87069fa5f40a498942a782dc1497f6c96 Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Mon, 4 Nov 2019 12:33:16 -0500 Subject: [PATCH 1/5] update docker to netcore3 --- Dockerfile | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 18e021c..4851497 100644 --- a/Dockerfile +++ b/Dockerfile @@ -108,21 +108,48 @@ set mouse= \n\ imap jj \n\ ' >> /etc/vim/vimrc -#taken from https://hub.docker.com/r/microsoft/dotnet/~/dockerfile/ -# region .net core + +# region NETCORE3 +# taken from https://hub.docker.com/_/microsoft-dotnet-core-sdk +# taken from https://github.com/dotnet/dotnet-docker/blob/master/3.0/sdk/bionic/amd64/Dockerfile # Install .NET Core SDK -ENV DOTNET_SDK_VERSION 2.1.500 -ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz -ENV DOTNET_SDK_DOWNLOAD_SHA 85055728e2433dfde41d15c85475f2dc6cfdd30242b4b23065b63cb12cc846acb93c09c000b02b722890ceac8ac382b40871c78660716ca2339c71052fe52f4e -ENV NUGET_XMLDOC_MODE skip -RUN curl -SL $DOTNET_SDK_DOWNLOAD_URL --output dotnet.tar.gz \ - && echo "$DOTNET_SDK_DOWNLOAD_SHA dotnet.tar.gz" | sha512sum -c - \ +ENV DOTNET_SDK_VERSION 3.0.100 + +RUN curl -SL --output dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \ + && dotnet_sha512='766da31f9a0bcfbf0f12c91ea68354eb509ac2111879d55b656f19299c6ea1c005d31460dac7c2a4ef82b3edfea30232c82ba301fb52c0ff268d3e3a1b73d8f7' \ + && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ && mkdir -p /usr/share/dotnet \ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ && rm dotnet.tar.gz \ && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet +# Enable detection of running in a container +ENV DOTNET_RUNNING_IN_CONTAINER=true \ + # Enable correct mode for dotnet watch (only mode supported in a container) + DOTNET_USE_POLLING_FILE_WATCHER=true \ + # Skip extraction of XML docs - generally not useful within an image/container - helps performance + NUGET_XMLDOC_MODE=skip + +# Trigger first run experience by running arbitrary cmd +RUN dotnet help + +# Install PowerShell global tool +ENV POWERSHELL_VERSION=7.0.0-preview.4 \ + POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-DotnetCoreSDK-Ubuntu-18.04 + +RUN curl -SL --output PowerShell.Linux.x64.$POWERSHELL_VERSION.nupkg https://pwshtool.blob.core.windows.net/tool/$POWERSHELL_VERSION/PowerShell.Linux.x64.$POWERSHELL_VERSION.nupkg \ + && powershell_sha512='0fb0167e13560371bffec38a4a87bf39377fa1a5cc39b3a078ddec8803212bede73e5821861036ba5c345bd55c74703134c9b55c49385f87dae9e2de9239f5d9' \ + && echo "$powershell_sha512 PowerShell.Linux.x64.$POWERSHELL_VERSION.nupkg" | sha512sum -c - \ + && mkdir -p /usr/share/powershell \ + && dotnet tool install --add-source / --tool-path /usr/share/powershell --version $POWERSHELL_VERSION PowerShell.Linux.x64 \ + && rm PowerShell.Linux.x64.$POWERSHELL_VERSION.nupkg \ + && ln -s /usr/share/powershell/pwsh /usr/bin/pwsh \ + # To reduce image size, remove the copy nupkg that nuget keeps. + && find /usr/share/powershell -print | grep -i '.*[.]nupkg$' | xargs rm + +# endregion NETCORE3 + run DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 dotnet tool install --tool-path /usr/local/bin paket run chmod +X /usr/local/bin/paket From bc306395b75c8f4a7a76bfecf593c659caeaad8f Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Wed, 6 Nov 2019 13:19:44 -0500 Subject: [PATCH 2/5] adding netcore2 back in per eric until he can clean some stuff up --- Dockerfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4851497..915bb70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -108,12 +108,23 @@ set mouse= \n\ imap jj \n\ ' >> /etc/vim/vimrc - -# region NETCORE3 +# region NETCORE # taken from https://hub.docker.com/_/microsoft-dotnet-core-sdk # taken from https://github.com/dotnet/dotnet-docker/blob/master/3.0/sdk/bionic/amd64/Dockerfile -# Install .NET Core SDK +# Install .NET Core 2 SDK +ENV DOTNET_SDK_VERSION 2.1.500 +ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz +ENV DOTNET_SDK_DOWNLOAD_SHA 85055728e2433dfde41d15c85475f2dc6cfdd30242b4b23065b63cb12cc846acb93c09c000b02b722890ceac8ac382b40871c78660716ca2339c71052fe52f4e +ENV NUGET_XMLDOC_MODE skip +RUN curl -SL $DOTNET_SDK_DOWNLOAD_URL --output dotnet.tar.gz \ + && echo "$DOTNET_SDK_DOWNLOAD_SHA dotnet.tar.gz" | sha512sum -c - \ + && mkdir -p /usr/share/dotnet \ + && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ + && rm dotnet.tar.gz \ + && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet + +# Install .NET Core 3 SDK ENV DOTNET_SDK_VERSION 3.0.100 RUN curl -SL --output dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \ From 42ac8d178364a8e7b63d5058dd28fd7083084fa6 Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Wed, 6 Nov 2019 15:21:11 -0500 Subject: [PATCH 3/5] trying a different set of msft instructions --- Dockerfile | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 915bb70..b07de3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -111,29 +111,15 @@ imap jj \n\ # region NETCORE # taken from https://hub.docker.com/_/microsoft-dotnet-core-sdk # taken from https://github.com/dotnet/dotnet-docker/blob/master/3.0/sdk/bionic/amd64/Dockerfile +# https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install -# Install .NET Core 2 SDK -ENV DOTNET_SDK_VERSION 2.1.500 -ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz -ENV DOTNET_SDK_DOWNLOAD_SHA 85055728e2433dfde41d15c85475f2dc6cfdd30242b4b23065b63cb12cc846acb93c09c000b02b722890ceac8ac382b40871c78660716ca2339c71052fe52f4e -ENV NUGET_XMLDOC_MODE skip -RUN curl -SL $DOTNET_SDK_DOWNLOAD_URL --output dotnet.tar.gz \ - && echo "$DOTNET_SDK_DOWNLOAD_SHA dotnet.tar.gz" | sha512sum -c - \ - && mkdir -p /usr/share/dotnet \ - && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ - && rm dotnet.tar.gz \ - && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet - -# Install .NET Core 3 SDK -ENV DOTNET_SDK_VERSION 3.0.100 - -RUN curl -SL --output dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \ - && dotnet_sha512='766da31f9a0bcfbf0f12c91ea68354eb509ac2111879d55b656f19299c6ea1c005d31460dac7c2a4ef82b3edfea30232c82ba301fb52c0ff268d3e3a1b73d8f7' \ - && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ - && mkdir -p /usr/share/dotnet \ - && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ - && rm dotnet.tar.gz \ - && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet +RUN wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ + && sudo dpkg -i packages-microsoft-prod.deb \ + && sudo apt-get update \ + && sudo apt-get install apt-transport-https -y \ + && sudo apt-get update \ + && sudo apt-get install dotnet-sdk-2.1 -y \ + && sudo apt-get install dotnet-sdk-3.0 -y # Enable detection of running in a container ENV DOTNET_RUNNING_IN_CONTAINER=true \ @@ -159,7 +145,7 @@ RUN curl -SL --output PowerShell.Linux.x64.$POWERSHELL_VERSION.nupkg https://pws # To reduce image size, remove the copy nupkg that nuget keeps. && find /usr/share/powershell -print | grep -i '.*[.]nupkg$' | xargs rm -# endregion NETCORE3 +# endregion NETCORE3 run DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 dotnet tool install --tool-path /usr/local/bin paket run chmod +X /usr/local/bin/paket From 6aaa2f35bfb43f8ce2c51834af11899db2f49ec2 Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Wed, 6 Nov 2019 15:22:18 -0500 Subject: [PATCH 4/5] fixing comments --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b07de3c..1a423ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -109,9 +109,9 @@ imap jj \n\ ' >> /etc/vim/vimrc # region NETCORE -# taken from https://hub.docker.com/_/microsoft-dotnet-core-sdk -# taken from https://github.com/dotnet/dotnet-docker/blob/master/3.0/sdk/bionic/amd64/Dockerfile -# https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install +# for netcore2 reference https://hub.docker.com/_/microsoft-dotnet-core-sdk +# for netcore3 reference https://github.com/dotnet/dotnet-docker/blob/master/3.0/sdk/bionic/amd64/Dockerfile +# taken from https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install RUN wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ && sudo dpkg -i packages-microsoft-prod.deb \ @@ -145,7 +145,7 @@ RUN curl -SL --output PowerShell.Linux.x64.$POWERSHELL_VERSION.nupkg https://pws # To reduce image size, remove the copy nupkg that nuget keeps. && find /usr/share/powershell -print | grep -i '.*[.]nupkg$' | xargs rm -# endregion NETCORE3 +# endregion NETCORE run DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 dotnet tool install --tool-path /usr/local/bin paket run chmod +X /usr/local/bin/paket From 46e48af4694443bcd5d9e09d72fde8f3d660828b Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Wed, 6 Nov 2019 17:24:48 -0500 Subject: [PATCH 5/5] vsdbg --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1a423ba..22f9242 100644 --- a/Dockerfile +++ b/Dockerfile @@ -144,6 +144,9 @@ RUN curl -SL --output PowerShell.Linux.x64.$POWERSHELL_VERSION.nupkg https://pws && ln -s /usr/share/powershell/pwsh /usr/bin/pwsh \ # To reduce image size, remove the copy nupkg that nuget keeps. && find /usr/share/powershell -print | grep -i '.*[.]nupkg$' | xargs rm + +#vsdbg for remote .net core debugging +RUN wget https://aka.ms/getvsdbgsh -O - 2>/dev/null | /bin/sh /dev/stdin -v latest -l ~/vsdbg # endregion NETCORE