{"id":7290,"date":"2022-12-29T09:38:17","date_gmt":"2022-12-29T00:38:17","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=7290"},"modified":"2022-12-30T08:00:55","modified_gmt":"2022-12-29T23:00:55","slug":"docker-hub%e3%81%aeubuntu%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6docker%e5%af%be%e8%a9%b1%e7%92%b0%e5%a2%83%e3%82%92%e8%a9%a6%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b%ef%bc%81","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/7290","title":{"rendered":"Docker Hub\u306eUbuntu\u3092\u4f7f\u7528\u3057\u3066\u5bfe\u8a71\u578b\u3067Docker\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u5229\u7528\u3057\u3066\u307f\u308b\uff01"},"content":{"rendered":"<p>Docker Hub\u306eUbuntu\u3092\u4f7f\u7528\u3057\u3066\u5bfe\u8a71\u578b\u3067Docker\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u5229\u7528\u3057\u3066\u307f\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>Ubuntu\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066bash\u3092\u5b9f\u884c\u3059\u308b\uff01\uff08docker run -it\uff09<\/h2>\n<pre class=\"brush: plain; highlight: [1,11]; title: ; notranslate\" title=\"\">\r\n$ docker container run -it ubuntu bash\r\nUnable to find image 'ubuntu:latest' locally\r\nlatest: Pulling from library\/ubuntu\r\n6e3729cf69e0: Pull complete \r\nDigest: sha256:27cb6e6ccef575a4698b66f5de06c7ecd61589132d5a91d098f7f3f9285415a9\r\nStatus: Downloaded newer image for ubuntu:latest\r\nroot@a11d8355444b:\/# ps -ef\r\nUID          PID    PPID  C STIME TTY          TIME CMD\r\nroot           1       0  0 00:10 pts\/0    00:00:00 bash\r\nroot           9       1  0 00:11 pts\/0    00:00:00 ps -ef\r\nroot@a11d8355444b:\/# exit\r\nexit\r\n<\/pre>\n<h2>Ubuntu\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u78ba\u8a8d\u3059\u308b\uff01\uff08docker image ls\uff09<\/h2>\n<p>\u4eca\u56de\u306f\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u30a4\u30e1\u30fc\u30b8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u306a\u304b\u3063\u305f\u306e\u3067\u3001TAG\u304clatest\u306e\u6700\u65b0\u7248\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u305f\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ docker image ls\r\nREPOSITORY   TAG       IMAGE ID       CREATED       SIZE\r\nubuntu       latest    6b7dfa7e8fdb   2 weeks ago   77.8MB\r\n<\/pre>\n<h2>Ubuntu\u306ebash\u3092\u5b9f\u884c\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3092\u78ba\u8a8d\u3059\u308b\uff01\uff08docker container ps -a\uff09<\/h2>\n<p>\u4eca\u56de\u306f\u3001\u30b3\u30f3\u30c6\u30ca\u540d\u3092\u6307\u5b9a\u3057\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u81ea\u52d5\u3067\u30b3\u30f3\u30c6\u30ca\u540d\u304c\u5272\u308a\u5f53\u3066\u3089\u308c\u3001\u300ccrazy_perlman\u300d\u3067\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ docker container ps -a\r\nCONTAINER ID   IMAGE     COMMAND   CREATED          STATUS                      PORTS     NAMES\r\na11d8355444b   ubuntu    &quot;bash&quot;    37 seconds ago   Exited (0) 14 seconds ago             crazy_perlman\r\n<\/pre>\n<h2>bash\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u30aa\u30d7\u30b7\u30e7\u30f3\u6307\u5b9a\u306a\u3057\u3067\u5b9f\u884c\u3059\u308b\uff01\uff08docker container start\uff09<\/h2>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u6a5f\u80fd\u78ba\u8a8d\u306e\u76ee\u7684\u3067\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u6307\u5b9a\u306a\u3057\u3067\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3082\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002\u30d0\u30c3\u30af\u30b0\u30e9\u30f3\u30c9\u3067\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306a\u72b6\u614b\u306a\u306e\u3067\u3001\u300cstop\u300d\u30b3\u30de\u30f3\u30c9\u3067\u505c\u6b62\u3055\u305b\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,3,6,8]; title: ; notranslate\" title=\"\">\r\n$ docker container start crazy_perlman \r\ncrazy_perlman\r\n$ docker ps\r\nCONTAINER ID   IMAGE     COMMAND   CREATED         STATUS         PORTS     NAMES\r\na11d8355444b   ubuntu    &quot;bash&quot;    8 minutes ago   Up 3 seconds             crazy_perlman\r\n$ docker container stop crazy_perlman \r\ncrazy_perlman\r\n$ docker ps\r\nCONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES\r\n<\/pre>\n<h2>bash\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u306b\u30a2\u30bf\u30c3\u30c1\u3057\u3066\u5b9f\u884c\u3059\u308b\uff01\uff08docker container start -a\uff09<\/h2>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u6a5f\u80fd\u78ba\u8a8d\u306e\u76ee\u7684\u3067\u3001\u30b3\u30f3\u30c6\u30ca\u30cb\u30a2\u30bf\u30c3\u30c1\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u306f\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u304c\u3001\u30b3\u30de\u30f3\u30c9\u81ea\u4f53\u306f\u53d7\u3051\u4ed8\u3051\u306a\u3044\u72b6\u614b\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,3]; title: ; notranslate\" title=\"\">\r\n$ docker container ps\r\nCONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES\r\n$ docker container start -a crazy_perlman \r\nroot@a11d8355444b:\/# ps\r\n<\/pre>\n<p>\u5225\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u3001\u300cstop\u300d\u30b3\u30de\u30f3\u30c9\u3067\u505c\u6b62\u3055\u305b\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ docker container stop crazy_perlman \r\ncrazy_perlman\r\n<\/pre>\n<h2>bash\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u306b\u30bf\u30fc\u30df\u30ca\u30eb\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u3066\u5b9f\u884c\u3059\u308b\uff01\uff08docker container start -ai\uff09<\/h2>\n<p>bash\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u30bf\u30fc\u30df\u30ca\u30eb\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u3066\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002\u30b3\u30de\u30f3\u30c9\u304c\u53d7\u4ed8\u53ef\u80fd\u306a\u72b6\u614b\u3067\u8d77\u52d5\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,6]; title: ; notranslate\" title=\"\">\r\n$ docker container start -ai crazy_perlman\r\nroot@a11d8355444b:\/# ps\r\n    PID TTY          TIME CMD\r\n      1 pts\/0    00:00:00 bash\r\n      9 pts\/0    00:00:00 ps\r\nroot@a11d8355444b:\/# exit\r\nexit\r\n<\/pre>\n<h2>\u5b9f\u884c\u4e2d\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\uff01\uff08docker container exec\uff09<\/h2>\n<p>\u300cdocker container exec\u300d\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3068\u5b9f\u884c\u4e2d\u306e\u30b3\u30f3\u30c6\u30ca\u5185\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ docker container exec rcrazy_perlman df -h\r\nFilesystem           Size  Used Avail Use% Mounted on\r\noverlay               17G  5.7G   12G  34% \/\r\ntmpfs                 64M     0   64M   0% \/dev\r\nshm                   64M     0   64M   0% \/dev\/shm\r\n\/dev\/mapper\/rl-root   17G  5.7G   12G  34% \/etc\/hosts\r\ntmpfs                886M     0  886M   0% \/proc\/asound\r\ntmpfs                886M     0  886M   0% \/proc\/acpi\r\ntmpfs                886M     0  886M   0% \/proc\/scsi\r\ntmpfs                886M     0  886M   0% \/sys\/firmware\r\n<\/pre>\n<h2>bash\u4ee5\u5916\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\uff01\uff08docker container run\uff09<\/h2>\n<p>Ubuntu\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u8868\u793a\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ docker container run ubuntu cat \/etc\/issue\r\nUbuntu 22.04.1 LTS \\n \\l\r\n<\/pre>\n<h2>\u30b3\u30f3\u30c6\u30ca\u3092\u307e\u3068\u3081\u3066\u524a\u9664\u3059\u308b\uff01\uff08docker container prune\uff09<\/h2>\n<p>\u300cdocker run\u300d\u3092\u7e70\u308a\u8fd4\u3059\u3068\u30b3\u30f3\u30c6\u30ca\u304c\u6e9c\u307e\u3063\u3066\u3044\u304d\u307e\u3059\u3002\u4e0d\u8981\u306b\u306a\u3063\u305f\u3089\u3001\u307e\u3068\u3081\u3066\u6d88\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,5,13]; title: ; notranslate\" title=\"\">\r\n$ docker container ps -a\r\nCONTAINER ID   IMAGE     COMMAND            CREATED             STATUS                       PORTS     NAMES\r\n23582ef155b1   ubuntu    &quot;cat \/etc\/issue&quot;   2 minutes ago       Exited (0) 2 minutes ago               keen_heisenberg\r\na11d8355444b   ubuntu    &quot;bash&quot;             About an hour ago   Exited (137) 4 minutes ago             crazy_perlman\r\n$ docker container prune\r\nWARNING! This will remove all stopped containers.\r\nAre you sure you want to continue? &#x5B;y\/N] y\r\nDeleted Containers:\r\n23582ef155b14fb3530bec634fd3bc84d0469e16a28b4aa0ba4c9e1d1ec512a7\r\na11d8355444b64aa8a25da5e966ee4ac98b3525e0971ad8aafe84d78b54f48d9\r\n\r\nTotal reclaimed space: 20B\r\n$ docker container ps -a\r\nCONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES\r\n<\/pre>\n<h2>\u30a4\u30e1\u30fc\u30b8\u3092\u307e\u3068\u3081\u3066\u524a\u9664\u3059\u308b\uff01\uff08docker image prune -a\uff09<\/h2>\n<p>\u30a4\u30e1\u30fc\u30b8\u306b\u3064\u3044\u3066\u3082\u307e\u3068\u3081\u3066\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,11]; title: ; notranslate\" title=\"\">\r\n$ docker image prune -a\r\nWARNING! This will remove all images without at least one container associated to them.\r\nAre you sure you want to continue? &#x5B;y\/N] y\r\nDeleted Images:\r\nuntagged: ubuntu:latest\r\nuntagged: ubuntu@sha256:27cb6e6ccef575a4698b66f5de06c7ecd61589132d5a91d098f7f3f9285415a9\r\ndeleted: sha256:6b7dfa7e8fdbe18ad425dd965a1049d984f31cf0ad57fa6d5377cca355e65f03\r\ndeleted: sha256:6515074984c6f8bb1b8a9962c8fb5f310fc85e70b04c88442a3939c026dbfad3\r\n\r\nTotal reclaimed space: 77.8MB\r\n$ docker image ls\r\nREPOSITORY   TAG       IMAGE ID   CREATED   SIZE\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>Ubuntu\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u7528\u3057\u3066\u3001Docker\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u5bfe\u8a71\u578b\u3067\u4f7f\u7528\u3059\u308b\u30b1\u30fc\u30b9\u3092\u8a66\u3057\u3066\u307e\u3057\u305f\u3002<\/p>\n<h2>\u53c2\u8003\u60c5\u5831<\/h2>\n<ul>\n<li><a href=\"https:\/\/docs.docker.com\/\" target=\"_blank\" rel=\"noopener\">Docker Docs<\/a><\/li>\n<li><a href=\"https:\/\/hub.docker.com\/\" target=\"_blank\" rel=\"noopener\">Docker Hub<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/docker\" target=\"_blank\" rel=\"noopener\">GitHub - Docker<\/a><\/li>\n<\/ul>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/6869\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Docker\u3067\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2020\/01\/eyecatch_docker_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Docker\u3067\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">Docker\u3067\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<h2>\u95a2\u9023\u66f8\u7c4d\uff08Amazon\uff09<\/h2>\n<p><iframe sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=infotecr-22&language=ja_JP&o=9&p=8&l=as4&m=amazon&f=ifr&ref=as_ss_li_til&asins=B0998CHJ9W&linkId=19a3b3108d3e43a0fba5a585ea9cf335\"><\/iframe><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker Hub\u306eUbuntu\u3092\u4f7f\u7528\u3057\u3066\u5bfe\u8a71\u578b\u3067Docker\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u5229\u7528\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":6879,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[159],"tags":[],"class_list":["post-7290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/7290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=7290"}],"version-history":[{"count":0,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/7290\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/6879"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=7290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=7290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=7290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}