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 BlogDocker
Weekly
InfoQThe Register.)

If you like to watch a step-by-step video of this tutorial, there’s one in German by Joern Boeger here.

时间: 2024-11-03 04:15:42

Windows上安装Docker的相关文章

在Windows系统上安装Docker的教程

  大家好,今天我们来了解一下 Windows 操作系统中的 Docker 以及在其中安装 Docker Windows 客户端的知识.Docker 引擎使用 Linux 特有的内核特性,因此不能通过 Windows 内核运行,所以,(在 Windows 上)Docker 引擎创建了一个小的虚拟系统运行 Linux 并利用它的资源和内核.这样,Windows Docker 客户端就可以用这个虚拟的 Docker 引擎来构建.运行以及管理 Docker 容器.有个叫 Boot2Docker 的团队

《循序渐进学Docker》——第2章 初步体验 Docker 2.1 Windows下安装Docker

第2章 初步体验Docker 上一章概括性地介绍了Docker的发展历史.组织结构.功能特性和使用场景等方面的内容.本章主要从实践的角度,介绍如何在本地搭建一个Docker运行环境. 由于大多数用户的个人电脑用的都是Windows系统,所以我们就先来讲讲在Windows环境下如何安装和运行Docker. 2.1 Windows下安装Docker 为了运行Docker,你的电脑必须安装64位Windows 7及以上版本的系统(包含Windows 8/8.1和Windows 10).另外,你要确保C

《第一本Docker书(修订版)》——2.5 在Windows中安装Docker Toolbox

2.5 在Windows中安装Docker Toolbox 如果使用的是Microsoft Windows系统,也可以使用Docker Toolbox工具快速上手Docker.Docker Toolbox是一个Docker组件的集合,还包括一个极小的虚拟机,在Windows宿主机上安装了一个支持命令行工具,并提供了一个Docker环境. Docker Toolbox自带了很多组件,包括: VirtualBox:Docker客户端:Docker Compose(参见第7章):Kitematic--

在Windows上安装MySQL

mysql|window   可在Windows 95.Windows 98 或Windows NT 下运行MySQL.为了做到这一点,必须安装TCP/IP 支持环境,而且Winsock 软件必须至少为版本2.    在Windows 下可安装两种软件:    ·独立程序,如为UNIX 安装的那种程序( mysqld 服务器与诸如m s y q l和mysladmin 这样的程序).    ·M y ODBC,允许其他程序(如A c c e s s)与MySQL服务器通信的ODBC 的MySQL

如何在Windows上安装多个Mysql

本文以免安装版的mysql(Without installer)为例,对如何在Windows上安装多个MySQL进行讲解. 免安装版的mysql(Without installer),其安装包的文件名类似于mysql-noinstall-5.1.31-win32.zip.因为它包含了完整安装包中除配置向导以外的全部文件,所以需要你手动安装和配置MySQL的配置文件(my.ini). 在Windows上安装多个MySQL的具体步骤如下: (一)安装MySQL 5.1 1.MySQL免安装版下载地址

Windows8系统如何还原Windows上安装的桌面小工具

  选择"控制面板"--"外观及个性化"--"还原Windows上安装的桌面小工具",即可恢复原先卸载的小工具,还原Windows默认桌面小工具.

在Ubuntu15.04上安装Docker的步骤以及基本用法_docker

简介 Docker 是一个开源项目,为开发者和系统管理员提供了一个开放的平台,在任何地方通过打包和运行应用程序作为一个轻量级的容器.Docker 在软件容器内自动部署应用程序.Docker 最开始由 Solomon Hykes 作为 dotCloud 一个内部开发项目,一个企业级的 PaaS (platform as a service 服务平台),该软件现在由 Docker 社区和 Docker 公司维护. 我们可以通过 Docker 官方提供的 KVM 与 Docker 的图片更加形象的知道

《Python入门经典》——1.2 在Windows上安装Python

1.2 在Windows上安装Python 在本节中,我们将指导你在Windows计算机上安装Python.Python 2.7可以运行在Windows 2000.Windows XP.Windows Vista.Windows 7和Windows 8上.如果计算机是在2000年以后购买的,使用的很可能是上述操作系统之一. 至于内存和硬盘空间,Python占用很小的内存,而且占用很小的硬盘空间.如果你使用的是Windows XP之后的版本,一切都没问题. 1.2.1 安装Python 用任意浏览

PHP 1:在Windows上安装和配置PHP,Apache和My SQL

原文:PHP 1:在Windows上安装和配置PHP,Apache和My SQL如果你Google一把类似的主题,你会发现相关的文章可以塞满你的硬盘.在这里之所以把它再次拿出来,目的是想记录我作为一个新手如何配置的,以及配置期间碰到的一些问题.期望其中的一些问题对大家有用.下载安装文件就不用说了.不过还是提一下版本吧. PHP:5.1.4 Apache 2.2.3 MySQL:5.0.2-community-nt 我安装的顺序如下: 安装PHP 安装Apache 安装MySQL PHP安装