Giter VIP home page Giter VIP logo

Comments (8)

garagatyi avatar garagatyi commented on June 29, 2024

Have you tried

RUN sudo chown -R user:user /home/user/che && \
     sudo service docker start
ENTRYPOINT ["/bin/sh", "-c", "/home/user/che/bin/che.sh run"]

And then

docker run -it --priviledged my/che -r:111.111.111.111

from che.

freewind avatar freewind commented on June 29, 2024

@garagatyi Thanks ~

I have tried but it will report this error:

!!! Running 'docker' succeeded, but 'docker ps' failed. This usually means that docker cannot reach its daemon.

Looks like something went wrong. Possible issues:
  1. (Win | Mac) VirtualBox not installed          ==> Rerun Docker Toolbox installation
  2. (Win | Mac) Docker Machine not installed      ==> Rerun Docker Toolbox installation
  3. (Win | Mac) Docker is not reachable           ==> Docker VM failed to start
  4. (Win | Mac) Docker ok, but docker ps fails    ==> Docker environment variables not set properly
  5. (Linux) Docker is not reachable               ==> Install: wget -qO- https://get.docker.com/ | sh
  6. Could not find the Che app server             ==> Did /tomcat get moved away from CHE_HOME?
  7. Did you use the right parameter syntax?       ==> See usage

We have seen issues with VirtualBox on windows where your VM gets corrupted when your computer is suspended while the VM is still running. This will appear as SSH or ethernet connection issues. This is rare, but if encountered, current known solution is to uninstall VirtualBox and Docker Toolbox, and then reinstall.

Che Environment Variables:
  (REQUIRED) JAVA_HOME                             ==> Location of Java runtime
  (REQUIRED: WIN|MAC) DOCKER_TOOLBOX_INSTALL_PATH  ==> Location of Docker Toolbox
  (REQUIRED: WIN|MAC) VBOX_MSI_INSTALL_PATH        ==> Location of VirtualBox
  (OPTIONAL) CHE_HOME                              ==> Directory where Che is installed
  (OPTIONAL) CHE_LOCAL_CONF_DIR                    ==> Directory with custom Che .properties files
  (OPTIONAL) CHE_LOGS_DIR                          ==> Directory for Che output logs


Usage:
  che [-i] [-i:tag] [-p:port] [-r:ip] [-m:vm] [-d] [run | start | stop]

     -i,      --image        Launches Che within a Docker container using latest image
     -i:tag,  --image:tag    Launches Che within a Docker container using specific image tag
     -p:port, --port:port    Port that Che server will use for HTTP requests; default=8080
     -r:ip,   --remote:ip    If Che clients are not localhost, set to IP address of Che server
     -m:vm,   --machine:vm   For Win & Mac, sets the docker-machine VM name to vm; default=default
     -s,      --suppress     Do not print browser client connection information
     -h,      --help         Show this help
     -d,      --debug        Use debug mode (prints command line options + app server debug)
     run                     Starts Che application server in current console
     start                   Starts Che application server in new console
     stop                    Stops Che application server

The -r flag sets the DOCKER_MACHINE_HOST system environment variable. Set this to the IP address of the node
that is running your Docker daemon. Only necessary to set this if on Linux and your browser clients are not
localhost, ie they are remote. This property automatically set for Che on Windows and Mac

Looks like the internal docker is not starting well which che.sh is running

from che.

TylerJewell avatar TylerJewell commented on June 29, 2024

Hi: You wrote on stack overflow:

My final solution is following you last "simple" case, neither write ENTRYPOINT nor CMD, just RUN sudo chown -R user:user /home/user/che, and invoke it like this: docker run -it --rm --privileged --net=host my/che bash -c " sudo service docker start && cd /home/user/che/bin/ && ./che.sh -r:159.203.211.163 run", which is working as I expected, although looks a little ugly.

Trying to learn some lessons here. Should we make any improvements to:

  1. The way the Dockerfile is authored, or:
  2. The way we launch Docker instances from within the che.sh scripts?

from che.

freewind avatar freewind commented on June 29, 2024

@TylerJewell Thanks for your kind suggestions! I'm not sure what I really want for now, since I haven't read much of the che code, and not quite clear about the design in the che.sh.

I'm start to read che code now, may I reply this several days later?

from che.

amalic avatar amalic commented on June 29, 2024

I have the same problem on WIndows7 (64Bit) at my workplace-PC and on WIndows10 at home.

If you guys are testing the installation, maybe you're testing it on a machine which already fulfills a prerequisite which the installation of che doesn't create.

`

echo %JAVA_HOME%
C:\Development\Java\jdk1.8.0_60

echo %DOCKER_TOOLBOX_INSTALL_PATH%
C:\Program Files\Docker Toolbox

echo %VBOX_MSI_INSTALL_PATH%
C:\Program Files\Oracle\VirtualBox
`

Following EInvironment variables are not set:
CHE_HOME, CHE_LOCAL_CONF_DIR, CHE_LOGS_DIR, CHE_DOCKER_MACHINE_NAME, DOCKER_MACHINE_HOST

from che.

randywallace avatar randywallace commented on June 29, 2024

@freewind if you still have problems try a different storage on docker. I kept running into this issue (docker not starting in docker-in-docker scenario) until I used devicemapper in both my VM and the nested docker. I ended up creating a compose file to run eclipse-che for me (note that you will have to make some changes for the extra_hosts and the -r) which you can use to easily track how you override the CMD from the original image, without having to bake a new Dockerfile image just for running che.

che:
  image: codenvy/che:latest
  #image: codenvy/che:4.0.0-beta-13
  command: >
    /bin/bash -c "
    sudo chown -R user:user /home/user/che &&
    sudo chmod 666 /etc/default/docker &&
    echo 'DOCKER_OPTS="'"'"-s devicemapper"'"'"' >> /etc/default/docker &&
    sudo service docker start &&
    cd /home/user/che/bin/ && ./che.sh run -d -r:${DOCKER_MACHINE_HOST}
    "
  ports:
    - "8080:8080"
    - "32768-32788:32768-32788"
  volumes:
    - "${HOME}/.che/conf:/home/user/.che"
    - "${HOME}/.che/projects:/home/user/che/temp/fs-root"
  privileged: true
  container_name: che
  extra_hosts:
    - "${CHE_HOSTNAME_IN_BROWSER}:127.0.0.1"

and I run it with: CHE_HOSTNAME_IN_BROWSER="vagrant-docker" DOCKER_MACHINE_HOST="172.128.128.3" docker-compose -f this_file.yaml up -d

hope this helps... YMMV (a lot), I run this on a Vagrant box in OS X, not via docker-machine

from che.

TylerJewell avatar TylerJewell commented on June 29, 2024

Pull request #257 will help with some of the questions stated here. Can you check this and let us know if we can close this issue?

from che.

 avatar commented on June 29, 2024

@freewind The new way to start Che in Docker addresses all these issues. Docs are here https://eclipse-che.readme.io/docs/usage-docker

In other threads you confirmed you can run Che in Docker on Digital Ocean. So I am closing the issue. Feel free ti reopen if the problem persists.

from che.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.