win10 docker安裝
docker安裝
1)bios開啟虛擬化
開機(jī)按F2 進(jìn)入bios后,按F7進(jìn)入高級(jí)設(shè)置
advanced CPU設(shè)置下:開啟intel 虛擬化技術(shù)
advanced SA設(shè)置下:開啟VT-d
2)系統(tǒng)中開啟Hyper-V,參考
https://www.runoob.com/docker/windows-docker-install.html
可能使用到的命令
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
bcdedit /set hypervisorlaunchtype auto
?
3)安裝 Docker Desktop for Windows即可
下載1(推薦)、Docker Desktop 官方下載地址:?https://hub.docker.com/editions/community/docker-ce-desktop-windows
注意:此方法僅適用于 Windows 10 操作系統(tǒng)專業(yè)版、企業(yè)版、教育版和部分家庭版!
下載2、點(diǎn)擊?Get started with Docker Desktop,并下載 Windows 的版本,如果你還沒有登錄,會(huì)要求注冊(cè)登錄:
4)安裝后打開docker,如果提示wsl安裝問題
dism.exe /online /enable-feature?/featurename:Microsoft-Windows-Subsystem-Linux?/all /norestart
dism.exe /online /enable-feature?/featurename:VirtualMachinePlatform /all /norestart
安裝完記得重啟
部署案例
1. 創(chuàng)建網(wǎng)絡(luò):執(zhí)行 `docker network create --driver bridge xxx`
2. 創(chuàng)建 jfrog API Key:登錄?https://jfrog.xxxxx.com/?,點(diǎn)擊右上角頭像 -> edit profie -> 生成并復(fù)制 API Key
登陸后獲取
3. 登錄鏡像倉庫:行執(zhí) `docker login?https://jfrog.xxxxx.com`,Username 使用自己的 jfrog 郵箱,Password 使用上一步申請(qǐng)的 API Key
4. 構(gòu)建容器:在 docker-compose.yml 同級(jí)目錄執(zhí)行 `docker-compose up -d --build`
過程時(shí)間比較就,要耐心等待
5、docker exec -it xx bash 進(jìn)入docker
?
進(jìn)入docker
打開后,根據(jù)提示,dev Environments配置后,根據(jù)提示會(huì)安裝git、Visual studio Code、Visual Studio Code Remote Containers Extension
docker ps -a 查看運(yùn)行的容器id
docker exec -it xx bash 進(jìn)入docker即可
docker中無法使用vi命令
mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb?http://mirrors.163.com/debian/?jessie main non-free contrib" >> /etc/apt/sources.list
echo "deb?http://mirrors.163.com/debian/?jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
echo "deb-src?http://mirrors.163.com/debian/?jessie main non-free contrib" >>/etc/apt/sources.list
echo "deb-src?http://mirrors.163.com/debian/?jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
#更新安裝源
apt-get update?
apt-get install vim
?
其他命令
After opening, follow the prompts,dev Environments configuration ,Install? git、Visual studio Code、Visual Studio Code Remote Containers Extension
docker ps -a? ?#View the running container ID
docker exec -it xx bash? ? # enter docker
exit? #exit docker
docker stop xx #close docker
docker start xx? # start docker
docker-compose ps
docker-compose logs -f -t --tail=100 servicenamexxx
鏈接:https://www.dianjilingqu.com/533916.html