Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker --env-file - executable file not found in $PATH

I want to run my docker container with environment variables with the --env-file option, like mentioned in the docker doc: docker run command

I've tried creating a file named env.list in my home dir /home/jw/data with the following content:

SSL_CERTIFICATE_PATH=/opt/onlyoffice/Data/certs/onlyoffice.crt
SSL_KEY_PATH=/opt/onlyoffice/Data/certs/onlyoffice.key
SSL_DHPARAM_PATH=/opt/onlyoffice/Data/certs/dhparam.pem

After that I added the directory /home/jw/data/ to my $PATH environment variable:

PATH=$PATH:/home/jw/data/; export PATH

On the same shell I started the docker container like this:

sudo docker run -i -t -d --name onlyoffice-document-server onlyoffice/documentserver --env-file /home/jw/data/env.list debian env

I get the following error message:

Error response from daemon: Cannot start container 45ff897e0cfdc676f4f0bac98e027e2c567558a173a7f80c02ba6dc86482a176: [8] System error: exec: "--env-file": executable file not found in $PAT

I've also tried setting the $PATH under root and execute the mentioned run command, with the same error message.

Did I miss something?

like image 293
jwi Avatar asked Jan 14 '16 12:01

jwi


1 Answers

onlyoffice/documentserver is at the wrong position.

Assuming that is the name of the container you want to start, it would have to be before env instead of debian, which is another image.

like image 69
Ingo Meldau Avatar answered Sep 22 '22 03:09

Ingo Meldau