Skip to content

Commit

Permalink
Add Check Markdown Link GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSimons committed Aug 21, 2024
1 parent 8225c99 commit 3145b3e
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/new-distro-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ assignees: lbussell
1. - [ ] Get PR signoff
1. - [ ] Merge PR to nightly branch
1. - [ ] Wait for automatically queued CI build to finish on [dotnet-docker-nightly pipeline](https://dev.azure.com/dnceng/internal/_build?definitionId=359) (internal MSFT link)
1. - [ ] Confirm READMEs have been updated in [Docker Hub](https://hub.docker.com/_/microsoft-dotnet)
1. - [ ] Confirm READMEs have been updated in [Docker Hub](https://hub.docker.com/r/microsoft/dotnet)

## Main Branch Tasks

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/new-windows-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ assignees: lbussell

## Nightly Branch Tasks

- [ ] Merge these changes to the nightly branch as part of the nightly branch [release process](dotnet-release.md) for the next .NET release.
- [ ] Merge these changes to the nightly branch as part of the nightly branch [release process](releases/dotnet-release-lifecycle.md) for the next .NET release.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add due dates to each of the issues so that we don't lose track of them.
- Adjust existing templates or add new templates in `eng/dockerfile-templates/` if necessary
- If there are no major changes between .NET versions, the new images can share `runtime-deps` layers with the previous .NET version
- Include only the latest/LTS version of each operating system according to our [supported operating systems documentation](https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-platforms.md#operating-systems).
- If adding a new OS version, follow the guidelines in [new-distro-release.md](https://raw.githubusercontent.com/dotnet/dotnet-docker/main/.github/ISSUE_TEMPLATE/releases/new-distro-release.md)
- If adding a new OS version, follow the guidelines in [new-distro-release.md](../new-distro-release.md)
- If PowerShell is not yet supported or functional on the new .NET version, file an issue at [PowerShell/PowerShell](https://github.com/PowerShell/PowerShell/issues) or link to an existing issue, exclude PowerShell from the new SDK images, and [file an issue](https://github.com/dotnet/dotnet-docker/issues/new/choose) to re-enable PowerShell in .NET Docker images
- [ ] Update tests
- [ ] Add new version info to [ImageVersion.cs](https://github.com/dotnet/dotnet-docker/blob/nightly/tests/Microsoft.DotNet.Docker.Tests/ImageVersion.cs)
Expand Down
23 changes: 23 additions & 0 deletions .github/linters/.check-markdown-links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"ignorePatterns": [
// Microsoft internal links used in release issue checklists
{
"pattern": "^https://dev.azure.com/dnceng/internal/_build\\?definitionId=359"
},
{
"pattern": "^https://github.com/dotnet/release/blob/main/.github/ISSUE_TEMPLATE/dotnet-docker-servicing-release.md"
},
// No support to exclude files: https://github.com/gaurav-nelson/github-action-markdown-link-check/issues/103
{
"pattern": "^https://mcr.microsoft.com/v2/\\{\\{REPO\\}\\}/tags/list"
},
{
"pattern": "^https://github.com/dotnet/dotnet-docker/blob/\\{\\{if"
},
// Headers ending with ? are not supported: https://github.com/tcort/markdown-link-check/issues/360
{
"pattern": "^l-is-the-package-in-the-linux-distro-base-image"
}
],
"aliveStatusCodes": [406]
}
24 changes: 24 additions & 0 deletions .github/workflows/check-markdown-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Check Markdown Links'

on:
pull_request:
paths:
- "**/*.md"

permissions:
pull-requests: read

jobs:
check-markdown-links:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check markdown links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: .github/linters/.check-markdown-links.json
use-quiet-mode: 'yes'
use-verbose-mode: 'no'
2 changes: 1 addition & 1 deletion .portal-docs/docker-hub/README.monitor-base.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The following Dockerfiles demonstrate how you can use this base image to build a

# Full Tag Listing

View the current tags at the [Microsoft Artifact Registry portal](https://mcr.microsoft.com/product/dotnet/monitor/base/tags) or on [GitHub](https://github.com/dotnet/dotnet-docker/blob/main/README.base.md#full-tag-listing).
View the current tags at the [Microsoft Artifact Registry portal](https://mcr.microsoft.com/product/dotnet/monitor/base/tags) or on [GitHub](https://github.com/dotnet/dotnet-docker/blob/main/README.monitor-base.md#full-tag-listing).

# Support

Expand Down
2 changes: 1 addition & 1 deletion .portal-docs/docker-hub/README.runtime-deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Please see the [Ubuntu Chiseled + .NET](https://github.com/dotnet/dotnet-docker/

The [.NET Docker samples](https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md) show various ways to use .NET and Docker together. See [Building Docker Images for .NET Applications](https://docs.microsoft.com/dotnet/core/docker/building-net-docker-images) to learn more.

* [.NET self-contained Sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/README.md) - This [sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.debian-x64-slim) builds and runs an application as a self-contained application.
* [.NET self-contained Sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/README.md) - This [sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.debian) builds and runs an application as a self-contained application.

# Image Variants

Expand Down
2 changes: 1 addition & 1 deletion .portal-docs/mar/README.runtime-deps.portal.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Please see the [Ubuntu Chiseled + .NET](https://github.com/dotnet/dotnet-docker/

The [.NET Docker samples](https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md) show various ways to use .NET and Docker together. See [Building Docker Images for .NET Applications](https://docs.microsoft.com/dotnet/core/docker/building-net-docker-images) to learn more.

* [.NET self-contained Sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/README.md) - This [sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.debian-x64-slim) builds and runs an application as a self-contained application.
* [.NET self-contained Sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/README.md) - This [sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.debian) builds and runs an application as a self-contained application.

## Image Variants

Expand Down
2 changes: 1 addition & 1 deletion README.runtime-deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Please see the [Ubuntu Chiseled + .NET](https://github.com/dotnet/dotnet-docker/

The [.NET Docker samples](https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md) show various ways to use .NET and Docker together. See [Building Docker Images for .NET Applications](https://docs.microsoft.com/dotnet/core/docker/building-net-docker-images) to learn more.

* [.NET self-contained Sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/README.md) - This [sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.debian-x64-slim) builds and runs an application as a self-contained application.
* [.NET self-contained Sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/README.md) - This [sample](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.debian) builds and runs an application as a self-contained application.

## Image Variants

Expand Down
2 changes: 1 addition & 1 deletion documentation/guiding-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ See the [supported tags](supported-tags.md) for the tagging practices and polici
1. Images will be rebuilt only as necessary in order to limit downstream image rebuilds and deployments for consumers of .NET images.
The [Image Update Policy](https://github.com/dotnet/dotnet-docker/blob/main/README.md#image-update-policy) section of the README contains the exact guidelines for when images will be updated.

1. Images will never be deleted from the [official Docker repositories](https://hub.docker.com/_/microsoft-dotnet/). This does not apply to the [nightly repositories](https://github.com/dotnet/dotnet-docker/blob/nightly/README.md).
1. Images will never be deleted from the [official Docker repositories](https://hub.docker.com/r/microsoft/dotnet/). This does not apply to the [nightly repositories](https://github.com/dotnet/dotnet-docker/blob/nightly/README.md).

1. The [Dockerfiles](https://github.com/dotnet/dotnet-docker/search?q=filename%3ADockerfile) used to produce all of the images will be publicly available. Customers will be able to take the Dockerfiles and build them to produce their own equivalent images. No special build steps or permissions should be needed to build the Dockerfiles.

Expand Down
6 changes: 3 additions & 3 deletions documentation/image-artifact-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You can see these components installed in the [runtime](https://github.com/dotne

### .NET Runtime Image

The [.NET runtime image](https://hub.docker.com/_/microsoft-dotnet-runtime/) includes the .NET runtime, with an associated license and third party notice file.
The [.NET runtime image](https://hub.docker.com/r/microsoft/dotnet-runtime/) includes the .NET runtime, with an associated license and third party notice file.

```console
$ docker run --rm mcr.microsoft.com/dotnet/runtime:6.0-bullseye-slim /bin/sh -c "find ./usr/share/dotnet | grep LICENSE"
Expand Down Expand Up @@ -54,7 +54,7 @@ $ docker run --rm mcr.microsoft.com/dotnet/runtime:6.0-bullseye-slim /bin/sh -c

### ASP.NET Core Image

The [ASP.NET Core image](https://hub.docker.com/_/microsoft-dotnet-aspnet/) includes ASP.NET Core in addition to .NET, with associated licenses and third party notice files.
The [ASP.NET Core image](https://hub.docker.com/r/microsoft/dotnet-aspnet/) includes ASP.NET Core in addition to .NET, with associated licenses and third party notice files.

```console
$ docker run --rm mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim /bin/sh -c "find ./usr/share/dotnet | grep LICENSE"
Expand All @@ -66,7 +66,7 @@ $ docker run --rm mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim /bin/sh -c "

### .NET SDK Image

The [SDK image](https://hub.docker.com/_/microsoft-dotnet-sdk/) includes the .NET SDK, which includes various .NET components, with associated licenses and third party notice files.
The [SDK image](https://hub.docker.com/r/microsoft/dotnet-sdk/) includes the .NET SDK, which includes various .NET components, with associated licenses and third party notice files.

```console
$ docker run --rm mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim /bin/sh -c "find ./usr/share/dotnet ./usr/share/powershell | grep LICENSE"
Expand Down
4 changes: 2 additions & 2 deletions documentation/image-variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ These images are intended to satisfy the most common use cases of .NET developer

Alpine and [Ubuntu Chiseled](./ubuntu-chiseled.md) .NET images are focused on size.
By default, these images do not include `icu` or `tzdata`, meaning that these images only work with apps that are configured for [globalization-invariant mode](https://learn.microsoft.com/dotnet/core/runtime-config/globalization).
Apps that require globalization support can use the `extra` image variant of the [dotnet/runtime-deps](https://hub.docker.com/_/microsoft-dotnet-runtime-deps/) images. Because this is only available with `runtime-deps` images, it requires a [self-contained deployment](https://learn.microsoft.com/dotnet/core/deploying/#publish-self-contained) of the application.
Apps that require globalization support can use the `extra` image variant of the [dotnet/runtime-deps](https://hub.docker.com/r/microsoft/dotnet-runtime-deps/) images. Because this is only available with `runtime-deps` images, it requires a [self-contained deployment](https://learn.microsoft.com/dotnet/core/deploying/#publish-self-contained) of the application.
Alpine, Azure Linux, and Ubuntu Chiseled images also come in `extra`, `composite`, and `aot` variants (see below).

## Distroless
Expand Down Expand Up @@ -36,6 +36,6 @@ Please see ["Limitations of Native AOT deployment"](https://learn.microsoft.com/
They also require the use of the `aot` SDK image which include extra libraries needed for Native AOT compilation.

> [!NOTE]
> `aot` images are only available as a preview in the [dotnet/nightly/sdk](https://hub.docker.com/_/microsoft-dotnet-nightly-sdk/) and [dotnet/nightly/runtime-deps](https://hub.docker.com/_/microsoft-dotnet-nightly-runtime-deps/) repos.
> `aot` images are only available as a preview in the [dotnet/nightly/sdk](https://hub.docker.com/r/microsoft/dotnet-nightly-sdk/) and [dotnet/nightly/runtime-deps](https://hub.docker.com/r/microsoft/dotnet-nightly-runtime-deps/) repos.
> Native AOT compiled apps will function exactly the same on the existing `runtime-deps` (non-`aot`) images, but with a larger deployment size.
> Please try out these new, smaller images and give us feedback!
12 changes: 6 additions & 6 deletions documentation/scenarios/installing-dotnet.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Installing .NET in a Dockerfile

There can be times where you need .NET installed on a base image that is unavailable amongst the set of official [.NET Docker images](https://hub.docker.com/_/microsoft-dotnet), such as a different Linux distro version or a Windows Server Core image. In that case, you'll need to author your own Dockerfile which installs .NET. The snippets below describe how to do this.
There can be times where you need .NET installed on a base image that is unavailable amongst the set of official [.NET Docker images](https://hub.docker.com/r/microsoft/dotnet), such as a different Linux distro version or a Windows Server Core image. In that case, you'll need to author your own Dockerfile which installs .NET. The snippets below describe how to do this.

There are two scenarios you should consider depending on how your Docker image is to be consumed: [general platform images](#general-platform-images) and [custom application images](#custom-application-images). But before getting to that, let's first consider whether you actually need to go down this road.

## Determine whether a different base image is needed

Before doing all the work of authoring and maintaining a Dockerfile that installs .NET, it's worthwhile to stop and thoroughly analyze whether you actually do need a different base image than those provided as part of the set of official [.NET Docker images](https://hub.docker.com/_/microsoft-dotnet).
Before doing all the work of authoring and maintaining a Dockerfile that installs .NET, it's worthwhile to stop and thoroughly analyze whether you actually do need a different base image than those provided as part of the set of official [.NET Docker images](https://hub.docker.com/r/microsoft/dotnet).

If there's a platform that you require that is available in its own Docker image, ask yourself whether it would be better to use that image and add .NET to it or would it be better to use the .NET image as the base and add the platform to it. An example scenario is using the .NET runtime with PowerShell Core; determine whether you would prefer to start with a [PowerShell Core](https://hub.docker.com/_/microsoft-powershell) image and install .NET runtime onto it or start with a [.NET runtime image](https://hub.docker.com/_/microsoft-dotnet-runtime) and install PowerShell Core onto it.
If there's a platform that you require that is available in its own Docker image, ask yourself whether it would be better to use that image and add .NET to it or would it be better to use the .NET image as the base and add the platform to it. An example scenario is using the .NET runtime with PowerShell; determine whether you would prefer to start with a [PowerShell](https://mcr.microsoft.com/product/powershell/about) image and install .NET runtime onto it or start with a [.NET runtime image](https://hub.docker.com/r/microsoft/dotnet-runtime) and install PowerShell Core onto it.

In some cases, you can workaround dependencies by publishing your .NET application as a [self-contained app](https://docs.microsoft.com/en-us/dotnet/core/deploying) in which case all of your app's dependencies are packaged with the app. This reduces the dependencies that need to be installed separately on the base image. For example, a Windows app may require dependencies that only exist in Windows Server Core but only .NET (pre-5.0) images on Nano Server are available. In that case, the app could be deployed as a self-contained app and operate just fine using the [windows/servercore](https://hub.docker.com/_/microsoft-windows-servercore) image as the base image. Example Dockerfiles that demonstrate publishing a self-contained app are available in the samples for [Linux](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.debian-x64-slim) and [Windows](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.nanoserver-x64-slim).
In some cases, you can workaround dependencies by publishing your .NET application as a [self-contained app](https://docs.microsoft.com/en-us/dotnet/core/deploying) in which case all of your app's dependencies are packaged with the app. This reduces the dependencies that need to be installed separately on the base image. For example, a Windows app may require dependencies that only exist in Windows Server Core but only .NET (pre-5.0) images on Nano Server are available. In that case, the app could be deployed as a self-contained app and operate just fine using the [windows/servercore](https://hub.docker.com/r/microsoft/windows-servercore) image as the base image. Example Dockerfiles that demonstrate publishing a self-contained app are available in the samples for [Linux](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.debian) and [Windows](https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.nanoserver).

## Image Purposes

Expand All @@ -32,7 +32,7 @@ For custom application images, it is recommended that you install .NET by [packa

When authoring your Dockerfiles, you can look to the official [.NET Dockerfiles](https://github.com/dotnet/dotnet-docker) as a template for the install steps. There are several variations depending on the .NET version, OS type, and architecture being used.

In addition to installing .NET, you'll also need to ensure that the [prerequisites](https://github.com/dotnet/core/blob/master/Documentation/prereqs.md) are installed. The [.NET Dockerfiles](https://github.com/dotnet/dotnet-docker) also demonstrate how that can be done.
In addition to installing .NET, you'll also need to ensure that the [prerequisites](https://github.com/dotnet/core/blob/main/linux.md#dependencies) are installed. The [.NET Dockerfiles](https://github.com/dotnet/dotnet-docker) also demonstrate how that can be done.

In the spirit of [clarity](https://github.com/docker-library/official-images#clarity), the Dockerfiles for the official .NET Docker images do not use a general purpose script for installing .NET. Rather, they explicitly provide each step of the installation process and reference the exact URL of the binary archive.

Expand Down Expand Up @@ -137,7 +137,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \

A set of [installation scripts](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script) are provided to conveniently install .NET on Linux with Bash or Windows with PowerShell. These scripts can be thought of as a happy medium between the two previously mentioned approaches (binary archive link and package manager). They fill a gap on systems where the desired .NET release is not available through a package manager and you don't want to deal with the cost of maintaining a direct link to a binary package. With the installation script, you have flexibility in specifying which version gets installed. You can install a specific version such as 6.0.0, the latest of a release channel such as the latest 6.0 patch, etc.

In addition to installing .NET, you'll also need to ensure that the [prerequisites](https://github.com/dotnet/core/blob/master/Documentation/prereqs.md) are installed. The [.NET Dockerfiles](https://github.com/dotnet/dotnet-docker) also demonstrate how that can be done.
In addition to installing .NET, you'll also need to ensure that the [prerequisites](https://github.com/dotnet/core/blob/main/linux.md#dependencies) are installed. The [.NET Dockerfiles](https://github.com/dotnet/dotnet-docker) also demonstrate how that can be done.

Example (Linux):

Expand Down
Loading

0 comments on commit 3145b3e

Please sign in to comment.