{"id":192278,"date":"2020-06-05T10:42:31","date_gmt":"2020-06-05T02:42:31","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=192278"},"modified":"2020-06-18T08:37:45","modified_gmt":"2020-06-18T00:37:45","slug":"docker-save-load","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/docker-save-load.html","title":{"rendered":"Docker\u5bb9\u5668\u4e2d\u7684\u5907\u4efd\u3001\u6062\u590d\u3001\u8fc1\u79fb\u3001\u5bfc\u5165\u3001\u5bfc\u51fa"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nDocker \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5e94\u7528\u5bb9\u5668\u5f15\u64ce\uff0c\u57fa\u4e8e Go \u8bed\u8a00 \u5e76\u9075\u4ece Apache2.0 \u534f\u8bae\u5f00\u6e90\uff1b\u8de8\u5e73\u53f0\u5e94\u7528\u5bb9\u5668\u5f15\u64ce\u670d\u52a1\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u5b9e\u9a8c\u73af\u5883<\/strong><\/div>\n

\u64cd\u4f5c\u7cfb\u7edf\uff1aUbuntu 18.04.4 LTS<\/p>\n

\u5e94\u7528\u7248\u672c\uff1aDocker version 19.03.9, build 9d988398e7<\/p>\n

\u955c\u50cf\u4e3e\u4f8b\uff1amysql:5.6<\/p>\n

\u6ce8\u610f\uff1a\u5fc5\u987b\u8981\u5148\u5b89\u88c5Docker\u5bb9\u5668\uff0c\u53c2\u8003\uff1ahttps:\/\/lrxjmw.cn\/ubuntu-install-docker-ce<\/a><\/p>\n

Docker\u6253\u5305\u5e94\u7528\u4ee5\u53ca\u4f9d\u8d56\u5305\u5230\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u3001\u53ef\u79fb\u690d\u7684\u5bb9\u5668\u4e2d\uff0c\u7136\u540e\u53d1\u5e03\u5230\u4efb\u4f55\u6d41\u884c\u7684Linux\u673a\u5668\u4e0a\uff0c\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u865a\u62df\u5316,Docker\u662f\u8de8\u5e73\u53f0\u7684\u5bb9\u5668\u5f15\u64ce\uff0c\u652f\u6301Windows\u3001MAC OS\u3001Linux\u7b49\u3002<\/p>\n

\"\"<\/p>\n

\u5bb9\u5668\u662f\u5b8c\u5168\u4f7f\u7528\u6c99\u7bb1\u673a\u5236\uff0c\u76f8\u4e92\u4e4b\u95f4\u4e0d\u4f1a\u6709\u4efb\u4f55\u63a5\u53e3\uff0c\u5b9e\u73b0\u4e86\u8d44\u6e90\u9694\u79bb\u6280\u672f\uff0c\u5bb9\u5668\u5185\u7684\u8d44\u6e90\u4e92\u4e0d\u5f71\u54cd,\u66f4\u91cd\u8981\u7684\u662f\u5bb9\u5668\u6027\u80fd\u5f00\u9500\u6781\u4f4e\u3002<\/p>\n

\"\"<\/p>\n

Docker\u955c\u50cf\u62c9\u53d6<\/strong><\/span><\/div>\n
\r\nroot@linuxcool:~# docker pull mysql:5.6\r\n5.6: Pulling from library\/mysql\r\ne62d08fa1eb1: Pull complete \r\nc4539e638b12: Pull complete \r\n0acb8f0db2a3: Pull complete \r\ne27254901ad3: Pull complete \r\n91e4d538a032: Pull complete \r\n8608c48c2d69: Pull complete \r\n2b7bbeb5e044: Pull complete \r\nf86c472cfc00: Pull complete \r\n3081c249e0ee: Pull complete \r\ncaddb3474aca: Pull complete \r\nec101f8c3a86: Pull complete \r\nDigest: sha256:60c27b50ca72d81d92a743a965a82f124a4e123c7d374a021887286408878d60\r\nStatus: Downloaded newer image for mysql:5.6\r\ndocker.io\/library\/mysql:5.6\r\n<\/pre>\n
Docker\u5bb9\u5668\u5907\u4efd<\/strong><\/span><\/div>\n
\r\nroot@linuxcool:~# docker image save mysql:5.6 -o mysql:5.6.tar.gz\r\nmysql:5.6\r\nmysql:5.6.tar.gz\r\n<\/pre>\n
Docker\u5bb9\u5668\u5bfc\u51fa<\/strong><\/span><\/div>\n
\r\nroot@linuxcool:~# docker save mysql:5.6 > mysql:5.6.tar.gz\r\nmysql:5.6\r\nmysql:5.6.tar.gz\r\n<\/pre>\n
Docker\u5bb9\u5668\u6062\u590d<\/strong><\/span><\/div>\n
\r\nroot@linuxcool:~# docker image load -i mysql:5.6.tar.gz\r\nmysql:5.6.tar.gz\r\n<\/pre>\n
Docker\u5bb9\u5668\u5bfc\u5165<\/strong><\/span><\/div>\n
\r\nroot@linuxcool:~# docker image load < mysql:5.6.tar.gz\r\nLoaded image: mysql:5.6\r\nmysql:5.6.tar.gz\r\n<\/pre>\n
Docker\u5bb9\u5668\u8fc1\u79fb<\/strong><\/span><\/div>\n

Docker\u5bb9\u5668\u8fc1\u79fb\u5176\u5b9e\u5c31\u662f\u628a\u73b0\u6709\u7684\u5df2\u7ecf\u5728\u8fd0\u884cDocker\u5bb9\u5668\u7684\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u65b0\u7684\u5bb9\u5668\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0a\u9762\u5907\u4efd\u3001\u6062\u590d\u3001\u5bfc\u5165\u3001\u5bfc\u51fa\u64cd\u4f5c\u6765\u5b8c\u6210\u8fc1\u79fb\uff1b\u5982\u679c\u4f01\u4e1a\u955c\u50cf\u6bd4\u8f83\u591a\u7684\u60c5\u51b5\u4e0b\uff0c\u4e5f\u53ef\u4ee5\u914d\u7f6e\u79c1\u6709\u4ed3\u5e93\uff0c\u901a\u8fc7\u79c1\u6709\u4ed3\u5e93\u53bb\u62c9\u53d6\u8981\u8fc1\u79fb\u540c\u6b65\u7684\u955c\u50cf\u8d44\u6e90\uff0c\u518d\u8fd0\u884c\u62c9\u53d6\u7684\u955c\u50cf\uff0c\u8fd9\u6837\u4e5f\u53ef\u4ee5\u5b8c\u6210\u5bb9\u5668\u8fc1\u79fb\u8fc7\u7a0b\uff1b\u540e\u7eed\u7ee7\u7eed\u53d1\u5e03\u79c1\u6709\u4ed3\u5e93harbor\u7684\u5b89\u88c5\u53ca\u914d\u7f6e\uff0c\u8fd9\u6837\u53ef\u4ee5\u628a\u4e1a\u52a1\u4e2d\u7684\u955c\u50cf\u5168\u90e8\u63a8\u9001\u5230\u79c1\u6709\u4ed3\u5e93\u4e2d\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u64cd\u4f5c\u7cfb\u7edf\uff1aUbuntu 18.04.4 LTS \u5e94\u7528\u7248\u672c\uff1aDocker version 19.03.9, bu […]<\/p>\n","protected":false},"author":1479,"featured_media":23890,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-192278","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/192278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1479"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=192278"}],"version-history":[{"count":14,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/192278\/revisions"}],"predecessor-version":[{"id":194151,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/192278\/revisions\/194151"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/23890"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=192278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=192278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=192278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}