前提・実現したいこと
Docker for Windows (Windowsコンテナ)
で稼働している Windows ServerCore 環境で Node.JSを稼働させるため Chocolatey をインストールしたいのですが、リモートサーバに接続できない旨、エラーが出てしまいます。正常にインストールする方法はありますでしょうか?
また、Chocolatey
, Scoop
以外でNode.jsをCLIインストールをする方法はありますでしょうか?
発生している問題・エラーメッセージ
Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server" At C:\chocolatey.ps1:13 char:1 + iex ((New-Object System.Net.WebClient).DownloadString('https://chocol ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : WebException
該当のソースコード
Dockerfile
1# WindowsServerイメージ 2FROM mcr.microsoft.com/windows/servercore:ltsc2019 3# IISとASP.NETのセッティング 4LABEL Description="IIS" Vendor="Microsoft" Version="10" 5RUN powershell -Command Add-WindowsFeature Web-Server 6RUN powershell add-windowsfeature web-asp-net45 7# PoweShellのデフォルトをTLS12に変更 8RUN powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 9 10# Chocolatey インストール 公式ドキュメント(https://chocolatey.org/install)より引用 11RUN powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Dockerコンテナのビルド
Powershell
1docker build -t nodeiis .
Dockerコンテナの立ち上げ
Poweshell
1docker run -it nodeiis powershell
試したこと
▼ホストPC側で上記インストールを再現
結果:インストール成功
▼Scoopのインストール
結果:上記と同じエラーが発生
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
補足情報(FW/ツールのバージョンなど)
ホスト環境
- windows10
- Docker for Windows (Windowsコンテナ)
あなたの回答
tips
プレビュー