Docker学习笔记-windows安装

专业版windows7以上系统 64bit
安装包下载
Index of Docker Toolbox

下载好的Docker Toolbox文件夹下的 boot2docker.iso 移动到 C:\Users\gzx01275258\.docker\machine\cache 防止启动下载过慢


开启系统H-v虚拟机
注:该虚拟机和其他虚拟机冲突安装其他VM需关闭
右键开始按钮>应用和功能>程序和功能>启动或关闭windows功能>选中Hyper-V>重启电脑

运行命令
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All


确认是否开启成功
任务管理器>性能>cpu>虚拟化属性是否已开启



启动问题记录
1.Error with pre-create check: "This computer is running Hyper-V. VirtualBox won't boot a 64bits VM when Hyper-V is activated. Either use Hyper-V as a driver, or disable the Hyper-V hypervisor. (To skip this check, use --virtualbox-no-vtx-check)"
Looks like something went wrong in step ´Checking if machine default exists´... Press any key to continue...

修改 start.sh启动文件中 “Checking if machine $VM exists” 部分为
STEP="Checking if machine $VM exists"
if [ $VM_EXISTS_CODE -eq 1 ]; then
"${DOCKER_MACHINE}" rm -f "${VM}" &> /dev/null || :
rm -rf ~/.docker/machine/machines/"${VM}"
#set proxy variables if they exists
if [ "${HTTP_PROXY}" ]; then
PROXY_ENV="$PROXY_ENV --engine-env HTTP_PROXY=$HTTP_PROXY"
fi
if [ "${HTTPS_PROXY}" ]; then
PROXY_ENV="$PROXY_ENV --engine-env HTTPS_PROXY=$HTTPS_PROXY"
fi
if [ "${NO_PROXY}" ]; then
PROXY_ENV="$PROXY_ENV --engine-env NO_PROXY=$NO_PROXY"
fi
"${DOCKER_MACHINE}" create -d virtualbox --virtualbox-no-vtx-check $PROXY_ENV "${VM}"
fi


2. A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."

系统host文件添加 host路径:C:\Windows\System32\drivers\etc
54.231.98.184 github-com.s3.amazonaws.com

3.Error creating machine: Error in driver during machine creation: Unable to start the VM: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe startvm default --type headless failed:
VBoxManage.exe: error: Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole

VirtualBox版本升级6

配置镜像加速器


1.在docker toolbox执行下面的命令进入VM bash
docker-machine ssh default
2.执行如下命令
sudo sed -i "s|EXTRA_ARGS='|EXTRA_ARGS='--registry-mirror=https://tos7iu9x.mirror.aliyuncs.com |g" /var/lib/boot2docker/profile
3.退出服务器容器命令
exit
4.重启虚拟机
docker-machine restart default
5.进入default主机后再次执行docker info 命令,可查看到 Registry Mirrors所配置的镜像地址,表示配置成功
docker info

你可能感兴趣的:(笔记,docker)