{"id":112,"date":"2018-12-17T18:55:51","date_gmt":"2018-12-17T15:55:51","guid":{"rendered":"http:\/\/mbrdancer.ru\/?p=112"},"modified":"2018-12-17T19:38:13","modified_gmt":"2018-12-17T16:38:13","slug":"nvcr-io-nvidia-tensorflow18-11-py3-to-custom-conda-python-3-5","status":"publish","type":"post","link":"http:\/\/mbrdancer.ru\/?p=112","title":{"rendered":"nvcr.io\/nvidia\/tensorflow:18.11-py3 to custom conda python 3.5"},"content":{"rendered":"\n<h4>Pre:<\/h4>\n\n\n\n<ul><li>download&nbsp;Anaconda3 distribution (Anaconda3-5.3.0-Linux-x86_64.sh in this example)<\/li><li>create .condarc (see below)<\/li><li>create&nbsp;jupyter_notebook_config.py (see below)<\/li><\/ul>\n\n\n\n<h4>.condarc :<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>channel_priority: True\n\nchannels:\n  - conda-forge\n  - defaults\n  - intel<\/code><\/pre>\n\n\n\n<h4>jupyter_notebook_config.py :<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>c.NotebookApp.ip = '0.0.0.0'\nc.NotebookApp.open_browser = False\nc.NotebookApp.password = 'sha1: xxxxxxxxx'\n# to generate: from notebook.auth import passwd; passwd()\nc.NotebookApp.port = 8888<\/code><\/pre>\n\n\n\n<h4>Dockerfile:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM nvcr.io\/nvidia\/tensorflow:18.11-py3\n\nMAINTAINER MyName &lt;my@email.dom>\nENV LANG=C.UTF-8 LC_ALL=C.UTF-8\nCOPY\t.\/Anaconda3-5.3.0-Linux-x86_64.sh \/root\/anaconda.sh\nENV\tPATH=\"\/opt\/conda\/bin:$PATH\"\n\nRUN \tapt-get update &amp;&amp; \\\n\tapt-get install -y libgtk2.0 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx &amp;&amp; \\\n\tapt-get purge &amp;&amp; \\\n\tapt-get clean\n\nRUN\t\/bin\/bash \/root\/anaconda.sh -b -p \/opt\/conda &amp;&amp; \\\n\trm \/root\/anaconda.sh &amp;&amp; \\\n\trm \/usr\/bin\/python &amp;&amp; \\\n\tln -s \/usr\/bin\/python3.5 \/usr\/bin\/python\n\nCOPY    .\/.condarc \/root\/.condarc\n\nCOPY\t.\/jupyter_notebook_config.py \/root\/.jupyter\/\n\nVOLUME [ \"\/app\", \"\/data\" ]\nEXPOSE 8888\n\nENTRYPOINT [ \"\/usr\/local\/bin\/nvidia_entrypoint.sh\" ]\n\nWORKDIR \/app\n\nCMD [\"bash\"]\n<\/code><\/pre>\n\n\n\n<h4>build image (1st approach)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># docker build . -t myrepo\/myimg_name:tag01<\/code><\/pre>\n\n\n\n<h4>run container:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># nvidia-docker run -it --rm myrepo\/myimg_name:tag01<\/code><\/pre>\n\n\n\n<h4>inside container:&nbsp;<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># conda install python=3.5 scikit-image imageio hyperopt basemap basemap-data-hires opencv pyarrow shapely numpy=1.14\n# conda install pydot graphviz netcdf4<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Pre: download&nbsp;Anaconda3 distribution (Anaconda3-5.3.0-Linux-x86_64.sh in this example) create .condarc (see below) create&nbsp;jupyter_notebook_config.py (see below) .condarc : jupyter_notebook_config.py : Dockerfile: build image (1st approach) run container: inside container:&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=\/wp\/v2\/posts\/112"}],"collection":[{"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":7,"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":119,"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions\/119"}],"wp:attachment":[{"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mbrdancer.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}