屁話很少說,直接開始重要內容linux
Docker for Windows 支持 64 位版本的 Windows 10 Pro,且必須開啓 Hyper-V。nginx
連接:https://pan.baidu.com/s/1Lkcaz7rMyepsWDIxXTb1zw 提取碼:xfwu 複製這段內容後打開百度網盤手機App,操做更方便哦
下載好以後雙擊 Docker for Windows Installer.exe 開始安裝。git
下載好以後雙擊 Docker.dmg 開始安裝。github
推薦安裝方式:阿里雲docker
# install docker curl -fsSL https://get.docker.com | sudo bash -s docker --mirror Aliyun rm -rf get-docker.sh # start docker service sudo systemctl enable docker sudo systemctl restart docker # 配置鏡像加速器 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://dt77flbr.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
docker ps -a
docker run ....
舉例:json
docker run -d --name ngx -p 8808:80 nginx
docker rm 容器ID
- window10 專業版 (不須要,已經集成) - linux ``` #下載docker-compose sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose #給docker-compose執行權限 sudo chmod +x /usr/local/bin/docker-compose #測試安裝是否成功,成功的話打印出docker-compose的版本信息 docker-compose --version ```
docker-compose up -d
docker-compose restart
docker-compose down
docker-compose build