{"id":6700,"date":"2025-06-26T18:08:29","date_gmt":"2025-06-26T09:08:29","guid":{"rendered":"https:\/\/blog.since2020.jp\/?p=6700"},"modified":"2025-06-26T18:08:29","modified_gmt":"2025-06-26T09:08:29","slug":"docker-jupyter-vscode","status":"publish","type":"post","link":"https:\/\/since2020.jp\/media\/docker-jupyter-vscode\/","title":{"rendered":"Docker \u00d7 Jupyter \u00d7 VS Code\u3067\u6a5f\u68b0\u5b66\u7fd2\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b"},"content":{"rendered":"\n<p>Docker\u3067\u6a5f\u68b0\u5b66\u7fd2\u74b0\u5883\u3092\u7c21\u5358\u69cb\u7bc9\uff01VS Code\u3068Jupyter\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30c1\u30fc\u30e0\u5168\u54e1\u304c\u540c\u3058\u74b0\u5883\u3067\u958b\u767a\u3067\u304d\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3002\u74b0\u5883\u306e\u9055\u3044\u3067\u60a9\u307e\u3055\u308c\u308b\u3053\u3068\u306a\u304f\u3001\u3059\u3050\u306b\u6a5f\u68b0\u5b66\u7fd2\u306e\u5b9f\u9a13\u306b\u96c6\u4e2d\u3067\u304d\u308b\u5b9f\u7528\u7684\u306a\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u624b\u9806\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u5206\u304b\u308a\u3084\u3059\u304f\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u6a5f\u68b0\u5b66\u7fd2\u306e\u5b9f\u9a13\u3092\u3057\u3066\u3044\u308b\u3068\u3001<strong>\u300c\u52d5\u3044\u305f\u306f\u305a\u306e\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u304c\u5225\u306e PC \u3067\u306f\u52d5\u304b\u306a\u3044\u300d<\/strong> \u3068\u3044\u3046\u7d4c\u9a13\u306f\u8ab0\u3057\u3082\u3042\u308b\u306f\u305a\u3067\u3059\u3002\u305d\u3053\u3067\u767b\u5834\u3059\u308b\u306e\u304c <strong>Docker \u00d7 VS Code Dev Containers<\/strong>\u3067\u3059\u3002Docker\u30b3\u30f3\u30c6\u30ca\u306b Jupyter Lab \u3092\u4e38\u3054\u3068\u8a70\u3081\u8fbc\u307f\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u3054\u3068\u5171\u6709\u3059\u308c\u3070<\/p>\r\n<blockquote>\r\n<p>git clone \u2192 Reopen in Container \u2192 \u5b9f\u884c<\/p>\r\n<\/blockquote>\r\n<p>\u3060\u3051\u3067\u201c\u307e\u3063\u305f\u304f\u540c\u3058\u201d\u74b0\u5883\u306b\u7acb\u3066\u308b\u3068\u3044\u3046\u518d\u73fe\u6027\u3092\u624b\u306b\u5165\u308c\u3089\u308c\u307e\u3059\u3002<\/p>\r\n<p>\u672c\u7a3f\u3067\u306f\u3001\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8 <code>jupyter\/datascience-notebook:python-3.11<\/code> \u3092\u30d9\u30fc\u30b9\u306b VS Code \u304b\u3089\u4e00\u767a\u3067\u7acb\u3061\u4e0a\u304c\u308b\u69cb\u6210\u3092\u30bc\u30ed\u304b\u3089\u4f5c\u6210\u3059\u308b\u624b\u9806\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\r\n<b><\/b>\r\n<b>\u53c2\u8003\u306b\u3057\u305f\u8a18\u4e8b<\/b>\r\n<p>[blogcard url=&#8221;https:\/\/note.com\/k_fukunaka\/n\/nabb5cd028595#ba990735-e887-40ba-a864-54eec6893a9b&#8221;]<\/p>\r\n<p><!-- notionvc: be8ef73b-1ac0-4682-b957-c686cd1d6018 --><\/p>\n\n<h2>\u4e8b\u524d\u6e96\u5099<\/h2>\n<p>\u3042\u3089\u304b\u3058\u3081\u3001Docker Desktop \u3068 Visual Studio Code (VS Code) \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>\u3055\u3089\u306b\u3001VS Code \u3067 Docker \u3068 Dev Containers \u306e\u62e1\u5f35\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\r\n<p><!-- notionvc: 9fda52cb-bcd5-4e4a-8283-36b0378fd020 --><\/p>\n\n<h2>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u50cf<\/h2>\n<p>\u3053\u3053\u3067\u306f\u201dmy-project\u201d\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u306f\u9069\u5b9c\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>my-project\/\r\n\u251c\u2500\u2500 .devcontainer\/        # \u2190 VS Code \u304c\u8aad\u3080\u5b9a\u7fa9\u4e00\u5f0f\r\n\u2502   \u251c\u2500\u2500 Dockerfile\r\n\u2502   \u251c\u2500\u2500 docker-compose.yml\r\n\u2502   \u251c\u2500\u2500 devcontainer.json\r\n\u2502   \u2514\u2500\u2500 requirements.txt  # \u2190 Python \u4f9d\u5b58\u3092\u307e\u3068\u3081\u308b\r\n\u2514\u2500\u2500 work\/                 # \u2190 \u30ce\u30fc\u30c8\u30d6\u30c3\u30af\uff0f\u30b3\u30fc\u30c9\u3092\u7f6e\u304f\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\r\n<\/code><\/pre>\r\n<\/div>\r\n<p><code>.devcontainer\/<\/code> \u3092 Git \u3067\u5171\u6709\u3059\u308c\u3070\u3001\u30e1\u30f3\u30d0\u30fc\u306f <strong>\u300cgit clone \u2192 Reopen in Container\u300d<\/strong> \u3060\u3051\u3067\u540c\u4e00\u74b0\u5883\u306b\u5165\u308c\u307e\u3059\uff08Docker Compose \u30b5\u30fc\u30d3\u30b9\u3082\u81ea\u52d5\u8d77\u52d5\uff09\u3002<\/p>\r\n<p><!-- notionvc: cb793efa-41cc-4944-9995-1704fac3083e --><\/p>\n\n<h2>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210<\/h2>\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>mkdir -p ~\/my-docker\/my-project\/.devcontainer\r\ncd ~\/my-docker\/my-project\r\nmkdir work\r\ncd .devcontainer\r\n<\/code><\/pre>\r\n<\/div>\r\n<p>\u4ee5\u964d\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3059\u3079\u3066 <code>.devcontainer\/<\/code> \u914d\u4e0b\u306b\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\r\n<p><!-- notionvc: 62f816d9-f402-4382-ab7b-951b4e9cafb8 --><\/p>\n\n<h2>Dockerfile\u3092\u4f5c\u6210<\/h2>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067<code>Dockerfile<\/code>\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>touch Dockerfile<\/code><\/pre>\r\n<\/div>\r\n<p><code>.devcontainer\/Dockerfile<\/code>\u306e\u5185\u5bb9\uff1a<\/p>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code># \u2500\u2500 \u2776 \u30d9\u30fc\u30b9\u30a4\u30e1\u30fc\u30b8 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\nFROM jupyter\/datascience-notebook:python-3.11\r\n\r\n# \u2500\u2500 \u2777 \u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u30fb\u30ed\u30b1\u30fc\u30eb\uff08\u65e5\u672c\u306a\u3089\u5165\u308c\u308b\u3068\u4fbf\u5229\uff09\u2500\u2500\r\nUSER root\r\nENV TZ=Asia\/Tokyo\r\nRUN ln -snf \/usr\/share\/zoneinfo\/$TZ \/etc\/localtime &amp;&amp; echo $TZ &gt; \/etc\/timezone\r\nUSER jovyan\r\n\r\n# \u2500\u2500 \u2778 OS \u30d1\u30c3\u30b1\u30fc\u30b8\uff08apt\uff09\u3092\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n# RUN apt-get update &amp;&amp; \\\\\r\n#     apt-get install -y --no-install-recommends \\\\\r\n#         libgl1-mesa-glx  &amp;&amp; \\\\\r\n#     apt-get clean &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/*\r\n\r\n# \u2500\u2500 \u2779 Python \u30d1\u30c3\u30b1\u30fc\u30b8\uff08Pip\/Poetry\/Conda \u3069\u308c\u3067\u3082\u53ef\uff09\u2500\u2500\r\nCOPY requirements.txt \/tmp\/requirements.txt\r\nRUN pip install --no-cache-dir -r \/tmp\/requirements.txt\r\n<\/code><\/pre>\r\n<\/div>\r\n<p>\u306a\u305c <code>jupyter\/datascience-notebook<\/code>\uff1f<\/p>\r\n<ul>\r\n\t<li><a href=\"https:\/\/hub.docker.com\/r\/jupyter\/datascience-notebook\/\"><span style=\"text-decoration: underline;color: #0000ff\">[Jupyter Docker Stacks] \u306e\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8<\/span><\/a>\u3067 <strong>Pandas \/ NumPy \/ scikit-learn \/ matplotlib<\/strong> \u7b49\u304c\u4e00\u901a\u308a\u5165\u308a\u3001\u8a66\u9a13\u3082\u6bce\u9031 CI \u3067\u56de\u3063\u3066\u3044\u307e\u3059\u3002<\/li>\r\n\t<li>\u5fc5\u8981\u306b\u5fdc\u3058\u3066 <strong>CUDA \u5bfe\u5fdc\u30a4\u30e1\u30fc\u30b8<\/strong>\uff08<code>cuda12-python-3.11<\/code> \u306a\u3069\uff09\u3078\u5dee\u3057\u66ff\u3048\u308b\u3060\u3051\u3067 GPU \u3082\u5373\u5229\u7528\u3067\u304d\u307e\u3059\u3002\r\n\r\n<ul>\r\n\t<li>\u53c2\u8003\uff1a<span style=\"text-decoration: underline;color: #0000ff\"><a href=\"https:\/\/jupyter-docker-stacks.readthedocs.io\/en\/latest\/using\/selecting.html\" style=\"color: #0000ff;text-decoration: underline\"><span style=\"color: #0000ff;text-decoration: underline\">jupyter-docker-stacks.readthedocs.io<\/span><\/a><\/span><\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<p><!-- notionvc: 98932a63-44a3-497b-b69a-5c27eebbe774 --><\/p>\n\n<h2>requirements.txt \u3092\u4f5c\u6210<\/h2>\n<p><code>.devcontainer\/requirements.txt<\/code> \u306bPython\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5217\u6319\u3057\u307e\u3059\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>\u6700\u4f4e\u9650\u306e\u4f8b\uff1a<\/p>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>numpy==1.26.4\r\npandas==2.2.2\r\nmatplotlib==3.9.2\r\nmatplotlib-inline==0.1.7\r\nscikit-learn==1.5.1\r\n<\/code><\/pre>\r\n<\/div>\r\n<p><!-- notionvc: 51df34a1-e672-4a06-b9eb-5315d5fad6b9 --><\/p>\n\n<h2>docker-compose.yml \u3092\u4f5c\u6210<\/h2>\n<p>\u4f8b\u3068\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>.devcontainer\/docker-compose.yml<\/code>\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>services:\r\n  notebook:\r\n    build: .\r\n    container_name: myproject-jupyter\r\n    # \u2776 \u30db\u30b9\u30c8\u21c6\u30b3\u30f3\u30c6\u30ca\u306e\u30d5\u30a1\u30a4\u30eb\u5171\u6709\r\n    volumes:\r\n      - ..\/work:\/home\/jovyan\/work\r\n    # \u2777 Jupyter \u3092\u516c\u958b\u3059\u308b\u30dd\u30fc\u30c8\r\n    ports:\r\n      - \"8888:8888\"\r\n    # \u2778 Notebook UI \u3092 JupyterLab \u306b\u56fa\u5b9a\r\n    environment:\r\n      JUPYTER_ENABLE_LAB: \"yes\"\r\n    # \u2779 MacSilicon \u3067 Intel \u30a4\u30e1\u30fc\u30b8\u3092\u52d5\u304b\u3059\u3068\u304d\r\n    # platform: linux\/amd64<\/code><\/pre>\r\n<\/div>\r\n<p><!-- notionvc: 728777a5-02d2-4e51-8c0c-a37debbb156f --><\/p>\n\n<h2>devcontainer.json \u3092\u4f5c\u6210<\/h2>\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>{\r\n  \"name\": \"My-Jupyter-DevContainer\",\r\n  \/\/ \u2776 Compose \u30d5\u30a1\u30a4\u30eb\u3068\u30b5\u30fc\u30d3\u30b9\u540d\r\n  \"dockerComposeFile\": \"docker-compose.yml\",\r\n  \"service\": \"notebook\",\r\n  \/\/ \u2777 \u3069\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u201c\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9\u201d\u3068\u3057\u3066\u898b\u305b\u308b\u304b\r\n  \"workspaceFolder\": \"\/home\/jovyan\/work\",\r\n  \"remoteUser\": \"jovyan\",\r\n  \/\/ \u2778 VS Code \u306e\u62e1\u5f35\u3092\u81ea\u52d5\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n  \"customizations\": {\r\n    \"vscode\": {\r\n      \"extensions\": [\r\n        \"ms-python.python\",\r\n        \"ms-toolsai.jupyter\",\r\n        \"ms-azuretools.vscode-docker\"\r\n      ],\r\n      \"settings\": {\r\n        \"python.defaultInterpreterPath\": \"\/opt\/conda\/bin\/python\"\r\n      }\r\n    }\r\n  },\r\n  \/\/ \u2779 \u30d3\u30eb\u30c9\u5f8c\u306b\u4e00\u5ea6\u3060\u3051\u5b9f\u884c\r\n  \"postCreateCommand\": \"pip check\",\r\n  \/\/ \u277a dotfiles \/ GitHub Codespaces \u4e92\u63db\r\n  \"features\": {}\r\n}\r\n<\/code><\/pre>\r\n<\/div>\r\n<p><code>dockerComposeFile<\/code> \u3068 <code>service<\/code> \u306e\u30da\u30a2\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001VS Code \u306f <strong>Compose up \u2192 attach \u2192 Workspace open<\/strong> \u307e\u3067\u81ea\u52d5\u5316\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\r\n<p><!-- notionvc: c4f0912a-64f7-4c94-9f18-2378637221eb --><\/p>\n\n<h2>\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u3066\u5165\u308b<\/h2>\n<p><strong>1: Dev Container \u3078\u63a5\u7d9a<\/strong><\/p>\r\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092 VS Code \u3067\u958b\u304d\u3001\u30b3\u30de\u30f3\u30c9\u30d1\u30ec\u30c3\u30c8 <code>\u2318\u21e7P<\/code> \u2192 <strong>Dev Containers: Reopen in Container<\/strong> \u3092\u5b9f\u884c\u3002\u30b9\u30c6\u30fc\u30bf\u30b9\u30d0\u30fc\u5de6\u7aef\u304c <code>&gt;&lt; Dev Container:<\/code> \u306b\u5909\u308f\u308c\u3070\u63a5\u7d9a\u5b8c\u4e86\u3067\u3059\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><strong>2: \u62e1\u5f35\u6a5f\u80fd\u306e\u81ea\u52d5\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><\/p>\r\n<p><code>devcontainer.json<\/code> \u306e <code>customizations<\/code> \u306b\u5217\u6319\u3057\u305f <strong>Python \/ Jupyter \/ Docker<\/strong> \u62e1\u5f35\u304c\u81ea\u52d5\u3067\u5c0e\u5165\u3055\u308c\u3001\u5b8c\u4e86\u5f8c\u306b VS Code \u304c\u518d\u8aad\u307f\u8fbc\u307f\u3055\u308c\u307e\u3059\u3002\u5de6\u5074\u306e Activity Bar \u306b \u201cJupyter\u201d \u30a2\u30a4\u30b3\u30f3\u304c\u73fe\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><strong>3: \u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u306e\u4f5c\u6210\u30fb\u30aa\u30fc\u30d7\u30f3<\/strong><\/p>\r\n<p><em>\u65b0\u898f\u4f5c\u6210<\/em> \u306f\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u30fc\u3067 <code>+ New Jupyter Notebook<\/code> \u3092\u9078\u629e\u3002<em>\u65e2\u5b58<\/em> \u30ce\u30fc\u30c8\u306f <code>work\/<\/code> \u5185\u306e <code>.ipynb<\/code> \u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3066\u958b\u304d\u307e\u3059\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><strong>4: \u30ab\u30fc\u30cd\u30eb\u3092\u78ba\u8a8d\u30fb\u5207\u308a\u66ff\u3048<\/strong><\/p>\r\n<p>\u30ce\u30fc\u30c8\u53f3\u4e0a\u306e <strong>Kernel<\/strong> \u8868\u793a\u304c <em>Python 3.x (myproject-jupyter)<\/em> \u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002\u9055\u3046\u5834\u5408\u306f\u30af\u30ea\u30c3\u30af\u3057\u3066 <strong>Select Kernel<\/strong> \u2192 <em>Python 3 (ipykernel)<\/em> \u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><strong>5: \u30bb\u30eb\u306e\u5b9f\u884c<\/strong><\/p>\r\n<p>\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066 <code>Shift Enter<\/code>\u3002\u5b9f\u884c\u4e2d\u306f\u884c\u756a\u53f7\u5de6\u306b <code>*<\/code>\u3001\u7d42\u4e86\u3059\u308b\u3068\u5b9f\u884c\u6642\u9593\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\r\n<p><!-- notionvc: 6d05911d-bd4b-4912-871d-013f972a7c53 --><\/p>\n\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u4ee5\u4e0a\u3067 <strong>Docker \u00d7 Jupyter \u00d7 VS Code<\/strong> \u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u518d\u73fe\u6027\u306e\u9ad8\u3044\u6a5f\u68b0\u5b66\u7fd2\u958b\u767a\u74b0\u5883\u304c\u5b8c\u6210\u3057\u307e\u3057\u305f\uff01<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>\u30dd\u30a4\u30f3\u30c8\u3092\u632f\u308a\u8fd4\u308b\u3068\u3001<\/p>\r\n<p><strong>1: \u74b0\u5883\u306e\u30b3\u30fc\u30c9\u5316<\/strong><\/p>\r\n<p><code>.devcontainer\/<\/code> \u4ee5\u4e0b\u306b Dockerfile\u30fbCompose\u30fb\u8a2d\u5b9a\u3092\u9589\u3058\u8fbc\u3081\u308b\u3053\u3068\u3067\u3001\u74b0\u5883\u69cb\u7bc9\u3092\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u4e00\u90e8\u3068\u3057\u3066\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3067\u304d\u308b\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><strong>2: \u30ef\u30f3\u30b9\u30c6\u30c3\u30d7\u8d77\u52d5<\/strong><\/p>\r\n<p>VS Code \u306e <em>Reopen in Container<\/em> \u3067\u81ea\u52d5\u30d3\u30eb\u30c9\uff06\u30a2\u30bf\u30c3\u30c1\u3002\u4ee5\u5f8c\u306f <code>docker compose up -d<\/code> \u3067\u3044\u3064\u3067\u3082\u518d\u958b\u53ef\u80fd\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><strong>3: \u4f9d\u5b58\u306e\u8ffd\u52a0\u3068\u4fdd\u5b88\u304c\u7c21\u5358<\/strong><\/p>\r\n<p><code>requirements.txt<\/code> \u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u8ffd\u8a18\u3057\u3066 <em>Rebuild Container<\/em> \u3059\u308b\u3060\u3051\u3002\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6b8b\u3055\u306a\u3044\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30a4\u30e1\u30fc\u30b8\u3082\u30b9\u30ea\u30e0\u5316\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><strong>4: \u30de\u30eb\u30c1\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\uff0fGPU \u3082\u5bfe\u5fdc<\/strong><\/p>\r\n<p><code>jupyter\/datascience-notebook<\/code> \u7cfb\u306f arm64 \u3068 amd64 \u306e\u30de\u30eb\u30c1\u30a2\u30fc\u30ad\u30bf\u30b0\u3092\u63d0\u4f9b\u3002GPU \u304c\u5fc5\u8981\u306b\u306a\u3063\u305f\u3089 CUDA \u5bfe\u5fdc\u30bf\u30b0\u3078\u5dee\u3057\u66ff\u3048\u308b\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>\u3053\u306e\u4ed5\u7d44\u307f\u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u96db\u5f62\u3068\u3057\u3066\u304a\u3051\u3070\u3001\u65b0\u30e1\u30f3\u30d0\u30fc\u3067\u3082 <strong>\u300cclone \u3057\u3066 5 \u5206\u5f8c\u306b\u306f\u5b66\u7fd2\u304c\u8d70\u308b\u300d<\/strong> \u72b6\u614b\u3092\u518d\u73fe\u3067\u304d\u307e\u3059\u3002\u672c\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3057\u3066\u3001\u305c\u3072 Docker \u00d7 Jupyter \u00d7 VS Code \u3067\u6a5f\u68b0\u5b66\u7fd2\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<!-- notionvc: 41159fd7-e246-4ea1-8133-037f46049ac3 --><\/p>\r\n<p><!-- notionvc: 89ad07cf-d996-47ae-a89f-bff9d39d7bd9 --><\/p>","protected":false},"excerpt":{"rendered":"<p>Docker\u3067\u6a5f\u68b0\u5b66\u7fd2\u74b0\u5883\u3092\u7c21\u5358\u69cb\u7bc9\uff01VS Code\u3068Jupyter\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u30c1\u30fc\u30e0\u5168\u54e1\u304c\u540c\u3058\u74b0\u5883\u3067\u958b\u767a\u3067\u304d\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3002\u74b0\u5883\u306e\u9055\u3044\u3067\u60a9\u307e\u3055\u308c\u308b\u3053\u3068\u306a\u304f\u3001\u3059\u3050\u306b\u6a5f\u68b0\u5b66\u7fd2\u306e\u5b9f\u9a13\u306b\u96c6\u4e2d\u3067\u304d\u308b\u5b9f\u7528\u7684\u306a\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u624b\u9806\u3092\u521d [&hellip;]<\/p>\n","protected":false},"author":46,"featured_media":6904,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","swell_btn_cv_data":"","footnotes":"","_wp_rev_ctl_limit":""},"categories":[1249],"tags":[511,332,492],"class_list":["post-6700","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledge","tag-docker","tag-jupyter-notebook","tag-vscode"],"_links":{"self":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts\/6700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/comments?post=6700"}],"version-history":[{"count":1,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts\/6700\/revisions"}],"predecessor-version":[{"id":6905,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/posts\/6700\/revisions\/6905"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/media\/6904"}],"wp:attachment":[{"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/media?parent=6700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/categories?post=6700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/since2020.jp\/media\/wp-json\/wp\/v2\/tags?post=6700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}