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

 更新时间:2016年10月17日 17:18:55   投稿:daisy  
相信大家都知道Docker有很多种安装的选择,其中支持最好的是Ubuntu系统。而且docker如果想在windows上运行必须借助docker-machine,这篇文章将给大家详细的介绍在Windows系统上安装docker窗口的配置过程,有需要的朋友们可以参考借鉴。

前言

目前对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窗口的配置过程,文中给出了详细的步骤介绍,希望对大家的学习或者工作带来一定的帮助,如果有疑问大家可以留言交流。

相关文章

  • Jenkins+Docker 一键自动化部署 SpringBoot 项目的详细步骤

    Jenkins+Docker 一键自动化部署 SpringBoot 项目的详细步骤

    这篇文章主要介绍了Jenkins+Docker 一键自动化部署SpringBoot 项目,本文章实现最简单全面的Jenkins+docker+springboot 一键自动部署项目,步骤齐全,少走坑路,需要的朋友可以参考下
    2022-08-08
  • Dockerfile文件详解

    Dockerfile文件详解

    Dockerfile是一个用来构建镜像的文本文件,文本内容包含一条条构建镜像所需的指令和说明。本文详细讲解了Dockerfile文件,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2022-06-06
  • Docker可视化管理工具DockerUI的使用

    Docker可视化管理工具DockerUI的使用

    DockerUI是一个易用且轻量化的 Docker 管理工具,本文主要介绍了Docker可视化管理工具DockerUI的使用,具有一定的参考价值,感兴趣的可以了解一下
    2024-08-08
  • Docker的彻底删除与重新安装完整步骤(ubuntu22.04)

    Docker的彻底删除与重新安装完整步骤(ubuntu22.04)

    Docker是一种轻量级的容器化平台,可以帮助开发人员将应用程序及其依赖项打包成一个可移植的容器,这篇文章主要介绍了Docker的彻底删除与重新安装完整步骤的相关资料,文中通过图文介绍的非常详细,需要的朋友可以参考下
    2025-03-03
  • Docker搭建私有GitLab服务的方法

    Docker搭建私有GitLab服务的方法

    本文主要介绍了Docker搭建私有GitLab服务的方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2022-06-06
  • 简述Docker安装Tomcat镜像并部署web项目

    简述Docker安装Tomcat镜像并部署web项目

    这篇文章主要介绍了简述Docker安装Tomcat镜像并部署web项目,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-10-10
  • 详解docker容器分配静态IP

    详解docker容器分配静态IP

    这篇文章主要介绍了详解docker容器分配静态IP,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-01-01
  • Docker容器内应用服务自启动的方法示例

    Docker容器内应用服务自启动的方法示例

    这篇文章主要介绍了Docker容器内应用服务自启动的方法示例,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2018-09-09
  • Docker之限制容器的资源使用过程

    Docker之限制容器的资源使用过程

    这篇文章主要介绍了Docker之限制容器的资源使用过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
    2024-07-07
  • Docker教程:使用容器(简单示例)

    Docker教程:使用容器(简单示例)

    今天小编就为大家分享一篇关于Docker教程:使用容器(简单示例),小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧
    2018-10-10

最新评论