Skip to content

Commit

Permalink
Add .NET 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thohng committed Mar 21, 2024
1 parent 59b823c commit 34c7268
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 30 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ jobs:
{ ver: "7.0", arch: bullseye-slim, matching: "7.0" },
{ ver: "7.0", arch: bookworm-slim, matching: "7.0" },
{ ver: "7.0", arch: jammy, matching: "7.0" },
# { ver: 8.0-preview, arch: alpine3.18, matching: "8.0.0-preview" },
# { ver: 8.0-preview, arch: bookworm-slim, matching: "8.0.0-preview" },
# { ver: 8.0-preview, arch: jammy, matching: "8.0.0-preview" },
{ ver: "8.0", arch: alpine3.18, matching: "8.0" },
{ ver: "8.0", arch: alpine3.19, matching: "8.0" },
{ ver: "8.0", arch: bookworm-slim, matching: "8.0" },
{ ver: "8.0", arch: jammy, matching: "8.0" },
# { ver: 8.0-preview, arch: jammy-chiseled, matching: "8.0.0-preview" },
{ ver: 9.0-preview, arch: alpine3.19, matching: "9.0.0-preview" },
{
ver: 9.0-preview,
arch: bookworm-slim,
matching: "9.0.0-preview",
},
{ ver: 9.0-preview, arch: jammy, matching: "9.0.0-preview" },
# { ver: 8.0-preview, arch: jammy-chiseled, matching: "8.0.0-preview" },
]
name: ${{ matrix.image.ver }}-${{ matrix.image.arch }}
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A customized ASP.NET Core Runtime image supports Azure AppService Web SSH. Docke
- ASP.NET Core 6.0, mcr.microsoft.com/dotnet/aspnet:6.0 tags: `6.0-alpine`, `6.0-bookworm-slim`, `6.0-bullseye-slim`, `6.0-jammy`, `6.0-focal`
- ASP.NET Core 7.0, mcr.microsoft.com/dotnet/aspnet:7.0 tags: `7.0-alpine`, `7.0-bookworm-slim`, `7.0-bullseye-slim`, `7.0-jammy`
- ASP.NET Core 8.0, mcr.microsoft.com/dotnet/aspnet:8.0 tags: `8.0-alpine`, `8.0-bookworm-slim`, `8.0-jammy`
- ASP.NET Core 9.0, mcr.microsoft.com/dotnet/aspnet:9.0 tags: `9.0-alpine`, `9.0-bookworm-slim`, `9.0-jammy`

## Github source

Expand Down
91 changes: 64 additions & 27 deletions docker-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,63 @@ param (
)

