github.com/iamlotus/docker@v1.8.1/docs/project/software-req-win.md (about) 1 <!--[metadata]> 2 +++ 3 title = "Set up for development on Windows" 4 description = "How to set up a server to test Docker Windows client" 5 keywords = ["development, inception, container, image Dockerfile, dependencies, Go, artifacts, windows"] 6 [menu.main] 7 parent = "smn_develop" 8 weight=3 9 +++ 10 <![end-metadata]--> 11 12 13 # Get the required software for Windows 14 15 This page explains how to get the software you need to use a a Windows Server 16 2012 or Windows 8 machine for Docker development. Before you begin contributing 17 you must have: 18 19 - a GitHub account 20 - Git for Windows (msysGit) 21 - TDM-GCC, a compiler suite for Windows 22 - MinGW (tar and xz) 23 - Go language 24 25 > **Note**: This installation procedure refers to the `C:\` drive. If you system's main drive 26 is `D:\` you'll need to substitute that in where appropriate in these 27 instructions. 28 29 ### Get a GitHub account 30 31 To contribute to the Docker project, you will need a <a 32 href="https://github.com" target="_blank">GitHub account</a>. A free account is 33 fine. All the Docker project repositories are public and visible to everyone. 34 35 You should also have some experience using both the GitHub application and `git` 36 on the command line. 37 38 ## Install Git for Windows 39 40 Git for Windows includes several tools including msysGit, which is a build 41 environment. The environment contains the tools you need for development such as 42 Git and a Git Bash shell. 43 44 1. Browse to the [Git for Windows](https://msysgit.github.io/) download page. 45 46 2. Click **Download**. 47 48 Windows prompts you to save the file to your machine. 49 50 3. Run the saved file. 51 52 The system displays the **Git Setup** wizard. 53 54 4. Click the **Next** button to move through the wizard and accept all the defaults. 55 56 5. Click **Finish** when you are done. 57 58 ## Installing TDM-GCC 59 60 TDM-GCC is a compiler suite for Windows. You'll use this suite to compile the 61 Docker Go code as you develop. 62 63 1. Browse to 64 [tdm-gcc download page](http://tdm-gcc.tdragon.net/download). 65 66 2. Click on the latest 64-bit version of the package. 67 68 Windows prompts you to save the file to your machine 69 70 3. Set up the suite by running the downloaded file. 71 72 The system opens the **TDM-GCC Setup** wizard. 73 74 4. Click **Create**. 75 76 5. Click the **Next** button to move through the wizard and accept all the defaults. 77 78 6. Click **Finish** when you are done. 79 80 81 ## Installing MinGW (tar and xz) 82 83 MinGW is a minimalist port of the GNU Compiler Collection (GCC). In this 84 procedure, you first download and install the MinGW installation manager. Then, 85 you use the manager to install the `tar` and `xz` tools from the collection. 86 87 1. Browse to MinGW 88 [SourceForge](http://sourceforge.net/projects/mingw/). 89 90 2. Click **Download**. 91 92 Windows prompts you to save the file to your machine 93 94 3. Run the downloaded file. 95 96 The system opens the **MinGW Installation Manager Setup Tool** 97 98 4. Choose **Install** install the MinGW Installation Manager. 99 100 5. Press **Continue**. 101 102 The system installs and then opens the MinGW Installation Manager. 103 104 6. Press **Continue** after the install completes to open the manager. 105 106 7. Select **All Packages > MSYS Base System** from the left hand menu. 107 108 The system displays the available packages. 109 110 8. Click on the the **msys-tar bin** package and choose **Mark for Installation**. 111 112 9. Click on the **msys-xz bin** package and choose **Mark for Installation**. 113 114 10. Select **Installation > Apply Changes**, to install the selected packages. 115 116 The system displays the **Schedule of Pending Actions Dialog**. 117 118 ![windows-mingw](/project/images/windows-mingw.png) 119 120 11. Press **Apply** 121 122 MingGW installs the packages for you. 123 124 12. Close the dialog and the MinGW Installation Manager. 125 126 127 ## Set up your environment variables 128 129 You'll need to add the compiler to your `Path` environment variable. 130 131 1. Open the **Control Panel**. 132 133 2. Choose **System and Security > System**. 134 135 3. Click the **Advanced system settings** link in the sidebar. 136 137 The system opens the **System Properties** dialog. 138 139 3. Select the **Advanced** tab. 140 141 4. Click **Environment Variables**. 142 143 The system opens the **Environment Variables dialog** dialog. 144 145 5. Locate the **System variables** area and scroll to the **Path** 146 variable. 147 148 ![windows-mingw](/project/images/path_variable.png) 149 150 6. Click **Edit** to edit the variable (you can also double-click it). 151 152 The system opens the **Edit System Variable** dialog. 153 154 7. Make sure the `Path` includes `C:\TDM-GCC64\bin` 155 156 ![include gcc](/project/images/include_gcc.png) 157 158 If you don't see `C:\TDM-GCC64\bin`, add it. 159 160 8. Press **OK** to close this dialog. 161 162 9. Press **OK** twice to close out of the remaining dialogs. 163 164 ## Install Go and cross-compile it 165 166 In this section, you install the Go language. Then, you build the source so that it can cross-compile for `linux/amd64` architectures. 167 168 1. Open [Go Language download](http://golang.org/dl/) page in your browser. 169 170 2. Locate and click the latest `.msi` installer. 171 172 The system prompts you to save the file. 173 174 3. Run the installer. 175 176 The system opens the **Go Programming Language Setup** dialog. 177 178 4. Select all the defaults to install. 179 180 5. Press **Finish** to close the installation dialog. 181 182 6. Start a command prompt. 183 184 7. Change to the Go `src` directory. 185 186 cd c:\Go\src 187 188 8. Set the following Go variables 189 190 c:\Go\src> set GOOS=linux 191 c:\Go\src> set GOARCH=amd64 192 193 9. Compile the source. 194 195 c:\Go\src> make.bat 196 197 Compiling the source also adds a number of variables to your Windows environment. 198 199 ## Get the Docker repository 200 201 In this step, you start a Git `bash` terminal and get the Docker source code 202 from GitHub. 203 204 1. Locate the **Git Bash** program and start it. 205 206 Recall that **Git Bash** came with the Git for Windows installation. **Git 207 Bash** just as it sounds allows you to run a Bash terminal on Windows. 208 209 ![Git Bash](/project/images/git_bash.png) 210 211 2. Change to the root directory. 212 213 $ cd /c/ 214 215 3. Make a `gopath` directory. 216 217 $ mkdir gopath 218 219 4. Go get the `docker/docker` repository. 220 221 $ go.exe get github.com/docker/docker package github.com/docker/docker 222 imports github.com/docker/docker 223 imports github.com/docker/docker: no buildable Go source files in C:\gopath\src\github.com\docker\docker 224 225 In the next steps, you create environment variables for you Go paths. 226 227 5. Open the **Control Panel** on your system. 228 229 6. Choose **System and Security > System**. 230 231 7. Click the **Advanced system settings** link in the sidebar. 232 233 The system opens the **System Properties** dialog. 234 235 8. Select the **Advanced** tab. 236 237 9. Click **Environment Variables**. 238 239 The system opens the **Environment Variables dialog** dialog. 240 241 10. Locate the **System variables** area and scroll to the **Path** 242 variable. 243 244 11. Click **New**. 245 246 Now you are going to create some new variables. These paths you'll create in the next procedure; but you can set them now. 247 248 12. Enter `GOPATH` for the **Variable Name**. 249 250 13. For the **Variable Value** enter the following: 251 252 C:\gopath;C:\gopath\src\github.com\docker\docker\vendor 253 254 255 14. Press **OK** to close this dialog. 256 257 The system adds `GOPATH` to the list of **System Variables**. 258 259 15. Press **OK** twice to close out of the remaining dialogs. 260 261 262 ## Where to go next 263 264 In the next section, you'll [learn how to set up and configure Git for 265 contributing to Docker](/project/set-up-git/).