欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

在Windows系统下安装docker窗口的配置过程

程序员文章站 2022-10-12 14:29:11
前言 目前对docker支持最好的是ubuntu系统,docker不支持在windows上运行,必须借助docker-machine。docker提供了toolbox用于...

前言

目前对docker支持最好的是ubuntu系统,docker不支持在windows上运行,必须借助docker-machine。docker提供了toolbox用于在windows和mac平台安装docker。

工具箱包括:

      docker machine

      docker engine

      kitematic

      docker命令行运行环境

      oracle vm virtualbox

安装之前需要检查bios中虚拟化的设置是否已打开,

1、下载安装文件

https://www.docker.com/toolbox

2、双击安装文件进行安装

3、运行docker run hello-world

运行时出现下面的问题

post http://127.0.0.1:2375/v1.20/containers/create: dial tcp 127.0.0.1:2375: connectex tcp: no connection could be made because the target machine actively refused it..
 * are you trying to connect to a tls-enabled daemon without tls?
 * is your docker daemon up and running?

如下解决:

docker-machine regenerate-certs default
docker-machine restart default

显示环境变量:

 $ docker-machine env default --shell sh
  export docker_tls_verify="1"
  export docker_host="tcp://192.168.99.100:2376"
  export docker_cert_path="c:\users\apex\.docker\machine\machines\default"
  export docker_machine_name="default"
  # run this command to configure your shell:
  # eval "$(e:\04_program files\docker_toolbox\docker toolbox\docker-machine.exe env default)"

设置环境变量:

eval "$(docker-machine env default --shell sh)"

再次运行:

$ docker run hello-world
unable to find image 'hello-world:latest' locally
pulling repository docker.io/library/hello-world
af340544ed62: pulling image (latest) from docker.io/library/hello-world
af340544ed62: pulling image (latest) from docker.io/library/hello-world, endpoint: https://registry-1.docker.io/v1/
af340544ed62: pulling dependent layers
535020c3e8ad: pulling metadata
535020c3e8ad: pulling fs layer
535020c3e8ad: download complete
af340544ed62: pulling metadata
af340544ed62: pulling fs layer
af340544ed62: download complete
af340544ed62: download complete
status: downloaded newer image for hello-world:latest
hello from docker.
this message shows that your installation appears to be working correctly.
to generate this message, docker took the following steps:
 1. the docker client contacted the docker daemon.
 2. the docker daemon pulled the "hello-world" image from the docker hub.
 3. the docker daemon created a new container from that image which runs the
 executable that produces the output you are currently reading.
 4. the docker daemon streamed that output to the docker client, which sent it
 to your terminal.
to try something more ambitious, you can run an ubuntu container with:
 $ docker run -it ubuntu bash
share images, automate workflows, and more with a free docker hub account:
 https://hub.docker.com
for more examples and ideas, visit:
 https://docs.docker.com/userguide/

配置加速器:

docker-machine ssh default
sudo sed -i "s|extra_args='|extra_args='--registry-mirror=http://efa65984.m.daocloud.io |g" /var/lib/boot2docker/profile
exit
docker-machine restart default

注意

docker用户的密码是tcuser

可用于winscp传输文件

总结

以上就是在windows系统上安装docker窗口的配置过程,文中给出了详细的步骤介绍,希望对大家的学习或者工作带来一定的帮助,如果有疑问大家可以留言交流。