Apr 27, 2016
Documentation
|
|
|
1 |
|
|
2 |
# Run Everware in a Docker container |
|
3 |
|
|
4 |
This section explains how to run Everware in a container, and the different possibilities to run users container |
|
5 |
|
|
6 |
## Build Everware container |
|
7 |
|
|
8 |
[Dockerfile](Dockerfile) |
|
9 |
|
|
10 |
``` |
|
11 |
docker build -t everware . |
|
12 |
``` |
|
13 |
|
|
14 |
## Create user containers on same machine as the Everware one |
|
15 |
|
|
16 |
Fill the file which will contains environment variables for Everware. |
|
17 |
``` |
|
18 |
cp env.docker-local.orig env.docker-local |
|
19 |
``` |
|
20 |
Define the `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET`, and `OAUTH_CALLBACK_URL` |
|
21 |
|
|
22 |
Edit `etc/container_config.py` file to set `c.DockerSpawner.hub_ip_connect` and `c.DockerSpawner.container_ip` to the IP of your machine running the Everware container. |
|
23 |
|
|
24 |
``` |
|
25 |
docker run -d --name everware \ |
|
26 |
-v /var/run/docker.sock:/var/run/docker.sock \ |
|
27 |
-v $PWD/etc/container_config.py:/srv/everware/etc/container_config.py \ |
|
28 |
--env-file=env.docker-local \ |
|
29 |
-p 8000:8000 \ |
|
30 |
-p 8081:8081 \ |
|
31 |
everware /srv/everware/etc/container_config.py --no-ssl --debug |
|
32 |
``` |
|
33 |
|
|
34 |
Note that you can skip `-v $PWD/etc/container_config.py:/srv/everware/etc/container_config.py` part if you build the container after having modified the config file `etc/container_config.py` |
|
35 |
|
|
36 |
## Create user containers on a remote Docker machine |
|
37 |
|
|
38 |
``` |
|
39 |
cp env.docker-remote.orig env.docker-remote |
|
40 |
``` |
|
41 |
Same as before, and define `DOCKER_HOST`, the IP of your remote Docker machine. |
|
42 |
|
|
43 |
``` |
|
44 |
docker run -d --name everware \ |
|
45 |
-v $PWD/etc/container_config.py:/srv/everware/etc/container_config.py \ |
|
46 |
--env-file=env.docker-remote \ |
|
47 |
-p 8000:8000 \ |
|
48 |
-p 8081:8081 \ |
|
49 |
everware /srv/everware/etc/container_config.py --no-ssl --debug |
|
50 |
``` |
|
51 |
|
|
52 |
## Create user containers on a Docker Swarm cluster |
|
53 |
|
|
54 |
This allows to create users container on a Docker Swarm cluster. |
|
55 |
|
|
56 |
``` |
|
57 |
cp env.docker-swarm.orig env.docker-swarm |
|
58 |
``` |
|
59 |
Define the variable, and set `DOCKER_HOST` to the IP of your Swarm master. |
|
60 |
|
|
61 |
Edit `etc/container_swarm.py` file to set `c.DockerSpawner.hub_ip_connect` to the IP of your machine hosting Everware container. |
|
62 |
|
|
63 |
``` |
|
64 |
docker run --rm -it --name everware \ |
|
65 |
-v $PWD/etc/container_swarm_config.py:/srv/everware/etc/container_swarm_config.py \ |
|
66 |
-v /home/ubuntu/docker:/etc/docker \ |
|
67 |
--env-file=env.docker-swarm \ |
|
68 |
-p 8000:8000 \ |
|
69 |
-p 8081:8081 \ |
|
70 |
everware /srv/everware/etc/container_swarm_config.py --no-ssl --debug |
|
71 |
``` |