[研究]Docker 20.10.9安裝 (Windows Server 2022)
2022-11-02
2023-03-25 更新
參考
準備 Windows 作業系統容器 | Microsoft Docs
https://docs.microsoft.com/zh-tw/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server
1.開啟提升權限的 PowerShell 工作階段,並且從 PowerShell 資源庫安裝 Docker-Microsoft PackageManagement 提供者。
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
如果系統提示您安裝 NuGet 提供者,請輸入 Y 以進行安裝。
2.使用 PackageManagement PowerShell 模組安裝最新版 Docker。
Install-Package -Name docker -ProviderName DockerMsftProvider
當 PowerShell 詢問是否要信任封裝來源 'DockerDefault' 時,輸入 A 以繼續安裝。
3.安裝完成後,重新啟動電腦。
Restart-Computer -Force
4.啟動docker
Start-Service Docker
Windows PowerShell 著作權(C) Microsoft Corporation。保留擁有權利。 安裝最新的 PowerShell 以取得新功能和改進功能!https://aka.ms/PSWindows PS C:\Users\Administrator> Install-Module -Name DockerMsftProvider -Repository PSGallery -Force 需要 NuGet 提供者才能繼續 PowerShellGet 需要 NuGet 提供者版本 '2.8.5.201' 或更新版本,才能與 NuGet 型存放庫互動。NuGet 提供者必須可從 'C:\Program Files\PackageManagement\ProviderAssemblies' 或 'C:\Users\Administrator\AppData\Local\PackageManagement\ProviderAssemblies' 存取。您也可以透過執行 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force' 來安裝 NuGet 提供者。是否要讓 PowerShellGet 立即安裝並匯入 NuGet 提供者? [Y] 是(Y) [N] 否(N) [S] 暫停(S) [?] 說明 (預設值為 "Y"): Enter PS C:\Users\Administrator> Install-Package -Name docker -ProviderName DockerMsftProvider 套件來自未標示為受信任的套件來源。 確定要安裝來自 'DockerDefault' 的軟體? [Y] 是(Y) [A] 全部皆是(A) [N] 否(N) [L] 全部皆否(L) [S] 暫停(S) [?] 說明 (預設值為 "N"): A 警告: A restart is required to enable the containers feature. Please restart your machine. Name Version Source Summary ---- ------- ------ ------- Docker 20.10.9 DockerDefault Contains Docker EE for use with Windows Server. PS C:\Users\Administrator> Restart-Computer -Force |
Windows PowerShell
著作權(C) Microsoft Corporation。保留擁有權利。
安裝最新的 PowerShell 以取得新功能和改進功能!https://aka.ms/PSWindows
PS C:\Users\Administrator> Start-Service Docker
|
PS C:\Users\Administrator> docker
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options:
--config string Location of client config files (default
"C:\\Users\\Administrator\\.docker")
-c, --context string Name of the context to use to connect to the
daemon (overrides DOCKER_HOST env var and
default context set with "docker context use")
-D, --debug Enable debug mode
-H, --host list Daemon socket(s) to connect to
-l, --log-level string Set the logging level
("debug"|"info"|"warn"|"error"|"fatal")
(default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default
"C:\\Users\\Administrator\\.docker\\ca.pem")
--tlscert string Path to TLS certificate file (default
"C:\\Users\\Administrator\\.docker\\cert.pem")
--tlskey string Path to TLS key file (default
"C:\\Users\\Administrator\\.docker\\key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
Management Commands:
app* Docker App (Docker Inc., v0.9.1-beta3)
builder Manage builds
cluster* Manage Mirantis Container Cloud clusters (Mirantis Inc., v1.9.0)
config Manage Docker configs
container Manage containers
context Manage contexts
image Manage images
manifest Manage Docker image manifests and manifest lists
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
registry* Manage Docker registries (Docker Inc., 0.1.0)
secret Manage Docker secrets
service Manage services
stack Manage Docker stacks
swarm Manage Swarm
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Commands:
attach Attach local standard input, output, and error streams to a running container
build Build an image from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List containers
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
To get more help with docker, check out our guides at https://docs.docker.com/go/guides/
PS C:\Users\Administrator> |
xxxxx
(完)
https://shaurong.blogspot.com/2022/11/docker-20109-windows-server-2022.html
https://shaurong.blogspot.com/2022/11/docker-411-rocky-linux-90.html
Docker Desktop for Mac and Windows | Docker
https://www.docker.com/products/docker-desktop
Docker 教學課程-第7部分:使用 Docker Compose | Microsoft Docs
https://docs.microsoft.com/zh-tw/visualstudio/docker/tutorials/use-docker-compose
HI 你好,請問我下 Install-Package -Name docker -ProviderName DockerMsftProvider 指令完,會出現下面問題,請問要如何排除
回覆刪除警告: 找不到 'C:\Users\ADMINI~1\AppData\Local\Temp\2\DockerMsftProvider\DockerDefault_DockerSearchIndex.json'
路徑,因為它不存在。
警告: 無法將引數繫結到 'downloadURL' 參數,因為它是個空字串。
警告: 在此物件上找不到屬性 'AbsoluteUri'。請確認該屬性存在。
警告: 在此物件上找不到屬性 'RequestMessage'。請確認該屬性存在。
Install-Package : 找不到任何符合所指定搜尋條件與套件名稱 'docker' 的項目。請嘗試執行 Get-PackageSource 以檢視所有可用的
已註冊套件來源。
位於 線路:1 字元:1
+ Install-Package -Name docker -ProviderName DockerMsftProvider
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
ception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage