Docker - 在Windows7中安装Docker
2017-06-06 21:49
369 查看
安装docker
1 - Virtualization SupportCheck 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:~#
a707
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
相关文章推荐
- windows7 安装docker
- windows7下安装DockerToolbox后VBoxmanage.exe报错
- windows7 安装docker
- Docker认识、安装及使用(windows7)
- Docker - 在Windows7中安装Docker
- Windows7 安装Docker
- windows7安装 docker可能出现的问题及解决方案
- 安装Windows7之后出现“Bootmgr is missing”的解决办法
- 安装windows7 7100RC体会和系统设置、优化小技巧
- 追寻Windows7---简单的安装过程
- 在Windows7 上安装WSS 3.0
- 无光盘,在C盘XP等系统下全新安装windows7。
- Windows7 Windows XP Mode安装尝鲜(失败) 推荐
- Windows7 支付宝证书安装方法
- 将windows7安装到映像文件方法总结
- 移动硬盘安装Windows7实例
- 安装64位操作系统Windows7
- Windows7下安装程序出现NSIS ERROR的解决办法
- 我的Windows7安装记录
- windows7 RC-X86安装与使用