Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
srv.world/iis latest 88abadb6d8ac 2 minutes ago 5.26GB
mcr.microsoft.com/windows/servercore ltsc2025 f9fb7d5c26c9 7 days ago 5.14GB
# -p xxx:xxx で [ホスト側のポート:コンテナー側のポート] をマッピング
PS C:\Users\Administrator> docker run -t -d -p 8081:80 srv.world/iis cmd
f7d4c2a9066dd2ec273a58b388393fd7c232239dd4fd9de8c955015a73975098
PS C:\Users\Administrator> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f7d4c2a9066d srv.world/iis "cmd" 13 seconds ago Up 11 seconds 0.0.0.0:8081->80/tcp focused_kare
# テストページ作成
PS C:\Users\Administrator> docker exec f7d4c2a9066d powershell -c "Write-Output 'IIS on Docker Container' | Out-File -Encoding default C:\inetpub\wwwroot\index.html"
# アクセス確認
PS C:\Users\Administrator> curl.exe localhost:8081
IIS on Docker Container
|