2. Install the Devilbox¶
Ensure you have read and followed the Prerequisites
Table of Contents
The Devilbox does not need to be installed. The only thing that is required is its git directory. To download that, open a terminal and copy/paste the following command.
host> git clone https://github.com/cytopia/devilbox
Inside the cloned Devilbox git directory, you will find a file called
env-example. This file
is the main configuration with sane defaults for Docker Compose. In order to use it, it must be
copied to a file named
.env. (Pay attention to the leading dot).
host> cp env-example .env
.env file does nothing else then providing environment variables for Docker Compose
and in this case it is used as the main configuration file for the Devilbox by providing all kinds
of settings (such as which version to start up).
To get you started, there are only two variables that need to be adjusted:
The values for those two variables refer to your local (on your host operating system) user id and group id. To find out what the values are required in your case, issue the following commands on a terminal:
host> id -g
In most cases both values will be
1000, but for the sake of this example, let’s assume a value
1001 for the user id and
1002 for the group id.
.env file with your favorite text editor and adjust those values:
host> vi .env NEW_UID=1001 NEW_GID=1002
If you have SELinux enabled, you will also have to adjust the MOUNT_OPTIONS to allow shared mounts among multiple container:
host> vi .env MOUNT_OPTIONS=,z
Out of the box, Docker for Mac has some performance issues when it comes to mount directories with a lot of files inside. To mitigate this issue, you can adjust the caching settings for mounted directories.
To do so, you will want to adjust the MOUNT_OPTIONS to allow caching on mounts.
host> vi .env MOUNT_OPTIONS=,cached
Ensure to read the links below to understand why this problem exists and how the fix works. The Docker documentation will also give you alternative caching options to consider.