I'm having a problem with docker-compose : the enviroment part doesn't seem to work anymore on one server whereas the same thing works on other servers.
On the designated server, with this docker-compose :
version: '3'
services:
test:
image: 'busybox'
command: env
environment:
- HELLO=WORLD
Running docker-compose up outputs this :
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=8d4af1fcbe88
HOME=/root
No trace of the environment variable HELLO
I tried running
docker run -e test=plop busybox env
It works and outputs
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=5880600fbb99
test=plop
HOME=/root
I tried using the latest docker-compose version on github but it changes nothing.
The same problem appears when using .env files.
Does anyone has any idea about what could be happening here ?
Edit: To be clear, I already ran this docker-compose on other servers and it works as intended, i was wondering if some people could help me debug this "bug". Here is a walkthrough that explains what I did :
/tmp/test$ curl -SsL "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o docker-compose
/tmp/test$ ls -a
. .. docker-compose docker-compose.yml
/tmp/test$ cat docker-compose.yml
version: '3'
services:
test:
image: 'busybox'
command: env
environment:
- HELLO=WORLD
/tmp/test$ sudo ./docker-compose down
Removing network test_default
WARNING: Network test_default not found.
/tmp/test$ sudo ./docker-compose up -d
Creating network "test_default" with the default driver
Creating test_test_1 ... done
/tmp/test$ sudo docker logs test_test_1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=b68e605e609d
HOME=/root