|
| 1 | +#----------------------------------------------------------------------------------------- |
| 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +# Licensed under the MIT License. See LICENSE in the project root for license information. |
| 4 | +#----------------------------------------------------------------------------------------- |
| 5 | + |
| 6 | +FROM maven:3-jdk-8 |
| 7 | + |
| 8 | +# Configure apt |
| 9 | +ENV DEBIAN_FRONTEND=noninteractive |
| 10 | +RUN apt-get update \ |
| 11 | + && apt-get -y install --no-install-recommends apt-utils 2>&1 |
| 12 | + |
| 13 | +# Install dotnet core sdk - See https://github.com/dotnet/dotnet-docker/blob/master/2.1/sdk/stretch/amd64/Dockerfile |
| 14 | +# Install .NET CLI dependencies |
| 15 | +RUN apt-get install -y --no-install-recommends \ |
| 16 | + libc6 \ |
| 17 | + libgcc1 \ |
| 18 | + libgssapi-krb5-2 \ |
| 19 | + libicu57 \ |
| 20 | + liblttng-ust0 \ |
| 21 | + libssl1.0.2 \ |
| 22 | + libstdc++6 \ |
| 23 | + zlib1g |
| 24 | + |
| 25 | +# Install .NET Core SDK |
| 26 | +ENV DOTNET_SDK_VERSION 2.1.603 |
| 27 | + |
| 28 | +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 \ |
| 29 | + && dotnet_sha512='dd0efb8aae75d8f48ef3abbeca38ae14d2621a47e37b2d9d74755b58f9173343305f1a62cfa9a03f17c42f58b1d1b653d271e7d1327c81ff4af0a54c43c7db59' \ |
| 30 | + && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ |
| 31 | + && mkdir -p /usr/share/dotnet \ |
| 32 | + && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ |
| 33 | + && rm dotnet.tar.gz \ |
| 34 | + && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet |
| 35 | + |
| 36 | +# Configure web servers to bind to port 80 when present |
| 37 | +ENV ASPNETCORE_URLS=http://+:80 \ |
| 38 | + # Enable detection of running in a container |
| 39 | + DOTNET_RUNNING_IN_CONTAINER=true \ |
| 40 | + # Enable correct mode for dotnet watch (only mode supported in a container) |
| 41 | + DOTNET_USE_POLLING_FILE_WATCHER=true \ |
| 42 | + # Skip extraction of XML docs - generally not useful within an image/container - helps performance |
| 43 | + NUGET_XMLDOC_MODE=skip |
| 44 | + |
| 45 | +# Trigger first run experience by running arbitrary cmd to populate local package cache |
| 46 | +RUN dotnet help |
| 47 | + |
| 48 | +# Verify git and needed tools are installed |
| 49 | +RUN apt-get -y install \ |
| 50 | + git \ |
| 51 | + procps \ |
| 52 | + curl \ |
| 53 | + apt-transport-https \ |
| 54 | + gnupg2 \ |
| 55 | + lsb-release |
| 56 | + |
| 57 | +# Install Azure Functions and Azure CLI |
| 58 | +RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ |
| 59 | + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ |
| 60 | + && curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \ |
| 61 | + && apt-get update \ |
| 62 | + && apt-get install -y azure-cli azure-functions-core-tools |
| 63 | + |
| 64 | +# Clean up |
| 65 | +RUN apt-get autoremove -y \ |
| 66 | + && apt-get clean -y \ |
| 67 | + && rm -rf /var/lib/apt/lists/* |
| 68 | +ENV DEBIAN_FRONTEND=dialog |
| 69 | + |
0 commit comments