Skip to content

Instantly share code, notes, and snippets.

@andyshinn
Created July 1, 2017 18:20
Show Gist options
  • Select an option

  • Save andyshinn/3034fa88e679e6357294e7a9b16b8197 to your computer and use it in GitHub Desktop.

Select an option

Save andyshinn/3034fa88e679e6357294e7a9b16b8197 to your computer and use it in GitHub Desktop.
version: "3"
services:
test:
env_file: ./myenv
image: alpine
command: env
MY_VAR=yes
$ docker version
Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:31:53 2017
OS/Arch: darwin/amd64
Server:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:51:55 2017
OS/Arch: linux/amd64
Experimental: false
$ docker-compose version
docker-compose version 1.14.0, build c7bdf9e
docker-py version: 2.3.0
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2j 26 Sep 2016
$ docker-compose 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 `docker stack deploy`.
Creating network "envfile_default" with the default driver
Creating envfile_test_1 ...
Creating envfile_test_1 ... done
Attaching to envfile_test_1
test_1 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
test_1 | HOSTNAME=9152d83d9311
test_1 | MY_VAR=yes
test_1 | no_proxy=*.local, 169.254/16
test_1 | HOME=/root
envfile_test_1 exited with code 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment