<commit_before># Using Docker for Canvas Development

You can use Docker in your development environment for a more seamless
way to get started developing Canvas.

## Getting Started

### Dependencies

#### OS X

On OS X, make sure you have the following installed:

##### VMWare Fusion

Preferred over VirtualBox for performance reasons. (although Virtualbox 5 is
pretty close, about 90% of VMWare fusion in basic testing)

##### Dinghy

```
$ brew install https://github.com/codekitchen/dinghy/raw/latest/dinghy.rb
$ dinghy create --memory=4096 --cpus=4 --provider=vmware_fusion
```

Type `docker ps` in your terminal to make sure your Docker environment
is happy.

Dinghy currently requires OS X Yosemite. Make sure you're using the most recent
Dinghy release, or else you'll probably have a bad time.

#### Linux

In Linux you can run docker natively, as long as you are using
a 64-bit kernel that is version 3.10 or higher.

##### Install the package

###### Arch Linux

```
$ pacman -S docker
```

###### Fedora

```
$ dnf install docker
```

###### Ubuntu

```
$ apt-get install docker.io
```

##### Start and optionally enable the docker service

In order to use docker, the docker service must be running.  You can start the
service using systemd:

```
systemctl start docker.service
```

You can optionally enable the docker service, which will cause it to
start automatically at boot time:

```
systemctl enable docker.service
```

##### Avoid requiring sudo to run the docker command (optional)

Because docker itelf runs with root privileges, you must be root
in order to command it.  Unfortunately, this is very
inconvenient and super annoying.  Fortunately, there is an elegant
work-around that simply involves creating a 'docker' group and
adding any users to that group that should have permission to
run docker.  First, add the docker group:

```
groupadd docker
```

Now add your user to that group:

```
usermod -a -G docker $(whoami)
```

Now you can run the docker command without root or sudo.
Note that you _will_ need to log out and back in for the group
addition to take effect.

#### Docker-Compose

##### OS X

```
$ brew install docker-compose --without-boot2docker
```

##### Linux

###### Arch Linux

Install docker-compose from the AUR using your preferred method.  For example with aura:

```
aura -A docker-compose<commit_msg>Docker development instructions:  Add note about security<commit_after># Using Docker for Canvas Development

You can use Docker in your development environment for a more seamless
way to get started developing Canvas.

## Getting Started

### Dependencies

#### OS X

On OS X, make sure you have the following installed:

##### VMWare Fusion

Preferred over VirtualBox for performance reasons. (although Virtualbox 5 is
pretty close, about 90% of VMWare fusion in basic testing)

##### Dinghy

```
$ brew install https://github.com/codekitchen/dinghy/raw/latest/dinghy.rb
$ dinghy create --memory=4096 --cpus=4 --provider=vmware_fusion
```

Type `docker ps` in your terminal to make sure your Docker environment
is happy.

Dinghy currently requires OS X Yosemite. Make sure you're using the most recent
Dinghy release, or else you'll probably have a bad time.

#### Linux

In Linux you can run docker natively, as long as you are using
a 64-bit kernel that is version 3.10 or higher.

##### Install the package

###### Arch Linux

```
$ pacman -S docker
```

###### Fedora

```
$ dnf install docker
```

###### Ubuntu

```
$ apt-get install docker.io
```

##### Start and optionally enable the docker service

In order to use docker, the docker service must be running.  You can start the
service using systemd:

```
systemctl start docker.service
```

You can optionally enable the docker service, which will cause it to
start automatically at boot time:

```
systemctl enable docker.service
```

##### Avoid requiring sudo to run the docker command (optional)

Because docker itelf runs with root privileges, you must be root
in order to command it.  Unfortunately, this is very
inconvenient and super annoying.  Fortunately, there is an elegant
work-around that simply involves creating a 'docker' group and
adding any users to that group that should have permission to
run docker.  First, add the docker group:

```
groupadd docker
```

Now add your user to that group:

```
usermod -a -G docker $(whoami)
```

Now you can run the docker command without root or sudo.
Note that you _will_ need to log out and back in for the group
addition to take effect.

NOTE: Adding non-privileged users to the docker group can be
a security risk.  Don't add users to this group that shouldn't
have root privileges.  Dev responsibly my friends.

#### Docker-Compose

##### OS X

```
$ brew install docker-compose --without-boot2docker
```

##### Linux

###### Arch Linux

Install docker-compose from the AUR using your preferred method.  For example with aura:

```
aura -A docker-compose
{'fraction_non_alphanumeric': 0.09190283400809716, 'fraction_numerical': 0.005668016194331984, 'mean_word_length': 4.163009404388715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5500491', 'n_tokens_mistral': 1515, 'n_tokens_neox': 1338, 'n_words': 689}