{"id":971,"date":"2023-10-01T12:23:09","date_gmt":"2023-10-01T03:23:09","guid":{"rendered":"https:\/\/shinke1987.net\/?p=971"},"modified":"2023-10-01T12:23:10","modified_gmt":"2023-10-01T03:23:10","slug":"docker%e3%81%a7%e7%b7%b4%e7%bf%92%e7%94%a8postgresql%e3%82%92%e6%ba%96%e5%82%99","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=971","title":{"rendered":"Docker\u3067\u7df4\u7fd2\u7528PostgreSQL\u3092\u6e96\u5099"},"content":{"rendered":"\n<h2 id=\"toc0\" class=\"wp-block-heading\">\u6982\u8981<\/h2>\n\n\n\n<p>OSS-DB Silver Ver3.0 \u306e\u7df4\u7fd2\u7528\u306e\u305f\u3081\u306bPostgreSQL14\u3092\u89e6\u308c\u308b\u74b0\u5883\u3092\u6e96\u5099\u3059\u308b\u3002<br>PostgreSQL\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u898b\u308b\u3068\u30d0\u30fc\u30b8\u30e7\u30f314\u306e\u6700\u65b0\u306f14.9\u3002<br>\u306a\u306e\u3067\u5229\u7528\u3059\u308bdocker\u30a4\u30e1\u30fc\u30b8\u306f14.9-bookworm\u3068\u306a\u308b\u3002<br>\u672c\u6765\u306a\u3089WSL\u3067\u52d5\u304f\u30c7\u30a3\u30b9\u30c8\u30ea\u306fDebian\u306b\u3059\u308b\u306e\u304c\u671b\u307e\u3057\u3044\u306e\u304b\u306a\u3068\u601d\u3044\u3064\u3064\u3001\u3068\u308a\u3042\u3048\u305a\u305d\u306e\u307e\u307e\u3084\u3063\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<h2 id=\"toc1\" class=\"wp-block-heading\">\u524d\u63d0<\/h2>\n\n\n\n<p>Windows10 Pro<br>WSL (Ubuntu 22.04.2 LTS jammy)<br>Docker Desktop 4.24.0<\/p>\n\n\n\n<h2 id=\"toc2\" class=\"wp-block-heading\">\u624b\u9806<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/docker-library\/postgres\/blob\/05f691067b29d8fb4211a47da37a381d58d36691\/14\/bookworm\/Dockerfile\">https:\/\/github.com\/docker-library\/postgres\/blob\/05f691067b29d8fb4211a47da37a381d58d36691\/14\/bookworm\/Dockerfile<\/a><\/p>\n\n\n\n<p>\u4e0a\u8a18\u30a2\u30c9\u30ec\u30b9\u306eDockerfile\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/docker-library\/postgres\/blob\/05f691067b29d8fb4211a47da37a381d58d36691\/14\/bookworm\/docker-entrypoint.sh\">https:\/\/github.com\/docker-library\/postgres\/blob\/05f691067b29d8fb4211a47da37a381d58d36691\/14\/bookworm\/docker-entrypoint.sh<\/a><\/p>\n\n\n\n<p>\u4e0a\u8a18\u30a2\u30c9\u30ec\u30b9\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3002<\/p>\n\n\n\n<p>(Dockerfile\u3068\u540c\u3058\u30d5\u30a9\u30eb\u30c0\u3078\u914d\u7f6e\u3059\u308b\u3053\u3068)<\/p>\n\n\n\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u4fdd\u5b58\u3055\u308c\u305f\u30d5\u30a9\u30eb\u30c0\u306b\u79fb\u52d5\u3057\u3001PowerShell\u304b\u3089\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3002(\u5b8c\u4e86\u307e\u3067\u306b\u7d0411\u5206\u304b\u304b\u3063\u305f)<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ndocker image build -t postgresql14 .\n<\/pre><\/div>\n\n\n<p>Docker\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\uff65\u5b9f\u884c\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ndocker container run -p 5432:5432 -e POSTGRES_PASSWORD=password --name postgresql -d postgresql14\n<\/pre><\/div>\n\n\n<p>\u5b9f\u884c\u4e2d\u306e\u30b3\u30f3\u30c6\u30ca\u306e\u30b7\u30a7\u30eb\u3078\u5165\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ndocker container exec -it postgresql \/bin\/bash\n<\/pre><\/div>\n\n\n<p>PostgreSQL\u3078\u5165\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# postgres\u30e6\u30fc\u30b6\u306b\u306a\u308b\u3002\nsu postgres\n\n# PostgreSQL\u3078\u5165\u308b\u3002\npsql\n<\/pre><\/div>\n\n\n<p>\u3053\u308c\u3067\u5b8c\u4e86\u3068\u306a\u308b\u3002<\/p>\n\n\n\n<p>\u505c\u6b62\u3057\u305f\u3051\u308c\u3070\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ndocker container stop postgresql\n<\/pre><\/div>\n\n\n<p>2\u56de\u76ee\u4ee5\u964d\u306b\u518d\u958b\u3057\u305f\u3051\u308c\u3070\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ndocker container restart postgresql\n# \u305d\u306e\u5f8c\u30b3\u30f3\u30c6\u306e\u30b7\u30a7\u30eb\u3078\u5165\u308a\u3001su\u3057\u3066psql\u30b3\u30de\u30f3\u30c9\u3067\u5165\u3063\u305f\u308a\u3002\n<\/pre><\/div>\n\n\n<p>\u30c7\u30fc\u30bf\u3092\u6c38\u7d9a\u5316\u3057\u305f\u304b\u3063\u305f\u308a\u3001\u8272\u3005\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3051\u3069\u305d\u308c\u306f\u305d\u306e\u6642\u306b\u3084\u308b\u4e88\u5b9a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 OSS-DB Silver Ver3.0 \u306e\u7df4\u7fd2\u7528\u306e\u305f\u3081\u306bPostgreSQL14\u3092\u89e6\u308c\u308b\u74b0\u5883\u3092\u6e96\u5099\u3059\u308b\u3002PostgreSQL\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u898b\u308b\u3068\u30d0\u30fc\u30b8\u30e7\u30f314\u306e\u6700\u65b0\u306f14.9\u3002\u306a\u306e\u3067\u5229\u7528\u3059\u308bdocker\u30a4\u30e1\u30fc\u30b8\u306f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97],"tags":[98,57],"class_list":["post-971","post","type-post","status-publish","format-standard","hentry","category-docker","tag-docker","tag-postgresql"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=971"}],"version-history":[{"count":2,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/971\/revisions"}],"predecessor-version":[{"id":973,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/971\/revisions\/973"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}