{"id":1905,"date":"2023-06-26T10:18:21","date_gmt":"2023-06-26T01:18:21","guid":{"rendered":"https:\/\/www.kwonline.org\/memo2\/?p=1905"},"modified":"2023-09-27T10:41:11","modified_gmt":"2023-09-27T01:41:11","slug":"run-docker-ce-on-wsl2","status":"publish","type":"post","link":"https:\/\/www.kwonline.org\/memo2\/2023\/06\/26\/run-docker-ce-on-wsl2\/","title":{"rendered":"WSL2 \u3067 Docker-CE \u3092\u5b9f\u884c\u3059\u308b"},"content":{"rendered":"<p>&nbsp;<br \/>\nWSL2 \u306e Ubuntu \u3067 Docker-CE \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u306e\u3067\u30e1\u30e2\u3002<\/p>\n<p>\u307e\u305a\u306f dockere-ce \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo apt update\r\nsudo apt install apt-transport-https ca-certificates curl software-properties-common\r\ncurl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -\r\nsudo add-apt-repository &quot;deb &#x5B;arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu $(lsb_release -cs) stable&quot;\r\nsudo apt-get install docker-ce\r\n<\/pre>\n<p>\u6b21\u306b non-root \u3067\u3082 docker \u3092\u5b9f\u884c\u51fa\u6765\u308b\u3088\u3046\u306b\u81ea\u5206\u81ea\u8eab ($USER) \u3092 docker \u30b0\u30eb\u30fc\u30d7\u306b\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo usermod -aG docker $USER\r\n<\/pre>\n<p>\u4e00\u56deUbuntu\u304b\u3089\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3066\u3001\u518d\u3073\u30ed\u30b0\u30a4\u30f3\u3059\u308c\u3070OK.<\/p>\n<p>\u3055\u3066\u3001 docker \u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3059\u308b\u305f\u3081\u306b\u306f WSL2 \u306a\u306e\u3067 service \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo service docker start\r\n<\/pre>\n<p>\u3042\u3068\u306f\u901a\u5e38\u901a\u308a\u3001docker \u3092\u4f7f\u3048\u3070OK\u3002<br \/>\ndocer ps \u30b3\u30de\u30f3\u30c9\u3092\u6253\u3063\u3066\u3001\u3061\u3083\u3093\u3068Docker\u30d7\u30ed\u30bb\u30b9\u304c\u52d5\u3044\u3066\u308b\u304b\u78ba\u8a8d\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndocker ps\r\n<\/pre>\n<p><strong>\u304a\u307e\u3051<\/strong><\/p>\n<p>\u306a\u3093\u304b permission \u304c\u8db3\u308a\u306a\u3044\u4e91\u3005\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u306e\u3067\u3053\u308c\u3082\u5b9f\u884c\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# docker: Got permission denied while trying to connect to the Docker daemon socket at unix:\/\/\/var\/run\/docker.sock\r\nsudo chmod 666 \/var\/run\/docker.sock\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; WSL2 \u306e Ubuntu \u3067 Docker-CE \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u306e\u3067\u30e1\u30e2\u3002 \u307e\u305a\u306f dockere-ce \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002 sudo apt update sudo apt install apt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,8,30],"tags":[],"class_list":["post-1905","post","type-post","status-publish","format-standard","hentry","category-docker","category-linux","category-wsl"],"_links":{"self":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/comments?post=1905"}],"version-history":[{"count":3,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1905\/revisions"}],"predecessor-version":[{"id":1940,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1905\/revisions\/1940"}],"wp:attachment":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/media?parent=1905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/categories?post=1905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/tags?post=1905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}