| OLD | NEW |
| 1 # Running the engine in a Docker container | 1 # Running the engine in a Docker container |
| 2 | 2 |
| 3 For local development and testing, you can run the engine in a Docker | 3 For local development and testing, you can run the engine in a Docker |
| 4 container. | 4 container. |
| 5 | 5 |
| 6 The steps are: | 6 The steps are: |
| 7 | 7 |
| 8 1. Bundle the engine and its dependencies. | 8 1. Bundle the engine and its dependencies. |
| 9 | 9 |
| 10 1. Build a Docker image. | 10 1. Build a Docker image. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 dependencies. | 52 dependencies. |
| 53 | 53 |
| 54 ## Build Docker Image | 54 ## Build Docker Image |
| 55 | 55 |
| 56 Using the tarfile you can create a Docker image: | 56 Using the tarfile you can create a Docker image: |
| 57 | 57 |
| 58 ```bash | 58 ```bash |
| 59 docker build -t blimp_engine - < ./out-linux/Debug/blimp_engine_bundle.tar | 59 docker build -t blimp_engine - < ./out-linux/Debug/blimp_engine_bundle.tar |
| 60 ``` | 60 ``` |
| 61 | 61 |
| 62 ## Create Docker Container | 62 ## Running the Engine in a Docker Container |
| 63 | 63 |
| 64 From the Docker image you can create a Docker container (i.e. run the engine): | 64 After building the Docker image you can launch the engine inside the Docker |
| 65 container. |
| 66 |
| 67 ### Setting up an Environment |
| 68 |
| 69 A little prep work is necessary to enable the engine to start as it requires a |
| 70 few files that are not provided by the container. You need: |
| 71 |
| 72 * A directory (`$CONFIG_DIR`) with permissions of 0755 (ie. world accessable) |
| 73 * `$CONFIG_DIR/stunnel.pem`: A PEM encoded file with a private key and a |
| 74 public certificate. Permissions should be set to 644. |
| 75 * `$CONFIG_DIR/client_token`: A file with a non-empty string used as the |
| 76 client token (the shared secret between the client and the engine). |
| 77 Persmissions should also be set to 644. |
| 78 |
| 79 This setup step is only required once and can be reused for all the rest of the |
| 80 runs of the engine. |
| 81 |
| 82 ### Running the Engine |
| 83 |
| 84 Once the `$CONFIG_DIR` is set up, you can launch the engine in the Docker |
| 85 container: |
| 65 | 86 |
| 66 ```bash | 87 ```bash |
| 67 docker run blimp_engine | 88 docker run -v $CONFIG_DIR:/engine/data -p 443:25466 blimp_engine |
| 68 ``` | 89 ``` |
| 69 | |
| 70 You can also pass additional flags: | 90 You can also pass additional flags: |
| 71 | 91 |
| 72 ```bash | 92 ```bash |
| 73 docker run blimp_engine --with-my-flags | 93 docker run ... blimp_engine --with-my-flags |
| 74 ``` | 94 ``` |
| 75 | |
| 76 See the [blimp engine `Dockerfile`](../engine/Dockerfile) to find out what flags | 95 See the [blimp engine `Dockerfile`](../engine/Dockerfile) to find out what flags |
| 77 are passed by default. | 96 are passed by default. |
| 78 | 97 |
| 79 ### Mapping Volumes into the Docker Container | |
| 80 | |
| 81 If you need to map a directory into the Docker container (eg. for necessary | |
| 82 files): | |
| 83 | |
| 84 ```bash | |
| 85 docker run -v /path/to/srcdir:/path/to/docker/destdir blimp_engine | |
| 86 ``` | |
| 87 | |
| 88 NB: The permissions of the directory and the files outside of the Docker | |
| 89 container will be carried over into the container. | |
| OLD | NEW |