{"id":386059,"date":"2024-06-29T06:29:08","date_gmt":"2024-06-29T06:29:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=386059"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=386059","title":{"rendered":"<span>Docker \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d<\/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<h2>\u0422\u0435\u043c\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435:<\/h2>\n<h3>Docker vs. Podman<\/h3>\n<ul>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Podman <\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Podman <\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a Podman \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b <\/p>\n<\/li>\n<li>\n<p>Docker Compose <\/p>\n<\/li>\n<li>\n<p>Podman REST API <\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 <\/p>\n<\/li>\n<\/ul>\n<h3>Demo-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h3>\n<ul>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Spring Boot <\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443 <\/p>\n<\/li>\n<li>\n<p>Dockerfile <\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u043e\u043d\u0432\u0435\u0439\u0435\u0440:<\/h3>\n<ul>\n<li>\n<p>Build <\/p>\n<\/li>\n<li>\n<p>Push <\/p>\n<\/li>\n<li>\n<p>Test <\/p>\n<\/li>\n<li>\n<p>Scan <\/p>\n<\/li>\n<li>\n<p>Archive <\/p>\n<\/li>\n<li>\n<p>\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <\/p>\n<\/li>\n<\/ul>\n<h3>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0435\u043d\u0434\u0430 Jenkins<\/h3>\n<h2>Docker vs. Podman<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Podman \u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0442 Docker.<br \/> \u0422\u0430\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435.<br \/> \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e, \u043c\u044b \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 (\u043f\u0440\u043e\u0441\u0442\u043e\u0435 Java \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435) \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c Docker \u043d\u0430 Podman \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 CI\/CD,<br \/> \u0438 \u043a\u0430\u043a\u0438\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u0434\u0438\u0432\u0438\u0434\u0435\u043d\u0434\u044b.<\/p>\n<p>Podman \u2013 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432.<br \/> \u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c\u0438 docker \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 root.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Podman \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 CI\/CD, \u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0439 Podman \u043e\u0442 Docker:<\/p>\n<ul>\n<li>\n<p>Podman \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u0430 \u0434\u043b\u044f \u0440\u0435\u0435\u0441\u0442\u0440\u043e\u0432. \u0412 Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"http:\/\/docker.io\" rel=\"noopener noreferrer nofollow\">docker.io<\/a> \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0438\u043c\u044f.<\/p>\n<\/li>\n<li>\n<p>Podman \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0438 \u043f\u043e\u0434\u044b \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c YAML \u041a\u0443\u0431\u0435\u0440\u043d\u0435\u0442\u0435\u0441. \u0410 \u0442\u0430\u043a\u0436\u0435 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c YAML \u041a\u0443\u0431\u0435\u0440\u043d\u0435\u0442\u0435\u0441 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>Podman \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u044b \u043a\u0430\u043a \u0432 \u041a\u0443\u0431\u0435\u0440\u043d\u0442\u0435\u0441 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0434\u0435.<\/p>\n<\/li>\n<li>\n<p>Podman \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0430\u044f CLI \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0430 Docker \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043c\u043e\u043d\u043e\u0432 Linux \u0441 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438 root.<\/p>\n<\/li>\n<li>\n<p>Podman \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u0445 \u0438\u043c\u0435\u043d \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 Docker.<\/p>\n<\/li>\n<li>\n<p>Podman \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a systemd \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 systemd.<\/p>\n<\/li>\n<li>\n<p>Podman \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0430 Do\u0441ker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0435\u043c\u043e\u043d Linux, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432\u0441\u0435\u0433\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 Podman \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 Docker.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432,<br \/> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Podman \u0440\u0435\u0448\u0438\u043b\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u0435\u0436\u0434\u0443 \u0442\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438: Podman, Buildah, \u0438 Skopeo.<br \/> Podman \u043d\u0430 Windows \u0438 macOS \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0430 Buildah \u043f\u043e\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 Linux, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 WSL2 \u043d\u0430 Windows.<\/p>\n<h3>\u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 Podman:<\/h3>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/96c\/276\/c99\/96c276c9984c6eef69de5ff4da06abcb.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/96c\/276\/c99\/96c276c9984c6eef69de5ff4da06abcb.png\"\/><\/figure>\n<h3>\u041a\u0430\u043a Docker \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b:<\/h3>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/dac\/a24\/673\/daca24673095dde995314ec28d94f841.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/dac\/a24\/673\/daca24673095dde995314ec28d94f841.png\"\/><\/figure>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 Containerd:<\/h3>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/d44\/6fb\/169\/d446fb169738f5708a82c28f04320420.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d44\/6fb\/169\/d446fb169738f5708a82c28f04320420.png\"\/><\/figure>\n<h3>\u041a\u0430\u043a Podman \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b:<\/h3>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/6f8\/550\/d7b\/6f8550d7b82b53378e4030b41968cfd8.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6f8\/550\/d7b\/6f8550d7b82b53378e4030b41968cfd8.png\"\/><\/figure>\n<h3>\u041a\u043e\u043c\u0430\u043d\u0434\u044b Docker \u0438 Podman:<\/h3>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/674\/792\/e26\/674792e26ff0eefb62aceb51f54049f6.jpg\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/674\/792\/e26\/674792e26ff0eefb62aceb51f54049f6.jpg\" data-blurred=\"true\"\/><\/figure>\n<h3>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 Podman:<\/h3>\n<p><code>docker container update<\/code><br \/> Podman \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u0437\u0430\u043d\u043e\u0432\u043e.<br \/> <code>docker plugin<\/code><br \/> Podman \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u044b.<br \/> <code>docker swarm<\/code><br \/> Podman \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 Docker Swarm, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e Podman, \u0434\u043b\u044f \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u041a\u0443\u0431\u0435\u0440\u043d\u0435\u0442\u0435\u0441 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 CRI-O.<br \/> <code>docker trust<\/code><br \/> \u042d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0440\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a <code>Podman image trust<\/code>.<\/p>\n<h3>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 Docker:<\/h3>\n<p><code>podman container<\/code><br \/> <code>podman generate<\/code><br \/> <code>podman healthcheck<\/code><br \/> <code>podman image<\/code><br \/> <code>podman init<\/code><br \/> <code>podman machine<\/code><br \/> <code>podman mount<\/code><br \/> <code>podman network exists\/prune\/reload<\/code><br \/> <code>podman play<\/code><br \/> <code>podman pod<\/code><br \/> <code>podman system<\/code><br \/> <code>podman unmount<\/code><br \/> <code>podman unshare<\/code><br \/> <code>podman untag<\/code><br \/> <code>podman volume exists<\/code><\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Podman<\/h3>\n<p>\u041f\u0430\u043a\u0435\u0442\u044b Podman \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 Linux \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432:<\/p>\n<pre><code>yum install podman buildah skopeo <\/code><\/pre>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 Podman \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 Docker.<\/p>\n<h3>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Podman<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/podman\/tree\/main\/libpod\" rel=\"noopener noreferrer nofollow\">libpod<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u043c \u0446\u0438\u043a\u043b\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/crun\" rel=\"noopener noreferrer nofollow\">crun\/runc<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/image\" rel=\"noopener noreferrer nofollow\">containers\/image<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/storage\" rel=\"noopener noreferrer nofollow\">containers\/storage<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043c\u0430\u043c\u0438, \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/buildah\" rel=\"noopener noreferrer nofollow\">Buildah<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0431\u043e\u0440\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/conmon\" rel=\"noopener noreferrer nofollow\">Conmon<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containernetworking\/cni\/blob\/main\/SPEC.md\" rel=\"noopener noreferrer nofollow\">Container Network Interface (CNI)<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u044f\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u041a\u0443\u0431\u0435\u0440\u043d\u0435\u0442\u0435\u0441 CNI<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0420\u0435\u0435\u0441\u0442\u0440\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0440\u0435\u0435\u0441\u0442\u0440\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f Podman:<\/p>\n<pre><code>podman info | grep registries -A 4  registries:   search:   - registry.access.redhat.com   - registry.redhat.io   - docker.io <\/code><\/pre>\n<h3>Docker Compose<\/h3>\n<p>Compose \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<br \/> Podman \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 Docker Compose, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e\u043a\u0435\u0442\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435:<\/p>\n<pre><code>systemctl enable --now podman.socket <\/code><\/pre>\n<p>docker-compose \u043d\u0443\u0436\u0435\u043d <code>docker.sock<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 Podman \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>ls -al \/run\/docker.sock <\/code><\/pre>\n<h3>API<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441\u043e\u043a\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c REST API Podman \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e curl:<\/p>\n<pre><code>curl --unix-socket \/run\/podman\/podman.sock http:\/\/d\/v3.0.0\/libpod\/images\/json <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Podman CLI \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0447\u0435\u0440\u0435\u0437 REST API.<\/p>\n<h3>\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438<\/h3>\n<p>Podman \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0445\u043e\u0441\u0442\u0430\u043c\u0438, \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0435\u0441\u0442\u0440\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 SSH \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>podman system connection add &lt;CONNECTION> -i ~\/.ssh\/id_ed25519 REMOTE_USER_NAME@&lt;IP_ADDRESS>\/run\/user\/1000\/podman\/podman.sock <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>podman image scp<\/code>:<\/p>\n<pre><code>podman image scp my_image &lt;CONNECTION> <\/code><\/pre>\n<h2>Demo-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Java Spring Boot. \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 Java \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Gradle.<br \/> \u0414\u043b\u044f \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438 Jenkins.<\/p>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Spring Boot<\/h3>\n<p>Spring Boot \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043a\u0435\u043b\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Java \u2013 Maven \u0438 Gradle.<br \/> \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0432\u0435\u0431-\u0444\u043e\u0440\u043c\u0443, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 curl:<\/p>\n<pre><code>curl https:\/\/start.spring.io\/starter.tgz \\     -d applicationName=HelloApplication \\     -d artifactId=demo \\     -d baseDir=hello \\     -d bootVersion=2.7.0 \\     -d dependencies=web,actuator \\     -d description='Demo project for Spring Boot' \\     -d groupId=com.example \\     -d javaVersion=17 \\     -d language=java \\     -d name=demo \\     -d packageName=com.example.demo \\     -d packaging=jar \\     -d type=gradle-project \\     -d version=0.0.1-SNAPSHOT \\ | tar -xzvf - <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c hello:<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>ls hello<\/code>.<br \/> \u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code>HELP.md   build.gradle  gradle    gradlew   gradlew.bat settings.gradle src <\/code><\/pre>\n<p>\u041d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443<\/h3>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043a\u0435\u043b\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<br \/> HelloApplication.java:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">package com.example.demo;  import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;  @SpringBootApplication @RestController public class HelloApplication {      @RequestMapping(\"\/\")     public String home() {         return \"Hello world\\n\";     }      public static void main(String[] args) {         SpringApplication.run(HelloApplication.class, args);     }  } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<pre><code>cp -f HelloApplication.java hello\/src\/main\/java\/com\/example\/demo\/ <\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>ls hello\/src\/main\/java\/com\/example\/demo\/<\/code><br \/> \u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"bash\">HelloApplication.java <\/code><\/pre>\n<h3>Dockerfile<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 Dockerfile:<\/p>\n<details class=\"spoiler\">\n<summary>Dockerfile<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>## Stage 1 : Gradle \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 jar FROM openjdk:17-oraclelinux8 as builder RUN microdnf install findutils WORKDIR \/home\/gradle\/src COPY . . RUN .\/gradlew build  ## Stage 2 : \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 JRE \u0438 jar FROM openjdk:17-oraclelinux8  # \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c jar \u0432 \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 COPY --from=builder \/home\/gradle\/src\/build\/libs\/demo-0.0.1-SNAPSHOT.jar demo.jar  EXPOSE 8080  # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 jar \u0444\u0430\u0439\u043b CMD [\"java\", \"-jar\", \"demo.jar\"] <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Java (Java runtime).<br \/> Jar-\u0444\u0430\u0439\u043b \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Spring Boot, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438.<\/p>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 Dockerfile \u0432 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<pre><code>cp -f Dockerfile hello <\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>ls hello\/Dockerfile<\/code><br \/> \u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"bash\">hello\/Dockerfile <\/code><\/pre>\n<h2>\u041a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438<\/h2>\n<p>Jenkins \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0435\u0431\u0445\u0443\u043a\u043e\u0432 (webhook) \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 GitLab \u0438\u043b\u0438 Gitea,<br \/> \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a CI \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Git.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/904\/169\/f78\/904169f788925cc1c1ebc5b5240e9a8c.jpg\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/904\/169\/f78\/904169f788925cc1c1ebc5b5240e9a8c.jpg\" data-blurred=\"true\"\/><\/figure>\n<h2>Build<\/h2>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Buildah.<\/p>\n<ul>\n<li>\n<p>Buildah \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 Podman. \u041a\u043e\u0434\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 Podman \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043f\u0430\u043a\u0435\u0442\u044b Buildah.<\/p>\n<\/li>\n<li>\n<p>Buildah \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 Dockerfile, \u043d\u043e \u0435\u0433\u043e \u0446\u0435\u043b\u044c \u044d\u0442\u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0431\u0435\u0437 Dockerfile.<\/p>\n<\/li>\n<li>\n<p>Buildah \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0434\u0435\u043c\u043e\u043d Linux, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>Buildah \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438 root \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u044b\u043c \u043f\u043b\u044e\u0441\u043e\u043c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>  stage('Build image') {     steps {       dir('k8s-course\/podman\/helloPodman') {         sh 'buildah build -f Dockerfile -t antonvkrylov\/k8s-course:helloPodman'       }     }   } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 \u043b\u043e\u0433\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u044b\u0432\u043e\u0434 Gradle: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/9ce\/d01\/32a\/9ced0132a4f9cd8c9e3bf4dcb6dfdd1b.jpg\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9ce\/d01\/32a\/9ced0132a4f9cd8c9e3bf4dcb6dfdd1b.jpg\" data-blurred=\"true\"\/><\/figure>\n<p><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f Buildah:<\/strong><br \/> \/etc\/containers\/registries.conf &#8212; \u0420\u0435\u0435\u0441\u0442\u0440\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432.<br \/> \/usr\/share\/containers\/policy.json &#8212; \u0412\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440.<br \/> \/usr\/share\/containers\/mounts.conf &#8212; \u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445.<br \/> \/usr\/share\/containers\/seccomp.json &#8212; \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445.<\/p>\n<h2>Push<\/h2>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 Docker:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>  stage('Push image') {     steps {       dir('k8s-course\/podman\/helloPodman') {         sh 'buildah push antonvkrylov\/k8s-course:helloPodman'       }     }   } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0441 Docker \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>podman\/buildah login<\/code><\/p>\n<p>Buildah \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 Podman \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438:<br \/> <code>buildah push --authfile \/auth.json registry.example.com<\/code><\/p>\n<h2>Test<\/h2>\n<p>Podman \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a (healthchecks).<br \/> \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Docker Compose.<br \/> \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 CI \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>  stage('Test') {   \/\/\/\/\/\/\/\/\/   \/\/\/ Jenkins \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0442\u0430\u0434\u0438\u0438 \u0438\u043b\u0438 \u0448\u0430\u0433\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e   \/\/\/\/\/\/\/\/\/     parallel {       stage('Test ports') {         steps {           \/\/\/\/\/\/\/\/\/           \/\/\/ \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 (healthcheck) \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e curl \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.           \/\/\/\/\/\/\/\/\/           sh\"\"\"           podman run --rm -dt --name test_ports \\           --healthcheck-start-period 10s \\           --healthcheck-retries 1 \\           --healthcheck-command \"CMD-SHELL curl -f http:\/\/127.0.0.1:8080 || exit 1\" docker.io\/antonvkrylov\/k8s-course:helloPodman           \"\"\"           \/\/\/\/\/\/\/\/\/           \/\/\/ \u0415\u0441\u043b\u0438 \u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u0432 2 \u043c\u0438\u043d\u0443\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d \u0442\u043e \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u043f\u0440\u0435\u0440\u0432\u0435\u0442\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u00abAborted\u00bb           \/\/\/\/\/\/\/\/\/           timeout(time: 2, unit: 'MINUTES') {           \/\/\/\/\/\/\/\/\/           \/\/\/ \u0412 \u044d\u0442\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0436\u0434\u044b\u0435 3 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u2013 \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u00abhealthy\u00bb \u0442\u043e \u0446\u0438\u043a\u043b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f.           \/\/\/\/\/\/\/\/\/           sh\"\"\"           #!\/bin\/bash           while [ \"`podman healthcheck run test_ports`\" = \"unhealthy\" ]; do               sleep 3           done           \"\"\"           }         }       }       stage('Test Java') {         steps {           \/\/\/\/\/\/\/\/\/           \/\/\/ \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e grep \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e Java \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435            \/\/\/\/\/\/\/\/\/           sh\"\"\"           podman run --rm -dt --name test_java \\           --healthcheck-start-period 10s \\           --healthcheck-retries 1 \\           --healthcheck-command \"CMD-SHELL java --version | grep 'openjdk 17.0.2' || exit 1\" docker.io\/antonvkrylov\/k8s-course:helloPodman           \"\"\"           timeout(time: 2, unit: 'MINUTES') {           sh\"\"\"           #!\/bin\/bash           while [ \"`podman healthcheck run test_java`\" = \"unhealthy\" ]; do               sleep 3           done           \"\"\"           }         }       }     }   } <\/code><\/pre>\n<\/div>\n<\/details>\n<h2>Scan<\/h2>\n<p>\u0414\u043b\u044f \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u043d\u0430 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (SAST):<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>    stage('Scan image') {       steps {         dir('k8s-course\/podman\/helloPodman') {           sh 'trivy image --security-checks vuln --severity CRITICAL antonvkrylov\/k8s-course:helloPodman'         }       }     } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 Jenkins: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/642\/6ac\/23f\/6426ac23fe902608a4ce55b0dd48b921.jpg\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/642\/6ac\/23f\/6426ac23fe902608a4ce55b0dd48b921.jpg\" data-blurred=\"true\"\/><\/figure>\n<h2>Archive<\/h2>\n<p>Skopeo \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0435\u0441\u0442\u0440\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438\u0437 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u0435\u0435\u0441\u0442\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e skopeo \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>    stage('Archive') {       steps {         sh\"\"\"         skopeo copy docker:\/\/antonvkrylov\/k8s-course:helloPodman --dest-compress --dest-compress-format gzip docker-archive:.\/helloPodman.tar.gz         \"\"\"       }     }   } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>Skopeo \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430 \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a Dockerfile:<\/p>\n<pre><code># \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b inspect \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 camunda-bpm-platform skopeo inspect docker:\/\/camunda\/camunda-bpm-platform:wildfly-SNAPSHOT  # \u0414\u0430\u043b\u0435\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u043e\u0431\u0440\u0430\u0437 \u0438\u0437 Dockerhub \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \/tmp\/camunda skopeo copy docker:\/\/camunda\/camunda-bpm-platform:wildfly-SNAPSHOT dir:\/\/tmp\/camunda  tree \/tmp\/camunda\/ \/tmp\/camunda\/ \u251c\u2500\u2500 0cdfa0c98ed79707cd91c5dd7ebd282aa2b976d86a9e699d7fc188cdb6be390e \u251c\u2500\u2500 16e3566755e5dc026d1a6bcc28c8edc7a7aa6d068af8a5b9e10478c1dd900682 \u251c\u2500\u2500 410f32425c8a73d3e62330ab499ae85a1ce97fec74e572c2b50af4d654d44649 \u251c\u2500\u2500 4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 \u251c\u2500\u2500 c2005d18c6a3b605fc54bf733127284e0e46adbcd1180532d8d0f06b684525ae \u251c\u2500\u2500 dd2f5668f681c59da620c20459eca51d05ac3412e3e37ab24420329452e5fec9 \u251c\u2500\u2500 manifest.json \u2514\u2500\u2500 version  0 directories, 8 files  # \u041c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 Docker \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u0430: cat \/tmp\/camunda\/16e3566755e5dc026d1a6bcc28c8edc7a7aa6d068af8a5b9e10478c1dd900682 | jq . <\/code><\/pre>\n<h3>\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u0435\u0441\u0442\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439, skopeo \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code># \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 openssl genrsa -out private_key.pem openssl rsa -inform pem -outform pem -pubout -in private_key.pem -out public_key.pem <\/code><\/pre>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e skopeo:<\/p>\n<pre><code># \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u0430 skopeo copy --encryption-key jwe:public_key.pem docker:\/\/antonvkrylov\/k8s-course:helloPodman docker:\/\/antonvkrylov\/k8s-course:helloPodman_encrypted <\/code><\/pre>\n<h2>Artifacts<\/h2>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0440\u0443\u0435\u043c Jenkins \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>    post {     \/\/ Clean after build     always {         cleanWs()     }     success {         echo \"Build success\"         \/\/archiveArtifacts artifacts: '**\/*.tar.gz', fingerprint: true     }     failure {         echo \"Build failed\"         sh \"podman stop --all\"     }     aborted {         echo \"Build aborted\"         sh \"podman stop --all\"     }   } <\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0435\u043d\u0434\u0430 Jenkins<\/h2>\n<details class=\"spoiler\">\n<summary>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043a\u0430\u0447\u0430\u0442\u044c docker-compose:<\/p>\n<pre><code>curl -L \"https:\/\/github.com\/docker\/compose\/releases\/download\/1.29.2\/docker-compose-$(uname -s)-$(uname -m)\" -o \/usr\/local\/bin\/docker-compose <\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c:<\/p>\n<pre><code>chmod +x \/usr\/local\/bin\/docker-compose <\/code><\/pre>\n<p>\u0423\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e docker-compose \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code>docker-compose --version  docker-compose version 1.29.2, build 5becea4c <\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c <code>docker-compose.yaml<\/code>:<\/p>\n<pre><code>version: '2' services:   jenkins:     image: jenkins\/jenkins:2.401.2-lts-jdk11     user: root     privileged: true     container_name: jenkins     user: jenkins     volumes:       - ${PWD}\/data:\/var\/jenkins_home     environment:       JENKINS_HOST_HOME: \"\/data\/jenkins\"     ports:       - \"8088:8080\"       - \"5000:5000\"       - \"50000:50000\" <\/code><\/pre>\n<pre><code>mkdir data chown -R 1000:1000 data <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 docker-compose:<\/p>\n<pre><code>docker-compose up <\/code><\/pre>\n<p>\u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code>Pulling jenkins (jenkins:2.60.3)... 2.60.3: Pulling from library\/jenkins 55cbf04beb70: Pull complete 1607093a898c: Pull complete 9a8ea045c926: Pull complete d4eee24d4dac: Pull complete c58988e753d7: Pull complete 794a04897db9: Pull complete 70fcfa476f73: Pull complete 0539c80a02be: Extracting [=========>                                         ]  26.74MB\/133.9MB 54fefc6dcf80: Download complete 911bc90e47a8: Download complete <\/code><\/pre>\n<p>http:\/\/&lt;&lt; IP ADDRESS >>:8088<\/p>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043b\u043e\u0433\u0435: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/4e3\/2a1\/239\/4e32a1239fac2e2c2582467b11ad7794.jpg\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/4e3\/2a1\/239\/4e32a1239fac2e2c2582467b11ad7794.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/c24\/c08\/c74\/c24c08c746fdd02bb3d70629aadb525c.jpg\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c24\/c08\/c74\/c24c08c746fdd02bb3d70629aadb525c.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0414\u043e\u0436\u0434\u0438\u0442\u0435\u0441\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/9bc\/507\/5cc\/9bc5075cc0075a81033fbcb58dde785a.jpg\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9bc\/507\/5cc\/9bc5075cc0075a81033fbcb58dde785a.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u00abnew item\u00bb => pipeline: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/ff7\/fc5\/306\/ff7fc53068a56e378bbe6f5fea6c4897.jpg\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ff7\/fc5\/306\/ff7fc53068a56e378bbe6f5fea6c4897.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0412 \u0441\u0435\u043a\u0446\u0438\u0438 \u00abpipeline\u00bb \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/e1c\/1e4\/b1f\/e1c1e4b1f3dde6282a8905e1768658c6.jpg\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e1c\/1e4\/b1f\/e1c1e4b1f3dde6282a8905e1768658c6.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>pipeline { agent any stages {   stage('Cleanup') {     steps {       sh 'rm -rf k8s-course'     }   }   stage('Clone sources') {     steps {       sh 'git clone https:\/\/github.com\/randomfx\/k8s-course.git'     }   }   stage('Build image') {     steps {       dir('k8s-course\/podman\/helloPodman') {         sh 'buildah build -f Dockerfile -t antonvkrylov\/k8s-course:helloPodman'       }     }   }   stage('Push image') {     steps {       dir('k8s-course\/podman\/helloPodman') {         sh 'buildah push antonvkrylov\/k8s-course:helloPodman'       }     }   }   stage('Scan image') {     steps {       dir('k8s-course\/podman\/helloPodman') {         sh 'trivy image --security-checks vuln --severity CRITICAL antonvkrylov\/k8s-course:helloPodman'       }     }   }   stage('Test') {   \/\/\/\/\/\/\/\/\/   \/\/\/ Jenkins \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0442\u0430\u0434\u0438\u0438 \u0438\u043b\u0438 \u0448\u0430\u0433\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e   \/\/\/\/\/\/\/\/\/     parallel {       stage('Test ports') {         steps {           \/\/\/\/\/\/\/\/\/           \/\/\/ \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 (healthcheck) \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e curl \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.           \/\/\/\/\/\/\/\/\/           sh\"\"\"           podman run --rm -dt --name test_ports \\           --healthcheck-start-period 10s \\           --healthcheck-retries 1 \\           --healthcheck-command \"CMD-SHELL curl -f http:\/\/127.0.0.1:8080 || exit 1\" docker.io\/antonvkrylov\/k8s-course:helloPodman           \"\"\"           \/\/\/\/\/\/\/\/\/           \/\/\/ \u0415\u0441\u043b\u0438 \u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u0432 2 \u043c\u0438\u043d\u0443\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0448\u0435\u043d \u0442\u043e \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u043f\u0440\u0435\u0440\u0432\u0435\u0442\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u00abAborted\u00bb           \/\/\/\/\/\/\/\/\/           timeout(time: 2, unit: 'MINUTES') {           \/\/\/\/\/\/\/\/\/           \/\/\/ \u0412 \u044d\u0442\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0436\u0434\u044b\u0435 3 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u2013 \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u00abhealthy\u00bb \u0442\u043e \u0446\u0438\u043a\u043b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f.           \/\/\/\/\/\/\/\/\/           sh\"\"\"           #!\/bin\/bash           while [ \"`podman healthcheck run test_ports`\" = \"unhealthy\" ]; do               sleep 3           done           \"\"\"           }         }       }       stage('Test Java') {         steps {           \/\/\/\/\/\/\/\/\/           \/\/\/ \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e grep \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e Java \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435           \/\/\/\/\/\/\/\/\/           sh\"\"\"           podman run --rm -dt --name test_java \\           --healthcheck-start-period 10s \\           --healthcheck-retries 1 \\           --healthcheck-command \"CMD-SHELL java --version | grep 'openjdk 17.0.2' || exit 1\" docker.io\/antonvkrylov\/k8s-course:helloPodman           \"\"\"           timeout(time: 2, unit: 'MINUTES') {           sh\"\"\"           #!\/bin\/bash           while [ \"`podman healthcheck run test_java`\" = \"unhealthy\" ]; do               sleep 3           done           \"\"\"           }         }       }     }   }   stage('Archive') {     steps {       sh\"\"\"       skopeo copy docker:\/\/antonvkrylov\/k8s-course:helloPodman --dest-compress --dest-compress-format gzip docker-archive:.\/helloPodman.tar.gz       \"\"\"     }   } }   post {   \/\/ Clean after build   always {       cleanWs()   }   success {       echo \"Build success\"       \/\/archiveArtifacts artifacts: '**\/*.tar.gz', fingerprint: true   }   failure {       echo \"Build failed\"       sh \"podman stop --all\"   }   aborted {       echo \"Build aborted\"       sh \"podman stop --all\"   } } } <\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\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\/748328\/\"> https:\/\/habr.com\/ru\/articles\/748328\/<\/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<h2>\u0422\u0435\u043c\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435:<\/h2>\n<h3>Docker vs. Podman<\/h3>\n<ul>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Podman <\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Podman <\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a Podman \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b <\/p>\n<\/li>\n<li>\n<p>Docker Compose <\/p>\n<\/li>\n<li>\n<p>Podman REST API <\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 <\/p>\n<\/li>\n<\/ul>\n<h3>Demo-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h3>\n<ul>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Spring Boot <\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443 <\/p>\n<\/li>\n<li>\n<p>Dockerfile <\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u043e\u043d\u0432\u0435\u0439\u0435\u0440:<\/h3>\n<ul>\n<li>\n<p>Build <\/p>\n<\/li>\n<li>\n<p>Push <\/p>\n<\/li>\n<li>\n<p>Test <\/p>\n<\/li>\n<li>\n<p>Scan <\/p>\n<\/li>\n<li>\n<p>Archive <\/p>\n<\/li>\n<li>\n<p>\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <\/p>\n<\/li>\n<\/ul>\n<h3>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0435\u043d\u0434\u0430 Jenkins<\/h3>\n<h2>Docker vs. Podman<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Podman \u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0442 Docker.<br \/> \u0422\u0430\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435.<br \/> \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e, \u043c\u044b \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 (\u043f\u0440\u043e\u0441\u0442\u043e\u0435 Java \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435) \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c Docker \u043d\u0430 Podman \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 CI\/CD,<br \/> \u0438 \u043a\u0430\u043a\u0438\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u0434\u0438\u0432\u0438\u0434\u0435\u043d\u0434\u044b.<\/p>\n<p>Podman \u2013 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432.<br \/> \u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c\u0438 docker \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 root.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Podman \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 CI\/CD, \u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0439 Podman \u043e\u0442 Docker:<\/p>\n<ul>\n<li>\n<p>Podman \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u0430 \u0434\u043b\u044f \u0440\u0435\u0435\u0441\u0442\u0440\u043e\u0432. \u0412 Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"http:\/\/docker.io\" rel=\"noopener noreferrer nofollow\">docker.io<\/a> \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0438\u043c\u044f.<\/p>\n<\/li>\n<li>\n<p>Podman \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0438 \u043f\u043e\u0434\u044b \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c YAML \u041a\u0443\u0431\u0435\u0440\u043d\u0435\u0442\u0435\u0441. \u0410 \u0442\u0430\u043a\u0436\u0435 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c YAML \u041a\u0443\u0431\u0435\u0440\u043d\u0435\u0442\u0435\u0441 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>Podman \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u044b \u043a\u0430\u043a \u0432 \u041a\u0443\u0431\u0435\u0440\u043d\u0442\u0435\u0441 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0434\u0435.<\/p>\n<\/li>\n<li>\n<p>Podman \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0430\u044f CLI \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0430 Docker \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u043c\u043e\u043d\u043e\u0432 Linux \u0441 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438 root.<\/p>\n<\/li>\n<li>\n<p>Podman \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u0445 \u0438\u043c\u0435\u043d \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 Docker.<\/p>\n<\/li>\n<li>\n<p>Podman \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a systemd \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 systemd.<\/p>\n<\/li>\n<li>\n<p>Podman \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0430 Do\u0441ker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0435\u043c\u043e\u043d Linux, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432\u0441\u0435\u0433\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 Podman \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 Docker.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432,<br \/> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Podman \u0440\u0435\u0448\u0438\u043b\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u0435\u0436\u0434\u0443 \u0442\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438: Podman, Buildah, \u0438 Skopeo.<br \/> Podman \u043d\u0430 Windows \u0438 macOS \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0430 Buildah \u043f\u043e\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 Linux, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 WSL2 \u043d\u0430 Windows.<\/p>\n<h3>\u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 Podman:<\/h3>\n<figure class=\"\"><\/figure>\n<h3>\u041a\u0430\u043a Docker \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b:<\/h3>\n<figure class=\"\"><\/figure>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 Containerd:<\/h3>\n<figure class=\"\"><\/figure>\n<h3>\u041a\u0430\u043a Podman \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b:<\/h3>\n<figure class=\"\"><\/figure>\n<h3>\u041a\u043e\u043c\u0430\u043d\u0434\u044b Docker \u0438 Podman:<\/h3>\n<figure class=\"\"><\/figure>\n<h3>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 Podman:<\/h3>\n<p><code>docker container update<\/code><br \/> Podman \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u0437\u0430\u043d\u043e\u0432\u043e.<br \/> <code>docker plugin<\/code><br \/> Podman \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u044b.<br \/> <code>docker swarm<\/code><br \/> Podman \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 Docker Swarm, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e Podman, \u0434\u043b\u044f \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u041a\u0443\u0431\u0435\u0440\u043d\u0435\u0442\u0435\u0441 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 CRI-O.<br \/> <code>docker trust<\/code><br \/> \u042d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0440\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a <code>Podman image trust<\/code>.<\/p>\n<h3>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 Docker:<\/h3>\n<p><code>podman container<\/code><br \/> <code>podman generate<\/code><br \/> <code>podman healthcheck<\/code><br \/> <code>podman image<\/code><br \/> <code>podman init<\/code><br \/> <code>podman machine<\/code><br \/> <code>podman mount<\/code><br \/> <code>podman network exists\/prune\/reload<\/code><br \/> <code>podman play<\/code><br \/> <code>podman pod<\/code><br \/> <code>podman system<\/code><br \/> <code>podman unmount<\/code><br \/> <code>podman unshare<\/code><br \/> <code>podman untag<\/code><br \/> <code>podman volume exists<\/code><\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Podman<\/h3>\n<p>\u041f\u0430\u043a\u0435\u0442\u044b Podman \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 Linux \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432:<\/p>\n<pre><code>yum install podman buildah skopeo <\/code><\/pre>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 Podman \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 Docker.<\/p>\n<h3>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Podman<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/podman\/tree\/main\/libpod\" rel=\"noopener noreferrer nofollow\">libpod<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u043c \u0446\u0438\u043a\u043b\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/crun\" rel=\"noopener noreferrer nofollow\">crun\/runc<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/image\" rel=\"noopener noreferrer nofollow\">containers\/image<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/storage\" rel=\"noopener noreferrer nofollow\">containers\/storage<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043c\u0430\u043c\u0438, \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/buildah\" rel=\"noopener noreferrer nofollow\">Buildah<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0431\u043e\u0440\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containers\/conmon\" rel=\"noopener noreferrer nofollow\">Conmon<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><a href=\"https:\/\/github.com\/containernetworking\/cni\/blob\/main\/SPEC.md\" rel=\"noopener noreferrer nofollow\">Container Network Interface (CNI)<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u044f\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u041a\u0443\u0431\u0435\u0440\u043d\u0435\u0442\u0435\u0441 CNI<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0420\u0435\u0435\u0441\u0442\u0440\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0440\u0435\u0435\u0441\u0442\u0440\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f Podman:<\/p>\n<pre><code>podman info | grep registries -A 4  registries:   search:   - registry.access.redhat.com   - registry.redhat.io   - docker.io <\/code><\/pre>\n<h3>Docker Compose<\/h3>\n<p>Compose \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<br \/> Podman \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 Docker Compose, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e\u043a\u0435\u0442\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435:<\/p>\n<pre><code>systemctl enable --now podman.socket <\/code><\/pre>\n<p>docker-compose \u043d\u0443\u0436\u0435\u043d <code>docker.sock<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 Podman \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>ls -al \/run\/docker.sock <\/code><\/pre>\n<h3>API<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441\u043e\u043a\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c REST API Podman \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e curl:<\/p>\n<pre><code>curl --unix-socket \/run\/podman\/podman.sock http:\/\/d\/v3.0.0\/libpod\/images\/json <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Podman CLI \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0447\u0435\u0440\u0435\u0437 REST API.<\/p>\n<h3>\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438<\/h3>\n<p>Podman \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0445\u043e\u0441\u0442\u0430\u043c\u0438, \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0435\u0441\u0442\u0440\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 SSH \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>podman system connection add &lt;CONNECTION> -i ~\/.ssh\/id_ed25519 REMOTE_USER_NAME@&lt;IP_ADDRESS>\/run\/user\/1000\/podman\/podman.sock <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>podman image scp<\/code>:<\/p>\n<pre><code>podman image scp my_image &lt;CONNECTION> <\/code><\/pre>\n<h2>Demo-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Java Spring Boot. \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 Java \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Gradle.<br \/> \u0414\u043b\u044f \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438 Jenkins.<\/p>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Spring Boot<\/h3>\n<p>Spring Boot \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043a\u0435\u043b\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Java \u2013 Maven \u0438 Gradle.<br \/> \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0432\u0435\u0431-\u0444\u043e\u0440\u043c\u0443, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 curl:<\/p>\n<pre><code>curl https:\/\/start.spring.io\/starter.tgz \\     -d applicationName=HelloApplication \\     -d artifactId=demo \\     -d baseDir=hello \\     -d bootVersion=2.7.0 \\     -d dependencies=web,actuator \\     -d description='Demo project for Spring Boot' \\     -d groupId=com.example \\     -d javaVersion=17 \\     -d language=java \\     -d name=demo \\     -d packageName=com.example.demo \\     -d packaging=jar \\     -d type=gradle-project \\     -d version=0.0.1-SNAPSHOT \\ | tar -xzvf - <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c hello:<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>ls hello<\/code>.<br \/> \u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code>HELP.md   build.gradle  gradle    gradlew   gradlew.bat settings.gradle src <\/code><\/pre>\n<p>\u041d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443<\/h3>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043a\u0435\u043b\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<br \/> HelloApplication.java:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">package com.example.demo;  import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;  @SpringBootApplication @RestController public class HelloApplication {      @RequestMapping(\"\/\")     public String home() {         return \"Hello world\\n\";     }      public static void main(String[] args) {         SpringApplication.run(HelloApplication.class, args);     }  } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<pre><code>cp -f HelloApplication.java hello\/src\/main\/java\/com\/example\/demo\/ <\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>ls hello\/src\/main\/java\/com\/example\/demo\/<\/code><br \/> \u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"bash\">HelloApplication.java <\/code><\/pre>\n<h3>Dockerfile<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 Dockerfile:<\/p>\n<details class=\"spoiler\">\n<summary>Dockerfile<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>## Stage 1 : Gradle \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 jar FROM openjdk:17-oraclelinux8 as builder RUN microdnf install findutils WORKDIR \/home\/gradle\/src COPY . . RUN .\/gradlew build  ## Stage 2 : \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 JRE \u0438 jar FROM openjdk:17-oraclelinux8  # \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c jar \u0432 \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 COPY --from=builder \/home\/gradle\/src\/build\/libs\/demo-0.0.1-SNAPSHOT.jar demo.jar  EXPOSE 8080  # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 jar \u0444\u0430\u0439\u043b CMD [\"java\", \"-jar\", \"demo.jar\"] <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Java (Java runtime).<br \/> Jar-\u0444\u0430\u0439\u043b \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Spring Boot, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438.<\/p>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 Dockerfile \u0432 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<pre><code>cp -f Dockerfile hello <\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>ls hello\/Dockerfile<\/code><br \/> \u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"bash\">hello\/Dockerfile <\/code><\/pre>\n<h2>\u041a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438<\/h2>\n<p>Jenkins \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0435\u0431\u0445\u0443\u043a\u043e\u0432 (webhook) \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 GitLab \u0438\u043b\u0438 Gitea,<br \/> \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a CI \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Git.<\/p>\n<figure class=\"\"><\/figure>\n<h2>Build<\/h2>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Buildah.<\/p>\n<ul>\n<li>\n<p>Buildah \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 Podman. \u041a\u043e\u0434\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 Podman \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043f\u0430\u043a\u0435\u0442\u044b Buildah.<\/p>\n<\/li>\n<li>\n<p>Buildah \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 Dockerfile, \u043d\u043e \u0435\u0433\u043e \u0446\u0435\u043b\u044c \u044d\u0442\u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0431\u0435\u0437 Dockerfile.<\/p>\n<\/li>\n<li>\n<p>Buildah \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0434\u0435\u043c\u043e\u043d Linux, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>Buildah \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438 root \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u044b\u043c \u043f\u043b\u044e\u0441\u043e\u043c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>  stage('Build image') {     steps {       dir('k8s-course\/podman\/helloPodman') {         sh 'buildah build -f Dockerfile -t antonvkrylov\/k8s-course:helloPodman'       }     }   } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 \u043b\u043e\u0433\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u044b\u0432\u043e\u0434 Gradle: <\/p>\n<figure class=\"\"><\/figure>\n<p><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f Buildah:<\/strong><br \/> \/etc\/containers\/registries.conf &#8212; \u0420\u0435\u0435\u0441\u0442\u0440\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432.<br \/> \/usr\/share\/containers\/policy.json &#8212; \u0412\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440.<br \/> \/usr\/share\/containers\/mounts.conf &#8212; \u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445.<br \/> \/usr\/share\/containers\/seccomp.json &#8212; \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445.<\/p>\n<h2>Push<\/h2>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 Docker:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>  stage('Push image') {     steps {       dir('k8s-course\/podman\/helloPodman') {         sh 'buildah push antonvkrylov\/k8s-course:helloPodman'       }     }   } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0441 Docker \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>podman\/buildah login<\/code><\/p>\n<p>Buildah \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 Podman \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438:<br \/> <code>buildah push --authfile \/auth.json <\/code><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-386059","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386059","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=386059"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386059\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=386059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=386059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=386059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}