{"id":154,"date":"2023-07-04T09:07:49","date_gmt":"2023-01-06T23:25:09","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/"},"modified":"2025-07-31T21:13:25","modified_gmt":"2025-07-31T12:13:25","slug":"ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/","title":{"rendered":"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5"},"content":{"rendered":"<p>\u8457\u8005\u306f\u3001\u5bc4\u4ed8\u306e\u4e00\u74b0\u3068\u3057\u3066\u300cWrite for Donations\u300d\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u30d5\u30ea\u30fc\u3067\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30d5\u30a1\u30f3\u30c9\u3092\u9078\u629e\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>\u306f\u3058\u3081\u306b<\/h3>\n<p>Docker\u306f\u3088\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u5316\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3042\u308a\u3001\u958b\u767a\u8005\u304c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u305d\u306e\u74b0\u5883\u3092\u7c21\u5358\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u3088\u308a\u8fc5\u901f\u306a\u30a4\u30c6\u30ec\u30fc\u30b7\u30e7\u30f3\u30b5\u30a4\u30af\u30eb\u3068\u30ea\u30bd\u30fc\u30b9\u52b9\u7387\u306e\u5411\u4e0a\u304c\u53ef\u80fd\u3068\u306a\u308a\u3001\u5404\u5b9f\u884c\u6642\u306b\u540c\u3058\u74b0\u5883\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002Docker Compose\u306f\u30b3\u30f3\u30c6\u30ca\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u30c4\u30fc\u30eb\u3067\u3042\u308a\u3001\u73fe\u4ee3\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u8981\u4ef6\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002\u8907\u6570\u306e\u76f8\u4e92\u63a5\u7d9a\u3055\u308c\u305f\u30b3\u30f3\u30c6\u30ca\u3092\u540c\u6642\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u624b\u52d5\u3067\u30b3\u30f3\u30c6\u30ca\u3092\u5b9f\u884c\u3059\u308b\u4ee3\u308f\u308a\u306b\u3001\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u30c4\u30fc\u30eb\u306f\u958b\u767a\u8005\u304c\u30b3\u30f3\u30c6\u30ca\u3092\u540c\u6642\u306b\u5236\u5fa1\u3001\u62e1\u5f35\u3001\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3059\u308b\u80fd\u529b\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<p>Nginx\u3092\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5229\u70b9\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3001\u8a2d\u5b9a\u53ef\u80fd\u6027\u3001\u304a\u3088\u3073TLS\u7d42\u7aef\u5316\u306b\u3042\u308a\u3001\u3053\u308c\u3089\u306e\u30bf\u30b9\u30af\u3092\u30a2\u30d7\u30ea\u304b\u3089\u89e3\u653e\u3057\u307e\u3059\u3002nginx-proxy\u306f\u3001Nginx\u3092\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u30d7\u30ed\u30bb\u30b9\u3092\u7c21\u7d20\u5316\u3059\u308bDocker\u30b3\u30f3\u30c6\u30ca\u5411\u3051\u306e\u81ea\u52d5\u5316\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002\u305d\u306eLet&#8217;s Encrypt\u30a2\u30c9\u30aa\u30f3\u306f\u3001nginx-proxy\u3068\u5171\u306b\u4f7f\u7528\u3057\u3066\u3001\u30d7\u30ed\u30ad\u30b7\u5316\u3055\u308c\u305f\u30b3\u30f3\u30c6\u30ca\u306e\u8a3c\u660e\u66f8\u306e\u751f\u6210\u3068\u66f4\u65b0\u3092\u81ea\u52d5\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001gorilla\/mux\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u30eb\u30fc\u30bf\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3057\u3001Nginx\u3092\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3057\u305fGo\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f8b\u3092Docker\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u5c55\u958b\u3057\u307e\u3059\u3002\u5c55\u958b\u306fDocker Compose\u306b\u3088\u3063\u3066\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3055\u308c\u307e\u3059\u3002\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3068\u3057\u3066\u3001nginx-proxy\u3068Let&#8217;s Encrypt\u306e\u30a2\u30c9\u30aa\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u6700\u5f8c\u306b\u306f\u3001Let&#8217;s Encrypt\u306e\u8a3c\u660e\u66f8\u3067\u4fdd\u8b77\u3055\u308c\u305f\u8907\u6570\u306e\u30eb\u30fc\u30c8\u3092\u6301\u3064Go\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u3001\u3042\u306a\u305f\u306e\u30c9\u30e1\u30a4\u30f3\u3067\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u306b\u5c55\u958b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<ul class=\"post-ul\">\n<li>An Ubuntu 22.04 server with root privileges, and a secondary, non-root account. You can set this up by following this initial server setup guide. For this tutorial, the non-root user is sammy.<\/li>\n<li>Docker installed by following the first two steps of How To Install Docker on Ubuntu 22.04.<\/li>\n<li>Docker Compose installed by following the first step of How To Install Docker Compose on Ubuntu 22.04.<\/li>\n<li>A fully registered domain name. This tutorial will use your_domain throughout. You can get one for free on Freenom, or use the domain registrar of your choice.<\/li>\n<li>A DNS \u201cA\u201d record with your_domain pointing to your server\u2019s public IP address. You can follow this introduction to Silicon Cloud DNS for details on how to add them.<\/li>\n<li>An understanding of Docker and its architecture. For an introduction to Docker, see The Docker Ecosystem: An Introduction to Common Components.<\/li>\n<\/ul>\n<h2>\u30b9\u30c6\u30c3\u30d71 &#8211; \u30b5\u30f3\u30d7\u30eb\u306eGo\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u306e\u4f5c\u6210<\/h2>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u3001\u5f8c\u3067\u30b3\u30f3\u30c6\u30ca\u5316\u3059\u308b\u305f\u3081\u306e\u30b7\u30f3\u30d7\u30eb\u306aGo\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u67d4\u8edf\u6027\u3068\u9ad8\u901f\u6027\u3092\u7406\u7531\u306b\u9078\u3070\u308c\u305f\u5f37\u529b\u306agorilla\/mux\u30ea\u30af\u30a8\u30b9\u30c8\u30eb\u30fc\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u3059\u3079\u3066\u306e\u30c7\u30fc\u30bf\u3092~\/go-docker\u306e\u4e0b\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002\u3053\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">mkdir<\/span> ~\/go-docker<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u308c\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token builtin class-name\">cd<\/span> ~\/go-docker<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3042\u306a\u305f\u306e\u4f8b\u306eGo\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u3092\u3001main.go\u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3092\u4f7f\u7528\u3057\u3066\u305d\u308c\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> main.go<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>~\/go-docker\/main.go\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u300c~\/go-docker\/main.go\u300d<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">package<\/span> main\r\n\r\n<span class=\"token keyword\">import<\/span> <span class=\"token punctuation\">(<\/span>\r\n\t<span class=\"token string\">\"fmt\"<\/span>\r\n\t<span class=\"token string\">\"net\/http\"<\/span>\r\n\r\n\t<span class=\"token string\">\"github.com\/gorilla\/mux\"<\/span>\r\n<span class=\"token punctuation\">)<\/span>\r\n\r\n<span class=\"token keyword\">func<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\tr <span class=\"token operator\">:=<\/span> mux<span class=\"token punctuation\">.<\/span><span class=\"token function\">NewRouter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\r\n\r\n\tr<span class=\"token punctuation\">.<\/span><span class=\"token function\">HandleFunc<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\/\"<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">func<\/span><span class=\"token punctuation\">(<\/span>w http<span class=\"token punctuation\">.<\/span>ResponseWriter<span class=\"token punctuation\">,<\/span> r <span class=\"token operator\">*<\/span>http<span class=\"token punctuation\">.<\/span>Request<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t\tfmt<span class=\"token punctuation\">.<\/span><span class=\"token function\">Fprintf<\/span><span class=\"token punctuation\">(<\/span>w<span class=\"token punctuation\">,<\/span> <span class=\"token string\">\"&lt;h1&gt;This is the homepage. Try \/hello and \/hello\/Sammy\\n&lt;\/h1&gt;\"<\/span><span class=\"token punctuation\">)<\/span>\r\n\t<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span>\r\n\r\n\tr<span class=\"token punctuation\">.<\/span><span class=\"token function\">HandleFunc<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\/hello\"<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">func<\/span><span class=\"token punctuation\">(<\/span>w http<span class=\"token punctuation\">.<\/span>ResponseWriter<span class=\"token punctuation\">,<\/span> r <span class=\"token operator\">*<\/span>http<span class=\"token punctuation\">.<\/span>Request<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t\tfmt<span class=\"token punctuation\">.<\/span><span class=\"token function\">Fprintf<\/span><span class=\"token punctuation\">(<\/span>w<span class=\"token punctuation\">,<\/span> <span class=\"token string\">\"&lt;h1&gt;Hello from Docker!\\n&lt;\/h1&gt;\"<\/span><span class=\"token punctuation\">)<\/span>\r\n\t<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span>\r\n\r\n\tr<span class=\"token punctuation\">.<\/span><span class=\"token function\">HandleFunc<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\/hello\/{name}\"<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">func<\/span><span class=\"token punctuation\">(<\/span>w http<span class=\"token punctuation\">.<\/span>ResponseWriter<span class=\"token punctuation\">,<\/span> r <span class=\"token operator\">*<\/span>http<span class=\"token punctuation\">.<\/span>Request<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n\t\tvars <span class=\"token operator\">:=<\/span> mux<span class=\"token punctuation\">.<\/span><span class=\"token function\">Vars<\/span><span class=\"token punctuation\">(<\/span>r<span class=\"token punctuation\">)<\/span>\r\n\t\ttitle <span class=\"token operator\">:=<\/span> vars<span class=\"token punctuation\">[<\/span><span class=\"token string\">\"name\"<\/span><span class=\"token punctuation\">]<\/span>\r\n\r\n\t\tfmt<span class=\"token punctuation\">.<\/span><span class=\"token function\">Fprintf<\/span><span class=\"token punctuation\">(<\/span>w<span class=\"token punctuation\">,<\/span> <span class=\"token string\">\"&lt;h1&gt;Hello, %s!\\n&lt;\/h1&gt;\"<\/span><span class=\"token punctuation\">,<\/span> title<span class=\"token punctuation\">)<\/span>\r\n\t<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span>\r\n\r\n\thttp<span class=\"token punctuation\">.<\/span><span class=\"token function\">ListenAndServe<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\":80\"<\/span><span class=\"token punctuation\">,<\/span> r<span class=\"token punctuation\">)<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<\/code><\/pre>\n<p>\u6700\u521d\u306bnet\/http\u304a\u3088\u3073gorilla\/mux\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306fHTTP\u30b5\u30fc\u30d0\u30fc\u306e\u6a5f\u80fd\u3068\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002gorilla\/mux\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3001\u3088\u308a\u5f37\u529b\u306a\u30ea\u30af\u30a8\u30b9\u30c8\u30eb\u30fc\u30bf\u30fc\u3068\u30c7\u30a3\u30b9\u30d1\u30c3\u30c1\u30e3\u30fc\u3092\u5b9f\u88c5\u3057\u3066\u304a\u308a\u3001\u6a19\u6e96\u306e\u30eb\u30fc\u30bf\u30fc\u3068\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u4e92\u63db\u6027\u3082\u4fdd\u6301\u3057\u3066\u3044\u307e\u3059\u3002\u65b0\u3057\u3044mux\u30eb\u30fc\u30bf\u30fc\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3057\u3001\u5909\u6570r\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001\/\u3001\/hello\u3001\u304a\u3088\u3073\/hello\/{\u540d\u524d}\u306e3\u3064\u306e\u30eb\u30fc\u30c8\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u6700\u521d\u306e(\/)\u306f\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3068\u3057\u3066\u6a5f\u80fd\u3057\u3001\u30da\u30fc\u30b8\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u542b\u3081\u307e\u3059\u30022\u756a\u76ee\u306e(\/hello)\u306f\u8a2a\u554f\u8005\u3078\u306e\u6328\u62f6\u3092\u8fd4\u3057\u307e\u3059\u30023\u3064\u76ee\u306e\u30eb\u30fc\u30c8(\/hello\/{\u540d\u524d})\u3067\u306f\u3001\u540d\u524d\u3092\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u53d7\u3051\u53d6\u308a\u3001\u540d\u524d\u304c\u633f\u5165\u3055\u308c\u305f\u6328\u62f6\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5f8c\u3067\u3001http.ListenAndServe\u3092\u4f7f\u7528\u3057\u3066HTTP\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3001\u8a2d\u5b9a\u3057\u305f\u30eb\u30fc\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u3066\u30dd\u30fc\u30c880\u3067\u53d7\u4fe1\u3059\u308b\u3088\u3046\u306b\u6307\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Go\u306e\u30a2\u30d7\u30ea\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u3001Docker\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002Go\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u8a00\u8a9e\u306a\u306e\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5b9f\u884c\u3055\u308c\u308b\u524d\u306b\u3001\u30b3\u30f3\u30d1\u30a4\u30e9\u304c\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u53ef\u80fd\u306a\u6a5f\u68b0\u8a9e\u306b\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n<p>\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u3001Go\u8a00\u8a9e\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u306e\u4f8b\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u6b21\u306b\u3001\u81ea\u52d5\u7684\u306bLet&#8217;s Encrypt\u306e\u8a3c\u660e\u66f8\u3092\u63d0\u4f9b\u3059\u308bnginx-proxy\u3092\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d72- Let&#8217;s Encrypt\u3092\u4f7f\u7528\u3057\u3066nginx-proxy\u3092\u5c55\u958b\u3059\u308b<\/h2>\n<p>\u30a2\u30d7\u30ea\u3092HTTPS\u3067\u4fdd\u8b77\u3059\u308b\u3053\u3068\u306f\u91cd\u8981\u3067\u3059\u3002\u3053\u308c\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u3001Docker Compose\u3092\u4f7f\u7528\u3057\u3066nginx-proxy\u3092\u5c55\u958b\u3057\u3001Let&#8217;s Encrypt\u30a2\u30c9\u30aa\u30f3\u3068\u4e00\u7dd2\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3059\u3002\u3053\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u3088\u308a\u3001nginx-proxy\u3092\u4ecb\u3057\u3066\u30d7\u30ed\u30ad\u30b7\u5316\u3055\u308c\u305fDocker\u30b3\u30f3\u30c6\u30ca\u3092\u5b89\u5168\u306b\u4fdd\u8b77\u3057\u3001TLS\u8a3c\u660e\u66f8\u306e\u4f5c\u6210\u3068\u66f4\u65b0\u3092\u81ea\u52d5\u7684\u306b\u51e6\u7406\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u3092HTTPS\u3067\u5b89\u5168\u306b\u4fdd\u8b77\u3057\u307e\u3059\u3002<\/p>\n<p>\u300cnginx-proxy\u300d\u306eDocker Compose\u8a2d\u5b9a\u3092\u300cnginx-proxy-compose.yaml\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002\u5b9f\u884c\u3057\u3066\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> <mark>nginx-proxy-compose.yaml<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u884c\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u65e5\u672c\u8a9e\u3067\u8868\u73fe\u3059\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n~\/go-docker\/nginx-proxy-compose.yaml -&gt; \u300c~\/go-docker\/nginx-proxy-compose.yaml\u300d<\/div>\n<pre class=\"post-pre\"><code>version: '3'\r\n\r\nservices:\r\n  nginx-proxy:\r\n    restart: always\r\n    image: jwilder\/nginx-proxy\r\n    ports:\r\n      - \"80:80\"\r\n      - \"443:443\"\r\n    volumes:\r\n      - \"\/etc\/nginx\/vhost.d\"\r\n      - \"\/usr\/share\/nginx\/html\"\r\n      - \"\/var\/run\/docker.sock:\/tmp\/docker.sock:ro\"\r\n      - \"\/etc\/nginx\/certs\"\r\n\r\n  letsencrypt-nginx-proxy-companion:\r\n    restart: always\r\n    image: jrcs\/letsencrypt-nginx-proxy-companion\r\n    volumes:\r\n      - \"\/var\/run\/docker.sock:\/var\/run\/docker.sock:ro\"\r\n    volumes_from:\r\n      - \"nginx-proxy\"\r\n<\/code><\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u306f\u3001nginx-proxy\u3068\u305d\u306eLet&#8217;s Encrypt\u30a2\u30c9\u30aa\u30f3\uff08letsencrypt-nginx-proxy-companion\uff09\u306e2\u3064\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u30d7\u30ed\u30ad\u30b7\u306b\u306f\u3001jwilder\/nginx-proxy\u30a4\u30e1\u30fc\u30b8\u3092\u6307\u5b9a\u3057\u3001HTTP\u304a\u3088\u3073HTTPS\u30dd\u30fc\u30c8\u3092\u516c\u958b\u304a\u3088\u3073\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3001Nginx\u95a2\u9023\u30c7\u30fc\u30bf\u3092\u6c38\u7d9a\u5316\u3059\u308b\u305f\u3081\u306b\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u306a\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<p>2\u756a\u76ee\u306e\u30d6\u30ed\u30c3\u30af\u3067\u306f\u3001Let&#8217;s Encrypt\u306e\u30a2\u30c9\u30aa\u30f3\u8a2d\u5b9a\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u5b9a\u7fa9\u3057\u3066Docker\u306e\u30bd\u30b1\u30c3\u30c8\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a2d\u5b9a\u3057\u3001\u30d7\u30ed\u30ad\u30b7\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u65e2\u5b58\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u5f15\u304d\u7d99\u304e\u307e\u3059\u3002\u4e21\u65b9\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u306f\u518d\u8d77\u52d5\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u5e38\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u308c\u306b\u3088\u3063\u3066Docker\u306f\u5e38\u306b\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u7d9a\u3051\u308b\u3088\u3046\u306b\u3057\u307e\u3059\uff08\u30af\u30e9\u30c3\u30b7\u30e5\u3084\u30b7\u30b9\u30c6\u30e0\u306e\u518d\u8d77\u52d5\u306e\u5834\u5408\u3067\u3082\uff09\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u308b\u3002<\/p>\n<p>\u300cnginx-proxy\u3092\u5b9f\u884c\u3057\u3066\u5c55\u958b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300d<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker<\/span> compose <span class=\"token parameter variable\">-f<\/span> <mark>nginx-proxy-compose.yaml<\/mark> up <span class=\"token parameter variable\">-d<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Docker Compose\u306f\u3001-f\u30d5\u30e9\u30b0\u3092\u901a\u3058\u3066\u30ab\u30b9\u30bf\u30e0\u540d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53d7\u3051\u5165\u308c\u307e\u3059\u3002up\u30b3\u30de\u30f3\u30c9\u306f\u30b3\u30f3\u30c6\u30ca\u30fc\u3092\u5b9f\u884c\u3057\u3001-d\u30d5\u30e9\u30b0\uff08\u30c7\u30bf\u30c3\u30c1\u30e2\u30fc\u30c9\uff09\u306f\u30b3\u30f3\u30c6\u30ca\u30fc\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u6307\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u5c4a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>[+] Running 21\/21 \u283f letsencrypt-nginx-proxy-companion Pulled 6.8s \u283f df9b9388f04a Pull complete 3.1s \u283f 6c6cfd4eaf5b Pull complete 3.9s \u283f 870307501973 Pull complete 4.3s \u283f e8ff3435d14f Pull complete 4.5s \u283f 5b78ba945919 Pull complete 4.8s \u283f 973b2ca26006 Pull complete 5.0s \u283f nginx-proxy Pulled 8.1s \u283f 42c077c10790 Pull complete 3.9s \u283f 62c70f376f6a Pull complete 5.5s \u283f 915cc9bd79c2 Pull complete 5.6s \u283f 75a963e94de0 Pull complete 5.7s \u283f 7b1fab684d70 Pull complete 5.7s \u283f db24d06d5af4 Pull complete 5.8s \u283f e917373dbecf Pull complete 5.9s \u283f 11e2be9775e9 Pull complete 5.9s \u283f 9996fa75bc02 Pull complete 6.1s \u283f d37674efdf77 Pull complete 6.3s \u283f a45d84576e75 Pull complete 6.3s \u283f a13c1f42faf7 Pull complete 6.4s \u283f 4f4fb700ef54 Pull complete 6.5s [+] Running 3\/3 \u283f Network go-docker_default Created 0.1s \u283f Container go-docker-nginx-proxy-1 Started 0.5s \u283f Container go-docker-letsencrypt-nginx-proxy-companion-1 Started 0.8s<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3042\u306a\u305f\u306fDocker Compose\u3092\u4f7f\u7528\u3057\u3066\u3001nginx-proxy\u3068\u305d\u306eLet&#8217;s Encrypt\u306e\u4ef2\u9593\u3092\u5c55\u958b\u3057\u307e\u3057\u305f\u3002\u6b21\u306b\u3001Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u306e\u305f\u3081\u306eDockerfile\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d73 &#8211; Go Web\u30a2\u30d7\u30ea\u3092Docker\u5316\u3059\u308b<\/h2>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001Go\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u7528\u306bDocker\u304c\u4e0d\u5909\u306a\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u6307\u793a\u3092\u542b\u3080Dockerfile\u3092\u6e96\u5099\u3057\u307e\u3059\u3002Docker\u306fDockerfile\u5185\u306e\u6307\u793a\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306e\u3088\u3046\u306a\u4e0d\u5909\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30a4\u30e1\u30fc\u30b8\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002\u30a4\u30e1\u30fc\u30b8\u306e\u4e0d\u5909\u6027\u306f\u3001\u7279\u5b9a\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u30d9\u30fc\u30b9\u306b\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u304c\u5b9f\u884c\u3055\u308c\u308b\u305f\u3073\u306b\u3001\u5e38\u306b\u540c\u3058\u74b0\u5883\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002<\/p>\n<p>\u3042\u306a\u305f\u306e\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3067Dockerfile\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> Dockerfile<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>~\/go-docker\/Dockerfile\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>~\/go-docker\/Dockerfile\u3092\u4f7f\u3046<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>FROM golang:alpine AS build\r\nRUN apk --no-cache add gcc g++ make git\r\nWORKDIR \/go\/src\/app\r\nCOPY . .\r\nRUN go mod init webserver\r\nRUN go mod tidy\r\nRUN GOOS=linux go build -ldflags=\"-s -w\" -o .\/bin\/web-app .\/main.go\r\n\r\nFROM alpine:3.17\r\nRUN apk --no-cache add ca-certificates\r\nWORKDIR \/usr\/bin\r\nCOPY --from=build \/go\/src\/app\/bin \/go\/bin\r\nEXPOSE 80\r\nENTRYPOINT \/go\/bin\/web-app --port 80\r\n<\/code><\/pre>\n<p>\u3053\u306eDockerfile\u306b\u306f2\u3064\u306e\u30b9\u30c6\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002\u6700\u521d\u306e\u30b9\u30c6\u30fc\u30b8\u3067\u306f\u3001golang:alpine\u30d9\u30fc\u30b9\u3092\u4f7f\u7528\u3057\u3001Alpine Linux\u4e0a\u3067\u4e8b\u524d\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fGo\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Go\u30a2\u30d7\u30ea\u306e\u5fc5\u8981\u306a\u30b3\u30f3\u30d1\u30a4\u30eb\u30c4\u30fc\u30eb\u3068\u3057\u3066gcc\u3001g++\u3001make\u3001git\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u306eGOPATH\u306e\/go\/src\/app\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u73fe\u5728\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5185\u5bb9\u3082\u30b3\u30f3\u30c6\u30ca\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002\u6700\u521d\u306e\u30b9\u30c6\u30fc\u30b8\u3067\u306f\u3001\u30b3\u30fc\u30c9\u304b\u3089\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u518d\u5e30\u7684\u306b\u53d6\u5f97\u3057\u3001main.go\u30d5\u30a1\u30a4\u30eb\u3092\u30b7\u30f3\u30dc\u30eb\u3068\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u306a\u3057\u3067\u30ea\u30ea\u30fc\u30b9\u7528\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3059\uff08-ldflags=&#8221;-s -w&#8221;\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\uff09\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f\uff1aGo\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u969b\u306b\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u7528\u306b\u30d0\u30a4\u30ca\u30ea\u306e\u5225\u306e\u90e8\u5206\u304c\u4fdd\u6301\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u306e\u8ffd\u52a0\u60c5\u5831\u306f\u30e1\u30e2\u30ea\u3092\u4f7f\u7528\u3059\u308b\u3060\u3051\u3067\u3042\u308a\u3001\u672c\u756a\u74b0\u5883\u3078\u306e\u5c55\u958b\u6642\u306b\u4fdd\u6301\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/div>\n<\/div>\n<p>\u7b2c2\u30b9\u30c6\u30fc\u30b8\u306falpine:3.17\uff08Alpine Linux 3.17\uff09\u3092\u30d9\u30fc\u30b9\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u4fe1\u983c\u3067\u304d\u308bCA\u8a3c\u660e\u66f8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u6700\u521d\u306e\u30b9\u30c6\u30fc\u30b8\u304b\u3089\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u305f\u30a2\u30d7\u30ea\u30d0\u30a4\u30ca\u30ea\u3092\u73fe\u5728\u306e\u30a4\u30e1\u30fc\u30b8\u306b\u30b3\u30d4\u30fc\u3057\u3001\u30dd\u30fc\u30c880\u3092\u516c\u958b\u3057\u3001\u30a2\u30d7\u30ea\u30d0\u30a4\u30ca\u30ea\u3092\u30a4\u30e1\u30fc\u30b8\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u308b\u3002<\/p>\n<p>\u3042\u306a\u305f\u306fGo\u30a2\u30d7\u30ea\u306e\u305f\u3081\u306eDockerfile\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u3053\u306eDockerfile\u306f\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u53d6\u5f97\u3057\u3001\u30ea\u30ea\u30fc\u30b9\u306e\u305f\u3081\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3001\u30b3\u30f3\u30c6\u30ca\u30fc\u306e\u4f5c\u6210\u6642\u306b\u5b9f\u884c\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Docker Compose\u306eyaml\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001Docker\u3067\u30a2\u30d7\u30ea\u3092\u5b9f\u884c\u3057\u3066\u30c6\u30b9\u30c8\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d74 &#8211; Docker Compose\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u3068\u5b9f\u884c<\/h2>\n<p>\u4eca\u5ea6\u306f\u3001\u304a\u524d\u306fDocker Compose\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u524d\u306e\u624b\u9806\u3067\u4f5c\u6210\u3057\u305fDocker\u30a4\u30e1\u30fc\u30b8\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u5fc5\u8981\u306a\u8a2d\u5b9a\u3092\u66f8\u304f\u3002\u305d\u3057\u3066\u3001\u305d\u308c\u3092\u5b9f\u884c\u3057\u3066\u6b63\u3057\u304f\u52d5\u4f5c\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3002\u4e00\u822c\u7684\u306b\u3001Docker Compose\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30a2\u30d7\u30ea\u304c\u5fc5\u8981\u3068\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u3001\u8a2d\u5b9a\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3001\u304a\u3088\u3073\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u3053\u308c\u3089\u306e\u8981\u7d20\u304c\u958b\u59cb\u304a\u3088\u3073\u505c\u6b62\u3059\u308b\u3088\u3046\u306b\u3082\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Go\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u306eDocker Compose\u306e\u8a2d\u5b9a\u3092go-app-compose.yaml\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> <mark>go-app-compose.yaml<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>\u4ee5\u4e0b\u306f\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u306e\u65e5\u672c\u8a9e\u3067\u306e\u8868\u73fe\u3067\u3059\u3002\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<p>\u300c~\/go-docker\/go-app-compose.yaml\u300d\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea(go-docker\u30d5\u30a9\u30eb\u30c0\u5185)\u306ego-app-compose.yaml\u30d5\u30a1\u30a4\u30eb<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>version: '3'\r\nservices:\r\n  go-web-app:\r\n    restart: always\r\n    build:\r\n      dockerfile: Dockerfile\r\n      context: .\r\n    environment:\r\n      - VIRTUAL_HOST=<mark>your_domain<\/mark>\r\n      - LETSENCRYPT_HOST=<mark>your_domain<\/mark>\r\n<\/code><\/pre>\n<p>\u3042\u306a\u305f\u306e\u30c9\u30e1\u30a4\u30f3\u540d\u3092\u4f7f\u3063\u3066\u3001\u4e21\u65b9\u306e\u5834\u6240\u3067\u300cyour_domain\u300d\u3068\u66f8\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u306e\u5f8c\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u306eDocker Compose\u306e\u8a2d\u5b9a\u306b\u306f1\u3064\u306e\u30b3\u30f3\u30c6\u30ca\uff08go-web-app\uff09\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u305d\u308c\u304cGo\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u8a2d\u5b9a\u3067\u306f\u3001\u524d\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u4f5c\u6210\u3057\u305fDockerfile\u3092\u4f7f\u7528\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30d3\u30eb\u30c9\u3057\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u542b\u307e\u308c\u308b\u73fe\u5728\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30d3\u30eb\u30c9\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002\u3055\u3089\u306b\u30012\u3064\u306e\u74b0\u5883\u5909\u6570\uff08VIRTUAL_HOST\u3068LETSENCRYPT_HOST\uff09\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002nginx-proxy\u306fVIRTUAL_HOST\u3092\u4f7f\u7528\u3057\u3066\u3069\u306e\u30c9\u30e1\u30a4\u30f3\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u5165\u308c\u308b\u304b\u3092\u77e5\u308b\u305f\u3081\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002LETSENCRYPT_HOST\u306fTLS\u8a3c\u660e\u66f8\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306e\u30c9\u30e1\u30a4\u30f3\u540d\u3092\u6307\u5b9a\u3057\u3001VIRTUAL_HOST\u3068\u540c\u3058\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u30c9\u30e1\u30a4\u30f3\u3092\u6307\u5b9a\u3057\u306a\u3044\u9650\u308a\u3001LETSENCRYPT_HOST\u306fVIRTUAL_HOST\u3068\u540c\u3058\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u5ea6\u306f\u3001Docker Compose\u3092\u4f7f\u3063\u3066Go\u306eWeb\u30a2\u30d7\u30ea\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">docker<\/span> compose <span class=\"token parameter variable\">-f<\/span> go-app-compose.yaml up <span class=\"token parameter variable\">-d<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\uff08\u53ef\u8aad\u6027\u306e\u305f\u3081\u3001\u3053\u306e\u51fa\u529b\u306f\u7701\u7565\u3055\u308c\u307e\u3057\u305f\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Creating network &#8220;go-docker_default&#8221; with the default driver Building go-web-app Step 1\/13 : FROM golang:alpine AS build &#8212;&gt; b97a72b8e97d &#8230; Successfully built 71e4b1ef2e25 Successfully tagged go-docker_go-web-app:latest &#8230; [+] Running 1\/1 \u283f Container go-docker-go-web-app-1 Started<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u5f8c\u306e\u51fa\u529b\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001Docker\u306fDockerfile\u306e\u8a2d\u5b9a\u306b\u5f93\u3063\u3066\u30a2\u30d7\u30ea\u306e\u30a4\u30e1\u30fc\u30b8\u306e\u69cb\u7bc9\u306e\u5404\u30b9\u30c6\u30c3\u30d7\u3092\u30ed\u30b0\u306b\u8a18\u9332\u3057\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u5b9a\u7fa9\u3057\u305f\/\u30eb\u30fc\u30c8\u306e\u7d50\u679c\u3068\u3057\u3066\u3001\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u306e\u30db\u30fc\u30e0\u30a2\u30c9\u30ec\u30b9\u3067\u3042\u308bhttps:\/\/your_domain\/\u306b\u79fb\u52d5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65645eb2daa94e2bdf7b26ee\/68-0.png\" alt=\"Screencapture of the domain page, which reads \" \/><\/div>\n<p>\u4eca\u3001https:\/\/your_domain\/hello \u306b\u79fb\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002Step1\u3067\u5b9a\u7fa9\u3057\u305f\/hello\u30eb\u30fc\u30c8\u306e\u30b3\u30fc\u30c9\u306b\u3088\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65645eb2daa94e2bdf7b26ee\/70-0.png\" alt=\"Screencapture of the route, which reads \" \/><\/div>\n<p>\u6700\u5f8c\u306b\u3001\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u306e\u30a2\u30c9\u30ec\u30b9\u306b\u540d\u524d\u3092\u8ffd\u52a0\u3057\u3066\u5225\u306e\u30eb\u30fc\u30c8\u3092\u30c6\u30b9\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4f8b\u3048\u3070\u3001https:\/\/your_domain\/hello\/Sammy \u306e\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65645eb2daa94e2bdf7b26ee\/72-0.png\" alt=\"Screencapture of the name route, which you have input as \" \/><\/div>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f\uff1a\u3082\u3057\u7121\u52b9\u306aTLS\u8a3c\u660e\u66f8\u306b\u95a2\u3059\u308b\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u305f\u5834\u5408\u3001\u6570\u5206\u5f85\u3063\u3066Let&#8217;s Encrypt\u30a2\u30c9\u30aa\u30f3\u304c\u8a3c\u660e\u66f8\u3092\u63d0\u4f9b\u3059\u308b\u306e\u3092\u5f85\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u6570\u5206\u5f85\u3063\u3066\u3082\u30a8\u30e9\u30fc\u304c\u7d9a\u304f\u5834\u5408\u306f\u3001\u3053\u306e\u624b\u9806\u306e\u30b3\u30de\u30f3\u30c9\u3068\u8a2d\u5b9a\u3068\u5165\u529b\u3057\u305f\u5185\u5bb9\u3092\u518d\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n<p>Docker Compose \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u3067 Go \u30a2\u30d7\u30ea\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3057\u307e\u3057\u305f\u3002\u6700\u5f8c\u306b\u3001\u3054\u308a\u3089\/mux \u30eb\u30fc\u30bf\u30fc\u306e\u8a2d\u5b9a\u304c Docker \u5316\u3055\u308c\u305f Go \u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u306b\u6b63\u3057\u304f\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001\u30c9\u30e1\u30a4\u30f3\u306b\u79fb\u52d5\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u73fe\u5728\u3001Ubuntu 22.04\u4e0a\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u306eWeb\u30a2\u30d7\u30ea\u3092\u6b63\u5e38\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3057\u305f\u3002Docker\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u306b\u304b\u304b\u308b\u6642\u9593\u304c\u77ed\u7e2e\u3055\u308c\u307e\u3059\u3002\u306a\u305c\u306a\u3089\u3001\u5b9f\u884c\u74b0\u5883\u304c\u6bce\u56de\u5b9f\u884c\u3055\u308c\u308b\u3054\u3068\u306b\u540c\u3058\u3067\u3042\u308b\u3053\u3068\u304c\u4fdd\u8a3c\u3055\u308c\u308b\u304b\u3089\u3067\u3059\u3002\u307e\u305f\u3001gorilla\/mux\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u512a\u308c\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u63d0\u4f9b\u3057\u3066\u304a\u308a\u3001\u30eb\u30fc\u30c8\u306e\u540d\u524d\u4ed8\u3051\u3084\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u306e\u63d0\u4f9b\u306a\u3069\u3001\u3088\u308a\u9ad8\u5ea6\u306a\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002Go\u306eHTTP\u30b5\u30fc\u30d0\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u3088\u308a\u7d30\u304b\u306a\u5236\u5fa1\u3092\u884c\u3044\u305f\u3044\u5834\u5408\u306f\u3001\u516c\u5f0f\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8457\u8005\u306f\u3001\u5bc4\u4ed8\u306e\u4e00\u74b0\u3068\u3057\u3066\u300cWrite for Donations\u300d\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u30d5\u30ea\u30fc\u3067\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30d5\u30a1\u30f3\u30c9\u3092\u9078\u629e\u3057\u307e\u3057\u305f\u3002 \u306f\u3058\u3081\u306b Docker\u306f\u3088\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u5316\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3042\u308a\u3001\u958b\u767a\u8005\u304c\u30a2 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,26],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-linux","tag-26"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04\u3067docker\u3068nginx\u3092\u4f7f\u7528\u3057\u3066go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04\u3067docker\u3068nginx\u3092\u4f7f\u7528\u3057\u3066go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-06T23:25:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T12:13:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65645eb2daa94e2bdf7b26ee\/68-0.png\" \/>\n<meta name=\"author\" content=\"\u5149, \u660e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5149, \u660e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"25\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/\",\"name\":\"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-01-06T23:25:09+00:00\",\"dateModified\":\"2025-07-31T12:13:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55\"},\"description\":\"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55\",\"name\":\"\u5149, \u660e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g\",\"caption\":\"\u5149, \u660e\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/hikariakira\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5 - Blog - Silicon Cloud","description":"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04\u3067docker\u3068nginx\u3092\u4f7f\u7528\u3057\u3066go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\/","og_locale":"ja_JP","og_type":"article","og_title":"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5","og_description":"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04\u3067docker\u3068nginx\u3092\u4f7f\u7528\u3057\u3066go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-01-06T23:25:09+00:00","article_modified_time":"2025-07-31T12:13:25+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65645eb2daa94e2bdf7b26ee\/68-0.png"}],"author":"\u5149, \u660e","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u5149, \u660e","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"25\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/","name":"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-01-06T23:25:09+00:00","dateModified":"2025-07-31T12:13:25+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55"},"description":"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Ubuntu 22.04\u3067Docker\u3068Nginx\u3092\u4f7f\u7528\u3057\u3066Go\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5c55\u958b\u306e\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55","name":"\u5149, \u660e","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g","caption":"\u5149, \u660e"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/hikariakira\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-22-04%e3%81%a7docker%e3%81%a8nginx%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6go%e3%82%a6%e3%82%a7%e3%83%96%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=154"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":325719,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/154\/revisions\/325719"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}