$mappingVersionArch = @{
'^6\.0(\.\d+)?-alpine(.*)$' = '6.0-alpine', '6.0'
'^6\.0(\.\d+)?-bullseye-slim$' = '6.0-bullseye-slim', '6.0', 'bullseye-slim'
'^6\.0(\.\d+)?-bookworm-slim$' = '6.0-bookworm-slim', '6.0', 'bookworm-slim'
'^6\.0(\.\d+)?-focal$' = '6.0-focal', '6.0', 'focal'
'^6\.0(\.\d+)?-jammy$' = '6.0-jammy', '6.0', 'jammy'

'^7\.0(\.\d+)?-alpine(.*)$' = '7.0-alpine', '7.0'
'^7\.0(\.\d+)?-bullseye-slim$' = '7.0-bullseye-slim', '7.0', 'bullseye-slim'
'^7\.0(\.\d+)?-bookworm-slim$' = '7.0-bookworm-slim', '7.0', 'bookworm-slim'
'^7\.0(\.\d+)?-jammy$' = '7.0-jammy', '7.0', 'jammy'

'^8\.0\.0-preview[^-]+-alpine(.*)$' = '8.0-preview-alpine', '8.0-alpine', '8.0'
'^8\.0\.0-preview[^-]+-bookworm-slim$' = '8.0-preview-bookworm-slim', '8.0-preview', '8.0', 'preview-bookworm-slim', 'bookworm-slim'
'^8\.0\.0-preview[^-]+-jammy$' = '8.0-preview-jammy', '8.0-preview', '8.0', 'jammy'
'^8\.0\.0-preview[^-]+-jammy-chiseled$' = '8.0-preview-jammy-chiseled', '8.0-jammy-chiseled', 'jammy-chiseled'
'^6\.0(\.\d+)?-alpine(.*)$' = '6.0-alpine', '6.0'
'^6\.0(\.\d+)?-bullseye-slim$' = '6.0-bullseye-slim', '6.0', 'bullseye-slim'
'^6\.0(\.\d+)?-bookworm-slim$' = '6.0-bookworm-slim', '6.0', 'bookworm-slim'
'^6\.0(\.\d+)?-focal$' = '6.0-focal', '6.0', 'focal'
'^6\.0(\.\d+)?-jammy$' = '6.0-jammy', '6.0', 'jammy'

'^7\.0(\.\d+)?-alpine(.*)$' = '7.0-alpine', '7.0'
'^7\.0(\.\d+)?-bullseye-slim$' = '7.0-bullseye-slim', '7.0', 'bullseye-slim'
'^7\.0(\.\d+)?-bookworm-slim$' = '7.0-bookworm-slim', '7.0', 'bookworm-slim'
'^7\.0(\.\d+)?-jammy$' = '7.0-jammy', '7.0', 'jammy'

'^8\.0\.0-preview[^-]+-alpine(.*)$' = '8.0-preview-alpine', '8.0-alpine', '8.0'
'^8\.0\.0-preview[^-]+-bookworm-slim$' = '8.0-preview-bookworm-slim', '8.0-preview', '8.0', 'preview-bookworm-slim', 'bookworm-slim'
'^8\.0\.0-preview[^-]+-jammy$' = '8.0-preview-jammy', '8.0-preview', '8.0', 'jammy'
'^8\.0\.0-preview[^-]+-jammy-chiseled$' = '8.0-preview-jammy-chiseled', '8.0-jammy-chiseled', 'jammy-chiseled'

'^8\.0\.0-rc[^-]+-alpine(.*)$' = '8.0-rc-alpine', '8.0-alpine', '8.0'
'^8\.0\.0-rc[^-]+-bookworm-slim$' = '8.0-rc-bookworm-slim', '8.0-rc', '8.0-bookworm-slim', '8.0', 'bookworm-slim'
'^8\.0\.0-rc[^-]+-jammy$' = '8.0-rc-jammy', '8.0-rc', '8.0-jammy', '8.0', 'jammy'
'^8\.0\.0-rc[^-]+-jammy-chiseled$' = '8.0-rc-jammy-chiseled', '8.0-jammy-chiseled', 'jammy-chiseled'
'^8\.0\.0-rc[^-]+-alpine(.*)$' = '8.0-rc-alpine', '8.0-alpine', '8.0'
'^8\.0\.0-rc[^-]+-bookworm-slim$' = '8.0-rc-bookworm-slim', '8.0-rc', '8.0-bookworm-slim', '8.0', 'bookworm-slim'
'^8\.0\.0-rc[^-]+-jammy$' = '8.0-rc-jammy', '8.0-rc', '8.0-jammy', '8.0', 'jammy'
'^8\.0\.0-rc[^-]+-jammy-chiseled$' = '8.0-rc-jammy-chiseled', '8.0-jammy-chiseled', 'jammy-chiseled'

'^8\.0(\.\d+)?-alpine(.*)$' = '8.0-alpine', '8.0'
'^8\.0(\.\d+)?-bookworm-slim$' = '8.0-bookworm-slim', '8.0', 'bookworm-slim'
'^8\.0(\.\d+)?-jammy$' = '8.0-jammy', '8.0', 'jammy'
'^8\.0(\.\d+)?-jammy-chiseled$' = '8.0-jammy-chiseled', 'jammy-chiseled'
'^8\.0(\.\d+)?-alpine(.*)$' = '8.0-alpine', '8.0'
'^8\.0(\.\d+)?-bookworm-slim$' = '8.0-bookworm-slim', '8.0', 'bookworm-slim'
'^8\.0(\.\d+)?-jammy$' = '8.0-jammy', '8.0', 'jammy'
'^8\.0(\.\d+)?-jammy-chiseled$' = '8.0-jammy-chiseled', 'jammy-chiseled'

'^9\.0(\.\d+)?-preview[^-]*-alpine(.*)$' = '9.0-preview-alpine', '9.0-alpine', '9.0'
'^9\.0(\.\d+)?-preview[^-]*-bookworm-slim$' = '9.0-preview-bookworm-slim', '9.0-preview', '9.0', 'preview-bookworm-slim', 'bookworm-slim'
'^9\.0(\.\d+)?-preview[^-]*-jammy$' = '9.0-preview-jammy', '9.0-preview', '9.0', 'jammy'
'^9\.0(\.\d+)?-preview[^-]*-jammy-chiseled$' = '9.0-preview-jammy-chiseled', '9.0-jammy-chiseled', 'jammy-chiseled'

'^9\.0(\.\d+)?-rc[^-]*-alpine(.*)$' = '9.0-rc-alpine', '9.0-alpine', '9.0'
'^9\.0(\.\d+)?-rc[^-]*-bookworm-slim$' = '9.0-rc-bookworm-slim', '9.0-rc', '9.0-bookworm-slim', '9.0', 'bookworm-slim'
'^9\.0(\.\d+)?-rc[^-]*-jammy$' = '9.0-rc-jammy', '9.0-rc', '9.0-jammy', '9.0', 'jammy'
'^9\.0(\.\d+)?-rc[^-]*-jammy-chiseled$' = '9.0-rc-jammy-chiseled', '9.0-jammy-chiseled', 'jammy-chiseled'

'^9\.0(\.\d+)?-alpine(.*)$' = '9.0-alpine', '9.0'
'^9\.0(\.\d+)?-bookworm-slim$' = '9.0-bookworm-slim', '9.0', 'bookworm-slim'
'^9\.0(\.\d+)?-jammy$' = '9.0-jammy', '9.0', 'jammy'
'^9\.0(\.\d+)?-jammy-chiseled$' = '9.0-jammy-chiseled', 'jammy-chiseled'
}

