Add env_vars in docker build docs
@@ -18,6 +18,30 @@ and Polyaxon will take care of building the image before running your code.
For example
```yaml
+
+---
+version: 1
+
+project:
+ name: mnist
+
+declarations:
+ batch_size: 128
+ lr: 0.1
+
+run:
+ image: tensorflow/tensorflow:1.4.1-py3
+ steps:
+ - pip install scikit-learn
+ cmd: python3 train.py --batch_size={{ batch_size }} --lr={{ lr }}
+```
+
+To expose some environment variables you can use `env_vars`
+
+For example
+
+```yaml
+
---
version: 1
@@ -32,6 +56,9 @@ run:
image: tensorflow/tensorflow:1.4.1-py3
steps:
- pip install scikit-learn
+ env_vars:
+ - ['MY_ENV_VAR_KEY1', 'MY_ENV_VAR_VALUE1']
+ - ['MY_ENV_VAR_KEY2', 'MY_ENV_VAR_VALUE2']
cmd: python3 train.py --batch_size={{ batch_size }} --lr={{ lr }}
```
@@ -72,6 +99,7 @@ If you have multiple commands that you wish to execute,
Polyaxon allows you to specify a `polyaxon_setup.sh` file, and a command to execute that file `./polyaxon_setup.sh`.
```yaml
+
---
version: 1
