{"id":4266,"date":"2025-08-14T13:38:12","date_gmt":"2025-08-14T10:38:12","guid":{"rendered":"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/container-image\/"},"modified":"2025-08-14T14:06:12","modified_gmt":"2025-08-14T11:06:12","slug":"container-image","status":"publish","type":"docs","link":"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/container-image\/","title":{"rendered":"Container Image"},"content":{"rendered":"\n<p><strong>Container Image<\/strong> \u2014 \u044d\u0442\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043d\u0430\u0431\u043e\u0440 \u0444\u0430\u0439\u043b\u043e\u0432, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435. \u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u043e \u00ab<strong>\u0441\u043d\u0438\u043c\u043e\u043a<\/strong>\u00bb \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c <strong>\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a<\/strong>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/docker\/\" data-internallinksmanager029f6b8e52c=\"258\" title=\"Docker\">Docker<\/a> \u0438\u043b\u0438 containerd.<\/p>\n\n\n\n<p>\u0412 \u043e\u0431\u0440\u0430\u0437 \u0432\u0445\u043e\u0434\u044f\u0442:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0439<\/strong> \u2014 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043b\u0438 \u0435\u0451 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Alpine, Ubuntu, Debian);<\/li>\n\n\n\n<li><strong>\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b;<\/li>\n\n\n\n<li><strong>\u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/strong> \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (entrypoint, \u043a\u043e\u043c\u0430\u043d\u0434\u044b).<\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udca1 <strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e<\/strong><br>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435 \u0441\u0440\u0435\u0434\u044b: \u043a\u043e\u0434, \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043a \u0436\u0435 \u0432 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c. \u042d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u00ab\u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e\u00bb.<\/p>\n\n\n\n<p><strong>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f<\/strong><br>\u041e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0438\u0448\u0435\u0442 Dockerfile, \u0433\u0434\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0448\u0430\u0433\u0438 \u0441\u0431\u043e\u0440\u043a\u0438: \u043a\u0430\u043a\u0443\u044e \u0431\u0430\u0437\u0443 \u0432\u0437\u044f\u0442\u044c, \u0447\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0437, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0430\u0445 (Docker Hub, GitHub <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/container-registry\/\" data-internallinksmanager029f6b8e52c=\"344\" title=\"Container Registry (\u0420\u0435\u0435\u0441\u0442\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432)\">Container Registry<\/a>, Harbor) \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n\n\n\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 Container Image<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0438\u0448\u0435\u0442 \u043a\u043e\u0434 \u0438 Dockerfile.<\/li>\n\n\n\n<li>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/gitlab-ci-cd\/\" data-internallinksmanager029f6b8e52c=\"372\" title=\"GitLab CI\/CD (\u041d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0430 \u0432 GitLab)\">CI\/CD<\/a> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0437.<\/li>\n\n\n\n<li>\u041e\u0431\u0440\u0430\u0437 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0435\u0441\u0442\u0440.<\/li>\n\n\n\n<li><a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/kubernetes\/\" data-internallinksmanager029f6b8e52c=\"259\" title=\"Kubernetes (K8s)\">Kubernetes<\/a> \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0437 \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b.<\/li>\n<\/ol>\n\n\n\n<p><strong>\u0414\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/strong><br>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 <strong>\u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435<\/strong>, \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u0430 <strong>\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439<\/strong> \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 <strong>\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/strong> \u2014 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u043e <strong>\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/strong>, \u0438\u0437 \u0447\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0441\u0440\u0435\u0434\u0430.<\/p>\n\n\n\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 Dockerfile \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e Python-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM python:3.11-slim\nWORKDIR \/app\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\nCOPY . .\nCMD &#91;\"python\", \"app.py\"]\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438 \u0441\u043b\u043e\u0438 (layers)<\/h3>\n\n\n\n<p><strong>Container Image<\/strong> \u0441\u043e\u0431\u0440\u0430\u043d \u0438\u0437 <strong>\u0441\u043b\u043e\u0451\u0432<\/strong> \u2014 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0444\u0430\u0439\u043b\u043e\u0432. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043b\u043e\u0439 \u00ab\u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00bb \u043f\u043e\u0432\u0435\u0440\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044f \u0438\u0442\u043e\u0433\u043e\u0432\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0439<\/strong>: \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u041e\u0421 \u0438\u043b\u0438 \u0440\u0430\u043d\u0442\u0430\u0439\u043c (alpine, debian-slim, distroless).<\/li>\n\n\n\n<li><strong>\u0421\u043b\u043e\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/strong>: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u044b.<\/li>\n\n\n\n<li><strong>\u0421\u043b\u043e\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong>: \u0432\u0430\u0448 \u043a\u043e\u0434, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u0441\u0435\u0442\u044b, \u043a\u043e\u043d\u0444\u0438\u0433\u0438.<\/li>\n\n\n\n<li><strong>\u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435<\/strong>: <code>ENTRYPOINT<\/code>, <code>CMD<\/code>, <code>ENV<\/code>, <code>EXPOSE<\/code>, <code>LABEL<\/code> \u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044f.<\/li>\n<\/ul>\n\n\n\n<p>\u041e\u0431\u0440\u0430\u0437\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0443 <strong>OCI Image<\/strong> \u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043a\u0430\u043a \u043d\u0430\u0431\u043e\u0440 \u0441\u043b\u043e\u0451\u0432 \u0441 <strong>\u043a\u043e\u043d\u0442\u0435\u043d\u0442\u2011\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0435\u0439<\/strong>: \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u043e\u0439 \u0438 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0438\u043c\u0435\u044e\u0442 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 <strong>digest<\/strong> (sha256), \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u0438 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438<\/h3>\n\n\n\n<p>Docker\/BuildKit \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u043e\u0438: \u0435\u0441\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432 <code>Dockerfile<\/code> \u0438 \u0435\u0451 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u2014 \u0441\u043b\u043e\u0439 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u043a\u044d\u0448\u0430.<\/p>\n\n\n\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u0451\u043c\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u0434<\/strong> <code>COPY requirements.txt . RUN pip install -r requirements.txt COPY . .<\/code> \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442 \u043a\u044d\u0448 \u0441\u043b\u043e\u044f \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/li>\n\n\n\n<li><strong>\u0418\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u043b\u0438\u0448\u043d\u0435\u0435<\/strong>: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>.dockerignore<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0430\u0449\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b (node_modules, .git, \u043b\u043e\u0433\u0438).<\/li>\n\n\n\n<li><strong>\u0421\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438<\/strong>: \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0439\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0438\u043d\u0430\u0447\u0435 \u043a\u044d\u0448 \u0431\u0443\u0434\u0435\u0442 \u0447\u0430\u0441\u0442\u043e \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/li>\n\n\n\n<li><strong>BuildKit<\/strong>: \u0432\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435 <code>DOCKER_BUILDKIT=1<\/code> \u2014 \u0431\u043e\u043b\u0435\u0435 \u0443\u043c\u043d\u043e\u0435 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/caching\/\" data-internallinksmanager029f6b8e52c=\"272\" title=\"Caching (\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435)\">\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a> \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0420\u0430\u0437\u043c\u0435\u0440 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <strong>\u0442\u043e\u043d\u043a\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b<\/strong> (<code>alpine<\/code>, <code>-slim<\/code>, <strong>distroless<\/strong> \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d\u0430).<\/li>\n\n\n\n<li>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0439\u0442\u0435 <strong>multi-stage builds<\/strong>: \u0441\u043e\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435, \u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u0432 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u043d\u0442\u0430\u0439\u043c.<\/li>\n<\/ul>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 (Go):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># stage 1: build\nFROM golang:1.22 AS build\nWORKDIR \/src\nCOPY go.mod go.sum .\/\nRUN go mod download\nCOPY . .\nRUN CGO_ENABLED=0 go build -o app .\/cmd\/app\n\n# stage 2: runtime\nFROM gcr.io\/distroless\/static:nonroot\nWORKDIR \/app\nCOPY --from=build \/src\/app .\nUSER nonroot:nonroot\nENTRYPOINT &#91;\"\/app\/app\"]\n<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0431\u0435\u0437 \u0448\u0435\u043b\u043b\u0430 \u0438 package\u2011\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430, \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c \u0430\u0442\u0430\u043a\u0438, \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0430.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0422\u0435\u0433\u0438, digest\u2019\u044b \u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u044c<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0422\u0435\u0433\u0438<\/strong> (<code>:latest<\/code>, <code>:v1.4.2<\/code>) \u2014 \u0443\u0434\u043e\u0431\u043d\u044b, \u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b.<\/li>\n\n\n\n<li><strong>Digest<\/strong> (<code>@sha256:\u2026<\/code>) \u2014 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440. \u0414\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0435\u043f\u043b\u043e\u0439\u0442\u0435 \u043f\u043e digest\u2019\u0443:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>image: registry.example.com\/app@sha256:abc123...\n<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430: \u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0442\u0435\u0433, \u0438 digest \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430\u0445 (Kubernetes, <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/helm-v-kubernetes\/\" data-internallinksmanager029f6b8e52c=\"350\" title=\"Helm (\u0432 Kubernetes)\">Helm<\/a>), \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0447\u0435\u0442\u0430\u0442\u044c \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0437\u043c.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u043e\u0432<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u041c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c \u0430\u0442\u0430\u043a\u0438<\/strong>: distroless\/ubi\u2011micro, \u0443\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0438 \u0448\u0435\u043b\u043b \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435.<\/li>\n\n\n\n<li><strong>\u041d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0439\u0442\u0435 \u043e\u0442 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/root-dostup\/\" data-internallinksmanager029f6b8e52c=\"234\" title=\"Root-\u0434\u043e\u0441\u0442\u0443\u043f\">root<\/a><\/strong>: <code>USER 10001:10001<\/code>, \u0437\u0430\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/li>\n\n\n\n<li><strong>\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u044b<\/strong>: Cosign\/Notary v2 \u2014 \u0432\u0435\u0440\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 CI\/CD \u0438 \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 (Policy\/Admission).<\/li>\n\n\n\n<li><strong>\u0421\u043a\u0430\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438<\/strong>: Trivy, Grype, Anchore; \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u00abbreak the build\u00bb \u043d\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 CVE.<\/li>\n\n\n\n<li><strong>SBOM<\/strong> (Software Bill of Materials): \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0439\u0442\u0435 CycloneDX\/SPDX (Syft, Trivy) \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/li>\n\n\n\n<li><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0439\u0442\u0435 \u0431\u0430\u0437\u0443<\/strong>: \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u044b \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u043f\u0430\u0442\u0447\u0430\u043c\u0438 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u044f.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0438 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435: Docker Hub, GHCR, Harbor, ECR\/GCR\/ACR.<\/li>\n\n\n\n<li><a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/replica-set\/\" data-internallinksmanager029f6b8e52c=\"295\" title=\"Replica Set\">\u0420\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f<\/a> \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043c\u0438 \u2014 \u0434\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/latency\/\" data-internallinksmanager029f6b8e52c=\"323\" title=\"Latency (\u0412\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f)\">latency<\/a> \u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438.<\/li>\n\n\n\n<li>\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0438: \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u00ab\u0432\u0438\u0441\u044f\u0447\u0438\u0445\u00bb \u0442\u0435\u0433\u043e\u0432 \u0438 \u0441\u0442\u0430\u0440\u044b\u0445 \u0431\u0438\u043b\u0434\u043e\u0432.<\/li>\n\n\n\n<li>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0430: RBAC\/OIDC, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 (<code>dev<\/code>, <code>staging<\/code>, <code>prod<\/code>).<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u0438 \u0434\u0435\u0431\u0430\u0433<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0439\u0442\u0435 <strong>\u043c\u0438\u043d\u0438\u043c\u0443\u043c<\/strong> \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043f\u0440\u043e\u0434\u2011\u043e\u0431\u0440\u0430\u0437. \u0414\u043b\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u00abdebug\u00bb-\u0432\u0430\u0440\u0438\u0430\u043d\u0442 (\u0441 \u0448\u0435\u043b\u043b\u043e\u043c \u0438 curl).<\/li>\n\n\n\n<li>\u041b\u043e\u0433\u0438 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u2014 \u0432\u043d\u0435 \u043e\u0431\u0440\u0430\u0437\u0430: \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0438 sidecar\u2011\u0430\u0433\u0435\u043d\u0442\u044b (\u043d\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u0430\u0439\u0442\u0435 \u0430\u0433\u0435\u043d\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u044c).<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0428\u0430\u0431\u043b\u043e\u043d \u00ab\u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e\u00bb Dockerfile (Node.js)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># build stage\nFROM <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/node-v-kubernetes\/\" data-internallinksmanager029f6b8e52c=\"349\" title=\"Node (\u0432 Kubernetes)\">node<\/a>:20-alpine AS build\nWORKDIR \/app\nCOPY package*.json .\/\nRUN npm ci --ignore-scripts\nCOPY . .\nRUN npm run build &amp;&amp; npm prune --production\n\n# runtime stage\nFROM gcr.io\/distroless\/nodejs20-debian12:nonroot\nWORKDIR \/app\nCOPY --from=build \/app\/dist .\/dist\nCOPY --from=build \/app\/node_modules .\/node_modules\nENV NODE_ENV=production\nUSER nonroot:nonroot\nEXPOSE 3000\nCMD &#91;\"dist\/server.js\"]\n<\/code><\/pre>\n\n\n\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>npm ci<\/code> \u2014 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430.<\/li>\n\n\n\n<li><code>prune --production<\/code> \u2014 \u0442\u043e\u043b\u044c\u043a\u043e runtime\u2011\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/li>\n\n\n\n<li>distroless \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u043d\u0442\u0430\u0439\u043c, <code>USER<\/code> \u2014 \u0431\u0435\u0437 root.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0414\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u043a\u043b\u0438\u0435\u043d\u0442\u0443<\/h3>\n\n\n\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u041f\u041e. <strong>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430<\/strong> <strong>\u0441\u043b\u043e\u0451\u0432<\/strong>, \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u0433\u0430\u043c\u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044e\u0442 \u0440\u0438\u0441\u043a\u0438, \u0443\u0441\u043a\u043e\u0440\u044f\u044e\u0442 \u0440\u0435\u043b\u0438\u0437\u044b \u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0430\u0443\u0434\u0438\u0442. \u0418\u0442\u043e\u0433 \u2014 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u0435\u043f\u043b\u043e\u0438 \u0438 <strong>\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c<\/strong> (\u043c\u0435\u043d\u044c\u0448\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438).<\/p>\n","protected":false},"featured_media":0,"parent":2927,"menu_order":199,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-4266","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/docs\/4266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/comments?post=4266"}],"version-history":[{"count":2,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/docs\/4266\/revisions"}],"predecessor-version":[{"id":4270,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/docs\/4266\/revisions\/4270"}],"up":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/docs\/2927"}],"next":[{"title":"CRI-O (Container Runtime)","link":"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/cri-o\/","href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/docs\/4298"}],"prev":[{"title":"Penetration Test (\u041f\u0435\u043d\u0442\u0435\u0441\u0442)","link":"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/penetration-test\/","href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/docs\/4240"}],"wp:attachment":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/media?parent=4266"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/doc_tag?post=4266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}