$mappingMajorRc = @{
'^8\.0\.0-rc[^-]+-alpine(.*)$' = '8.0-alpine'
'^8\.0\.0-rc[^-]+-bookworm-slim$' = '8.0-bookworm-slim'
'^8\.0\.0-rc[^-]+-jammy$' = '8.0-jammy'
'^8\.0\.0-rc[^-]+-jammy-chiseled$' = '8.0-jammy-chiseled'
'^8\.0\.0-rc[^-]+-alpine(.*)$' = '8.0-alpine'
'^8\.0\.0-rc[^-]+-bookworm-slim$' = '8.0-bookworm-slim'
'^8\.0\.0-rc[^-]+-jammy$' = '8.0-jammy'
'^8\.0\.0-rc[^-]+-jammy-chiseled$' = '8.0-jammy-chiseled'

'^9\.0(\.\d+)?-preview[^-]*-alpine(.*)$' = '9.0-alpine'
'^9\.0(\.\d+)?-preview[^-]*-bookworm-slim$' = '9.0-bookworm-slim'
'^9\.0(\.\d+)?-preview[^-]*-jammy$' = '9.0-jammy'
'^9\.0(\.\d+)?-preview[^-]*-jammy-chiseled$' = '9.0-jammy-chiseled'

'^9\.0(\.\d+)?-rc[^-]*-alpine(.*)$' = '9.0-alpine'
'^9\.0(\.\d+)?-rc[^-]*-bookworm-slim$' = '9.0-bookworm-slim'
'^9\.0(\.\d+)?-rc[^-]*-jammy$' = '9.0-jammy'
'^9\.0(\.\d+)?-rc[^-]*-jammy-chiseled$' = '9.0-jammy-chiseled'
}

$latestTag = '6.0-alpine'
Expand Down Expand Up @@ -68,6 +93,18 @@ $mappingArch = @{
'8.0-bookworm-slim' = 'debian'
'8.0-jammy' = 'debian' #ubuntu 22.04 LTS
'8.0-jammy-chiseled' = 'debian' #ubuntu 22.04 LTS
'9.0-preview-alpine' = 'alpine'
'9.0-preview-bookworm-slim' = 'debian'
'9.0-preview-jammy' = 'debian' #ubuntu 22.04 LTS
'9.0-preview-jammy-chiseled' = 'debian' #ubuntu 22.04 LTS
'9.0-rc-alpine' = 'alpine'
'9.0-rc-bookworm-slim' = 'debian'
'9.0-rc-jammy' = 'debian' #ubuntu 22.04 LTS
'9.0-rc-jammy-chiseled' = 'debian' #ubuntu 22.04 LTS
'9.0-alpine' = 'alpine'
'9.0-bookworm-slim' = 'debian'
'9.0-jammy' = 'debian' #ubuntu 22.04 LTS
'9.0-jammy-chiseled' = 'debian' #ubuntu 22.04 LTS
}

