blob: 9aa364d9d83fdeadb2659d54e3d87ed9649896de [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
<meta charset="UTF-8">
<title>Docker usage</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Jekyll v2.4.0">
<link rel="stylesheet" href="/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/screen.css">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<script src="/js/jquery-3.2.1.min.js"></script>
<!--[if lt IE 9]>
<script src="/js/html5shiv.min.js"></script>
<script src="/js/respond.min.js"></script>
<![endif]-->
<script src="/js/screen.js"></script>
<script type="text/javascript" src="/assets/javascripts/bundle.js" charset="utf-8"></script>
</head>
<body>
<header role="banner">
<nav class="mobile-nav show-on-mobiles">
<ul>
<li class="">
<a href="/">Home</a>
</li>
<li class="current">
<a href="/docs/">Doc<span class="show-on-mobiles">s</span><span class="hide-on-mobiles">umentation</span></a>
</li>
</li>
<li class="">
<a href="/downloads/">Downloads</a>
</li>
<li class="">
<a href="/talks/">Talks</a>
</li>
<li class="">
<a href="/news/">News</a>
</li>
<li class="">
<a href="/develop/">Develop</a>
</li>
<li class="">
<a href="/help/">Help</a>
</li>
</ul>
</nav>
<div class="grid">
<div class="unit one-third center-on-mobiles">
<h1>
<a href="/">
<span class="sr-only">Apache Mnemonic</span>
<img src="/img/mnemonic_logo_v2.png" width="289" alt="Mnemonic Logo" class="logo">
</a>
<a href="https://www.apache.org/events/current-event.html">
<img src="https://www.apache.org/events/current-event-234x60.png"/>
</a>
</h1>
</div>
<nav class="main-nav unit two-thirds hide-on-mobiles">
<ul>
<li class="">
<a href="/">Home</a>
</li>
<li class="current">
<a href="/docs/">Doc<span class="show-on-mobiles">s</span><span class="hide-on-mobiles">umentation</span></a>
</li>
</li>
<li class="">
<a href="/downloads/">Downloads</a>
</li>
<li class="">
<a href="/talks/">Talks</a>
</li>
<li class="">
<a href="/news/">News</a>
</li>
<li class="">
<a href="/develop/">Develop</a>
</li>
<li class="">
<a href="/help/">Help</a>
</li>
</ul>
</nav>
</div>
<!-- Return to Top -->
<a href="#top" id="return-to-top"><i class="fa fa-chevron-up"></i></a>
</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="Overview">
<option value="/docs/arch.html">Architecture</option>
<option value="/docs/features.html">Features</option>
<option value="/docs/modes.html">Mnemonic Modes</option>
<option value="/docs/memsrvcmp.html">Durable Memory Service Comparison</option>
<option value="/docs/integration.html">Integration with other projects</option>
<option value="/docs/domusecases.html">DOM Use Cases</option>
<option value="/docs/dcmusecases.html">DCM Use Cases</option>
<option value="/docs/msusecases.html">MS Use Cases</option>
<option value="/docs/sparkusecases.html">Apache Spark Integration Use Cases</option>
<option value="/docs/hadoopusecases.html">Apache Hadoop Integration Use Cases</option>
<option value="/docs/gcdata.html">Java GC data</option>
<option value="/docs/security.html">Security</option>
</optgroup>
<optgroup label="Usage">
<option value="/docs/getstarted.html">Get Started</option>
<option value="/docs/devsetup.html">Development Setup</option>
<option value="/docs/submitchanges.html">Submit Changes</option>
<option value="/docs/build.html">Project Build</option>
<option value="/docs/runtest.html">Run tests</option>
<option value="/docs/docker.html">Docker usage</option>
</optgroup>
</select>
</div>
<div class="unit four-fifths">
<article>
<h1>Docker usage</h1>
<p>This is the “Dockerfiles” that will automatically build the CentOS/Ubuntu environment of this project.</p>
<hr />
<p>### Features:</p>
<p><em>What does the Dockerfile do?</em></p>
<ul>
<li>Build from centos/ubuntu.</li>
<li>Default is not using proxy. Please see instruction below to set up http/https proxy.</li>
<li>Install dependency packages.</li>
<li>Set up environment variables of paths.</li>
<li>Create /ws folder.</li>
<li>Install pmalloc in /ws</li>
<li>Install nvml in /ws.</li>
<li>Set up maven proxy mvn.sh.</li>
<li>Clone mnemonic code then build/install.</li>
<li>Go to /ws fold and start bash.</li>
</ul>
<h4 id="how-to-set-up-proxy">How to set up proxy?</h4>
<p>Set the argument “http_proxy” for the docker option “–build-arg” as follows
<code>bash
$ docker build -t NAME[:TAG] --build-arg proxy_host="&lt;proxy_host&gt;" proxy_port="&lt;proxy_port&gt;" .
</code></p>
<p>For old version docker v1.10 below, Please replace ARG with ENV and set its value as proxy strings in Dockerfile instead</p>
<h3 id="how-to-build-the-docker-image-from-dockerfile-in-host-os">How to build the docker image from Dockerfile in host OS?</h3>
<p>Build from git repository</p>
<p><code>bash
$ docker build -t NAME[:TAG] https://github.com/apache/mnemonic.git#:docker/docker-CentOS
$ docker build -t NAME[:TAG] https://github.com/apache/mnemonic.git#:docker/docker-Ubuntu
</code></p>
<p>– OR –</p>
<p>In the folder of Dockerfile, run:</p>
<p><code>bash
$ docker build -t NAME[:TAG] .
</code></p>
<ul>
<li>More detials please refer to <a href="https://docs.docker.com/engine/reference/commandline/build/">Docker build reference</a></li>
</ul>
<h4 id="optional-after-build-push-image-to-dockerhub">Optional: After build, push image to dockerhub:</h4>
<p><code>bash
$ docker login [OPTIONS] [SERVER]
$ docker push [OPTIONS] NAME[:TAG]
</code></p>
<ul>
<li>More detials please refer to <a href="https://docs.docker.com/engine/reference/commandline/login/">Docker login reference</a>
and <a href="https://docs.docker.com/engine/reference/commandline/push/">Docker push reference</a></li>
</ul>
<h3 id="how-to-run-image-after-build">How to run image after build</h3>
<p>Run image:</p>
<p><code>bash
$ docker run --name CONTAINER_NAME -it NAME[:TAG]
</code></p>
<h3 id="sharing-host-project-folder-to-dock-container-for-ides-eg-eclipse-intellij-idea">Sharing host project folder to Dock container for IDEs e.g. Eclipse, Intellij IDEA</h3>
<p><code>bash
$ docker run -v &lt;hostdir&gt;/mnemonic:/ws/mnemonic -it NAME[:TAG]
</code>
Note: this command will override the container’s project folder, you can use another name to avoid it.</p>
<ul>
<li>More details please refer to <a href="https://docs.docker.com/engine/reference/run/">Docker run reference</a></li>
</ul>
<div class="section-nav">
<div class="left align-right">
<a href="/docs/runtest.html" class="prev">Back</a>
</div>
<div class="right align-left">
<span class="next disabled">Next</span>
</div>
</div>
<div class="clear"></div>
</article>
</div>
<div class="unit one-fifth hide-on-mobiles">
<aside>
<h4>Overview</h4>
<ul>
<li class=""><a href="/docs/arch.html">Architecture</a></li>
<li class=""><a href="/docs/features.html">Features</a></li>
<li class=""><a href="/docs/modes.html">Mnemonic Modes</a></li>
<li class=""><a href="/docs/memsrvcmp.html">Durable Memory Service Comparison</a></li>
<li class=""><a href="/docs/integration.html">Integration with other projects</a></li>
<li class=""><a href="/docs/domusecases.html">DOM Use Cases</a></li>
<li class=""><a href="/docs/dcmusecases.html">DCM Use Cases</a></li>
<li class=""><a href="/docs/msusecases.html">MS Use Cases</a></li>
<li class=""><a href="/docs/sparkusecases.html">Apache Spark Integration Use Cases</a></li>
<li class=""><a href="/docs/hadoopusecases.html">Apache Hadoop Integration Use Cases</a></li>
<li class=""><a href="/docs/gcdata.html">Java GC data</a></li>
<li class=""><a href="/docs/security.html">Security</a></li>
</ul>
<h4>Usage</h4>
<ul>
<li class=""><a href="/docs/getstarted.html">Get Started</a></li>
<li class=""><a href="/docs/devsetup.html">Development Setup</a></li>
<li class=""><a href="/docs/submitchanges.html">Submit Changes</a></li>
<li class=""><a href="/docs/build.html">Project Build</a></li>
<li class=""><a href="/docs/runtest.html">Run tests</a></li>
<li class="current"><a href="/docs/docker.html">Docker usage</a></li>
</ul>
</aside>
</div>
<div class="clear"></div>
</div>
</section>
<footer role="contentinfo">
<p><div align="center">Apache Mnemonic, Mnemonic, Apache, and the Mnemonic logo are trademarks of The Apache Software Foundation.</div>
<div align="center"> Copyright &copy;&nbsp;2021 <a href="https://www.apache.org/">The Apache Software Foundation</a></div></p>
</footer>
<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("docs")[0] || document.getElementsByClassName("news")[0];
if (!contentBlock) {
return;
}
for (var level = 1; level <= 6; level++) {
linkifyAnchors(level, contentBlock);
}
}
};
</script>
</body>
</html>