Windows上安装docker

Windows上安装docker

首先配置Windows,打开虚拟化技术

在任务管理器 性能中查看CPU虚拟化是否打开。

  • 打开方式: 进入BIOS,找到Configuration选项或者Security选项,然后选择Virtualization,或者Intel Virtual Technology,将值设为Enable

安装docker的两种解决方案

64位 Windows 10 Pro/Enterprise/Education 则直接下载docker for windows

  • 该方案需设置: 控制面板 —> 程序 —> 启动或关闭Windows功能 —> 开启hyper-V虚拟

其它旧版系统,需下载docker toolbox 安装,docker toolbox使用virtualbox不能启用Hyper-V
(以下介绍docker toolbox方式安装)

安装后桌面图标

启动docker及相关配置

创建docker 名为default

  1. 配置boot2docker镜像,在c:\用户.docker\machine\cache
  2. 在virtualBox中执行命令
    • docker-machine.exe create --driver virtualbox --virtualbox-boot2docker-url=boot2docker.iso default
    • 创建名为default的docker
  3. 打开Docker Quickstart Terminal自动启动docker

docker镜像下载地址转换为国内阿里云镜像

  1. 在Docker Quickstart Terminal||powerShell中执行以下命令

    • docker-machine ssh [machine-name"docker名"] 进入VM bash

    • sudo sed -i “s|EXTRA_ARGS=’|EXTRA_ARGS=’–registry-mirror=https://qxzrbbld.mirror.aliyuncs.com(阿里云镜像地址) |g” /var/lib/boot2docker/profile

    • sudo vi /var/lib/boot2docker/profile

  2. 打开文件后在–label provider=virtualbox的下一行添加

    • –registry-mirror https://xxxxxxxx.mirror.aliyuncs.com1(“登录阿里云镜像服务免费获取自己的镜像加速地址”)

然后重启docker服务,三种方式:

  • sudo /etc/init.d/docker restart

  • 重启VM :exit 退出VM bash

  • 在Windows命令行中执行docker-machine restart

Docker on Windows by Elton Stoneman English | 14 July 2017 | ISBN: 1785281658 | 358 Pages | AZW3/EPUB/MOBI/PDF (conv) | 23.77 MB Key Features Start building applications as Docker images and running containers in a Windows production environment Design and implement distributed applications that run across multiple networked containers Build a full Continuous Deployment pipeline for a .NET Core application running on Windows Book Description Docker has become hugely popular because it offers benefits at all stages of software design and delivery. Until recently, it was impossible to use a Windows Server platform to host the Docker Engine without adding an additional layer of virtualization. Starting with Windows Server 2016, you are able to use Docker on Windows and take advantage to easily build, deploy, and run Windows Containers. From building and running simple images to designing and implementing distributed applications, this book will teach everything you need to know while using Docker on Windows. You will start by installing Docker on different versions of Windows and Windows Server, and run a simple container to verify that the setup is working correctly. You will see how to build Docker images with a Dockerfile for a simple website, and then run it on Windows. Moving on, we'll cover the practical usage of Docker and the tools in the Docker ecosystem, such as Docker Compose, Docker Trusted Registry, and Docker Swarm Mode. Then, you'll be able to apply that knowledge by building a full continuous deployment pipeline for a .NET Core application running on Windows. We'll also dive deep into some of the core features of Docker, such as networking and security. At the end of the book, you'll be guided through a business case that will help you practically implement Docker in a real-world scenario. What you will learn Understand how Docker works, build images, and run containers Run Docker on different versions of Windows, and on the cloud with Azure Des
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值