{"id":890,"date":"2024-01-26T19:47:49","date_gmt":"2024-01-26T10:47:49","guid":{"rendered":"https:\/\/www8281uo.sakura.ne.jp\/blog\/?p=890"},"modified":"2024-01-30T11:42:15","modified_gmt":"2024-01-30T02:42:15","slug":"dockerfile-%e3%81%ae%e4%b8%ad%e3%81%a7-conda-activate-%e3%81%a7%e3%81%8d%e3%81%aa%e3%81%84%e3%81%a8%e3%81%8d%e3%81%ae%e5%af%be%e5%87%a6%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www8281uo.sakura.ne.jp\/blog\/?p=890","title":{"rendered":"Dockerfile \u306e\u4e2d\u3067 conda activate \u3067\u304d\u306a\u3044\u3068\u304d\u306e\u5bfe\u51e6\u6cd5"},"content":{"rendered":"\n<p>Dockerfile \u3067\u30d3\u30eb\u30c9\u4e2d\u306b <code>conda activate<\/code> \u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001<code>conda init<\/code> \u3057\u308d\u307f\u305f\u3044\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u3051\u3069\u3001\u305d\u308c\u3092\u66f8\u3044\u305f\u3068\u3053\u308d\u3067\u89e3\u6c7a\u3057\u306a\u3044\u3002\u3061\u3087\u3063\u3068\u8abf\u3079\u3066\u3082\u306a\u304b\u306a\u304b\u826f\u3044 workaround \u304c\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306b\u306f\u5927\u304d\u304f\uff12\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u3001\u4e00\u3064\u306f <code>conda run<\/code> \u3092\u4f7f\u3046\u65b9\u6cd5\u3067\u3001\u3082\u3046\u4e00\u3064\u306f <code>RUN<\/code> \u306e\u4e2d\u8eab\u3092\u5b9f\u884c\u3059\u308b <code>SHELL<\/code> \u3092\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306b\u3059\u308b\u65b9\u6cd5\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">conda run \u3092\u4f7f\u3046\u65b9\u6cd5<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>RUN &lt;&lt;EOF\nset -xe\nconda run -n &lt;env&gt; &lt;command&gt;\nEOF<\/code><\/pre>\n\n\n\n<p>\u307f\u305f\u3044\u306b\u3059\u308b\u3068\u3001conda \u74b0\u5883\u306e\u4e2d\u3067\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u308c\u308b\u3002\u305f\u3060\u3001\u3053\u308c\u3060\u3051\u3060\u3068\u30b3\u30de\u30f3\u30c9\u306b\u3088\u3063\u3066\u306f\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306a\u30b7\u30a7\u30eb\u3067\u5b9f\u884c\u3059\u308b\u3068\u304d\u3068\u6319\u52d5\u304c\u5909\u308f\u308b\u3082\u306e\u304c\u3042\u3063\u3066\u3001\u601d\u3063\u305f\u7d50\u679c\u306b\u306a\u3089\u306a\u3044\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SHELL \u3092\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306b\u3059\u308b\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u3053\u308c\u306f\u3001<code>SHELL<\/code> \u3092\u660e\u793a\u7684\u306b\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SHELL &#91;\"\/bin\/bash\", \"-i\", \"-c\"]\n\nRUN &lt;&lt;EOF\nset -xe\nconda activate &lt;env&gt;\ncommand\ncoda deactivate<\/code><\/pre>\n\n\n\n<p>\u3053\u3046\u3059\u308b\u3068\u3001<code>-i<\/code> \u306b\u3088\u308a\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306a\u30b7\u30a7\u30eb\u3067\u5b9f\u884c\u3055\u308c\u308b\u3002\u3053\u306e\u5834\u5408\u3001<code>conda activate<\/code> \u3067\u304d\u308b\u306e\u3067\u666e\u6bb5\u306e\u4f7f\u3044\u65b9\u3068\u540c\u69d8\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dockerfile \u3067\u30d3\u30eb\u30c9\u4e2d\u306b conda activate \u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001conda init \u3057\u308d\u307f\u305f\u3044\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u3051\u3069\u3001\u305d\u308c\u3092\u66f8\u3044\u305f\u3068\u3053\u308d\u3067\u89e3\u6c7a\u3057\u306a\u3044\u3002\u3061\u3087\u3063\u3068\u8abf\u3079\u3066\u3082\u306a\u304b\u306a\u304b\u826f\u3044 workaround [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[23],"tags":[],"class_list":["post-890","post","type-post","status-publish","format-standard","hentry","category-docker"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=890"}],"version-history":[{"count":2,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/890\/revisions"}],"predecessor-version":[{"id":897,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/890\/revisions\/897"}],"wp:attachment":[{"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}