diff --git a/build/build-images-define.ps1 b/build/build-images-define.ps1 index f152490..edc9f8b 100644 --- a/build/build-images-define.ps1 +++ b/build/build-images-define.ps1 @@ -3,6 +3,8 @@ $onlyPrint = $false # 编译镜像 linux/amd64 $buildImageList = @( # ## + "aspnet:6-focal-powershell-7.2.19", + "aspnet:6-focal-windowsservercore-ltsc2022", # "aspnet:6-centos-7.9.2009-gdi-fontconfig", # "aspnet:6-focal-gdi-fontconfig", # "aspnet:5-focal-gdi-fontconfig", @@ -10,18 +12,22 @@ $buildImageList = @( # "aspnet:6-focal-puppeteer", # 未完成 # "dotnet:5-focal", # "dotnet:6-focal", + "dotnet:6-focal-windowsservercore-ltsc2022", # "dotnet:5-focal-gdi-fontconfig", # "dotnet:6-focal-gdi-fontconfig", "nginx:1.19.6", - # "nginx:1.19.6-basic", - # "nginx:1.19.6-appconfig-prod", + "nginx:1.19.6-basic", + "nginx:1.19.6-appconfig-prod", # "nginx:1.19.6-appconfig-prod-pda", # "nginx:1.19.6-shell-runner", - # "nginx:1.19.6-wait-for-it", + "nginx:1.19.6-wait-for-it", # "node:8.9.4", # "node:14.21.3", - # "node:16.13.1", + "node:16.13.1", # "node:20.10.0", + "powershell:lts-nanoserver-ltsc2022", + "powershell:lts-windowsservercore-ltsc2022", + "powershell:lts-windowsservercore-ltsc2022-docker-24.0.2", # "powershell:lts-debian-10-focal", # "powershell:lts-debian-10-focal-node-14", # "powershell:lts-debian-10-focal-node-16", @@ -34,8 +40,8 @@ $buildImageList = @( # "powershell:lts-debian-10-focal-dotnet-6", # "powershell:lts-debian-10-focal-dotnet-6-node-16", # "powershell:lts-debian-10-focal-dotnet-6-node-20", - # "frps:0.34.3", - # "frpc:0.34.3-env", + "frps:0.34.3", + "frpc:0.34.3-env", # "common-scripts:alpine-3.17", # "ntp:chrony", # "portainer:agent-2.16.1", @@ -45,7 +51,9 @@ $buildImageList = @( # "redis:6.2.4", # "keepalived:2.0.20", # "keepalived:2.0.20-docker", - # "rabbitmq:3.11.10-management", + "rabbitmq:3.11.10-management-windowsservercore-ltsc2022", + "rabbitmq:3.11.10-management-nanoserver-ltsc2022", + "rabbitmq:3.11.10-management", # "rabbitmq:3.11.10-management-mqtt", # "android-template:uni-app-3.7.11.81746_20230428", # "gitlab-runner:v14.10.1", @@ -56,6 +64,7 @@ $buildImageList = @( # "cp-kafka:7.3.2", # "wait-for-it:default", # "minio:RELEASE.2021-12-27T07-23-18Z", + "minio:RELEASE.2024-04-06T05-26-02Z", # "mongo:4.2.8-bionic", # "haproxy:2.2.28-alpine", # "mysql:8.1.0", @@ -65,7 +74,7 @@ $buildImageList = @( # "android:33.0.2", # "android:30.0.3", # "mssql:2019-latest", - # "redis:3.0.5", + "redis:3.0.5", # "dotnet:2.1-bionic", # "aspnet:2.1-bionic", # "aspnet:2.1-bionic-fontconfig", diff --git a/src/aspnet/6-focal-powershell-7.2.19/Dockerfile.windows-amd64 b/src/aspnet/6-focal-powershell-7.2.19/Dockerfile.windows-amd64 new file mode 100644 index 0000000..90bab49 --- /dev/null +++ b/src/aspnet/6-focal-powershell-7.2.19/Dockerfile.windows-amd64 @@ -0,0 +1,88 @@ +# escape=` +# Referenced in https://github.com/PowerShell/PowerShell-Docker/blob/master/release/7-2/nanoserver2022/docker/Dockerfile + +# Args used by from statements must be defined here: +ARG InstallerVersion=nanoserver +ARG InstallerRepo=mcr.microsoft.com/powershell + +# Use server core as an installer container to extract PowerShell, +# As this is a multi-stage build, this stage will eventually be thrown away +FROM ${InstallerRepo}:${InstallerVersion} AS installer-env + +# Arguments for installing PowerShell, must be defined in the container they are used +ARG PS_VERSION=7.2.19 + +ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v$PS_VERSION/PowerShell-$PS_VERSION-win-x64.zip + +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# disable telemetry +ENV POWERSHELL_TELEMETRY_OPTOUT="1" + +ARG PS_PACKAGE_URL_BASE64 + +RUN Write-host "Verifying valid Version..."; ` + if (!($env:PS_VERSION -match '^\d+\.\d+\.\d+(-\w+(\.\d+)?)?$' )) { ` + throw ('PS_Version ({0}) must match the regex "^\d+\.\d+\.\d+(-\w+(\.\d+)?)?$"' -f $env:PS_VERSION) ` + } ` + $ProgressPreference = 'SilentlyContinue'; ` + if($env:PS_PACKAGE_URL_BASE64){ ` + Write-host "decoding: $env:PS_PACKAGE_URL_BASE64" ;` + $url = [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($env:PS_PACKAGE_URL_BASE64)) ` + } else { ` + Write-host "using url: $env:PS_PACKAGE_URL" ;` + $url = $env:PS_PACKAGE_URL ` + } ` + Write-host "downloading: $url"; ` + [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; ` + New-Item -ItemType Directory /installer > $null ; ` + Invoke-WebRequest -Uri $url -outfile /installer/powershell.zip -verbose; ` + Expand-Archive /installer/powershell.zip -DestinationPath \PowerShell + +# Install PowerShell into aspnet:6.0 +FROM mcr.microsoft.com/dotnet/aspnet:6.0 + +# Copy PowerShell Core from the installer container +ENV ProgramFiles="C:\Program Files" ` + # set a fixed location for the Module analysis cache + PSModuleAnalysisCachePath="C:\Users\Public\AppData\Local\Microsoft\Windows\PowerShell\docker\ModuleAnalysisCache" ` + # Persist %PSCORE% ENV variable for user convenience + PSCORE="$ProgramFiles\PowerShell\pwsh.exe" ` + # Set the default windows path so we can use it + WindowsPATH="C:\Windows\system32;C:\Windows" ` + POWERSHELL_DISTRIBUTION_CHANNEL="PSDocker-NanoServer-ltsc2022" + +### Begin workaround ### +# Note that changing user on nanoserver is not recommended +# See, https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-base-images#base-image-differences +# But we are working around a bug introduced in the nanoserver image introduced in 1809 +# Without this, PowerShell Direct will fail +# this command sholud be like this: https://github.com/PowerShell/PowerShell-Docker/blob/f81009c42c96af46aef81eb1515efae0ef29ad5f/release/preview/nanoserver/docker/Dockerfile#L76 +USER ContainerAdministrator + +# This is basically the correct code except for the /M +RUN setx PATH "%PATH%;%ProgramFiles%\PowerShell;" /M + +USER ContainerUser +### End workaround ### + +COPY --from=installer-env ["\\PowerShell\\", "$ProgramFiles\\PowerShell"] + +# intialize powershell module cache +RUN pwsh ` + -NoLogo ` + -NoProfile ` + -Command " ` + $stopTime = (get-date).AddMinutes(15); ` + $ErrorActionPreference = 'Stop' ; ` + $ProgressPreference = 'SilentlyContinue' ; ` + while(!(Test-Path -Path $env:PSModuleAnalysisCachePath)) { ` + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; ` + if((get-date) -gt $stopTime) { throw 'timout expired'} ` + Start-Sleep -Seconds 6 ; ` + }" + +# re-enable telemetry +ENV POWERSHELL_TELEMETRY_OPTOUT="0" + +CMD ["pwsh.exe"] \ No newline at end of file diff --git a/src/aspnet/6-focal-windowsservercore-ltsc2022/Dockerfile.windows-amd64 b/src/aspnet/6-focal-windowsservercore-ltsc2022/Dockerfile.windows-amd64 new file mode 100644 index 0000000..8a7eb29 --- /dev/null +++ b/src/aspnet/6-focal-windowsservercore-ltsc2022/Dockerfile.windows-amd64 @@ -0,0 +1 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0-windowsservercore-ltsc2022 \ No newline at end of file diff --git a/src/dotnet/6-focal-windowsservercore-ltsc2022/Dockerfile.windows-amd64 b/src/dotnet/6-focal-windowsservercore-ltsc2022/Dockerfile.windows-amd64 new file mode 100644 index 0000000..3bce97f --- /dev/null +++ b/src/dotnet/6-focal-windowsservercore-ltsc2022/Dockerfile.windows-amd64 @@ -0,0 +1 @@ +FROM mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2022 \ No newline at end of file diff --git a/src/frpc/0.34.3-env/Dockerfile.windows-amd64 b/src/frpc/0.34.3-env/Dockerfile.windows-amd64 new file mode 100644 index 0000000..6d80a0c --- /dev/null +++ b/src/frpc/0.34.3-env/Dockerfile.windows-amd64 @@ -0,0 +1,22 @@ +FROM staneee/powershell:lts-nanoserver-ltsc2022 + +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +USER ContainerAdministrator + +RUN $frpc_version='0.34.3'; \ + Invoke-WebRequest -OutFile './frpc.zip' -Uri https://github.com/fatedier/frp/releases/download/v${frpc_version}/frp_${frpc_version}_windows_amd64.zip; \ + Expand-Archive -Path './frpc.zip' -DestinationPath '/'; \ + Rename-Item -Path "/frp_${frpc_version}_windows_amd64" -NewName 'frpc'; \ + Remove-Item -Force './frpc.zip'; + +WORKDIR /frpc + +COPY ./before_shell_frpc_ini.ps1 . + +EXPOSE 7000 7500 + +ENV FRPC_INI='' + +CMD ./before_shell_frpc_ini.ps1; \ + ./frpc.exe -c C:\\frpc\\frpc.ini diff --git a/src/frpc/0.34.3-env/before_shell_frpc_ini.ps1 b/src/frpc/0.34.3-env/before_shell_frpc_ini.ps1 new file mode 100644 index 0000000..84201f4 --- /dev/null +++ b/src/frpc/0.34.3-env/before_shell_frpc_ini.ps1 @@ -0,0 +1,6 @@ +# 创建 frpc.ini +if ($env:FRPC_INI) { + @" +$env:FRPC_INI +"@ | Out-File -FilePath "/frpc/frpc.ini" +} \ No newline at end of file diff --git a/src/frps/0.34.3/Dockerfile.windows-amd64 b/src/frps/0.34.3/Dockerfile.windows-amd64 new file mode 100644 index 0000000..d009618 --- /dev/null +++ b/src/frps/0.34.3/Dockerfile.windows-amd64 @@ -0,0 +1,17 @@ +FROM staneee/powershell:lts-nanoserver-ltsc2022 + +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +USER ContainerAdministrator + +RUN $frps_version='0.34.3'; \ + Invoke-WebRequest -OutFile './frps.zip' -Uri https://github.com/fatedier/frp/releases/download/v${frps_version}/frp_${frps_version}_windows_amd64.zip; \ + Expand-Archive -Path './frps.zip' -DestinationPath '/'; \ + Rename-Item -Path "/frp_${frps_version}_windows_amd64" -NewName 'frps'; \ + Remove-Item -Force './frps.zip'; + +WORKDIR /frps + +EXPOSE 7000 7500 + +CMD ["frps.exe"] diff --git a/src/minio/RELEASE.2024-04-06T05-26-02Z/Dockerfile.linux-arm64.linux-amd64 b/src/minio/RELEASE.2024-04-06T05-26-02Z/Dockerfile.linux-arm64.linux-amd64 new file mode 100644 index 0000000..350b975 --- /dev/null +++ b/src/minio/RELEASE.2024-04-06T05-26-02Z/Dockerfile.linux-arm64.linux-amd64 @@ -0,0 +1 @@ +FROM --platform=$TARGETPLATFORM minio/minio:RELEASE.2024-04-06T05-26-02Z AS base \ No newline at end of file diff --git a/src/minio/RELEASE.2024-04-06T05-26-02Z/Dockerfile.windows-amd64 b/src/minio/RELEASE.2024-04-06T05-26-02Z/Dockerfile.windows-amd64 new file mode 100644 index 0000000..d31c46a --- /dev/null +++ b/src/minio/RELEASE.2024-04-06T05-26-02Z/Dockerfile.windows-amd64 @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 + +USER ContainerAdministrator + +WORKDIR /minio + +# 会永远拉取最新版本,官方未提供历史版本exe文件,2024-4-17目前最新版本: RELEASE.2024-04-06T05-26-02Z +ADD https://dl.min.io/server/minio/release/windows-amd64/minio.exe C:\\minio\\minio.exe + +EXPOSE 9000 9001 + +CMD ["minio.exe", "server", "C:\\minio\\data", "--console-address", ":9001"] diff --git a/src/nginx/1.19.6-appconfig-prod/Dockerfile.windows-amd64 b/src/nginx/1.19.6-appconfig-prod/Dockerfile.windows-amd64 index c79bb1e..2d4669a 100644 --- a/src/nginx/1.19.6-appconfig-prod/Dockerfile.windows-amd64 +++ b/src/nginx/1.19.6-appconfig-prod/Dockerfile.windows-amd64 @@ -1,9 +1,8 @@ -# escape=` FROM staneee/nginx:1.19.6-basic # appconfig.prod.json content ENV APPCONFIG='' # entrypoint -ENTRYPOINT /before_shell_appconfig_prod.ps1; ` - nginx.exe \ No newline at end of file +ENTRYPOINT ./before_shell_appconfig_prod.ps1; \ + ./nginx.exe \ No newline at end of file diff --git a/src/nginx/1.19.6-wait-for-it/Dockerfile.windows-amd64 b/src/nginx/1.19.6-wait-for-it/Dockerfile.windows-amd64 index 2865411..1a7840a 100644 --- a/src/nginx/1.19.6-wait-for-it/Dockerfile.windows-amd64 +++ b/src/nginx/1.19.6-wait-for-it/Dockerfile.windows-amd64 @@ -1,8 +1,7 @@ -# escape=` FROM staneee/nginx:1.19.6-basic ENV NGINX_WAITHOST=localhost NGINX_WAITPORT=80 # entrypoint -ENTRYPOINT /wait-for-it.ps1 $NGINX_WAITHOST:$NGINX_WAITPORT --timeout=0; ` - nginx.exe \ No newline at end of file +ENTRYPOINT ./wait-for-it.ps1 ${env:NGINX_WAITHOST}:${env:NGINX_WAITPORT} -timeout=0; \ + ./nginx.exe \ No newline at end of file diff --git a/src/nginx/1.19.6/Dockerfile.windows-amd64 b/src/nginx/1.19.6/Dockerfile.windows-amd64 index 5c1cb8e..a4b6ef3 100644 --- a/src/nginx/1.19.6/Dockerfile.windows-amd64 +++ b/src/nginx/1.19.6/Dockerfile.windows-amd64 @@ -1,39 +1,18 @@ -# escape=` +FROM mcr.microsoft.com/windows/servercore:ltsc2022 -# run image -FROM mcr.microsoft.com/powershell:lts-7.2-nanoserver-ltsc2022 +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] USER ContainerAdministrator -SHELL ["pwsh", "-c"] - - -RUN $ErrorActionPreference = 'Stop'; ` - $ProgressPreference = 'SilentlyContinue'; ` - # new dirs - New-Item -Type Directory -Path /downloads; ` - Set-Location /downloads; ` - # download nginx - $nginx_version='1.19.6'; ` - Invoke-WebRequest -OutFile './nginx.zip' https://nginx.org/download/nginx-$nginx_version.zip; ` - # expand install package - Expand-Archive -Path './nginx.zip' -DestinationPath '/'; ` - # rename - Rename-Item -Path "/nginx-${nginx_version}" -NewName 'nginx'; ` - # remove files +RUN $nginx_version='1.19.6'; \ + Invoke-WebRequest -OutFile './nginx.zip' https://nginx.org/download/nginx-$nginx_version.zip; \ + Expand-Archive -Path './nginx.zip' -DestinationPath '/'; \ + Rename-Item -Path "/nginx-${nginx_version}" -NewName 'nginx'; \ Remove-Item -Force './nginx.zip'; -# Make sure that Docker always uses default DNS servers which hosted by Dockerd.exe -RUN Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name ServerPriorityTimeLimit -Value 0 -Type DWord; ` - Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name ScreenDefaultServers -Value 0 -Type DWord; ` - Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name ScreenUnreachableServers -Value 0 -Type DWord - -# Shorten DNS cache times -RUN Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name MaxCacheTtl -Value 30 -Type DWord; ` - Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name MaxNegativeCacheTtl -Value 30 -Type DWord - WORKDIR /nginx +# start EXPOSE 80 -# ENTRYPOINT ["nginx.exe"] -CMD ["nginx", "-g", "\"daemon off;\""] \ No newline at end of file + +ENTRYPOINT ["nginx.exe", "-g", "daemon off;"] \ No newline at end of file diff --git a/src/node/16.13.1/Dockerfile.windows-amd64 b/src/node/16.13.1/Dockerfile.windows-amd64 new file mode 100644 index 0000000..616ae01 --- /dev/null +++ b/src/node/16.13.1/Dockerfile.windows-amd64 @@ -0,0 +1,22 @@ +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +USER ContainerAdministrator + +RUN $node_version='16.13.1'; \ + # download nodejs https://nodejs.org/dist/v$node_version/node-v$node_version-win-x64.zip + Invoke-WebRequest -OutFile './nodejs.zip' https://registry.npmmirror.com/-/binary/node/v$node_version/node-v$node_version-win-x64.zip; \ + Expand-Archive -Path './nodejs.zip' -DestinationPath '/'; \ + Rename-Item -Path "/node-v${node_version}-win-x64" -NewName 'nodejs'; \ + Remove-Item -Force './nodejs.zip'; \ + # download and install vc_redist.x64 + $vc_redist_installUrl='https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe'; \ + Invoke-WebRequest -OutFile './vc_redist.x64.exe' $vc_redist_installUrl; \ + Start-Process -FilePath './vc_redist.x64.exe' -NoNewWindow -ArgumentList '/install', '/quiet', '/norestart' -Wait; \ + Remove-Item -Force ./vc_redist.x64.exe; + +RUN cmd.exe /c "setx PATH \"%PATH%;C:\nodejs\"" /M + +# 全局安装 yarn +RUN npm install -g yarn \ No newline at end of file diff --git a/src/powershell/lts-nanoserver-ltsc2022/Dockerfile.windows-amd64 b/src/powershell/lts-nanoserver-ltsc2022/Dockerfile.windows-amd64 new file mode 100644 index 0000000..783b1d0 --- /dev/null +++ b/src/powershell/lts-nanoserver-ltsc2022/Dockerfile.windows-amd64 @@ -0,0 +1,2 @@ +# PowerShell 7.2.18 +FROM mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022 \ No newline at end of file diff --git a/src/powershell/lts-windowsservercore-ltsc2022-docker-24.0.2/Dockerfile.windows-amd64 b/src/powershell/lts-windowsservercore-ltsc2022-docker-24.0.2/Dockerfile.windows-amd64 new file mode 100644 index 0000000..1710fb9 --- /dev/null +++ b/src/powershell/lts-windowsservercore-ltsc2022-docker-24.0.2/Dockerfile.windows-amd64 @@ -0,0 +1,20 @@ +# escape=` + +FROM staneee/powershell:lts-windowsservercore-ltsc2022 + +WORKDIR /docker + +RUN powershell -command " ` +Invoke-WebRequest 'https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1' ` +-OutFile ./install-docker-ce.ps1; ` +./install-docker-ce.ps1 -DockerVersion '24.0.2' -NoRestart; ` +./install-docker-ce.ps1 -DockerVersion '24.0.2' -NoRestart;" + +# COPY ./docker-compose.exe . + +# Download docker-compose for the corresponding version of docker. +RUN powershell Invoke-WebRequest "https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-windows-x86_64.exe" ` + -UseBasicParsing -OutFile c:\docker\docker-compose.exe + +RUN setx PATH "%PATH%;C:\docker" + diff --git a/src/powershell/lts-windowsservercore-ltsc2022/Dockerfile.windows-amd64 b/src/powershell/lts-windowsservercore-ltsc2022/Dockerfile.windows-amd64 new file mode 100644 index 0000000..91e4cfb --- /dev/null +++ b/src/powershell/lts-windowsservercore-ltsc2022/Dockerfile.windows-amd64 @@ -0,0 +1,2 @@ +# PowerShell 7.2.19 +FROM mcr.microsoft.com/powershell:lts-windowsservercore-ltsc2022 \ No newline at end of file diff --git a/src/rabbitmq/3.11.10-management-nanoserver-ltsc2022/Dockerfile.windows-amd64 b/src/rabbitmq/3.11.10-management-nanoserver-ltsc2022/Dockerfile.windows-amd64 new file mode 100644 index 0000000..a23df89 --- /dev/null +++ b/src/rabbitmq/3.11.10-management-nanoserver-ltsc2022/Dockerfile.windows-amd64 @@ -0,0 +1,59 @@ +# escape=` + +ARG ERLANG_VERSION=25.3.2.9 +ARG RABBITMQ_VERSION=3.11.10 + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 As Installer +USER ContainerAdministrator + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; "] + +ARG ERLANG_VERSION +ARG RABBITMQ_VERSION + +ENV ERLANG_VERSION=$ERLANG_VERSION ` + RABBITMQ_VERSION=$RABBITMQ_VERSION ` + ERLANG_HOME=C:\erlang + +RUN Write-Host -Object 'Downloading Erlang OTP' ; ` + Invoke-WebRequest -UseBasicParsing -Uri $('http://erlang.org/download/otp_win64_{0}.exe' -f $env:ERLANG_VERSION) -OutFile './otp_win64.exe'; ` + Unblock-File -Path './otp_win64.exe'; ` + Write-Host -Object 'Installing Erlang OTP'; ` + Start-Process -NoNewWindow -Wait -FilePath './otp_win64.exe' -ArgumentList /S, /D=${env:ERLANG_HOME}; ` + Write-Host -Object 'Removing Erlang OTP Installer'; ` + Remove-Item -Force './otp_win64.exe'; ` + Write-Host -Object 'Done Installing Erlang OTP'; ` + Write-Host -Object 'Downloading RabbitMQ Zip'; ` + Invoke-WebRequest -UseBasicParsing -Uri $('https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.11.10/rabbitmq-server-windows-{0}.zip' -f $env:RABBITMQ_VERSION) -OutFile './rabbitmq.zip'; ` + Unblock-File -Path './rabbitmq.zip'; ` + Write-Host -Object 'Extracting RabbitMQ Zip'; ` + Expand-Archive -Path './rabbitmq.zip' -DestinationPath '/'; ` + Rename-Item -Path "/rabbitmq_server-${env:RABBITMQ_VERSION}" -NewName 'rabbitmq'; ` + Write-Host -Object 'Removing RabbitMQ Zip'; ` + Remove-Item -Path './rabbitmq.zip'; ` + Write-Host -Object 'Done Installing RabbitMQ' + +FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 +USER ContainerAdministrator + +COPY --from=Installer ["/erlang", "/erlang"] +COPY --from=Installer ["/rabbitmq", "/rabbitmq"] +COPY --from=Installer ["/Windows/System32/vcruntime140.dll", "/Windows/System32"] +COPY --from=Installer ["/Windows/System32/msvcp140.dll", "/Windows/System32"] +COPY --from=Installer ["/Windows/System32/vcruntime140_1.dll", "/Windows/System32"] + +ENV ERLANG_HOME=C:\erlang ` + RABBITMQ_BASE=C:\rabbitmq\data ` + RABBITMQ_CONFIG_FILE=c:\rabbitmq\data\rabbitmq.conf ` + HOMEDRIVE=C:\ ` + HOMEPATH=Users\ContainerAdministrator + +RUN setx /M PATH "%PATH%;%ERLANG_HOME%\bin" + +RUN c:\rabbitmq\sbin\rabbitmq-plugins.bat enable rabbitmq_management --offline + +RUN ["cmd", "/c", "echo loopback_users.guest = false> C:\\rabbitmq\\data\\rabbitmq.conf"] + +EXPOSE 5672 15672 15673 + +CMD "c:\rabbitmq\sbin\rabbitmq-server.bat" diff --git a/src/rabbitmq/3.11.10-management-windowsservercore-ltsc2022/Dockerfile.windows-amd64 b/src/rabbitmq/3.11.10-management-windowsservercore-ltsc2022/Dockerfile.windows-amd64 new file mode 100644 index 0000000..bcaef4d --- /dev/null +++ b/src/rabbitmq/3.11.10-management-windowsservercore-ltsc2022/Dockerfile.windows-amd64 @@ -0,0 +1,46 @@ +# escape=` + +ARG ERLANG_VERSION=25.3.2.9 +ARG RABBITMQ_VERSION=3.11.10 + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 +USER ContainerAdministrator + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; "] + +ARG ERLANG_VERSION +ARG RABBITMQ_VERSION + +ENV ERLANG_VERSION=$ERLANG_VERSION ` + RABBITMQ_VERSION=$RABBITMQ_VERSION ` + ERLANG_HOME=C:\erlang ` + RABBITMQ_BASE=C:\rabbitmq\data ` + RABBITMQ_CONFIG_FILE=c:\rabbitmq\data\rabbitmq.conf + +RUN Write-Host -Object 'Downloading Erlang OTP' ; ` + Invoke-WebRequest -UseBasicParsing -Uri $('http://erlang.org/download/otp_win64_{0}.exe' -f $env:ERLANG_VERSION) -OutFile './otp_win64.exe'; ` + Unblock-File -Path './otp_win64.exe'; ` + Write-Host -Object 'Installing Erlang OTP'; ` + Start-Process -NoNewWindow -Wait -FilePath './otp_win64.exe' -ArgumentList /S, /D=${env:ERLANG_HOME}; ` + Write-Host -Object 'Removing Erlang OTP Installer'; ` + Remove-Item -Force './otp_win64.exe'; ` + Write-Host -Object 'Done Installing Erlang OTP'; ` + Write-Host -Object 'Downloading RabbitMQ Zip'; ` + Invoke-WebRequest -UseBasicParsing -Uri $('https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.11.10/rabbitmq-server-windows-{0}.zip' -f $env:RABBITMQ_VERSION) -OutFile './rabbitmq.zip'; ` + Unblock-File -Path './rabbitmq.zip'; ` + Write-Host -Object 'Extracting RabbitMQ Zip'; ` + Expand-Archive -Path './rabbitmq.zip' -DestinationPath '/'; ` + Rename-Item -Path "/rabbitmq_server-${env:RABBITMQ_VERSION}" -NewName 'rabbitmq'; ` + Write-Host -Object 'Removing RabbitMQ Zip'; ` + Remove-Item -Path './rabbitmq.zip'; ` + Write-Host -Object 'Done Installing RabbitMQ' + +RUN cmd.exe /c "setx PATH \"%PATH%;%ERLANG_HOME%\bin\"" /M + +RUN c:\rabbitmq\sbin\rabbitmq-plugins.bat enable rabbitmq_management --offline + +RUN ["cmd", "/c", "echo loopback_users.guest = false> C:\\rabbitmq\\data\\rabbitmq.conf"] + +EXPOSE 5672 15672 15673 + +CMD "c:\rabbitmq\sbin\rabbitmq-server.bat" diff --git a/src/rabbitmq/3.11.10-management/Dockerfile.windows-amd64 b/src/rabbitmq/3.11.10-management/Dockerfile.windows-amd64 new file mode 100644 index 0000000..de0deb8 --- /dev/null +++ b/src/rabbitmq/3.11.10-management/Dockerfile.windows-amd64 @@ -0,0 +1 @@ +FROM staneee/rabbitmq:3.11.10-management-nanoserver-ltsc2022 \ No newline at end of file diff --git a/src/redis/3.0.5/Dockerfile.windows-amd64 b/src/redis/3.0.5/Dockerfile.windows-amd64 index 85e0d33..903dc13 100644 --- a/src/redis/3.0.5/Dockerfile.windows-amd64 +++ b/src/redis/3.0.5/Dockerfile.windows-amd64 @@ -1,25 +1,17 @@ -# escape=` +FROM staneee/powershell:lts-nanoserver-ltsc2022 -# install image -FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS installer - -# copy package -WORKDIR /installer-packages -COPY ./redis-x64-3.0.504.zip . - -# expand package -RUN powershell -Command " ` -New-Item -Type Directory -Path '/redis'; ` -Expand-Archive -Path '/installer-packages/redis-x64-3.0.504.zip' -DestinationPath '/redis'" +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] +USER ContainerAdministrator -# run image -FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 WORKDIR /redis -COPY --from=installer ["/redis", "/redis"] -USER ContainerAdministrator +# other version https://github.com/tporadowski/redis/releases/tag/v5.0.14.1 +RUN $redis_version='3.0.504'; \ + Invoke-WebRequest -OutFile './redis.zip' -Uri https://github.com/microsoftarchive/redis/releases/download/win-$redis_version/Redis-x64-$redis_version.zip; \ + Expand-Archive -Path './redis.zip' -DestinationPath '/redis'; \ + Remove-Item -Force './redis.zip'; -# start redis EXPOSE 6379 -CMD ["redis-server.exe"] \ No newline at end of file + +CMD ["redis-server.exe"]