0

I'm trying to enable GitHub oAuth in Eclipse Che. The documentation calls for modification of che.env.

Further, the docs say:

Configuration is handled by modifying che.env placed in the host folder volume mounted to :/data. This configuration file is generated during the che init phase.

I run Eclipse Che in a docker container as follows:

mkdir /home/<USERNAME>/che
docker run -p 8080:8080 \
            --name che \
            --rm \
            -v /var/run/docker.sock:/var/run/docker.sock \
            -v /home/<USERNAME>/che:/data \
            eclipse/che-server:5.0.0-latest 

(Ref: http://www.eclipse.org/che/docs/setup/docker/index.html)

I enter the container and search for che.env:

docker exec -it <CONTAINER ID> bash
find /data -name 'che.env'

Nothing is returned, thus the file che.env doesn't exist in /data. Why?

matthiash
  • 3,105
  • 3
  • 23
  • 34

2 Answers2

2

As per your docker run command, host folder mounted to volume :/data is /home/<USERNAME>/che so your che.env file must exist at path - /home/<USERNAME>/che/che.env

Update - Image used to run eclipse che is different in docker run command. eclipse/che image is required for running eclipse che. Complete command -

docker run -it --rm -v /che-data:/data -v /var/run/docker.sock:/var/run/docker.sock eclipse/che:5.17.0 start
Vikas Sachdeva
  • 5,633
  • 2
  • 17
  • 26
  • As you can see [here](https://i.imgur.com/sm8Krr1.jpg) and [here](https://i.imgur.com/kqp53Si.jpg), that is not the case. – matthiash Sep 26 '17 at 08:34
  • @matthiash [this](https://i.imgur.com/kqp53Si.jpg) screenshot is your host machine or container ? `che.env` file will get stored in host machine – Vikas Sachdeva Sep 26 '17 at 09:09
  • The screenshot is from my host machine. Have you tried replicating the issue, and if so, how does it look at your side? – matthiash Sep 26 '17 at 10:13
  • @matthiash I have similar environment. In my case, host folder which is mounted to `:/data` is /che-data/ and `che.env` file is present in this directory. The folders that you showed in screenshot, is present in workspace data in host machine and `/data/ ` folder in container. – Vikas Sachdeva Sep 26 '17 at 13:15
  • Could you give me the exact commands you use to 1) start the container and 2) identify the `che.env` file. I seem to need some spoon feeding here :) – matthiash Sep 26 '17 at 14:07
  • 1
    The command that I used for starting the container - `docker run -it --rm -v /che-data:/data -v /var/run/docker.sock:/var/run/docker.sock eclipse/che:5.17.0 start`. Regarding identifying `che.env` file, as you can see in command, my host folder is che-data and `che.env` file gets created inside this. – Vikas Sachdeva Sep 28 '17 at 02:57
  • 1
    I ran your command, and now the che.env file gets created. I notice that you run another image than me, I run `eclipse/che-server`, while you run `eclipse/che` (and the `start` command). Thanks! – matthiash Sep 28 '17 at 07:42
0

It's in /home//che folder. Make sure you restart Che after making changes to the file

bianchi
  • 500
  • 2
  • 12