diff --git a/2.1/runtime-deps/alpine/amd64/Dockerfile b/2.1/runtime-deps/alpine/amd64/Dockerfile new file mode 100644 index 0000000..228f3cc --- /dev/null +++ b/2.1/runtime-deps/alpine/amd64/Dockerfile @@ -0,0 +1,22 @@ +FROM alpine:3.6 + +RUN apk add --no-cache \ + ca-certificates \ + \ + # .NET Core dependencies + krb5-libs \ + libcurl \ + libgcc \ + libintl \ + libssl1.0 \ + libstdc++ \ + libunwind \ + libuuid \ + tzdata \ + userspace-rcu \ + zlib \ + && apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \ + lttng-ust + +# Set the invariant mode since icu_libs isn't included (see https://github.com/dotnet/announcements/issues/20) +ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT true diff --git a/2.1/runtime/alpine/amd64/Dockerfile b/2.1/runtime/alpine/amd64/Dockerfile new file mode 100644 index 0000000..03164dc --- /dev/null +++ b/2.1/runtime/alpine/amd64/Dockerfile @@ -0,0 +1,16 @@ +FROM microsoft/dotnet-nightly:2.1-runtime-deps-alpine + +# Install .NET Core +ENV DOTNET_VERSION 2.1.0-preview1-25919-02 +ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-alpine.3.6-x64.tar.gz +ENV DOTNET_DOWNLOAD_SHA 7a8b081c890226ba7220c654dc833752f837171c2fe449367d24c2980db3a809012478a67423fd46264e5d2f0389a6890077f8dd25a1fc4aeecb25deb84d72a4 + +RUN apk add --no-cache --virtual .build-deps \ + openssl \ + && wget -O dotnet.tar.gz $DOTNET_DOWNLOAD_URL \ + && echo "$DOTNET_DOWNLOAD_SHA dotnet.tar.gz" | sha512sum -c - \ + && mkdir -p /usr/share/dotnet \ + && tar -C /usr/share/dotnet -xzf dotnet.tar.gz \ + && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ + && rm dotnet.tar.gz \ + && apk del .build-deps diff --git a/README.md b/README.md index ddf1eee..ea94149 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ See [dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) for images w - [`2.0.3-sdk-stretch`, `2.0-sdk-stretch`, `2.0.3-sdk`, `2.0-sdk`, `2-sdk`, `sdk`, `latest` (*2.0/sdk/stretch/amd64/Dockerfile*)](https://github.com/dotnet/dotnet-docker-nightly/blob/master/2.0/sdk/stretch/amd64/Dockerfile) - [`2.0.3-sdk-jessie`, `2.0-sdk-jessie`, `2-sdk-jessie` (*2.0/sdk/jessie/amd64/Dockerfile*)](https://github.com/dotnet/dotnet-docker-nightly/blob/master/2.0/sdk/jessie/amd64/Dockerfile) - [`2.1.0-preview1-runtime-stretch`, `2.1-runtime-stretch`, `2.1.0-preview1-runtime`, `2.1-runtime` (*2.1/runtime/stretch/amd64/Dockerfile*)](https://github.com/dotnet/dotnet-docker-nightly/blob/master/2.1/runtime/stretch/amd64/Dockerfile) +- [`2.1.0-preview1-runtime-alpine`, `2.1-runtime-alpine` (*2.1/runtime/alpine/amd64/Dockerfile*)](https://github.com/dotnet/dotnet-docker-nightly/blob/master/2.1/runtime/alpine/amd64/Dockerfile) - [`2.1.0-preview1-runtime-jessie`, `2.1-runtime-jessie` (*2.1/runtime/jessie/amd64/Dockerfile*)](https://github.com/dotnet/dotnet-docker-nightly/blob/master/2.1/runtime/jessie/amd64/Dockerfile) +- [`2.1.0-preview1-runtime-deps-alpine`, `2.1-runtime-deps-alpine` (*2.1/runtime-deps/alpine/amd64/Dockerfile*)](https://github.com/dotnet/dotnet-docker-nightly/blob/master/2.1/runtime-deps/alpine/amd64/Dockerfile) - [`2.1.0-preview1-sdk-stretch`, `2.1-sdk-stretch`, `2.1.0-preview1-sdk`, `2.1-sdk` (*2.1/sdk/stretch/amd64/Dockerfile*)](https://github.com/dotnet/dotnet-docker-nightly/blob/master/2.1/sdk/stretch/amd64/Dockerfile) - [`2.1.0-preview1-sdk-jessie`, `2.1-sdk-jessie` (*2.1/sdk/jessie/amd64/Dockerfile*)](https://github.com/dotnet/dotnet-docker-nightly/blob/master/2.1/sdk/jessie/amd64/Dockerfile) diff --git a/manifest.json b/manifest.json index 43a9611..44b9e62 100644 --- a/manifest.json +++ b/manifest.json @@ -369,7 +369,7 @@ ] }, { - "readmeOrder": 12, + "readmeOrder": 14, "sharedTags": { "2.1.0-preview1-sdk": {}, "2.1-sdk": {} @@ -403,7 +403,7 @@ ] }, { - "readmeOrder": 11, + "readmeOrder": 12, "platforms": [ { "dockerfile": "2.1/runtime/jessie/amd64", @@ -416,7 +416,7 @@ ] }, { - "readmeOrder": 13, + "readmeOrder": 15, "platforms": [ { "dockerfile": "2.1/sdk/jessie/amd64", @@ -427,6 +427,32 @@ } } ] + }, + { + "readmeOrder": 13, + "platforms": [ + { + "dockerfile": "2.1/runtime-deps/alpine/amd64", + "os": "linux", + "tags": { + "2.1.0-preview1-runtime-deps-alpine": {}, + "2.1-runtime-deps-alpine": {} + } + } + ] + }, + { + "readmeOrder": 11, + "platforms": [ + { + "dockerfile": "2.1/runtime/alpine/amd64", + "os": "linux", + "tags": { + "2.1.0-preview1-runtime-alpine": {}, + "2.1-runtime-alpine": {} + } + } + ] } ] } diff --git a/test/Microsoft.DotNet.Docker.Tests/ImageDescriptor.cs b/test/Microsoft.DotNet.Docker.Tests/ImageDescriptor.cs index 8b7c788..b1496f5 100644 --- a/test/Microsoft.DotNet.Docker.Tests/ImageDescriptor.cs +++ b/test/Microsoft.DotNet.Docker.Tests/ImageDescriptor.cs @@ -14,6 +14,7 @@ public class ImageDescriptor public string Architecture { get; set; } = "amd64"; public string DotNetCoreVersion { get; set; } + public bool IsAlpine { get => String.Equals("alpine", OsVariant, StringComparison.OrdinalIgnoreCase); } public bool IsArm { get => String.Equals("arm", Architecture, StringComparison.OrdinalIgnoreCase); } public string OsVariant { get; set; } public string PlatformOS { get; set; } diff --git a/test/Microsoft.DotNet.Docker.Tests/ImageTests.cs b/test/Microsoft.DotNet.Docker.Tests/ImageTests.cs index d666957..feb253b 100644 --- a/test/Microsoft.DotNet.Docker.Tests/ImageTests.cs +++ b/test/Microsoft.DotNet.Docker.Tests/ImageTests.cs @@ -44,12 +44,8 @@ public static IEnumerable GetVerifyImagesData() Architecture = "arm" }, new ImageDescriptor { DotNetCoreVersion = "2.1", RuntimeDepsVersion = "2.0" }, - new ImageDescriptor - { - DotNetCoreVersion = "2.1", - RuntimeDepsVersion = "2.0", - OsVariant = "jessie" - }, + new ImageDescriptor { DotNetCoreVersion = "2.1", RuntimeDepsVersion = "2.0", OsVariant = "jessie" }, + new ImageDescriptor { DotNetCoreVersion = "2.1", OsVariant = "alpine", SdkOsVariant = "", }, new ImageDescriptor { DotNetCoreVersion = "2.1", @@ -112,7 +108,7 @@ public void VerifyImages(ImageDescriptor imageDescriptor) { CreateTestAppWithSdkImage(imageDescriptor, appSdkImage); - if (!imageDescriptor.IsArm) + if (!string.IsNullOrEmpty(imageDescriptor.SdkOsVariant)) { VerifySdkImage_RunApp(imageDescriptor, appSdkImage); } @@ -273,6 +269,10 @@ private static string GetRuntimeIdentifier(ImageDescriptor imageDescriptor) { rid = "linux-arm"; } + else if (imageDescriptor.IsAlpine) + { + rid = "alpine.3.6-x64"; + } else if (imageDescriptor.DotNetCoreVersion.StartsWith("1.")) { rid = "debian.8-x64";