<commit_before># Boot2Docker

Boot2Docker is a lightweight Linux distribution made specifically to run
[Docker](https://www.docker.com/) containers. It runs completely from RAM, is a
small ~24MB download and boots in ~5s (YMMV).

## Features

* Kernel 3.18.5 with AUFS, Docker v1.5.0 - using libcontainer
* Container persistence via disk automount on `/var/lib/docker`
* SSH keys persistence via disk automount

> **Note:** Boot2Docker uses port **2376**, the [registered IANA Docker SSL
> port](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker)

## Caveat Emptor

Boot2Docker is currently designed and tuned for development.  Using it for
any kind of production workloads at this time is highly discouraged.

## Installation

Installation instructions for [OS X](https://docs.docker.com/installation/mac/)
and [Windows](https://docs.docker.com/installation/windows/) are available on
the Docker documentation site.

The [ISO can be downloaded
here](https://github.com/boot2docker/boot2docker/releases).

### All in one Installers for OS X and Windows

We have built installers for [OS
X](https://github.com/boot2docker/osx-installer/releases) and
[Windows](https://github.com/boot2docker/windows-installer/releases) which will
install the `boot2docker` management tool, VirtualBox, and any tools needed to
run Boot2Docker.

### Installation using the `boot2docker` management tool

If you have the prerequisites, or want to help develop Boot2Docker, you can also
download the appropriate [boot2docker management
release](https://github.com/boot2docker/boot2docker-cli/releases) and use it to
download
[`boot2docker.iso`](https://github.com/boot2docker/boot2docker/releases).

## How to use

The `boot2docker` management tool leverages VirtualBox's `VBoxManage` to
initialise, start, stop and delete the VM right from the command line.

#### Initialize

```console
$ boot2docker init
```

#### Start VM

```console
$ boot2docker up
```

#### Upgrade the Boot2docker VM image

```console
$ boot2docker stop
$ boot2docker download
$ boot2docker up
```

If your Boot2Docker virtual machine was created prior to 0.11.1-pre1, it's best
to delete -  `boot2docker delete` and then `boot2docker init` to create a new
VM.

The main changes are to add a `/var/lib/boot2docker/userdata.tar` file that is
un-tarred into the `/home/docker` directory on boot. This file contains a
`.ssh/authorized_keys` and `.ssh/authorized_keys2` files containing a public
SSH key.

## Docker Hub

To save and share container images, automate workflows, and more sign-up for a
free [Docker Hub account](https://hub.docker.com).

## More information

See [Frequently asked questions](doc/FAQ.md) for more details.

#### Boot script log

The bootup script output is logged to `/boot.log`, so you can see (and
potentially debug) what happens. Note that this is not persistent between boots
because we're logging from before the persistence partition is mounted (and it
may not exist at all).

#### Container Port redirection

The latest version of `boot2docker` sets up two network adaptors, one using NAT
to allow the VM to download images and files from the internet, and a host only
network that Docker container's ports will be exposed on.

If you run a container with an exposed port, and then use OSX's `open` command:

```console
$ boot2docker up
$ $(boot2docker shellinit)
$ docker run --name nginx-test -d -p 80:80 nginx
$ open http://$(boot2docker ip 2>/dev/null)/
$ docker stop nginx-test
$ docker rm nginx-test
```

The `$(boot2docker shellinit)` sets the `DOCKER_HOST` environment variable for
this shell, then the `docker run` starts the webserver as a daemon, and `open`
will then show the default page in your default web browser (using `boot2docker
ip`).

If you want to share container ports with other computers on your LAN, you will
need to set up [NAT adaptor based port forwarding](doc/WORKAROUNDS.md).

#### TLS support

By default, `boot2docker` runs `docker` with TLS enabled. It auto-generates
certificates and stores them in `/home/docker/.docker` inside the VM. The
`boot2docker up` command will copy them to `~/.boot2docker/certs` on the
host machine once the VM has started, and output the correct values for
the `DOCKER_CERT_PATH` and `DOCKER_TLS_VERIFY` environment variables.

`$(boot2docker shellinit)` will also set them correctly.

We strongly recommend against running Boot2Docker with an unencrypted Docker 
socket for security reasons, but if you have tools that cannot be easily 
switched, you can disable it by adding `DOCKER_TLS=no` to your 
`/var/lib/boot2docker/profile` file on the persistent partition inside the
Boot2Docker virtual machine (use 
`boot2docker ssh sudo vi /var/lib/boot2docker/profile`).<commit_msg>Add "eval" to every invocation of "boot2docker shellinit"<commit_after># Boot2Docker

Boot2Docker is a lightweight Linux distribution made specifically to run
[Docker](https://www.docker.com/) containers. It runs completely from RAM, is a
small ~24MB download and boots in ~5s (YMMV).

## Features

* Kernel 3.18.5 with AUFS, Docker v1.5.0 - using libcontainer
* Container persistence via disk automount on `/var/lib/docker`
* SSH keys persistence via disk automount

> **Note:** Boot2Docker uses port **2376**, the [registered IANA Docker SSL
> port](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker)

## Caveat Emptor

Boot2Docker is currently designed and tuned for development.  Using it for
any kind of production workloads at this time is highly discouraged.

## Installation

Installation instructions for [OS X](https://docs.docker.com/installation/mac/)
and [Windows](https://docs.docker.com/installation/windows/) are available on
the Docker documentation site.

The [ISO can be downloaded
here](https://github.com/boot2docker/boot2docker/releases).

### All in one Installers for OS X and Windows

We have built installers for [OS
X](https://github.com/boot2docker/osx-installer/releases) and
[Windows](https://github.com/boot2docker/windows-installer/releases) which will
install the `boot2docker` management tool, VirtualBox, and any tools needed to
run Boot2Docker.

### Installation using the `boot2docker` management tool

If you have the prerequisites, or want to help develop Boot2Docker, you can also
download the appropriate [boot2docker management
release](https://github.com/boot2docker/boot2docker-cli/releases) and use it to
download
[`boot2docker.iso`](https://github.com/boot2docker/boot2docker/releases).

## How to use

The `boot2docker` management tool leverages VirtualBox's `VBoxManage` to
initialise, start, stop and delete the VM right from the command line.

#### Initialize

```console
$ boot2docker init
```

#### Start VM

```console
$ boot2docker up
```

#### Upgrade the Boot2docker VM image

```console
$ boot2docker stop
$ boot2docker download
$ boot2docker up
```

If your Boot2Docker virtual machine was created prior to 0.11.1-pre1, it's best
to delete -  `boot2docker delete` and then `boot2docker init` to create a new
VM.

The main changes are to add a `/var/lib/boot2docker/userdata.tar` file that is
un-tarred into the `/home/docker` directory on boot. This file contains a
`.ssh/authorized_keys` and `.ssh/authorized_keys2` files containing a public
SSH key.

## Docker Hub

To save and share container images, automate workflows, and more sign-up for a
free [Docker Hub account](https://hub.docker.com).

## More information

See [Frequently asked questions](doc/FAQ.md) for more details.

#### Boot script log

The bootup script output is logged to `/boot.log`, so you can see (and
potentially debug) what happens. Note that this is not persistent between boots
because we're logging from before the persistence partition is mounted (and it
may not exist at all).

#### Container Port redirection

The latest version of `boot2docker` sets up two network adaptors, one using NAT
to allow the VM to download images and files from the internet, and a host only
network that Docker container's ports will be exposed on.

If you run a container with an exposed port, and then use OSX's `open` command:

```console
$ boot2docker up
$ eval "$(boot2docker shellinit)"
$ docker run --name nginx-test -d -p 80:80 nginx
$ open http://$(boot2docker ip 2>/dev/null)/
$ docker stop nginx-test
$ docker rm nginx-test
```

The `eval "$(boot2docker shellinit)"` sets the `DOCKER_HOST` environment variable for
this shell, then the `docker run` starts the webserver as a daemon, and `open`
will then show the default page in your default web browser (using `boot2docker
ip`).

If you want to share container ports with other computers on your LAN, you will
need to set up [NAT adaptor based port forwarding](doc/WORKAROUNDS.md).

#### TLS support

By default, `boot2docker` runs `docker` with TLS enabled. It auto-generates
certificates and stores them in `/home/docker/.docker` inside the VM. The
`boot2docker up` command will copy them to `~/.boot2docker/certs` on the
host machine once the VM has started, and output the correct values for
the `DOCKER_CERT_PATH` and `DOCKER_TLS_VERIFY` environment variables.

`eval "$(boot2docker shellinit)"` will also set them correctly.

We strongly recommend against running Boot2Docker with an unencrypted Docker 
socket for security reasons, but if you have tools that cannot be easily 
switched, you can disable it by adding `DOCKER_TLS=no` to your 
`/var/lib/boot2docker/profile` file on the persistent partition inside the
Boot2Docker virtual machine (use 
`boot2docker ssh sudo vi /var/lib/boot2docker/profile`).
{'fraction_non_alphanumeric': 0.09006952371069835, 'fraction_numerical': 0.014423575801598008, 'mean_word_length': 4.788588588588588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 18, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4679870', 'n_tokens_mistral': 3001, 'n_tokens_neox': 2753, 'n_words': 1197}