IssueRaiser

`docker stack deploy` in 1.13 doesn't load `.env` file as `docker-compose up` does

To test `docker stack deploy --compose-file` function, I load one of my sample `docker-compose.yml`: ```yaml version: '3' services: nginx: image: "${DOCKER_USER}/lnmp-nginx:v1.2" build: context: . dockerfile: Dockerfile.nginx ports: - "80:80" networks: - frontend depends_on: - php php: image: "${DOCKER_USER}/lnmp-php:v1.2" build: context: . dockerfile: Dockerfile.php networks: - frontend - backend environment: MYSQL_PASSWORD: Passw0rd depends_on: - mysql mysql: image: mysql:5.7 volumes: - mysql-data:/var/lib/mysql environment: TZ: 'Asia/Shanghai' MYSQL_ROOT_PASSWORD: Passw0rd command: ['mysqld', '--character-set-server=utf8'] networks: - backend volumes: mysql-data: networks: frontend: backend: ``` In the `image` section of service `nginx` and `php`, I used `${DOCKER_USER}` to get the docker id from environment variables. And if I use `docker-compose up`, it will load `.env` file as default envvar files, which content is: ```bash DOCKER_USER=twang2218 ``` However, if I use `docker stack` to deploy this `docker-compose.yml`, I will got following errors: ```bash $ docker stack deploy --compose-file docker-compose.yml lnmp Ignoring unsupported options: bu

Posted by twang2218 on Dec 5, 2016, 2:44 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

github (Sysadmin)

`docker stack deploy` in 1.13 doesn't load `.env` file as `docker-compose up` does

twang2218Dec 5, 2016, 2:44 PM

To test `docker stack deploy --compose-file` function, I load one of my sample `docker-compose.yml`: ```yaml version: '3' services: nginx: image: "${DOCKER_USER}/lnmp-nginx:v1.2" build: context: . dockerfile: Dockerfile.nginx ports: - "80:80" networks: - frontend depends_on: - php php: image: "${DOCKER_USER}/lnmp-php:v1.2" build: context: . dockerfile: Dockerfile.php networks: - frontend - backend environment: MYSQL_PASSWORD: Passw0rd depends_on: - mysql mysql: image: mysql:5.7 volumes: - mysql-data:/var/lib/mysql environment: TZ: 'Asia/Shanghai' MYSQL_ROOT_PASSWORD: Passw0rd command: ['mysqld', '--character-set-server=utf8'] networks: - backend volumes: mysql-data: networks: frontend: backend: ``` In the `image` section of service `nginx` and `php`, I used `${DOCKER_USER}` to get the docker id from environment variables. And if I use `docker-compose up`, it will load `.env` file as default envvar files, which content is: ```bash DOCKER_USER=twang2218 ``` However, if I use `docker stack` to deploy this `docker-compose.yml`, I will got following errors: ```bash $ docker stack deploy --compose-file docker-compose.yml lnmp Ignoring unsupported options: bu

Comments (0)

No comments yet. Start the discussion.

Comment on this issue