function getVersionArch($imageTag) {
Expand Down
30 changes: 30 additions & 0 deletions eng/alpine/Dockerfile-9.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG IMAGE_TAG=6.0-alpine
FROM mcr.microsoft.com/dotnet/aspnet:${IMAGE_TAG} AS base

# Sample dotnet Alpine with ICU https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.alpine-x64#L20
ENV SSH_PORT=2222 \
TZ=UTC \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
APPUSER_UID=1000

# Copy files in structure /etc/ssh/sshd_config, /opt/startup/init_container.sh /tmp/ssh_setup.sh
COPY src/ /

# Install OpenSSH and set the password for root to "Docker!". In this example, "apk add" is the install instruction for an Alpine Linux-based image.
# .NET Core 2.0 Globalization Invariant Mode https://github.com/dotnet/announcements/issues/20
RUN apk add --no-cache openssh tzdata icu-data-full icu-libs \
&& mkdir -p /run/sshd \
&& chmod -R 755 /run/sshd \
&& echo "root:Docker!" | chpasswd \
&& chmod -R +x /opt/startup \
&& (sleep 1;/opt/startup/ssh_setup.sh 2>&1 > /dev/null) \
&& rm -rf /tmp/* \
&& addgroup \
--gid=$APPUSER_UID \
appuser \
&& adduser \
--uid=$APPUSER_UID \
--ingroup=appuser \
--disabled-password \
appuser
28 changes: 28 additions & 0 deletions eng/debian/Dockerfile-9.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG IMAGE_TAG=6.0-bullseye-slim
FROM mcr.microsoft.com/dotnet/aspnet:${IMAGE_TAG} AS base

ENV SSH_PORT=2222 \
TZ=UTC \
APPUSER_UID=1000

# Copy files in structure /etc/ssh/sshd_config, /opt/startup/init_container.sh /tmp/ssh_setup.sh
COPY src/ /

# Install OpenSSH and set the password for root to "Docker!". In this example, "apk add" is the install instruction for an Alpine Linux-based image.
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openssh-server tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /run/sshd \
&& chmod -R 755 /run/sshd \
&& echo "root:Docker!" | chpasswd \
&& chmod -R +x /opt/startup \
&& (sleep 1;/opt/startup/ssh_setup.sh 2>&1 > /dev/null) \
&& rm -rf /tmp/* \
&& addgroup \
--gid=$APPUSER_UID \
appuser \
&& adduser \
--uid=$APPUSER_UID \
--ingroup=appuser \
--disabled-password \
appuser
30 changes: 30 additions & 0 deletions src/alpine/Dockerfile-9.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG IMAGE_TAG=6.0-alpine
FROM mcr.microsoft.com/dotnet/aspnet:${IMAGE_TAG} AS base

# Sample dotnet Alpine with ICU https://github.com/dotnet/dotnet-docker/blob/main/samples/dotnetapp/Dockerfile.alpine-x64#L20
ENV SSH_PORT=2222 \
TZ=UTC \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
APPUSER_UID=1000

# Copy files in structure /etc/ssh/sshd_config, /opt/startup/init_container.sh /tmp/ssh_setup.sh
COPY src/ /

# Install OpenSSH and set the password for root to "Docker!". In this example, "apk add" is the install instruction for an Alpine Linux-based image.
# .NET Core 2.0 Globalization Invariant Mode https://github.com/dotnet/announcements/issues/20
RUN apk add --no-cache openssh tzdata icu-data-full icu-libs \
&& mkdir -p /run/sshd \
&& chmod -R 755 /run/sshd \
&& echo "root:Docker!" | chpasswd \
&& chmod -R +x /opt/startup \
&& (sleep 1;/opt/startup/ssh_setup.sh 2>&1 > /dev/null) \
&& rm -rf /tmp/* \
&& addgroup \
--gid=$APPUSER_UID \
appuser \
&& adduser \
--uid=$APPUSER_UID \
--ingroup=appuser \
--disabled-password \
appuser
28 changes: 28 additions & 0 deletions src/debian/Dockerfile-9.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG IMAGE_TAG=6.0-bullseye-slim
FROM mcr.microsoft.com/dotnet/aspnet:${IMAGE_TAG} AS base

ENV SSH_PORT=2222 \
TZ=UTC \
APPUSER_UID=1000

# Copy files in structure /etc/ssh/sshd_config, /opt/startup/init_container.sh /tmp/ssh_setup.sh
COPY src/ /

# Install OpenSSH and set the password for root to "Docker!". In this example, "apk add" is the install instruction for an Alpine Linux-based image.
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openssh-server tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /run/sshd \
&& chmod -R 755 /run/sshd \
&& echo "root:Docker!" | chpasswd \
&& chmod -R +x /opt/startup \
&& (sleep 1;/opt/startup/ssh_setup.sh 2>&1 > /dev/null) \
&& rm -rf /tmp/* \
&& addgroup \
--gid=$APPUSER_UID \
appuser \
&& adduser \
--uid=$APPUSER_UID \
--ingroup=appuser \
--disabled-password \
appuser

0 comments on commit 34c7268

Please sign in to comment.