-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to remove docker-in-docker for che running as image #257
Conversation
TylerJewell
commented
Feb 2, 2016
- Do a docker pull before doing docker run to get latest image.
- Launch docker image by volume mounting directories to avoid dind.
- Update the docker exec that launches che to copy ws-agent and terminal to right location.
echo -e "Cleaning up any zombie containers named ${GREEN}che${NC}..." | ||
|
||
# Force remove any lingering zombie containers with the name che | ||
"${DOCKER}" rm -f che &> /dev/null || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's name container eclipseche to avoid possible collisions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the possible collisions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when some other product uses name che.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a new command line option --container:name which will set the name of the container. The default is che. But it can be overridden.
1. Added CONTAINER variable & command line option for setting name of docker container to use. 2. Refactored numerous strings for simpler reading and reduce duplication. 3. Added in SKIP_JAVA_VERSION check command line option 4. Improved formatting of error output.
@garagatyi Numerous improvements made. Please do another review. |
|
Yes correct. I can post what the new docker command looks like if you want. |
I should be able to figure it out, otherwise I'll let you know. What's neat is I should be able to get it running on carina 💃 |
There is one significant issue with this new approach. If you run this che container on vbox on Windows, it is able to successfully start and shutdown. But for some reason if you restart the same container, then the vbox VM will peg the CPU and not complete the boot of the Che server. It then requires the VM to be destroyed before the che container can start again. We are researching the root cause, but we think it's a vbox bug. |
I'll take you up on seeing the new docker command now :) |
This is the quickest way to experience the new container that doesn't use dind.
|
Awesome! Leaving this hear in case anyone else is curious... (I haven't tested to make sure everything works as expected yet) editor_container:
image: "codenvy/che:no_dnd"
restart: "always"
environment:
- "VIRTUAL_HOST=sub.yourdomain.org"
- "VIRTUAL_PORT=8080"
- "TZ=America/Mountains"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
volumes_from:
- "editor_data"
editor_data:
image: "codenvy/che:no_dnd"
environment:
- "TZ=America/Mountains"
volumes:
- "/home/user/che/lib-copy"
- "/home/user/che/workspaces"
- "/home/user/che/tomcat/temp/local-storage"
entrypoint: "true"
Should close #238. |
thanks for the contribution @DanTheColoradan. May we post this suggestion on the docs when we update our Docker page with the new instructions? |
if [[ "${SKIP_JAVA_VERSION}" == false ]]; then | ||
# Che requires Java version 1.8 or higher. | ||
JAVA_VERSION=$("${JAVA_HOME}/bin/java" -version 2>&1 | awk -F '"' '/version/ {print $2}') | ||
if [[ -z "${JAVA_VERSION}" || "${JAVA_VERSION}" < "1.8" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix indentation
if ${USE_DEBUG}; then | ||
set +x | ||
fi | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Necessary to avoid flawed output if script execution is interrupted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@TylerJewell It is nice that you changed functions declaration syntax but it won't help to fix #262. |
ok for me. @skabashnyuk @vparfonov WDYT? |
Hold on any merge. We have a new commit that is coming that will need re-testing. |
Made numerous improvements. We now have the ability to start / stop repeatedly a Che server running in an image without corruption. Finally!
@garagatyi @skabashnyuk @vparfonov I am ready to merge this. Made numerous improvements and now Che in a docker image is stable even after many stop / restart cycles. |
`"mkdir -p /home/user/che/lib-copy/ && "` | ||
`"sudo chown -R user:user /home/user && "` | ||
`"cp -rf /home/user/che/lib/* /home/user/che/lib-copy && "` | ||
`"sudo sed -i 's/random/urandom/g' /opt/jre1.8.0_65/lib/security/java.security && "` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explaine why you added this sed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this change decreses security of random generator. @skabashnyuk WDYT is it ok to accept that change?
I think this one isn't necessary - http://stackoverfklow.com/questions/26431922/tomcat7-starts-too-late-on-ubuntu-14-04-x64-digitalocean however, it is harmless in terms of affecting Che. It is just an exec. I thought this might be the reason why container was unresponsive. |
1. Will only stop the che server if che is in a docker container. 2. Added --stop-container option which will also stop docker container running che 3. Removed unnecessary sed command in che start
@garagatyi Ready to merge. Last updates made. |
ok |
Improvements to remove docker-in-docker for che running as image