安装docker

1 - Virtualization Support

Check whether virtualization support is enabled at BIOS via HAV detection tool

2 - Docker Toolbox

DockerToolbox-1.12.6

Included Components:

    docker 1.12.6
docker-machine 0.8.2
docker-compose 1.9.0
Kitematic 0.12.0
Boot2Docker ISO 1.12.6
VirtualBox 5.1.10

3 - Run Docker Quickstart Terminal

Download Boot2Docker.iso manually from internet and store iso file at:C:\Users\<user>\.docker\machine\cache

Run "Docker Quickstart Terminal".



                        ##         .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/ docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com Start interactive shell guowli@5CG450158J MINGW64 ~
$ docker version
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Wed Jan 11 00:23:16 2017
OS/Arch: windows/amd64 Server:
Version: 1.13.1
API version: 1.26
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 08:47:51 2017
OS/Arch: linux/amd64 guowli@5CG450158J MINGW64 ~
$
guowli@5CG450158J MINGW64 ~
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.13.1 guowli@5CG450158J MINGW64 ~
$

docker-machine常用命令

docker-machine help # 查看帮助信息

  active                # Print which machine is active
config # Print the connection config for machine
create # Create a machine
env # Display the commands to set up the environment for the Docker client
inspect # Inspect information about a machine
ip # Get the IP address of a machine
kill # Kill a machine
ls # List machines
provision # Re-provision existing machines
regenerate-certs # Regenerate TLS Certificates for a machine
restart # Restart a machine
rm # Remove a machine
ssh # Log into or run a command on a machine with SSH.
scp # Copy files between machines
start # Start a machine
status # Get the status of a machine
stop # Stop a machine
upgrade # Upgrade a machine to the latest version of Docker
url # Get the URL of a machine
version # Show the Docker Machine version or a machine docker version
help # Shows a list of commands or help for one command

Run 'docker-machine COMMAND --help' for more information on a command.

通过SSH方式登录boot2docker

一般情况下,boot2docker的默认地址为192.168.99.100,SSH端口:22,默认的用户名和密码:docker/tcuser

具体信息可通过Docker Quickstart Terminal执行相关命令查看和ssh登录。

但Docker Quickstart Terminal的复制粘贴较为繁琐,建议使用第三方ssh登录工具。

guowli@5CG450158J MINGW64 ~
$ docker-machine ip
192.168.99.100 guowli@5CG450158J MINGW64 ~
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.13.1 guowli@5CG450158J MINGW64 ~
$ docker-machine ssh default
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
_ _ ____ _ _
| |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.13.1, build HEAD : b7f6033 - Wed Feb 8 20:31:48 UTC 2017
Docker version 1.13.1, build 092cba3
docker@default:~$

在boot2docker中切换root用户

可以通过sudo -i方式切换成root用户

参考信息:http://stackoverflow.com/questions/32646952/docker-machine-boot2docker-root-password

$ docker-machine ssh default
docker@default:~$ sudo -i
Boot2Docker version 1.13.1, build HEAD : b7f6033 - Wed Feb 8 20:31:48 UTC 2017
Docker version 1.13.1, build 092cba3
root@default:

在boot2docker中设置代理

因网络访问限制导致无法拉取镜像:

$ docker run hello-world
Unable to find image 'hello-world:latest' locally
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

处理方法:在boot2docker的/var/lib/boot2docker/profile文件添加相应代理,然后重启docker。

例如:

$ docker-machine ssh default
docker@default:~$ sudo -i
Boot2Docker version 1.13.1, build HEAD : b7f6033 - Wed Feb 8 20:31:48 UTC 2017
Docker version 1.13.1, build 092cba3
root@default:~# vi /var/lib/boot2docker/profile
root@default:~# cat /var/lib/boot2docker/profile | tail -n 3
export HTTP_PROXY=http://10.144.1.10:8080
export HTTPS_PROXY=https://10.144.1.10:8080
export NO_PROXY=localhost,127.0.0.1,.nsn-net.net,.ext.net.nokia.com,.inside.nsn.com,.int.net.nokia.com,.inside.nokiasiemensnetworks.com
root@default:~#
root@default:~# exit
docker@default:~$ exit

