2014-04-16 00:53:12 +00:00
|
|
|
page_title: Installation on Windows
|
|
|
|
page_description: Please note this project is currently under heavy development. It should not be used in production.
|
|
|
|
page_keywords: Docker, Docker documentation, Windows, requirements, virtualbox, boot2docker
|
|
|
|
|
|
|
|
# Windows
|
|
|
|
|
|
|
|
Docker can run on Windows using a virtualization platform like
|
|
|
|
VirtualBox. A Linux distribution is run inside a virtual machine and
|
2014-04-23 20:48:28 +00:00
|
|
|
that's where Docker will run.
|
2014-04-16 00:53:12 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2014-04-18 20:21:55 +00:00
|
|
|
> **Note**:
|
2014-04-23 20:48:28 +00:00
|
|
|
> Docker is still under heavy development! We don't recommend using it in
|
|
|
|
> production yet, but we're getting closer with each release. Please see
|
2014-04-18 20:21:55 +00:00
|
|
|
> our blog post, [Getting to Docker 1.0](
|
|
|
|
> http://blog.docker.io/2013/08/getting-to-docker-1-0/)
|
2014-04-16 00:53:12 +00:00
|
|
|
|
2014-04-23 20:48:28 +00:00
|
|
|
1. Install virtualbox from [https://www.virtualbox.org](
|
|
|
|
https://www.virtualbox.org) - or follow this [tutorial](
|
|
|
|
http://www.slideshare.net/julienbarbier42/install-virtualbox-on-windows-7).
|
|
|
|
2. Download the latest boot2docker.iso from
|
|
|
|
[https://github.com/boot2docker/boot2docker/releases](
|
|
|
|
https://github.com/boot2docker/boot2docker/releases).
|
|
|
|
3. Start VirtualBox.
|
|
|
|
4. Create a new Virtual machine with the following settings:
|
2014-04-16 00:53:12 +00:00
|
|
|
|
2014-04-23 20:48:28 +00:00
|
|
|
- Name: boot2docker
|
|
|
|
- Type: Linux
|
|
|
|
- Version: Linux 2.6 (64 bit)
|
|
|
|
- Memory size: 1024 MB
|
|
|
|
- Hard drive: Do not add a virtual hard drive
|
2014-04-16 00:53:12 +00:00
|
|
|
|
2014-04-23 20:48:28 +00:00
|
|
|
5. Open the settings of the virtual machine:
|
2014-04-16 00:53:12 +00:00
|
|
|
|
|
|
|
5.1. go to Storage
|
|
|
|
5.2. click the empty slot below Controller: IDE
|
|
|
|
5.3. click the disc icon on the right of IDE Secondary Master
|
|
|
|
5.4. click Choose a virtual CD/DVD disk file
|
|
|
|
|
2014-04-23 20:48:28 +00:00
|
|
|
6. Browse to the path where you`ve saved the boot2docker.iso, select
|
|
|
|
the boot2docker.iso and click open.
|
2014-04-16 00:53:12 +00:00
|
|
|
|
2014-04-23 20:48:28 +00:00
|
|
|
7. Click OK on the Settings dialog to save the changes and close the
|
|
|
|
window.
|
2014-04-16 00:53:12 +00:00
|
|
|
|
2014-04-23 20:48:28 +00:00
|
|
|
8. Start the virtual machine by clicking the green start button.
|
2014-04-16 00:53:12 +00:00
|
|
|
|
2014-04-23 20:48:28 +00:00
|
|
|
9. The boot2docker virtual machine should boot now.
|
2014-04-16 00:53:12 +00:00
|
|
|
|
|
|
|
## Running Docker
|
|
|
|
|
|
|
|
boot2docker will log you in automatically so you can start using Docker
|
|
|
|
right away.
|
|
|
|
|
2014-04-23 20:48:28 +00:00
|
|
|
Let's try the “hello world” example. Run
|
2014-04-16 00:53:12 +00:00
|
|
|
|
2014-05-01 14:13:34 +00:00
|
|
|
$ docker run busybox echo hello world
|
2014-04-16 00:53:12 +00:00
|
|
|
|
|
|
|
This will download the small busybox image and print hello world.
|
|
|
|
|
2014-05-21 08:29:24 +00:00
|
|
|
## Persistent storage
|
2014-04-16 00:53:12 +00:00
|
|
|
|
2014-05-21 08:29:24 +00:00
|
|
|
1. Add a virtual hard drive to the VM created in Installation
|
|
|
|
2. Start the VM
|
|
|
|
3. Create an empty partition on the attached virtual hard drive
|
2014-04-16 00:53:12 +00:00
|
|
|
|
2014-05-21 08:29:24 +00:00
|
|
|
```sh
|
|
|
|
sudo fdisk /dev/sda
|
|
|
|
n (new partition)
|
|
|
|
p (primary partition)
|
|
|
|
1 (partition 1)
|
|
|
|
w (write changes to disk)
|
|
|
|
```
|
|
|
|
|
|
|
|
4. Format the partition using ext4
|
|
|
|
|
|
|
|
```sh
|
|
|
|
mkfs.ext4 -L boot2docker-data /dev/sda1
|
|
|
|
```
|
|
|
|
|
|
|
|
5. Reboot
|
|
|
|
|
|
|
|
```sh
|
|
|
|
sudo reboot
|
|
|
|
```
|
|
|
|
|
|
|
|
6. boot2docker should now auto mount the partition and persist data there. (/var/lib/docker linking to /mnt/sda1/var/lib/docker)
|
|
|
|
|
|
|
|
```sh
|
|
|
|
ls -l /var/lib
|
|
|
|
```
|