blob: 2753174343652d42d886978c2682e9f086fcc263 [file] [log] [blame]
<!-- jQuery Eclipse IP approval https://dev.eclipse.org/ipzilla/show_bug.cgi?id=10801 -->
<script type="text/javascript" charset="utf8" src="../../../docs/assets/scripts/jquery-1.8.1.min.js"></script>
<script type="text/javascript" charset="utf8">
$(document).ready(function(){
var images = document.getElementsByTagName('img');
for (var i = 0; i < images.length; i++) {
var image = images[i];
var parentElement = image.parentElement;
var a = document.createElement('a');
if (! image.getAttribute('src').includes("logo-codenvy.svg") && ! image.getAttribute('src').includes("codenvy-contribute.svg") ){
a.href = image.getAttribute('src');
a.target = "_blank";
a.appendChild(image);
parentElement.appendChild(a);
}
}
});
</script>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<title>Docker Installation -
Docs
- Eclipse Che</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Jekyll v3.5.1">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
<link rel="stylesheet" href="../../../docs/assets/css/screen.css">
<link rel="icon" type="image/x-icon" href="../../../docs/assets/imgs/favicon.ico">
<!--[if lt IE 9]>
<script src="/js/html5shiv.min.js"></script>
<script src="/js/respond.min.js"></script>
<![endif]-->
</head>
<body class="wrap">
<header>
<nav class="mobile-nav show-on-mobiles">
<ul>
<li class="current">
<a href="../../../docs/index.html">Docs</a>
</li>
<li class="">
<a href="../../../docs/tutorials/multi-machine/index.html">Tutorials</a>
</li>
<li class="">
<a href="../../../docs/openshift/config/index.html">OpenShift</a>
</li>
<li>
<a href="https://github.com/eclipse/che-docs/tree/master/src/main">GitHub</a>
</li>
</ul>
</nav>
<div class="grid">
<div class="unit one-third center-on-mobiles">
<a href="https://eclipse.org/che/">
<span class="sr-only">Eclipse Che</span>
<img src="../../../docs/assets/imgs/logo-eclipseche.svg" alt="Eclipse Che Logo" width="249" height="115">
</a>
</div>
<nav class="main-nav unit two-thirds hide-on-mobiles">
<ul>
<li class="current">
<a href="../../../docs/index.html">Docs</a>
</li>
<li class="">
<a href="../../../docs/tutorials/multi-machine/index.html">Tutorials</a>
</li>
<li class="">
<a href="../../../docs/openshift/config/index.html">OpenShift</a>
</li>
<li>
<a href="https://github.com/eclipse/che-docs/tree/master/src/main">GitHub</a>
</li>
</ul>
</nav>
</div>
</header>
<section class="docs">
<div class="grid">
<div class="docs-nav-mobile unit whole show-on-mobiles">
<select onchange="if (this.value) window.location.href=this.value">
<option value="">Navigate the docs…</option>
<optgroup label="SETUP">
<ul>
<option value="../../../docs/index.html">Introduction</option>
<option value="../../../docs/setup/getting-started/index.html">Getting Started&#58 Local</option>
<option value="../../../docs/setup/getting-started-saas-cloud/index.html">Getting Started&#58 SaaS Cloud</option>
<option value="../../../docs/setup/configuration/index.html">Configuration</option>
<option value="../../../docs/setup/managing/index.html">Managing</option>
<option value="../../../docs/setup/cli/index.html">CLI Reference</option>
<option value="../../../docs/setup/glossary/index.html">Glossary</option>
<option value="../../../docs/setup/docker/index.html">Docker Installation</option>
<option value="../../../docs/setup/openshift/index.html">OpenShift Installation</option>
<option value="../../../docs/setup/selenium/index.html">How to run selenium tests</option>
</ul>
<ul>
<li class=""><a href="../../../docs/index.html">Introduction</a></li>
<li class=""><a href="../../../docs/setup/getting-started/index.html">Getting Started&#58 Local</a></li>
<li class=""><a href="../../../docs/setup/getting-started-saas-cloud/index.html">Getting Started&#58 SaaS Cloud</a></li>
<li class=""><a href="../../../docs/setup/configuration/index.html">Configuration</a></li>
<li class=""><a href="../../../docs/setup/managing/index.html">Managing</a></li>
<li class=""><a href="../../../docs/setup/cli/index.html">CLI Reference</a></li>
<li class=""><a href="../../../docs/setup/glossary/index.html">Glossary</a></li>
<li class="current"><a href="../../../docs/setup/docker/index.html">Docker Installation</a></li>
<li class=""><a href="../../../docs/setup/openshift/index.html">OpenShift Installation</a></li>
<li class=""><a href="../../../docs/setup/selenium/index.html">How to run selenium tests</a></li>
</ul>
</optgroup>
<optgroup label="WORKSPACE ADMINISTRATION">
<ul>
<option value="../../../docs/devops/intro/index.html">Introduction</option>
<option value="../../../docs/devops/runtime-stacks/index.html">Runtime Stacks</option>
<option value="../../../docs/devops/runtime-recipes/index.html">Runtime Recipes</option>
<option value="../../../docs/devops/project-samples/index.html">Project Samples</option>
<option value="../../../docs/devops/runtime-machines/index.html">Runtime Machines</option>
<option value="../../../docs/devops/volume-mounts/index.html">Volume Mounts</option>
<option value="../../../docs/devops/ws-agents/index.html">Workspace Agents</option>
<option value="../../../docs/devops/workspaces-data-model/index.html">Workspace Data Model</option>
<option value="../../../docs/devops/runtime-stacks-data-model/index.html">Runtime Stacks Data Model</option>
<option value="../../../docs/devops/project-samples-data-model/index.html">Project Samples Data Model</option>
</ul>
<ul>
<li class=""><a href="../../../docs/devops/intro/index.html">Introduction</a></li>
<li class=""><a href="../../../docs/devops/runtime-stacks/index.html">Runtime Stacks</a></li>
<li class=""><a href="../../../docs/devops/runtime-recipes/index.html">Runtime Recipes</a></li>
<li class=""><a href="../../../docs/devops/project-samples/index.html">Project Samples</a></li>
<li class=""><a href="../../../docs/devops/runtime-machines/index.html">Runtime Machines</a></li>
<li class=""><a href="../../../docs/devops/volume-mounts/index.html">Volume Mounts</a></li>
<li class=""><a href="../../../docs/devops/ws-agents/index.html">Workspace Agents</a></li>
<li class=""><a href="../../../docs/devops/workspaces-data-model/index.html">Workspace Data Model</a></li>
<li class=""><a href="../../../docs/devops/runtime-stacks-data-model/index.html">Runtime Stacks Data Model</a></li>
<li class=""><a href="../../../docs/devops/project-samples-data-model/index.html">Project Samples Data Model</a></li>
</ul>
</optgroup>
<optgroup label="USER GUIDE">
<ul>
<option value="../../../docs/ide/projects/index.html">Projects</option>
<option value="../../../docs/ide/import-a-project/index.html">Import</option>
<option value="../../../docs/ide/ssh/index.html">SSH</option>
<option value="../../../docs/ide/sync/index.html">Local IDE Sync</option>
<option value="../../../docs/ide/editor-settings/index.html">Editor</option>
<option value="../../../docs/ide/intellisense/index.html">Intellisense</option>
<option value="../../../docs/ide/commands/index.html">Commands</option>
<option value="../../../docs/ide/git-svn/index.html">Git and SVN</option>
<option value="../../../docs/ide/previews/index.html">Previews</option>
<option value="../../../docs/ide/build/index.html">Build</option>
<option value="../../../docs/ide/run/index.html">Run</option>
<option value="../../../docs/ide/sharing/index.html">Share</option>
<option value="../../../docs/ide/debug/index.html">Debug</option>
<option value="../../../docs/ide/docker/index.html">Docker</option>
<option value="../../../docs/ide/electron/index.html">Install Che Desktop Client</option>
</ul>
<ul>
<li class=""><a href="../../../docs/ide/projects/index.html">Projects</a></li>
<li class=""><a href="../../../docs/ide/import-a-project/index.html">Import</a></li>
<li class=""><a href="../../../docs/ide/ssh/index.html">SSH</a></li>
<li class=""><a href="../../../docs/ide/sync/index.html">Local IDE Sync</a></li>
<li class=""><a href="../../../docs/ide/editor-settings/index.html">Editor</a></li>
<li class=""><a href="../../../docs/ide/intellisense/index.html">Intellisense</a></li>
<li class=""><a href="../../../docs/ide/commands/index.html">Commands</a></li>
<li class=""><a href="../../../docs/ide/git-svn/index.html">Git and SVN</a></li>
<li class=""><a href="../../../docs/ide/previews/index.html">Previews</a></li>
<li class=""><a href="../../../docs/ide/build/index.html">Build</a></li>
<li class=""><a href="../../../docs/ide/run/index.html">Run</a></li>
<li class=""><a href="../../../docs/ide/sharing/index.html">Share</a></li>
<li class=""><a href="../../../docs/ide/debug/index.html">Debug</a></li>
<li class=""><a href="../../../docs/ide/docker/index.html">Docker</a></li>
<li class=""><a href="../../../docs/ide/electron/index.html">Install Che Desktop Client</a></li>
</ul>
</optgroup>
<optgroup label="PORTABLE WORKSPACES">
<ul>
<option value="../../../docs/chedir/getting-started/index.html">Chedir - Getting Started</option>
<option value="../../../docs/chedir/why/index.html">Chedir - Why Chedir?</option>
<option value="../../../docs/chedir/installation/index.html">Chedir - Installation</option>
<option value="../../../docs/chedir/project-setup/index.html">Chedir - Project Setup</option>
<option value="../../../docs/chedir/up-and-down/index.html">Chedir - Up and Down</option>
<option value="../../../docs/chedir/chefiles/index.html">Chedir - Chefile</option>
<option value="../../../docs/chedir/ssh/index.html">Chedir - SSH</option>
<option value="../../../docs/chedir/factories/index.html">Chedir - Factories</option>
<option value="">Error Generating Page Link. Contact Maintainer./docs/factory-getting-started/</option>
<option value="">Error Generating Page Link. Contact Maintainer./docs/factory-creating/</option>
<option value="">Error Generating Page Link. Contact Maintainer./docs/factory-json-reference/</option>
</ul>
<ul>
<li class=""><a href="../../../docs/chedir/getting-started/index.html">Chedir - Getting Started</a></li>
<li class=""><a href="../../../docs/chedir/why/index.html">Chedir - Why Chedir?</a></li>
<li class=""><a href="../../../docs/chedir/installation/index.html">Chedir - Installation</a></li>
<li class=""><a href="../../../docs/chedir/project-setup/index.html">Chedir - Project Setup</a></li>
<li class=""><a href="../../../docs/chedir/up-and-down/index.html">Chedir - Up and Down</a></li>
<li class=""><a href="../../../docs/chedir/chefiles/index.html">Chedir - Chefile</a></li>
<li class=""><a href="../../../docs/chedir/ssh/index.html">Chedir - SSH</a></li>
<li class=""><a href="../../../docs/chedir/factories/index.html">Chedir - Factories</a></li>
<li class=""><a href="../../../docs/factory/getting-started/index.html">Factory - Getting Started</a></li>
<li class=""><a href="../../../docs/factory/creating/index.html">Factory - Creating</a></li>
<li class=""><a href="../../../docs/factory/json-reference/index.html">Factory - JSON Reference</a></li>
</ul>
</optgroup>
<optgroup label="DEVELOPER GUIDE - REST API">
<ul>
<option value="../../../docs/assemblies/intro/index.html">Introduction</option>
<option value="../../../docs/assemblies/archetype/index.html">Archetype</option>
<option value="../../../docs/assemblies/assembly-lifecycle/index.html">Assembly Dev Lifecycle</option>
<option value="../../../docs/assemblies/plugin-lifecycle/index.html">Plugin Lifecycle</option>
<option value="../../../docs/assemblies/sdk-rest-apis/index.html">SDK REST APIs</option>
<option value="../../../docs/assemblies/sdk-class-reference/index.html">SDK Class Reference</option>
<option value="../../../docs/assemblies/sdk-dependency-injection/index.html">SDK Dependency Injection</option>
<option value="../../../docs/assemblies/sdk-dto/index.html">SDK DTOs</option>
<option value="../../../docs/assemblies/sdk-properties/index.html">SDK Properties</option>
<option value="../../../docs/assemblies/sdk-code-editors/index.html">SDK Editors</option>
<option value="../../../docs/assemblies/sdk-embed-htmljs/index.html">SDK Embedded JavaScript</option>
<option value="../../../docs/assemblies/sdk-project-types/index.html">SDK Project Types</option>
<option value="../../../docs/assemblies/sdk-actions/index.html">SDK Actions</option>
<option value="../../../docs/assemblies/sdk-services/index.html">SDK Services</option>
<option value="../../../docs/assemblies/sdk-parts/index.html">SDK Parts</option>
<option value="../../../docs/assemblies/sdk-themes/index.html">SDK Themes</option>
<option value="../../../docs/assemblies/sdk-custom-agents/index.html">SDK Custom Agents</option>
<option value="../../../docs/assemblies/sdk-language-server-protocol/index.html">SDK Language Server Protocol</option>
<option value="../../../docs/assemblies/sdk-workspace/index.html">SDK Workspace</option>
</ul>
<ul>
<li class=""><a href="../../../docs/assemblies/intro/index.html">Introduction</a></li>
<li class=""><a href="../../../docs/assemblies/archetype/index.html">Archetype</a></li>
<li class=""><a href="../../../docs/assemblies/assembly-lifecycle/index.html">Assembly Dev Lifecycle</a></li>
<li class=""><a href="../../../docs/assemblies/plugin-lifecycle/index.html">Plugin Lifecycle</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-rest-apis/index.html">SDK REST APIs</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-class-reference/index.html">SDK Class Reference</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-dependency-injection/index.html">SDK Dependency Injection</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-dto/index.html">SDK DTOs</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-properties/index.html">SDK Properties</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-code-editors/index.html">SDK Editors</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-embed-htmljs/index.html">SDK Embedded JavaScript</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-project-types/index.html">SDK Project Types</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-actions/index.html">SDK Actions</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-services/index.html">SDK Services</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-parts/index.html">SDK Parts</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-themes/index.html">SDK Themes</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-custom-agents/index.html">SDK Custom Agents</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-language-server-protocol/index.html">SDK Language Server Protocol</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-workspace/index.html">SDK Workspace</a></li>
</ul>
</optgroup>
</select>
</div>
<div class="unit four-fifths">
<article>
<div class="improve right hide-on-mobiles">
<a href="https://github.com/codenvy/che-docs/blob/master/src/main/_docs/setup/setup-docker.md"><i class="fa fa-pencil"></i> &nbsp;Improve this page</a>
<!--<a href="https://github.com/eclipse/che/blob/master/docs/_docs/setup/setup-docker.md"><i class="fa fa-pencil"></i> &nbsp;Improve this page</a>-->
</div>
<div class="doc-title">
<h1>Docker Installation</h1>
<div class="doc-title-border">
</div>
</div>
<p>You can run the Che server directly by launching a Docker image. This approach bypasses the CLI, which has additional utilities to simplify administration and operation. The <code class="highlighter-rouge">eclipse/che-server</code> Docker image is appropriate for running Che within clusters, orchestrators, or by third party tools with automation.</p>
<h1 id="run-the-image">Run the Image</h1>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code><span class="c"># Run the latest released version of Che</span>
<span class="c"># Replace &lt;LOCAL_PATH&gt; with any host folder</span>
<span class="c"># Che will place backup files there - configurable properties, workspaces, lib, storage</span>
docker run -p 8080:8080 <span class="se">\</span>
--name che <span class="se">\</span>
--rm <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
-v &lt;LOCAL_PATH&gt;:/data <span class="se">\</span>
eclipse/che-server:5.0.0-latest
<span class="c"># To run the nightly version of Che, replace eclipse/che-server:5.0.0-latest with</span>
eclipse/che-server:nightly
<span class="c"># To run a specific tagged version of Che, replace eclipse/che-server:5.0.0-latest with</span>
eclipse/che-server:&lt;version&gt;
<span class="c"># Stop the container running Che</span>
docker stop che
<span class="c"># Restart the container running Che and restart the Che server</span>
docker restart che
<span class="c"># Upgrade to a newer version</span>
docker pull eclipse/che-server:5.0.0-latest
docker restart che
</code></pre>
</div>
<p>Che has started when you see <code class="highlighter-rouge">Server startup in ##### ms</code>. After starting, Che is available at <code class="highlighter-rouge">localhost:8080</code> or a remote IP if Che has been started remotely. The examples on this page assume that I am running this container on a Windows machine and I would like my workspaces to be saved in <code class="highlighter-rouge">C:\tmp</code>. Note that on Windows, volume mounts require Linux-formatted syntax, for which they are here.</p>
<h2 id="selinux">SELinux</h2>
<p>If you are on SELinux then run this instead:</p>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code><span class="c"># Run the latest released version of Che</span>
docker run -p 8080:8080 <span class="se">\</span>
--name che <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
-v &lt;LOCAL_PATH&gt;:/data:Z <span class="se">\</span>
--security-opt label:disable <span class="se">\</span>
-e <span class="nv">CHE_DOCKER_SERVER__EVALUATION__STRATEGY</span><span class="o">=</span>docker-local <span class="se">\</span>
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
<h2 id="ports">Ports</h2>
<p>Tomcat inside the container will bind itself to port 8080 by default. You must map this port to be exposed in your container using <code class="highlighter-rouge">-p 8080:8080</code>. If you want to change the port at which your browsers connect, then change the first value, such as <code class="highlighter-rouge">p 9000:8080</code>. This will route requests from port 9000 to the internal Tomcat bound to port 8080. If you want to change the internal port that Tomcat is bound, you must update the port binding and set <code class="highlighter-rouge">CHE_PORT</code> to the new value.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code>docker run -p 9000:9500 \
--name che \
-e CHE_PORT=9500 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v &lt;LOCAL_PATH&gt;:/data \
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
<h2 id="configuration">Configuration</h2>
<p>Most important configuration properties are defined as environment variables that you pass into the container. You can also optionally pass in a custom <code class="highlighter-rouge">che.properties</code> which has internal Che configuration that is loaded when Che’s tomcat is booted. For example, to have Che listen on port 9000:</p>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code>docker run -p:9000:9000 <span class="se">\</span>
--name che <span class="se">\</span>
-e <span class="nv">CHE_SERVER_ACTION</span><span class="o">=</span>stop <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
-v &lt;LOCAL_PATH&gt;:/data <span class="se">\</span>
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
<p>There are many variables that can be set.</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
<th>Defaults</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">CHE_SERVER_ACTION</code></td>
<td>The command to send to Tomcat. it can be [<code class="highlighter-rouge">run</code>, <code class="highlighter-rouge">start</code> , <code class="highlighter-rouge">stop</code>].</td>
<td><code class="highlighter-rouge">run</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">CHE_LOCAL_CONF_DIR</code></td>
<td>Folder where a custom <code class="highlighter-rouge">che.properties</code> located. If not provided, then the container will copy the system <code class="highlighter-rouge">che.properties</code> into <code class="highlighter-rouge">/data/conf/che.properties</code>. You can reuse this or replace it with configuration on a different folder using this variable. If you use this variable, you must also mount the same directory.</td>
<td><code class="highlighter-rouge">/data/conf</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">CHE_ASSEMBLY</code></td>
<td>The path to a Che assembly that is on your host to be used instead of the assembly packaged within the <code class="highlighter-rouge">che-server</code> image. If you set this variable, you must also volume mount the same directory to <code class="highlighter-rouge">/home/user/che</code></td>
<td><code class="highlighter-rouge">/home/user/che</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">CHE_IN_VM</code></td>
<td>Set to ‘true’ if this container is running inside of a VM providing Docker such as boot2docker, Docker for Mac, or Docker for Windows. We auto-detect this for most situations, but it’s not always perfect.</td>
<td>auto-detection</td>
</tr>
<tr>
<td><code class="highlighter-rouge">CHE_LOG_LEVEL</code></td>
<td>Logging level of output for Che server. Can be <code class="highlighter-rouge">debug</code> or <code class="highlighter-rouge">info</code>.</td>
<td><code class="highlighter-rouge">info</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">CHE_IP</code></td>
<td>IP address Che server will bind to. Used by browsers to contact workspaces. You must set this IP address if you want to bind the Che server to an external IP address that is not the same as Docker’s.</td>
<td>The IP address set to the Docker host. This does cover 99% of situations, but on rare occassions we are not able to discover this IP address and you must provide it.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">CHE_DEBUG_SERVER</code></td>
<td>If <code class="highlighter-rouge">true</code>, then will launch the Che server with JPDA activated so that you a Java debugger can attach to the Che server for debugging plugins, extensions, and core libraries.</td>
<td><code class="highlighter-rouge">false</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">CHE_DEBUG_SERVER_PORT</code></td>
<td>The port that the JPDA debugger will listen.</td>
<td><code class="highlighter-rouge">8000</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">CHE_DEBUG_SERVER_SUSPEND</code></td>
<td>If <code class="highlighter-rouge">true</code>, then activates <code class="highlighter-rouge">JPDA_SUSPEND</code> flag for Tomcat running the Che server. Used for advanced internal debugging of extensions.</td>
<td><code class="highlighter-rouge">false</code></td>
</tr>
<tr>
<td><code class="highlighter-rouge">CHE_PORT</code></td>
<td>The port the Che server will bind itself to within the Che container.</td>
<td><code class="highlighter-rouge">8080</code></td>
</tr>
</tbody>
</table>
<h2 id="run-che-on-public-ip-address">Run Che on Public IP Address</h2>
<p>If you want to have remote browser clients connect to the Che server (as opposed to local browser clients) and override the defaults that we detect, set <code class="highlighter-rouge">CHE_IP</code> to the Docker host IP address that will have requests forwarded to the <code class="highlighter-rouge">che-server</code> container.</p>
<p>We run an auto-detection algorithm within the che-server container to determine this IP. If Docker is running on <code class="highlighter-rouge">boot2docker</code> this is usually the <code class="highlighter-rouge">eth1</code> interface. If you are running Docker for Windows or Docker for Mac this is usually the <code class="highlighter-rouge">eth0</code> interface. If you are running Docker natively on Linux, this is the <code class="highlighter-rouge">docker0</code> interface. If your host that is running Docker has its IP at 10.0.75.4 and you wanted to allow remote clients access to this container then:</p>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code>docker run -p:8080:8080 <span class="se">\</span>
--name che <span class="se">\</span>
-e <span class="nv">CHE_IP</span><span class="o">=</span>10.0.75.4 <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
-v &lt;LOCAL_PATH&gt;:/data <span class="se">\</span>
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
<h2 id="run-che-as-a-daemon">Run Che as a Daemon</h2>
<p>Pass the <code class="highlighter-rouge">--restart always</code> parameter to the docker syntax to have the Docker daemon restart the container on any exit event, including when your host is initially booting. You can also run Che in the background with the <code class="highlighter-rouge">-d</code> option.</p>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code>docker run -p:8080:8080 <span class="se">\</span>
--name che <span class="se">\</span>
--restart always <span class="se">\</span>
-e <span class="nv">CHE_IP</span><span class="o">=</span>10.0.75.4 <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
-v &lt;LOCAL_PATH&gt;:/data <span class="se">\</span>
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
<h2 id="override-che-internals">Override Che Internals</h2>
<p>Eclipse Che running in the container has its configuration in <code class="highlighter-rouge">/data/conf/che.properties</code>. This file is copied into the directory that you mount into <code class="highlighter-rouge">/data</code>. You can modify this file and restart Che if you want.</p>
<p>You can also start a shell session in the context of the running container. This will allow you to browse all directories and use your favorite text editor.</p>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code>sudo docker <span class="nb">exec</span> -it che /bin/bash
<span class="c"># You can also just edit /home/user/che/conf/che.properties`:</span>
sudo docker <span class="nb">exec</span> -it che vi /data/conf/che.properties
<span class="c"># After you finish making changes, restart the contain</span>
docker restart che
</code></pre>
</div>
<p>You can save your Che configuration to reside outside of the container to be reusable between different container instances. Create a local <code class="highlighter-rouge">che.properties</code> file, volume mount it into the container, and also tell Che in the container where to locate this file.</p>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code><span class="c"># Mount host directory with che.properties into container and inform Che where it is.</span>
<span class="c"># Place the folder with che.properties as a mount to /conf</span>
docker run -p:8080:8080 <span class="se">\</span>
--name che <span class="se">\</span>
--restart always <span class="se">\</span>
-e <span class="nv">CHE_IP</span><span class="o">=</span>10.0.75.4 <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
-v &lt;LOCAL_PATH&gt;:/data <span class="se">\</span>
-v /C/conf:/conf <span class="se">\</span>
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
<h2 id="use-local-che-assembly">Use Local Che Assembly</h2>
<p>You can run the Che image with a Che assembly that you have installed (or compiled) locally on your host. If you are developing a custom assembly, extension, or developing Che, you can mount your local binaries built on your host into the container by mounting the assembly to <code class="highlighter-rouge">/assembly</code>.</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code># If your local assembly is located at /home/my_assembly:
docker run -p:8080:8080 \
--name che \
--restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v &lt;LOCAL_PATH&gt;:/data \
-v /C/conf:/conf \
-v /home/my_assembly:/assembly \
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
<h2 id="port-exposure">Port Exposure</h2>
<p>Docker uses the ephemeral port range from <code class="highlighter-rouge">32768-65535</code>. If you do not want to expose ports <code class="highlighter-rouge">32768-65535</code> because of the large port range, you need to reconfigure your Docker daemon to communicate over the <code class="highlighter-rouge">docker0</code> interface. You need to set <code class="highlighter-rouge">DOCKER_MACHINE_HOST</code> to <code class="highlighter-rouge">172.17.0.1</code> and modify <code class="highlighter-rouge">machine.docker.che_api.endpoint</code> in the <code class="highlighter-rouge">che.properties</code> file.</p>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code><span class="c"># Modify your local che.properties with:</span>
machine.docker.che_api.endpoint<span class="o">=</span>http://172.17.0.1:8080/wsmaster/api
<span class="c"># Run the Che container with:</span>
docker run -p:8080:8080 <span class="se">\</span>
--name che <span class="se">\</span>
--restart always <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
-v &lt;LOCAL_PATH&gt;:/data <span class="se">\</span>
-v /C/conf:/conf <span class="se">\</span>
-v /home/my_assembly:/assembly <span class="se">\</span>
-e <span class="nv">DOCKER_MACHINE_HOST</span><span class="o">=</span>172.17.0.1 <span class="se">\</span>
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
<p><em>Compose File</em></p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">che</span><span class="pi">:</span>
<span class="s">image</span><span class="pi">:</span> <span class="s">eclipse/che-server:5.0.0-latest</span>
<span class="s">port</span><span class="pi">:</span> <span class="s">8080:8080</span>
<span class="s">restart</span><span class="pi">:</span> <span class="s">always</span>
<span class="s">environment</span><span class="pi">:</span>
<span class="s">CHE_LOCAL_CONF_DIR=/C/conf</span>
<span class="s">CHE_ASSEMBLY=/home/my_assembly</span>
<span class="s">DOCKER_MACHINE_HOST=172.17.0.1</span>
<span class="s">volumes</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">/var/run/docker.sock:/var/run/docker.sock</span>
<span class="pi">-</span> <span class="s">&lt;LOCAL_PATH&gt;:/data</span>
<span class="pi">-</span> <span class="s">/C/conf:/conf</span>
<span class="pi">-</span> <span class="s">/home/my_assembly:/assembly</span>
<span class="s">container_name</span><span class="pi">:</span> <span class="s">che</span>
</code></pre>
</div>
<p>Save this into a file named <code class="highlighter-rouge">Composefile</code>. Replace the <code class="highlighter-rouge">${IP}</code> with the IP address of the server where you are hosting Eclipse Che. You can then run this with Docker Compose with <code class="highlighter-rouge">docker-compose -f Composefile -d</code>.</p>
<h1 id="docker-unix-socket-mounting-vs-tcp-mode">Docker Unix Socket Mounting vs TCP Mode</h1>
<p>The <code class="highlighter-rouge">-v /var/run/docker.sock:/var/run/docker.sock</code> syntax is for mounting a Unix socket so that when a process inside the container speaks to a Docker daemon, the process is redirected to the same socket on the host system.</p>
<p>However, peculiarities of file systems and permissions may make it impossible to invoke Docker processes from inside a container. If this happens, the Che startup scripts will print an error about not being able to reach the Docker daemon with guidance on how to resolve the issue.</p>
<p>An alternative solution is to run Docker daemon in TCP mode on the host and export <code class="highlighter-rouge">DOCKER_HOST</code> environment variable in the container. You can tell the Docker daemon to listen on both Unix sockets and TCP. On the host running the Docker daemon:</p>
<div class="language-text highlighter-rouge"><pre class="highlight"><code># Set this environment variable and restart the Docker daemon
DOCKER_OPTS=" -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
# Verify that the Docker API is responding at:
http://localhost:2375/containers/json
</code></pre>
</div>
<p>Having verified that your Docker daemon is listening, run the Che container with the with <code class="highlighter-rouge">DOCKER_HOST</code> environment variable set to the IP address of <code class="highlighter-rouge">docker0</code> or <code class="highlighter-rouge">eth0</code> network interface. If <code class="highlighter-rouge">docker0</code> is running on 1.1.1.1 then:</p>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code>docker run -p:8080:8080 <span class="se">\</span>
--name che <span class="se">\</span>
--restart always <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
-v &lt;LOCAL_PATH&gt;:/data <span class="se">\</span>
-v /C/conf:/conf <span class="se">\</span>
-v /home/my_assembly:/assembly <span class="se">\</span>
-e <span class="nv">DOCKER_MACHINE_HOST</span><span class="o">=</span>172.17.0.1 <span class="se">\</span>
-e <span class="nv">DOCKER_HOST</span><span class="o">=</span>tcp://1.1.1.1:2375 <span class="se">\</span>
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
<h1 id="where-is-data-stored">Where Is Data Stored?</h1>
<p>The Che container uses host mounted volumes to store persistent data:</p>
<table>
<thead>
<tr>
<th>Local Location</th>
<th>Container Location</th>
<th>Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">/var/run/docker.sock</code></td>
<td><code class="highlighter-rouge">/var/run/docker.sock</code></td>
<td>This is how Che gets access to Docker daemon. This instructs the container to use your local Docker daemon when Che wants to create its own containers.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">/&lt;your-path&gt;/lib</code></td>
<td><code class="highlighter-rouge">/data/lib</code></td>
<td>Inside the container, we make a copy of important libraries that your workspaces will need and place them into <code class="highlighter-rouge">/lib</code>. When Che creates a workspace container, that container will be using your local Docker daemon and the Che workspace will look for these libraries in your local <code class="highlighter-rouge">/lib</code>. This is a tactic we use to get files from inside the container out onto your local host.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">/&lt;your-path&gt;/workspaces</code></td>
<td><code class="highlighter-rouge">/data/workspaces</code></td>
<td>The location of your workspace and project files.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">/&lt;your-path&gt;/storage</code>  </td>
<td><code class="highlighter-rouge">/data/storage</code>  </td>
<td>The location where Che stores the meta information that describes the various workspaces, projects and user preferences.  </td>
</tr>
</tbody>
</table>
<h1 id="debugging">Debugging</h1>
<p>Inside the Che container is a Tomcat service. The Tomcat debugger is running on port 8000. If you want to connect to that port, you need to bind it as part of the docker run command.</p>
<div class="language-shell highlighter-rouge"><pre class="highlight"><code>docker run -p 8080:8080 <span class="se">\</span>
-p 9000:8000 <span class="se">\</span>
--name che <span class="se">\</span>
--restart always <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
-v /C/tmp/:/data <span class="se">\</span>
eclipse/che-server:5.0.0-latest
</code></pre>
</div>
</article>
</div>
<div class="unit one-fifth hide-on-mobiles">
<aside>
<h4>SETUP</h4>
<ul>
<li class=""><a href="../../../docs/index.html">Introduction</a></li>
<li class=""><a href="../../../docs/setup/getting-started/index.html">Getting Started&#58 Local</a></li>
<li class=""><a href="../../../docs/setup/getting-started-saas-cloud/index.html">Getting Started&#58 SaaS Cloud</a></li>
<li class=""><a href="../../../docs/setup/configuration/index.html">Configuration</a></li>
<li class=""><a href="../../../docs/setup/managing/index.html">Managing</a></li>
<li class=""><a href="../../../docs/setup/cli/index.html">CLI Reference</a></li>
<li class=""><a href="../../../docs/setup/glossary/index.html">Glossary</a></li>
<li class="current"><a href="../../../docs/setup/docker/index.html">Docker Installation</a></li>
<li class=""><a href="../../../docs/setup/openshift/index.html">OpenShift Installation</a></li>
<li class=""><a href="../../../docs/setup/selenium/index.html">How to run selenium tests</a></li>
</ul>
<h4>WORKSPACE ADMINISTRATION</h4>
<ul>
<li class=""><a href="../../../docs/devops/intro/index.html">Introduction</a></li>
<li class=""><a href="../../../docs/devops/runtime-stacks/index.html">Runtime Stacks</a></li>
<li class=""><a href="../../../docs/devops/runtime-recipes/index.html">Runtime Recipes</a></li>
<li class=""><a href="../../../docs/devops/project-samples/index.html">Project Samples</a></li>
<li class=""><a href="../../../docs/devops/runtime-machines/index.html">Runtime Machines</a></li>
<li class=""><a href="../../../docs/devops/volume-mounts/index.html">Volume Mounts</a></li>
<li class=""><a href="../../../docs/devops/ws-agents/index.html">Workspace Agents</a></li>
<li class=""><a href="../../../docs/devops/workspaces-data-model/index.html">Workspace Data Model</a></li>
<li class=""><a href="../../../docs/devops/runtime-stacks-data-model/index.html">Runtime Stacks Data Model</a></li>
<li class=""><a href="../../../docs/devops/project-samples-data-model/index.html">Project Samples Data Model</a></li>
</ul>
<h4>USER GUIDE</h4>
<ul>
<li class=""><a href="../../../docs/ide/projects/index.html">Projects</a></li>
<li class=""><a href="../../../docs/ide/import-a-project/index.html">Import</a></li>
<li class=""><a href="../../../docs/ide/ssh/index.html">SSH</a></li>
<li class=""><a href="../../../docs/ide/sync/index.html">Local IDE Sync</a></li>
<li class=""><a href="../../../docs/ide/editor-settings/index.html">Editor</a></li>
<li class=""><a href="../../../docs/ide/intellisense/index.html">Intellisense</a></li>
<li class=""><a href="../../../docs/ide/commands/index.html">Commands</a></li>
<li class=""><a href="../../../docs/ide/git-svn/index.html">Git and SVN</a></li>
<li class=""><a href="../../../docs/ide/previews/index.html">Previews</a></li>
<li class=""><a href="../../../docs/ide/build/index.html">Build</a></li>
<li class=""><a href="../../../docs/ide/run/index.html">Run</a></li>
<li class=""><a href="../../../docs/ide/sharing/index.html">Share</a></li>
<li class=""><a href="../../../docs/ide/debug/index.html">Debug</a></li>
<li class=""><a href="../../../docs/ide/docker/index.html">Docker</a></li>
<li class=""><a href="../../../docs/ide/electron/index.html">Install Che Desktop Client</a></li>
</ul>
<h4>PORTABLE WORKSPACES</h4>
<ul>
<li class=""><a href="../../../docs/chedir/getting-started/index.html">Chedir - Getting Started</a></li>
<li class=""><a href="../../../docs/chedir/why/index.html">Chedir - Why Chedir?</a></li>
<li class=""><a href="../../../docs/chedir/installation/index.html">Chedir - Installation</a></li>
<li class=""><a href="../../../docs/chedir/project-setup/index.html">Chedir - Project Setup</a></li>
<li class=""><a href="../../../docs/chedir/up-and-down/index.html">Chedir - Up and Down</a></li>
<li class=""><a href="../../../docs/chedir/chefiles/index.html">Chedir - Chefile</a></li>
<li class=""><a href="../../../docs/chedir/ssh/index.html">Chedir - SSH</a></li>
<li class=""><a href="../../../docs/chedir/factories/index.html">Chedir - Factories</a></li>
<li class=""><a href="../../../docs/factory/getting-started/index.html">Factory - Getting Started</a></li>
<li class=""><a href="../../../docs/factory/creating/index.html">Factory - Creating</a></li>
<li class=""><a href="../../../docs/factory/json-reference/index.html">Factory - JSON Reference</a></li>
</ul>
<h4>DEVELOPER GUIDE - REST API</h4>
<ul>
<li class=""><a href="../../../docs/assemblies/intro/index.html">Introduction</a></li>
<li class=""><a href="../../../docs/assemblies/archetype/index.html">Archetype</a></li>
<li class=""><a href="../../../docs/assemblies/assembly-lifecycle/index.html">Assembly Dev Lifecycle</a></li>
<li class=""><a href="../../../docs/assemblies/plugin-lifecycle/index.html">Plugin Lifecycle</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-rest-apis/index.html">SDK REST APIs</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-class-reference/index.html">SDK Class Reference</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-dependency-injection/index.html">SDK Dependency Injection</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-dto/index.html">SDK DTOs</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-properties/index.html">SDK Properties</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-code-editors/index.html">SDK Editors</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-embed-htmljs/index.html">SDK Embedded JavaScript</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-project-types/index.html">SDK Project Types</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-actions/index.html">SDK Actions</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-services/index.html">SDK Services</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-parts/index.html">SDK Parts</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-themes/index.html">SDK Themes</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-custom-agents/index.html">SDK Custom Agents</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-language-server-protocol/index.html">SDK Language Server Protocol</a></li>
<li class=""><a href="../../../docs/assemblies/sdk-workspace/index.html">SDK Workspace</a></li>
</ul>
</aside>
</div>
<div class="clear"></div>
</div>
</section>
<script>
var anchorForId = function (id) {
var anchor = document.createElement("a");
anchor.className = "header-link";
anchor.href = "#" + id;
anchor.innerHTML = "<span class=\"sr-only\">Permalink</span><i class=\"fa fa-link\"></i>";
anchor.title = "Permalink";
return anchor;
};
var linkifyAnchors = function (level, containingElement) {
var headers = containingElement.getElementsByTagName("h" + level);
for (var h = 0; h < headers.length; h++) {
var header = headers[h];
if (typeof header.id !== "undefined" && header.id !== "") {
header.appendChild(anchorForId(header.id));
}
}
};
document.onreadystatechange = function () {
if (this.readyState === "complete") {
var contentBlock = document.getElementsByClassName("artik")[0] || document.getElementsByClassName("openshift")[0] || document.getElementsByClassName("tutorials")[0] || document.getElementsByClassName("docs")[0] || document.getElementsByClassName("news")[0];
if (!contentBlock) {
return;
}
for (var level = 1; level <= 6; level++) {
linkifyAnchors(level, contentBlock);
}
}
};
</script>
</body>
</html>