Docker - 在Windows7中安装Docker的更多相关文章

  1. Docker(一) - CentOS7中安装Docker - (视频教程)

    Docker的使用越来越多,安装也相对简单.本文使用视频的方式展示在CentOS7系统中安装Docker,本文更适合于准备入门学习Docker的童靴. 以下视频,请带上耳机开始聆听 (双击全屏播放) ...

  2. Docker - 在CentOS7中安装Docker

    在CentOS 7中安装Docker 1-确认系统信息 # cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # uname - ...

  3. Docker - 在CentOS 7中安装Docker

    1-确认系统信息 # cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # uname -a Linux CentOS-7 3. ...

  4. ubuntu中安装Docker

    系统要求: 必须时64位的系统,内核最低要求是3.10 查看系统内核: $ uname -r 3.11.0-15-generic 获取最新版本打Docker: $ wget -qO- https:// ...

  5. 在deepin中安装docker

    用往常方法安装 一般在Linux中安装docker的时候都会使用这条命令 wget -qO- https://get.docker.com/ | sh 而在deepin这么做缺不行 打开网址即可发现支 ...

  6. 在Ubuntu中安装Docker和docker的使用

    1.在Ubuntu中安装Docker 更新ubuntu的apt源索引 sudo apt-get update 安装包允许apt通过HTTPS使用仓库 sudo apt-get install \ ap ...

  7. Docker 01 - CentOS 7 中安装 Docker 的详细步骤

    目录 1 初识 Docker 1.1 Docker 原理简介 1.2 Docker 核心概念 2 安装 Docker 2.1 查看系统内核版本 2.2 更新 yum 包 2.3 安装软件包 2.4 向 ...

  8. mac下idea中安装docker插件

    idea中安装docker插件: 点击Intellij IDEA->Preferences...->Plugins->Browse repositories...如下: 点击Inst ...

  9. Arch系Linux中安装Docker

    Arch系Linux中安装Docker 1. 下载最新版docker $ sudo pacman -Syu docker 2. 免sudo执行docker $ sudo gpasswd -a ${US ...

随机推荐

  1. cudaMemcpy与cudaMemcpyAsync的区别

    转载请注明来源:http://www.cnblogs.com/shrimp-can/p/5231857.html 简单可以理解为:cudaMemcpy是同步的,而cudaMemcpyAsync是异步的 ...

  2. c++学习笔记之继承篇

    title: c++学习笔记之继承篇 date: 2017-03-26 16:36:33 tags: [c++,继承,public,virtual,private,protected] categor ...

  3. (转)KMP算法实现。超级赞!见过的最容易理解的

    网上有很多讲解KMP算法的博客,我就不浪费时间再写一份了.直接推荐一个当初我入门时看的博客吧:http://www.cnblogs.com/yjiyjige/p/3263858.html这位同学用详细 ...

  4. JavaScript贪食蛇游戏制作详解

    之前闲时开发过一个简单的网页版贪食蛇游戏程序,现在把程序的实现思路写下来,供有兴趣同学参考阅读. 代码的实现比较简单,整个程序由三个类,一组常量和一些游戏逻辑以外的初始化和控制代码组成,总共400多行 ...

  5. Servlet小总结(转)

    一,什么是Servlet? Servlet是一个Java编写的程序,此程序是基于Http协议的,在服务器端运行的(如tomcat), 是按照Servlet规范编写的一个Java类. 二,Servlet ...

  6. 【C语言】判断三角形类型

    根据输入的三角形的三边判断三角形的类型,并输出其面积和类型. #include<stdio.h> #include<stdlib.h> #include<math.h&g ...

  7. React Native 导入原生Xcode项目总结与记录

    html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,bi ...

  8. js引用类型数组去重-对象标记法

    前言 Js数组去重已经有很多种实现方式:包括逐个检索对比(使用Array.property.indexOf),先排序后对比,使用hash表,利用ES6中的Set()等.这些数组去重办法中速度最快的是h ...

  9. EM最大期望算法-走读

    打算抽时间走读一些算法,尽量通俗的记录下面,希望帮助需要的同学.   overview: 基本思想:      通过初始化参数P1,P2,推断出隐变量Z的概率分布(E步):      通过隐变量Z的概 ...

  10. package(1):tm

    tm包是R语言中为文本挖掘提供综合性处理的package,进行操作前载入tm包,vignette命令可以让你得到相关的文档说明.使用默认安装的R平台是不带tm  package的,在安装的过程中,它会 ...