|
1 | | -# Test in docker shell: |
| 1 | +# Test base image in shell: |
2 | 2 | # docker run -it --rm --pull always --name Testing lscr.io/linuxserver/code-server:latest /bin/bash |
3 | 3 | # export DEBIAN_FRONTEND=noninteractive |
4 | 4 |
|
| 5 | +# Test image in shell: |
| 6 | +# docker run -it --rm --pull always --name Testing ptr727/vscode-server-dotnetcore:develop /bin/bash |
| 7 | + |
| 8 | +# Build Dockerfile |
| 9 | +# docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --tag testing:latest . |
| 10 | + |
| 11 | +# Test linux/amd64 target |
| 12 | +# docker buildx build --load --progress plain --no-cache --platform linux/amd64 --tag testing:latest . |
| 13 | +# docker run -it --rm --name Testing testing:latest /bin/bash |
| 14 | + |
| 15 | + |
| 16 | + |
5 | 17 | # https://github.com/linuxserver/docker-code-server |
6 | 18 | FROM lscr.io/linuxserver/code-server:latest |
7 | 19 |
|
| 20 | +# Image label |
| 21 | +# TODO: Get current STS and LTS versions dynamically |
8 | 22 | ARG LABEL_VERSION="60.70" |
9 | | -ARG INSTALL_VERSION="dotnet-sdk-6.0 dotnet-sdk-7.0" |
10 | | - |
11 | 23 | LABEL name="VSCode-Server-DotNet" \ |
12 | 24 | version=${LABEL_VERSION} \ |
13 | | - description="VSCode Server with .NET Core SDK and PowerShell Pre-Installed" \ |
| 25 | + description="VSCode Server with .NET SDK Pre-Installed" \ |
14 | 26 | maintainer="Pieter Viljoen <ptr727@users.noreply.github.com>" |
15 | 27 |
|
16 | | - # Enable .NET detection of running in a container |
17 | | - # See: https://github.com/dotnet/dotnet-docker/blob/master/3.0/sdk/bionic/amd64/Dockerfile |
| 28 | +# See: https://github.com/dotnet/dotnet-docker/blob/main/src/sdk/7.0/jammy/amd64/Dockerfile |
18 | 29 | ENV DOTNET_RUNNING_IN_CONTAINER=true \ |
19 | 30 | # Enable correct mode for dotnet watch (only mode supported in a container) |
20 | 31 | DOTNET_USE_POLLING_FILE_WATCHER=true \ |
21 | 32 | # Skip extraction of XML docs - generally not useful within an image/container - helps performance |
22 | 33 | NUGET_XMLDOC_MODE=skip \ |
| 34 | + # Do not show first run text |
| 35 | + DOTNET_NOLOGO=true \ |
| 36 | + # Unset ASPNETCORE_URLS from aspnet base image |
| 37 | + ASPNETCORE_URLS= \ |
| 38 | + # Do not generate certificate |
| 39 | + DOTNET_GENERATE_ASPNET_CERTIFICATE=false \ |
23 | 40 | # No installer frontend interaction |
24 | 41 | DEBIAN_FRONTEND=noninteractive |
25 | 42 |
|
26 | | -RUN apt-get update \ |
27 | | - # Install pre-requisites |
28 | | - && apt-get install -y wget apt-transport-https software-properties-common \ |
29 | | - # Register the Microsoft repository |
30 | | - && wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -sr)/packages-microsoft-prod.deb \ |
31 | | - && dpkg -i packages-microsoft-prod.deb \ |
32 | | - && rm packages-microsoft-prod.deb \ |
33 | | - && touch /etc/apt/preferences \ |
34 | | - && echo "Package: *" >> /etc/apt/preferences \ |
35 | | - && echo "Pin: origin \"packages.microsoft.com\"" >> /etc/apt/preferences \ |
36 | | - && echo "Pin-Priority: 1001" >> /etc/apt/preferences \ |
37 | | - && cat /etc/apt/preferences \ |
38 | | - && cat /etc/apt/sources.list.d/microsoft-prod.list \ |
39 | | - # Update |
40 | | - && apt-get update \ |
41 | | - && apt-get upgrade -y \ |
42 | | - # Install .NET SDK and PowerShell |
43 | | - # https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu |
44 | | - # https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux |
45 | | - && apt-get install -y ${INSTALL_VERSION} powershell \ |
46 | | - && dotnet --info \ |
| 43 | +# Prerequisites |
| 44 | +# https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#dependencies |
| 45 | +RUN apt-get update && apt-get upgrade -y \ |
| 46 | + && apt-get install -y --no-install-recommends \ |
| 47 | + libc6 \ |
| 48 | + libgcc1 \ |
| 49 | + libgcc-s1 \ |
| 50 | + libgssapi-krb5-2 \ |
| 51 | + libicu70 \ |
| 52 | + liblttng-ust1 \ |
| 53 | + libssl3 \ |
| 54 | + libstdc++6 \ |
| 55 | + libunwind8 \ |
| 56 | + wget \ |
| 57 | + zlib1g \ |
| 58 | + && apt-get clean \ |
| 59 | + && rm -rf /var/lib/apt/lists/* |
| 60 | + |
| 61 | +# TODO: What is preferred way to set the root and get in path? |
| 62 | +ENV DOTNET_ROOT=/usr/share/dotnet |
| 63 | +ENV DOTNET_CLI_HOME=/usr/share/dotnet |
| 64 | + |
| 65 | +# Install .NET |
| 66 | +# https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script |
| 67 | +RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \ |
| 68 | + && chmod +x ./dotnet-install.sh \ |
| 69 | + && ./dotnet-install.sh --install-dir /usr/share/dotnet --version latest --channel LTS\ |
| 70 | + && ./dotnet-install.sh --install-dir /usr/share/dotnet --version latest --channel STS\ |
| 71 | + && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ |
| 72 | + && dotnet --list-runtimes \ |
| 73 | + && dotnet --list-sdks \ |
47 | 74 | && apt-get clean \ |
48 | 75 | && rm -rf /var/lib/apt/lists/* |
0 commit comments