{"id":427472,"date":"2024-07-26T09:01:15","date_gmt":"2024-07-26T09:01:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=427472"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=427472","title":{"rendered":"<span>\u0427\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c Docker Hub \u0432 \u0420\u043e\u0441\u0441\u0438\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u201cYou\u2019re either the one that creates the automation or you\u2019re getting automated.\u201d \u2014 Tom Preston-Werner<\/p>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u0432\u0441\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 Docker Hub \u0432 \u0420\u0424, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u0438\u043b\u0430\u0441\u044c \u0441 30 \u043c\u0430\u044f \u043f\u043e 3 \u0438\u044e\u043d\u044f. \u0425\u043e\u0442\u044f \u0441\u0435\u0439\u0447\u0430\u0441 Docker Hub \u0432\u043d\u043e\u0432\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u044f \u0443\u0441\u043f\u0435\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0432\u0441\u0435\u0445 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 \u0440\u0435\u0448\u0438\u043b \u0435\u044e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f (\u043f\u0443\u0441\u043a\u0430\u0439 \u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0437\u0434\u043d\u043e). \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0436\u0438\u0442\u044c \u0441 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0438 \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 Docker Hub.<\/p>\n<h3>1. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u0430\u043c<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c <code>docker pull<\/code> \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>docker pull ubuntu:latest<\/code>). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u043e\u0442 Google: <code>https:\/\/mirror.gcr.io\/<\/code>. \u0415\u0449\u0435 \u0435\u0441\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u043e\u0442 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 <code>cr.yandex\/mirror<\/code>, \u043d\u043e \u0442\u0430\u043c \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043c\u0430\u043b\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u0432 (<code>ubuntu:latest<\/code> \u2014 \u0435\u0441\u0442\u044c, <code>python:3.12<\/code> \u2014 \u043d\u0435\u0442). \u041c\u043e\u0436\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>docker pull mirror.gcr.io\/ubuntu:latest<\/code>. \u041d\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Docker \u0438 \u0434\u0435\u043b\u0430\u0442\u044c <code>docker pull<\/code> \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e: <code>docker pull ubuntu:latest<\/code> (\u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438).<\/p>\n<p>\u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430 \u0432\u0430\u0441. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438\u0448\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c. \u041f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u043d\u0430 Linux Ubuntu \u0438 MacOS.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0434\u043b\u044f MacOS<\/strong>: \u0432 \u043a\u043e\u0434\u0435 \u0441\u0442\u043e\u044f\u0442 sleep&#8217;\u044b, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430 Docker. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0434\u043b\u044f Windows<\/strong>: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434, \u0433\u0434\u0435 <code>\"$os\" == \"CYGWIN_NT\"<\/code> \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  set -e  DOCKER_REGISTRY_MIRROR=\"$1\"  # utils__str_strip takes input from stdin and strips space characters function utils__str_strip() {     cat | tr -d '[:space:]' }  # utils__is_true takes single argument and # returns 0 if argument equals \"true\" (case-insensitive) # returns 1 otherwise function utils__is_true() {     bool=\"$(echo \"$1\" | tr '[:upper:]' '[:lower:]' | utils__str_strip)\"     if [ \"$bool\" == \"true\" ]; then         return 0     fi     return 1 }  function _get_docker_daemon_config_path() {     os=\"$(uname -s)\"     local path     if [ \"$os\" == \"Linux\" ]; then         path=\"\/etc\/docker\/daemon.json\"     elif [ \"$os\" == \"Darwin\" ]; then         # path=\"~\/.config\/docker\/daemon.json\" # https:\/\/docs.docker.com\/config\/daemon\/         path=\"$HOME\/.docker\/daemon.json\"     elif [ \"$os\" == \"CYGWIN_NT\" ] || [ \"$os\" == \"MINGW32_NT\" ] || [ \"$os\" == \"MSYS_NT\" ]; then         # NOTE: not tested         # https:\/\/docs.docker.com\/config\/daemon\/         path=\"C:\\ProgramData\\docker\\config\\daemon.json\"     else         echo \"Error: unsupported operating system\"         exit 1     fi     echo $path }  function _restart_docker() {     os=\"$(uname -s)\"     local path     if [ \"$os\" == \"Linux\" ]; then         sudo systemctl restart docker     elif [ \"$os\" == \"Darwin\" ]; then         pkill 'Docker' || true         sleep 3         open -a Docker         sleep 3     elif [ \"$os\" == \"CYGWIN_NT\" ] || [ \"$os\" == \"MINGW32_NT\" ] || [ \"$os\" == \"MSYS_NT\" ]; then         # NOTE: not tested         # https:\/\/forums.docker.com\/t\/restart-docker-service-from-command-line\/27331\/3         restart-service *docker*     else         echo \"Error: unsupported operating system\"         exit 1     fi }  function dr__has_mirror() {     local mirror=\"$1\"     sudo docker system info --format json | jq -r \".RegistryConfig.Mirrors | if index(\\\"${mirror}\\\") == null then \\\"false\\\" else \\\"true\\\" end\" }  function dr__add_mirror() {     local mirror=\"$1\"     local config_path=$(_get_docker_daemon_config_path)     (cat \"$config_path\" 2&gt;\/dev\/null || echo \"{}\") | jq \". + {\\\"registry-mirrors\\\": [\\\"${mirror}\\\"]}\" &gt; \/tmp\/daemon.json &amp;&amp; sudo mv \/tmp\/daemon.json \"$config_path\"     _restart_docker }  function DR_UPDATE_MIRROR() {     mirror=\"$1\"     if ! utils__is_true $(dr__has_mirror \"$mirror\"); then         echo \"Target docker registry mirror ('$mirror') not found\"         echo \"Start configuring docker registry mirror\"         dr__add_mirror \"$mirror\"         if [ \"$(dr__has_mirror \"$mirror\")\" == \"false\" ]; then             echo \"Failed to configure docker registry mirror\"             exit 1;         fi;         echo \"Successfully configured docker registry mirror\"     else         echo \"Mirror is already configured (look at \"docker system info\")\"     fi }  DR_UPDATE_MIRROR \"$DOCKER_REGISTRY_MIRROR\"<\/code><\/pre>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0443\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0435\u0440\u043a\u0430\u043b\u0430 \u043d\u0435\u0442, \u0442\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u043e\u043a\u0435\u0440<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/h4>\n<ol start=\"NaN\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c <code>update_mirror<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0430 <code>chmod +x update_mirror<\/code><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <code>.\/update_mirror 'https:\/\/mirror.gcr.io\/'<\/code><\/p>\n<\/li>\n<\/ol>\n<h4>\u0421\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u043b\u0435\u043d\u0438\u0432\u044b\u0445 \ud83d\ude42<\/h4>\n<pre><code class=\"bash\">curl https:\/\/gist.githubusercontent.com\/Deimvis\/c747446725c84cf0731e82d76f7cc67b\/raw\/709e8fe296121fb1445fca49086ab9359ca5da67\/update_mirror.sh | bash -s 'https:\/\/mirror.gcr.io\/'<\/code><\/pre>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 <code>docker system info<\/code>. \u041f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0438:<\/p>\n<pre><code> Registry Mirrors:   https:\/\/mirror.gcr.io\/<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u043b\u043b\u0438\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e: <code>docker pull ubuntu:latest<\/code><\/p>\n<h3>2. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 registry. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e registry \u043e\u0442 \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435\u0434\u043e\u0440\u043e\u0433\u043e, \u0438 \u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434 \u043d\u0438\u0445.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Container Registry<\/h4>\n<ol start=\"NaN\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 <a href=\"https:\/\/yandex.cloud\/\" rel=\"noopener noreferrer nofollow\">Yandex Cloud<\/a><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433 (folder): <a href=\"https:\/\/yandex.cloud\/ru\/docs\/resource-manager\/operations\/folder\/create\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430<\/a><\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c Yandex Cloud Console (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Container Registry (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043c registry \u0441 \u043b\u044e\u0431\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c id \u043d\u0430\u0448\u0435\u0433\u043e registry (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c registry id \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0448\u0438\u043c\u0438 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438 \u0438 \u0434\u043e\u043a\u0435\u0440 \u043f\u043e\u0439\u043c\u0435\u0442, \u0447\u0442\u043e \u043a\u0443\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\/\u043e\u0442\u043a\u0443\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <code>cr.yandex\/crparlvq5pji2gn67f8s\/pw_backend:latest<\/code><\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6cd\/10b\/06d\/6cd10b06dad6a0a4b1568e73be4e3420.png\" width=\"340\" height=\"383\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6cd\/10b\/06d\/6cd10b06dad6a0a4b1568e73be4e3420.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cd0\/442\/be4\/cd0442be48f102edaac4ab3fbc05d59a.png\" width=\"771\" height=\"340\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cd0\/442\/be4\/cd0442be48f102edaac4ab3fbc05d59a.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/675\/e67\/405\/675e674054d7722fb3c5204cfb155acb.png\" width=\"1420\" height=\"816\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/675\/e67\/405\/675e674054d7722fb3c5204cfb155acb.png\"\/><\/figure>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c registry, \u043d\u0443\u0436\u043d\u043e \u043a \u043d\u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0415\u0441\u0442\u044c 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430&#8230;<\/p>\n<h4>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 pull \u0438\u043b\u0438 push \u043e\u0431\u0440\u0430\u0437\u043e\u0432 (\u043e\u0431\u0430 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442\u0441\u044f, \u0432\u0442\u043e\u0440\u043e\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e).<\/p>\n<ol start=\"NaN\">\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 registry \u0432 \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c Access bindings (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Assign bindings (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Public + All users (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430: puller \u0438\/\u0438\u043b\u0438 pusher (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7b1\/10c\/759\/7b110c7594873df1251e6b57398568e1.png\" width=\"703\" height=\"340\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b1\/10c\/759\/7b110c7594873df1251e6b57398568e1.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b6b\/950\/529\/b6b950529d2f2afc43c199fb370b160d.png\" width=\"1366\" height=\"340\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b6b\/950\/529\/b6b950529d2f2afc43c199fb370b160d.png\"\/><\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d1a\/476\/429\/d1a476429fdc46b2094f2819dd214f12.png\" width=\"484\" height=\"340\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d1a\/476\/429\/d1a476429fdc46b2094f2819dd214f12.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3a8\/c1e\/803\/3a8c1e80333d54428291e8ad83ada252.png\" width=\"544\" height=\"340\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3a8\/c1e\/803\/3a8c1e80333d54428291e8ad83ada252.png\"\/><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 registry \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u0443\/\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c, \u043d\u043e \u0434\u043b\u044f \u043a\u043e\u0433\u043e-\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435.<\/p>\n<h4>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0439<\/h4>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437 \u0438 \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043a Container Registry.<\/p>\n<ol start=\"NaN\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u044e\u0447\u0438: <code>yc iam key create --service-account-name default-sa -o key.json<\/code> (\u0441\u043c. <a href=\"https:\/\/yandex.cloud\/ru\/docs\/container-registry\/operations\/authentication#sa-json\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u041b\u043e\u0433\u0438\u043d\u0438\u043c\u0441\u044f:<\/p>\n<pre><code class=\"bash\">cat key.json | docker login \\   --username json_key \\   --password-stdin \\   cr.yandex<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0435, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<ol start=\"NaN\">\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043b\u044e\u0447 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0442\u044c: <code>secrets\/yc_key.json<\/code> (\u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043d\u0435 \u0437\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0442\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/p>\n<ul>\n<li>\n<p><code>SSH_USER<\/code> \u2014 \u044e\u0437\u0435\u0440 \u0434\u043b\u044f SSH<\/p>\n<\/li>\n<li>\n<p><code>SSH_HOST<\/code> \u2014 \u0445\u043e\u0441\u0442 \u0434\u043b\u044f SSH<\/p>\n<\/li>\n<li>\n<p><code>SSH_PKEY<\/code> \u2014 \u043f\u0443\u0442\u044c \u043a \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443 \u0434\u043b\u044f SSH<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\">export SSH_USER=dbrusenin export SSH_HOST=111.222.0.3 export SSH_PKEY=~\/.ssh\/id_rsa<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  set -e  function SSH() {     local cmd=\"$1\"     ssh -t -o LogLevel=QUIET -o \"StrictHostKeyChecking no\" -i $SSH_PKEY $SSH_USER@$SSH_HOST \"$cmd\" }  function SCP {     local src=$1     local dst_dir=$2     SSH \"mkdir -p \\\"$(dirname $dst_dir)\\\"\"     scp -i $SSH_PKEY -r $src $SSH_USER@$SSH_HOST:$dst_dir }  function DR_YANDEX_AUTH() {     local auth_keys=\"$1\"     SCP \"$auth_keys\" \/tmp\/yc_key.json     SSH \"cat \/tmp\/yc_key.json | sudo docker login \\         --username json_key \\         --password-stdin \\         cr.yandex\" &gt; \/dev\/null     SSH \"rm \/tmp\/yc_key.json\" }  DR_YANDEX_AUTH \".\/secrets\/yc_key.json\"<\/code><\/pre>\n<p><strong>\u0418\u043b\u0438 \u0441\u043d\u043e\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u043b\u0435\u043d\u0438\u0432\u044b\u0445:<\/strong><\/p>\n<pre><code class=\"bash\">curl https:\/\/gist.githubusercontent.com\/Deimvis\/a60df999aca23b2292f2a5d5c856618a\/raw\/937d846ab667b84f13a9fb59e012ec3a37afedc8\/yandex_auth.sh | sh<\/code><\/pre>\n<\/li>\n<\/ol>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0443\u0448\u0438\u0442\u044c \u0438 \u043f\u0443\u043b\u043b\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b, \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u043c <code>cr.yandex\/&lt;registry_id&gt;\/<\/code>. \u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043a registry \u043f\u043e \u0438\u0434\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433 <code>~\/.docker\/config.json<\/code>. <\/p>\n<h3>\u0418\u0442\u043e\u0433<\/h3>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 Docker Hub \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0434\u0435\u043b\u0430\u0442\u044c pull\/push \u043e\u0431\u0440\u0430\u0437\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c pull \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c push\/pull \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 registry \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/831608\/\"> https:\/\/habr.com\/ru\/articles\/831608\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u201cYou\u2019re either the one that creates the automation or you\u2019re getting automated.\u201d \u2014 Tom Preston-Werner<\/p>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u0432\u0441\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 Docker Hub \u0432 \u0420\u0424, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u0438\u043b\u0430\u0441\u044c \u0441 30 \u043c\u0430\u044f \u043f\u043e 3 \u0438\u044e\u043d\u044f. \u0425\u043e\u0442\u044f \u0441\u0435\u0439\u0447\u0430\u0441 Docker Hub \u0432\u043d\u043e\u0432\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u044f \u0443\u0441\u043f\u0435\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0432\u0441\u0435\u0445 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 \u0440\u0435\u0448\u0438\u043b \u0435\u044e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f (\u043f\u0443\u0441\u043a\u0430\u0439 \u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0437\u0434\u043d\u043e). \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0436\u0438\u0442\u044c \u0441 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0438 \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 Docker Hub.<\/p>\n<h3>1. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u0430\u043c<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c <code>docker pull<\/code> \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>docker pull ubuntu:latest<\/code>). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u043e\u0442 Google: <code>https:\/\/mirror.gcr.io\/<\/code>. \u0415\u0449\u0435 \u0435\u0441\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u043e\u0442 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 <code>cr.yandex\/mirror<\/code>, \u043d\u043e \u0442\u0430\u043c \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043c\u0430\u043b\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u0432 (<code>ubuntu:latest<\/code> \u2014 \u0435\u0441\u0442\u044c, <code>python:3.12<\/code> \u2014 \u043d\u0435\u0442). \u041c\u043e\u0436\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>docker pull mirror.gcr.io\/ubuntu:latest<\/code>. \u041d\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Docker \u0438 \u0434\u0435\u043b\u0430\u0442\u044c <code>docker pull<\/code> \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e: <code>docker pull ubuntu:latest<\/code> (\u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438).<\/p>\n<p>\u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430 \u0432\u0430\u0441. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438\u0448\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c. \u041f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u043d\u0430 Linux Ubuntu \u0438 MacOS.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0434\u043b\u044f MacOS<\/strong>: \u0432 \u043a\u043e\u0434\u0435 \u0441\u0442\u043e\u044f\u0442 sleep&#8217;\u044b, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430 Docker. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0434\u043b\u044f Windows<\/strong>: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434, \u0433\u0434\u0435 <code>\"$os\" == \"CYGWIN_NT\"<\/code> \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  set -e  DOCKER_REGISTRY_MIRROR=\"$1\"  # utils__str_strip takes input from stdin and strips space characters function utils__str_strip() {     cat | tr -d '[:space:]' }  # utils__is_true takes single argument and # returns 0 if argument equals \"true\" (case-insensitive) # returns 1 otherwise function utils__is_true() {     bool=\"$(echo \"$1\" | tr '[:upper:]' '[:lower:]' | utils__str_strip)\"     if [ \"$bool\" == \"true\" ]; then         return 0     fi     return 1 }  function _get_docker_daemon_config_path() {     os=\"$(uname -s)\"     local path     if [ \"$os\" == \"Linux\" ]; then         path=\"\/etc\/docker\/daemon.json\"     elif [ \"$os\" == \"Darwin\" ]; then         # path=\"~\/.config\/docker\/daemon.json\" # https:\/\/docs.docker.com\/config\/daemon\/         path=\"$HOME\/.docker\/daemon.json\"     elif [ \"$os\" == \"CYGWIN_NT\" ] || [ \"$os\" == \"MINGW32_NT\" ] || [ \"$os\" == \"MSYS_NT\" ]; then         # NOTE: not tested         # https:\/\/docs.docker.com\/config\/daemon\/         path=\"C:\\ProgramData\\docker\\config\\daemon.json\"     else         echo \"Error: unsupported operating system\"         exit 1     fi     echo $path }  function _restart_docker() {     os=\"$(uname -s)\"     local path     if [ \"$os\" == \"Linux\" ]; then         sudo systemctl restart docker     elif [ \"$os\" == \"Darwin\" ]; then         pkill 'Docker' || true         sleep 3         open -a Docker         sleep 3     elif [ \"$os\" == \"CYGWIN_NT\" ] || [ \"$os\" == \"MINGW32_NT\" ] || [ \"$os\" == \"MSYS_NT\" ]; then         # NOTE: not tested         # https:\/\/forums.docker.com\/t\/restart-docker-service-from-command-line\/27331\/3         restart-service *docker*     else         echo \"Error: unsupported operating system\"         exit 1     fi }  function dr__has_mirror() {     local mirror=\"$1\"     sudo docker system info --format json | jq -r \".RegistryConfig.Mirrors | if index(\\\"${mirror}\\\") == null then \\\"false\\\" else \\\"true\\\" end\" }  function dr__add_mirror() {     local mirror=\"$1\"     local config_path=$(_get_docker_daemon_config_path)     (cat \"$config_path\" 2&gt;\/dev\/null || echo \"{}\") | jq \". + {\\\"registry-mirrors\\\": [\\\"${mirror}\\\"]}\" &gt; \/tmp\/daemon.json &amp;&amp; sudo mv \/tmp\/daemon.json \"$config_path\"     _restart_docker }  function DR_UPDATE_MIRROR() {     mirror=\"$1\"     if ! utils__is_true $(dr__has_mirror \"$mirror\"); then         echo \"Target docker registry mirror ('$mirror') not found\"         echo \"Start configuring docker registry mirror\"         dr__add_mirror \"$mirror\"         if [ \"$(dr__has_mirror \"$mirror\")\" == \"false\" ]; then             echo \"Failed to configure docker registry mirror\"             exit 1;         fi;         echo \"Successfully configured docker registry mirror\"     else         echo \"Mirror is already configured (look at \"docker system info\")\"     fi }  DR_UPDATE_MIRROR \"$DOCKER_REGISTRY_MIRROR\"<\/code><\/pre>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0443\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0435\u0440\u043a\u0430\u043b\u0430 \u043d\u0435\u0442, \u0442\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u043e\u043a\u0435\u0440<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/h4>\n<ol start=\"NaN\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c <code>update_mirror<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0430 <code>chmod +x update_mirror<\/code><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <code>.\/update_mirror 'https:\/\/mirror.gcr.io\/'<\/code><\/p>\n<\/li>\n<\/ol>\n<h4>\u0421\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u043b\u0435\u043d\u0438\u0432\u044b\u0445 \ud83d\ude42<\/h4>\n<pre><code class=\"bash\">curl https:\/\/gist.githubusercontent.com\/Deimvis\/c747446725c84cf0731e82d76f7cc67b\/raw\/709e8fe296121fb1445fca49086ab9359ca5da67\/update_mirror.sh | bash -s 'https:\/\/mirror.gcr.io\/'<\/code><\/pre>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 <code>docker system info<\/code>. \u041f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0438:<\/p>\n<pre><code> Registry Mirrors:   https:\/\/mirror.gcr.io\/<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u043b\u043b\u0438\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e: <code>docker pull ubuntu:latest<\/code><\/p>\n<h3>2. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 registry. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e registry \u043e\u0442 \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435\u0434\u043e\u0440\u043e\u0433\u043e, \u0438 \u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434 \u043d\u0438\u0445.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Container Registry<\/h4>\n<ol start=\"NaN\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 <a href=\"https:\/\/yandex.cloud\/\" rel=\"noopener noreferrer nofollow\">Yandex Cloud<\/a><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433 (folder): <a href=\"https:\/\/yandex.cloud\/ru\/docs\/resource-manager\/operations\/folder\/create\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430<\/a><\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c Yandex Cloud Console (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Container Registry (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043c registry \u0441 \u043b\u044e\u0431\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c id \u043d\u0430\u0448\u0435\u0433\u043e registry (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c registry id \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0448\u0438\u043c\u0438 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438 \u0438 \u0434\u043e\u043a\u0435\u0440 \u043f\u043e\u0439\u043c\u0435\u0442, \u0447\u0442\u043e \u043a\u0443\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\/\u043e\u0442\u043a\u0443\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <code>cr.yandex\/crparlvq5pji2gn67f8s\/pw_backend:latest<\/code><\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c registry, \u043d\u0443\u0436\u043d\u043e \u043a \u043d\u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0415\u0441\u0442\u044c 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430&#8230;<\/p>\n<h4>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 pull \u0438\u043b\u0438 push \u043e\u0431\u0440\u0430\u0437\u043e\u0432 (\u043e\u0431\u0430 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442\u0441\u044f, \u0432\u0442\u043e\u0440\u043e\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e).<\/p>\n<ol start=\"NaN\">\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 registry \u0432 \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c Access bindings (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Assign bindings (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Public + All users (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430: puller \u0438\/\u0438\u043b\u0438 pusher (\u0441\u043c. \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 registry \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u0443\/\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c, \u043d\u043e \u0434\u043b\u044f \u043a\u043e\u0433\u043e-\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435.<\/p>\n<h4>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0439<\/h4>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437 \u0438 \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043a Container Registry.<\/p>\n<ol start=\"NaN\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u044e\u0447\u0438: <code>yc iam key create --service-account-name default-sa -o key.json<\/code> (\u0441\u043c. <a href=\"https:\/\/yandex.cloud\/ru\/docs\/container-registry\/operations\/authentication#sa-json\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u041b\u043e\u0433\u0438\u043d\u0438\u043c\u0441\u044f:<\/p>\n<pre><code class=\"bash\">cat key.json | docker login \\   --username json_key \\   --password-stdin \\   cr.yandex<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0435, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<ol start=\"NaN\">\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043b\u044e\u0447 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0442\u044c: <code>secrets\/yc_key.json<\/code> (\u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043d\u0435 \u0437\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0442\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/p>\n<ul>\n<li>\n<p><code>SSH_USER<\/code> \u2014 \u044e\u0437\u0435\u0440 \u0434\u043b\u044f SSH<\/p>\n<\/li>\n<li>\n<p><code>SSH_HOST<\/code> \u2014 \u0445\u043e\u0441\u0442 \u0434\u043b\u044f SSH<\/p>\n<\/li>\n<li>\n<p><code>SSH_PKEY<\/code> \u2014 \u043f\u0443\u0442\u044c \u043a \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443 \u0434\u043b\u044f SSH<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\">export SSH_USER=dbrusenin export SSH_HOST=111.222.0.3 export SSH_PKEY=~\/.ssh\/id_rsa<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  set -e  function SSH() {     local cmd=\"$1\"     ssh -t -o LogLevel=QUIET -o \"StrictHostKeyChecking no\" -i $SSH_PKEY $SSH_USER@$SSH_HOST \"$cmd\" }  function SCP {     local src=$1     local dst_dir=$2     SSH \"mkdir -p \\\"$(dirname $dst_dir)\\\"\"     scp -i $SSH_PKEY -r $src $SSH_USER@$SSH_HOST:$dst_dir }  function DR_YANDEX_AUTH() {     local auth_keys=\"$1\"     SCP \"$auth_keys\" \/tmp\/yc_key.json     SSH \"cat \/tmp\/yc_key.json | sudo docker login \\         --username json_key \\         --password-stdin \\         cr.yandex\" &gt; \/dev\/null     SSH \"rm \/tmp\/yc_key.json\" }  DR_YANDEX_AUTH \".\/secrets\/yc_key.json\"<\/code><\/pre>\n<p><strong>\u0418\u043b\u0438 \u0441\u043d\u043e\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u043b\u0435\u043d\u0438\u0432\u044b\u0445:<\/strong><\/p>\n<pre><code class=\"bash\">curl https:\/\/gist.githubusercontent.com\/Deimvis\/a60df999aca23b2292f2a5d5c856618a\/raw\/937d846ab667b84f13a9fb59e012ec3a37afedc8\/yandex_auth.sh | sh<\/code><\/pre>\n<\/li>\n<\/ol>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0443\u0448\u0438\u0442\u044c \u0438 \u043f\u0443\u043b\u043b\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b, \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u043c <code>cr.yandex\/&lt;registry_id&gt;\/<\/code>. \u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043a registry \u043f\u043e \u0438\u0434\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433 <code>~\/.docker\/config.json<\/code>. <\/p>\n<h3>\u0418\u0442\u043e\u0433<\/h3>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 Docker Hub \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0434\u0435\u043b\u0430\u0442\u044c pull\/push \u043e\u0431\u0440\u0430\u0437\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c pull \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0437\u0435\u0440\u043a\u0430\u043b\u043e<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c push\/pull \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 registry \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/831608\/\"> https:\/\/habr.com\/ru\/articles\/831608\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-427472","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/427472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=427472"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/427472\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=427472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=427472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=427472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}