从windows CMD 命令行(CMD promp)运行Docker
英文原帖
Running Docker from Windows CMD prompt
https://medium.com/@neil.avery_68603/running-docker-from-windows-cmd-prompt-6540daebedad
#### 打开CMD窗口,尝试运行docker命令,检查docker环境是否可用 `docker run hello-world`
C:\Users\NovakZheng>docker run hello-world
docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.31/c
ontainers/create: open //./pipe/docker_engine: The system cannot find the file s
pecified. In the default daemon configuration on Windows, the docker client must
be run elevated to connect. This error may also indicate that the docker daemon
is not running.
See 'docker run --help'.
尝试其它docker命令, `docker ps`
C:\Users\NovakZheng>docker ps
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.31/containers
/json: open //./pipe/docker_engine: The system cannot find the file specified. I
n the default daemon configuration on Windows, the docker client must be run ele
vated to connect. This error may also indicate that the docker daemon is not run
ning.
用指令建立docker环境 docker-machine env
C:\Users\NovakZheng>docker-machine env default
SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.99.100:2376
SET DOCKER_CERT_PATH=C:\Users\NovakZheng\.docker\machine\machines\default
SET DOCKER_MACHINE_NAME=default
SET COMPOSE_CONVERT_WINDOWS_PATHS=true
REM Run this command to configure your shell:
REM @FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i
再运行上文中REM后面的指令来configure your shell (CMD prompt)
C:\Users\NovakZheng>@FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i
#### 尝试docker指令,检验是否能够执行 , `docker run hello-world`
C:\Users\NovakZheng>docker run hello-world
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 ID:
https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
C:\Users\NovakZheng>docker ps
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
以上输出,证明docker环境已经可以在CMD下面运行了。
从windows CMD 命令行(CMD promp)运行Docker的更多相关文章
- windows更改命令行cmd的字体为conlosas+微软雅黑
windows更改命令行cmd的字体为conlosas+微软雅黑 动力来源于对美孜孜不倦的追求~ 下载conlosas+微软雅黑字体 谢谢支持. 将解压后的YaHei.Consolas.1.12.tt ...
- cmd命令行编译和运行java程序报错 NoClassDefFoundError
首先,当在运行java程序出现这个错误时,首先考虑是不是路径或者未指定正确的包名,例如当运行下面这个文件时: package cn.wgh.socket; public class HelloWorl ...
- Atitit.运行cmd 命令行 php
Atitit.运行cmd 命令行 php 1. 运行cmd 命令行,调用系统命令的基础 1 1.1. 实际运行模式 1 1.2. 空格的问题 1 1.3. 中文路径的问题.程序文件读取编码设置 1 1 ...
- Windows下的cmd命令行中设置环境编码
我们都知道,Windows下的cmd命令行默认编码是Windows系统的编码,就是ANSI编码或者说是GBK编码的,这样我们编写的很多应用比如php编写utf-8编码的应用在命令行下面运行时都会出现乱 ...
- 在windows下使用cmd命令行对java文件进行编译和执行
windows下利用cmd命令行可以调用jdk里的javac.exe和java.exe对java文件进行编译和执行,前提是jdk已成功安装并正确配置相关环境变量 相关配置链接:java基础学习总结—— ...
- Windows 如何在cmd命令行中查看、修改、删除与添加环境变量
转自:http://www.cnblogs.com/saptechnique/archive/2013/02/17/2914222.html 首先明确一点: 所有的在cmd命令行下对环境变量的修改只对 ...
- Windows:将cmd命令行添加到右键中方法
win10中将命令行cmd添加到右键的方法 Windows cmd 右键 win10 命令行 最近在学python,所以会用到很多库文件,但是有的库文件需要下载whl文件再通过cmd进行安装,所以每次 ...
- 【转】Python实现修改Windows CMD命令行输出颜色(完全解析)
用Python写命令行程序的时候,单一的输出颜色太单调.其实我们可以加些色彩,比如用红色表示警告,绿色表示结果正常等.网上也有几篇类似的帖子,但是没有把问题讲清楚,贴的代码也不是太清晰.这里,对Win ...
- Windows如何在cmd命令行中查看、修改、删除与添加、设置环境变量
首先明确一点: 所有的在cmd命令行下对环境变量的修改只对当前窗口有效,不是永久性的修改.也就是说当关闭此cmd命令行窗口后,将不再起作用.永久性修改环境变量的方法有两种:一种是直接修改注册表(此种方 ...
随机推荐
- hdu2067 小兔的棋盘
小兔的棋盘 时间限制:1000/1000 MS(Java / Others)内存限制:32768/32768 K(Java / Others)总提交内容:13029接受的提交内容:6517 问题描述 ...
- Linux下如何使用Wireshark进行抓包
1. 安装wireshark Ubuntu 14.04.3 缺省安装后, 不包含Wireshark抓包软件,因此首先需要手工进行Wireshark的安装: apt-get update apt ...
- layim和Gatewayworker组合的实时通讯
今天是第二次重新开发使用layim和Gatewayworker,但是由于第一次没有写文档,导致这一次就跟第一次一样,一头雾水,重新开始看文档研究,导致遇到一个瓶颈,怎么都过不去.所以,以这篇文章开始, ...
- HandlerInterceptor拦截器使用总结
简介 SpringMVC的处理器拦截器,类似于Servlet开发中的过滤器Filter,用于对请求进行拦截和处理. 常见应用场景 1.权限检查:如检测请求是否具有登录权限,如果没有直接返回到登陆页面. ...
- Linux虚拟机无法通过宿主机上网
解决方法 1.Windows: 确保相关服务已经启动 2.Linux: 确保相关服务已经启动 1) 确认Linux的IP地址和Windows在同一个网段: 若Windows给虚拟机分配的IP地址如下: ...
- HTML5 video 连续播放视频
HTML Video标签属性 html页面代码 <video height="2160" id="playVideo" width="3840& ...
- iTween Scale缩放
void Start () { //键值对儿的形式保存iTween所用到的参数 Hashtable args = new Hashtable(); //放大的倍数 args.Add(, , )); / ...
- BuildAssetBundles文件打包
BuildAssetBundles文件打包: public class BuildAssetBundlesTest : Editor { //定义打包文件路径 public static string ...
- animition动画的加入
很多时候我们把PopupWindow用作自定义的菜单,需要一个从底部向上弹出的效果,这就需要为PopupWindow添加动画. 在工程res下新建anim文件夹,在anim文件夹先新建两个xml文件 ...
- HDU 4342——History repeat itself——————【数学规律】
History repeat itself Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. O ...