Windows上安装Docker
How to compile Docker on Windows
After taking on my new role at the Azure Linux Team, my first assignment was to get the Docker command line interface working on Windows. This is an important piece in bringing Docker into the Windows ecosystem and part of our partnership with Docker.
Today, I am proud to announce that the first piece of Windows code is now merged into Docker, which means you can now compile the Docker client on Windows!
Before going any further, I would like to clarify several things:
Clarifications
-
At this point, the merged code is only the first step in getting it compiling and (barely) working on Windows. We have a set of known bugs (see PR description), which we are looking forward to fix and I am pretty sure there are more bugs beyond that. Making something designed for UNIX work on Windows seamlessly is not a trivial task. In the upcoming days, I will be focusing on resolving those bugs. We are also looking forward to seeing your contributions to make Docker’s Windows support better.
-
Also, please note that this tutorial is not about running the Docker daemon on Windows or running Windows containers on Docker. None of these are possible today. This is just about getting client code compiled on Windows.
-
I will not be talking about how the porting work was done, that will be topic of another blog post here on my blog, again. Stay tuned for that one!
-
Please note that the docker.exe you are about to build is not a supported distribution by Microsoft or Docker. Please use it at your own risk. A more stable version of the Docker Windows CLI will be shipped later.
Step 1: Install Go
Download the Go MSI Installer from golang.org. This installation will add the go
program to your PATH environment variable and you should be able to run the go
command in cmd.exe
. If that does not work, you may need a restart.
Step 2: Check out the code
Assuming you have Git installed on your system, you need to clone thedocker/docker repository locally:
git clone https://github.com/docker/docker.git c:\gopath\src\github.com\docker\docker
Step 3: Compile!
The rest is just as simple. Run cmd.exe
and run the following commands in order:
set GOPATH=c:\gopath;c:\gopath\src\github.com\docker\docker\vendor set DOCKER_CLIENTONLY=1 cd c:\gopath\src\github.com\docker\docker\docker go build -v
If all goes well, you will end up with a lovely docker.exe
on the directory you are at!
(If you happen to run in problems about emulating TTY (linux terminal) in cmd.exe, you need to use ConEmu or install ANSICON. Please see the pull request description for detailed info.)
Summary
This is just an intro to building the Docker CLI for Windows. Normally, these binaries are built in a Linux environment, inside a Docker container (yes, Go is crazy like that, it can cross compile Windows binaries on Linux)! However, for demonstration purposes we are detailing the procedure for building these Windows binaries on its own turf.
In the meantime, you can use this tutorial to build Docker on your Windows machine to test the changes. We are looking forward to your contributions on making the Docker’s Windows support even better!
If you happen to find a bug, please open an issue on [Docker repo] and mention me cc: @ahmetalpbalkan
in the description.
I would like to acknowledge help of the Docker developer community on getting this work reviewed and merged to Docker. We are looking forward to make it more stable and shippable soon!
There is some Windows code now living in Docker!
(This article has appeared on Azure Blog, Docker Weekly, InfoQ, The Register.)
If you like to watch a step-by-step video of this tutorial, there’s one in German by Joern Boeger here.

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Virtualbox 安装CoreOS 学习使用Docker
1,安装virtualbox 首先你需要有一个virtualbox,才能跑CoreOS。 CoreOS更新的很快,找了半天,虽然官方的文档没有更新,但是镜像已经都是正式版本的了。 直接下载virtualbox的虚拟机文件就行。 2,下载virtualbox镜像 地址已经更新: http://stable.release.core-os.net/amd64-usr/current/ 然后导入virtualbox的虚拟机就行了。 3,启动CoreOS
- 下一篇
ceph伦理概念
Preface:CEPH: THE FUTURE OF STORAGE(未来存储) Ceph was made possible by a global community of passionate storage engineers and researchers(存储工程师及研究员); Ceph is a unified,distributed object store(分布式对象存储) and file system(FS文件系统) designed to provide excellent(出色性能) performance, reliability and scalability Ceph is open source and freely-available, and it always will be <2,> http://www.sebastien-han.fr/blog/2014/11/03/openstack-glance-disable-cache-management-while-using-ceph-rbd/ OpenStack Glance...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Hadoop3单机部署,实现最简伪集群
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- CentOS7编译安装Gcc9.2.0,解决mysql等软件编译问题
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- SpringBoot2整合Redis,开启缓存,提高访问速度
- Windows10,CentOS7,CentOS8安装Nodejs环境
- MySQL8.0.19开启GTID主从同步CentOS8
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- Eclipse初始化配置,告别卡顿、闪退、编译时间过长
- 设置Eclipse缩进为4个空格,增强代码规范