<commit_before># docker-vagrant

This is a Vagrantfile for running an Ubuntu VM with Docker installed, exposing the Docker HTTP API over TCP port `2375` to the Host-only Network, which allows you to use Docker on your non-Linux workstation.

Unlike [**boot2docker**][boot2docker], this is a full-fledged Ubuntu VM, rather than being based on TinyCore Linux. As such, VirtualBox Guest Additions are installed, so shared folders and other features work as expected.

If supports Docker volume mounts from your host (OSX) filesystem into the Docker container. To facilitate this support, it shares your entire `$HOME` into the VM at the exact same path. This ensures the absolute host path you must specify to `docker run -v #{host_path}:#{container_path}` is resolved to the same place in the VM as it exists in your home directory. This is also convienient because in most every case, your user directory is the only shared folder you'll need to set up. This makes for less hassle, which is the whole point of this workflow.

[boot2docker]: http://boot2docker.io/

## Installation

Clone the repo somewhere for safe keeping (`~/.local/opt/docker-vagrant` might make a good spot) and then install the file `bin/docker-vagrant` to your `$PATH` somewhere **using a symlink**.

```shell
prefix=$HOME/.local
mkdir -p $prefix/opt $prefix/bin
echo $PATH | grep -o $prefix/bin
# if that returned nothing, add $prefix/bin to your PATH in your shell config (or choose a different prefix directory)
git clone 'https://github.com/rtlong/docker-vagrant.git' $prefix/opt/docker-vagrant
ln -s $prefix/opt/docker-vagrant/bin/docker-vagrant $prefix/bin/docker-vagrant
```

## Usage

Now, without ever having to `cd` to the clone directory, you can work with this VM using the command `docker-vagrant`:

```shell
docker-vagrant up
```

> Note: the shared folder is configured to use NFS, which should be supported on OSX just fine, but I haven't tested on Linux or Windows. Vagrant's going to use `sudo` while bringing the VM up, in order to alter your system's NFS exports file. Please see the Vagrant NFS documentation for more info about this as well as how to avoid typing your password upon each `docker-vagrant up`.

After Vagrant brings up the new VM, it will print some intructions which you'll need to follow:

- Required:
    - Set the `DOCKER_HOST` environment variable; feel free to put this in your shell RC file for ease, or just export it when needed.
- Optional, but highly recommended one-time step:
    - Define a `docker.dev` host in `/etc/hosts` pointing to the host-only-networking IP address of the VM

## Known Issues
<commit_msg>Add GG-specific note<commit_after># docker-vagrant

This is a Vagrantfile for running an Ubuntu VM with Docker installed, exposing the Docker HTTP API over TCP port `2375` to the Host-only Network, which allows you to use Docker on your non-Linux workstation.

Unlike [**boot2docker**][boot2docker], this is a full-fledged Ubuntu VM, rather than being based on TinyCore Linux. As such, VirtualBox Guest Additions are installed, so shared folders and other features work as expected.

If supports Docker volume mounts from your host (OSX) filesystem into the Docker container. To facilitate this support, it shares your entire `$HOME` into the VM at the exact same path. This ensures the absolute host path you must specify to `docker run -v #{host_path}:#{container_path}` is resolved to the same place in the VM as it exists in your home directory. This is also convienient because in most every case, your user directory is the only shared folder you'll need to set up. This makes for less hassle, which is the whole point of this workflow.

[boot2docker]: http://boot2docker.io/

## Installation

Clone the repo somewhere for safe keeping (`~/.local/opt/docker-vagrant` might make a good spot) and then install the file `bin/docker-vagrant` to your `$PATH` somewhere **using a symlink**.

```shell
prefix=$HOME/.local
mkdir -p $prefix/opt $prefix/bin
echo $PATH | grep -o $prefix/bin
# if that returned nothing, add $prefix/bin to your PATH in your shell config (or choose a different prefix directory)
git clone 'https://github.com/rtlong/docker-vagrant.git' $prefix/opt/docker-vagrant
ln -s $prefix/opt/docker-vagrant/bin/docker-vagrant $prefix/bin/docker-vagrant
```

## Usage

Now, without ever having to `cd` to the clone directory, you can work with this VM using the command `docker-vagrant`:

```shell
docker-vagrant up
```

> Note: the shared folder is configured to use NFS, which should be supported on OSX just fine, but I haven't tested on Linux or Windows. Vagrant's going to use `sudo` while bringing the VM up, in order to alter your system's NFS exports file. Please see the Vagrant NFS documentation for more info about this as well as how to avoid typing your password upon each `docker-vagrant up`.

After Vagrant brings up the new VM, it will print some intructions which you'll need to follow:

- Required:
    - Set the `DOCKER_HOST` environment variable; feel free to put this in your shell RC file for ease, or just export it when needed.
- Optional, but highly recommended one-time step:
    - Define a `docker.dev` host in `/etc/hosts` pointing to the host-only-networking IP address of the VM
        - Many GoodGuide docs/configfiles depend on this hostname.

## Known Issues

{'fraction_non_alphanumeric': 0.07375514788468739, 'fraction_numerical': 0.002995132909022838, 'mean_word_length': 4.316417910447761, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5841685', 'n_tokens_mistral': 1558, 'n_tokens_neox': 1440, 'n_words': 783}