Created
September 17, 2016 14:51
-
-
Save sudo-bmitch/2db1ec35e47c0ac4017ef9a5a0ddbf82 to your computer and use it in GitHub Desktop.
docker-compose env_file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat docker-compose.env.yml | |
version: '2' | |
services: | |
test: | |
image: busybox | |
command: env | |
env_file: ./env.data | |
environment: | |
- VAL="from compose" | |
$ cat env.data | |
HELLO=world | |
TEST=123 | |
$ cat .env | |
ENV=default | |
$ docker-compose -f docker-compose.env.yml up | |
WARNING: The Docker Engine you're using is running in swarm mode. | |
Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node. | |
To deploy your application across the swarm, use the bundle feature of the Docker experimental build. | |
More info: | |
https://docs.docker.com/compose/bundles | |
Starting test_test_1 | |
Attaching to test_test_1 | |
test_1 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
test_1 | HOSTNAME=f5d3d0a14087 | |
test_1 | TEST=123 | |
test_1 | HELLO=world | |
test_1 | VAL="from compose" | |
test_1 | HOME=/root | |
test_test_1 exited with code 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment