System Requirements:
Windows 10 64bit: Pro, Enterprise or Education (Build 15063 or later).
Virtualization is enabled in BIOS. Typically, virtualization is enabled by default. This is different from having Hyper-V enabled. For more detail see Virtualization must be enabled in Troubleshooting.
CPU SLAT-capable feature.
At least 4GB of RAM.
docker 下載? https://download.docker.com/mac/stable/37199/Docker.dmg(mac 版)
控制面板\所有控制面板項(xiàng)\程序和功能\啟用或關(guān)閉Windows功能\Windows功能 勾選Hyper-V相關(guān)選項(xiàng)
重啟猎物,進(jìn)入BIOS,打開(kāi)Virtualization
教程 get start:https://docs.docker.com/docker-for-windows/
添加國(guó)內(nèi)鏡像务嫡,個(gè)人使用的中科大:https://docker.mirrors.ustc.edu.cn
測(cè)試可用性:docker --version,docker run hello-world
跑nginx:?docker run --detach --publish 80:80 --name webserver nginx
打開(kāi)localhost
Docker命令:
docker --version
列出鏡像:docker image ls
docker信息:docker info
鏡像下載:docker image pull
測(cè)試docker:docker run hello-word
所有容器:docker container ls --all
創(chuàng)建并啟動(dòng)容器:docker run --detach --publish 80:80 --name webserver nignx
停止運(yùn)行的容器:docker container stop webserver
刪除已有容器:docker rm beautiful_brown
啟動(dòng)已有容器:docker start webserver
存活的容器:docker ps
進(jìn)入容器:docker exec -it webserver /bin/bash
退出:exit
查找本地鏡像:docker images redis
查找鏡像庫(kù):docker search redis
啟動(dòng)redis:docker run -p 6379:6379 -v ~/docker/redis/data:/data --name redisServer redis --appendonly yes
docker run \
-p 6379:6379 \ # 端口映射 宿主機(jī):容器
-v /docker/redis/data:/data:rw \ # 映射數(shù)據(jù)目錄 rw 為讀寫(xiě)
-v /docker/redis/conf/redis.conf:/etc/redis/redis.conf:ro \ # 掛載配置文件 ro 為readonly
--privileged=true\ # 給與一些權(quán)限
--name myredis \ # 給容器起個(gè)名字
-d docker.io/redis:latest redis-server /etc/redis/redis.conf # deamon 運(yùn)行 服務(wù)使用指定的配置文件