{"id":382378,"date":"2024-06-29T04:14:29","date_gmt":"2024-06-29T04:14:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=382378"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=382378","title":{"rendered":"<span>\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 Maven \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 Docker<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e67\/928\/d48\/e67928d4869c552748abe295b03ed599.png\" width=\"595\" height=\"160\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e67\/928\/d48\/e67928d4869c552748abe295b03ed599.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u043e\u043f\u0438\u0441\u0430\u043b\u00a0<a href=\"https:\/\/habr.com\/ru\/post\/582688\/\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b<\/a>\u00a0\u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0438\u0445 Maven \u0441\u0431\u043e\u0440\u043e\u043a.\u00a0<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043e\u043a Maven\u00a0<em>\u0432\u043d\u0443\u0442\u0440\u0438 Docker<\/em>.<\/p>\n<p>\u041c\u0435\u0436\u0434\u0443 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043c\u044b \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043e\u0434\u043d\u0443 \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443;\u00a0\u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0436\u0434\u044b\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u043c \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u043e\u0439 \u200b\u200b\u0441\u0431\u043e\u0440\u043a\u0438.\u00a0\u0418\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.\u00a0\u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0446\u0435\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 <a href=\"https:\/\/github.com\/nfrankel\/fast-maven-builds\" rel=\"noopener noreferrer nofollow\">Kotlin\u00a0\u043f\u0440\u043e\u0435\u043a\u0442<\/a>.<\/p>\n<p>\u0412\u043e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439\u00a0<code>Dockerfile<\/code>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/55c\/e28\/60b\/55ce2860b5b4461426295af72dcda0f4.png\" alt=\"Dockerfile \" title=\"Dockerfile \" width=\"602\" height=\"400\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/55c\/e28\/60b\/55ce2860b5b4461426295af72dcda0f4.png\"\/><figcaption>Dockerfile <\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u043e\u0431\u0440\u0430\u0437\u0430 JDK \u0434\u043b\u044f \u044d\u0442\u0430\u043f\u0430 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 JAR<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 JRE \u0434\u043b\u044f \u0448\u0430\u0433\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 JAR \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e68\/c42\/e9e\/e68c42e9e920a53e071a4eb74ac320e9.png\" width=\"584\" height=\"36\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e68\/c42\/e9e\/e68c42e9e920a53e071a4eb74ac320e9.png\"\/><figcaption><\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u041f\u043e\u043a\u0430 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u043a\u0430 \u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043e \u043d\u0435\u0439 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u044f\u0442\u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432:<\/p>\n<pre><code>* 0.36s user 0.53s system 0% cpu 1:53.06 total * 0.36s user 0.56s system 0% cpu 1:52.50 total * 0.35s user 0.55s system 0% cpu 1:56.92 total * 0.36s user 0.56s system 0% cpu 2:04.55 total * 0.38s user 0.61s system 0% cpu 2:04.68 total<\/code><\/pre>\n<h3>Buildkit \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b<\/h3>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u044b <code>DOCKER_BUILDKIT<\/code>.\u00a0\u042d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043a\u0430\u0437\u0430\u0442\u044c Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u0434\u0432\u0438\u0436\u043e\u043a.\u00a0\u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0438 Docker, \u0437\u043d\u0430\u0447\u0438\u0442, \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044d\u0442\u043e\u0442 \u0434\u0432\u0438\u0436\u043e\u043a.\u00a0\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f\u00a0<a href=\"https:\/\/github.com\/moby\/buildkit\" rel=\"noopener noreferrer nofollow\">BuildKit<\/a>\u00a0\u0437\u0430\u043c\u0435\u043d\u0438\u043b \u0435\u0433\u043e \u0438 \u0441\u0442\u0430\u043b \u043d\u043e\u0432\u044b\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>BuildKit \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0431\u043e\u0440 \u043c\u0443\u0441\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\/\u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u043a\u044d\u0448\u0430 \u0441\u0431\u043e\u0440\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0438 \u0442.\u043f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u043d\u043e\u0432\u043e\u043c \u0434\u0432\u0438\u0436\u043a\u0435:<\/p>\n<pre><code class=\"bash\">time docker build -t fast-maven:1.1 .<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n<pre><code class=\"bash\">...  => => transferring context: 4.35kB  => [build 2\/6] COPY .mvn .mvn  => [build 3\/6] COPY mvnw .  => [build 4\/6] COPY pom.xml .  => [build 5\/6] COPY src src  => [build 6\/6] RUN .\/mvnw -B package ...  0.68s user 1.04s system 1% cpu 2:06.33 total<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u043e\u0439 \u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"bash\">...  => => transferring context: 1.82kB  => CACHED [build 2\/6] COPY .mvn .mvn  => CACHED [build 3\/6] COPY mvnw .  => CACHED [build 4\/6] COPY pom.xml .  => [build 5\/6] COPY src src  => [build 6\/6] RUN .\/mvnw -B package ...<\/code><\/pre>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043c\u0438.\u00a0\u0424\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u043c, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e <code>.mvn<\/code>, <code>mvnw <\/code>\u0438 <code>pom.xml<\/code>, <em>\u043a\u044d\u0448\u0438\u0440\u0443\u044e\u0442\u0441\u044f <\/em>BuildKit. \u041d\u043e \u044d\u0442\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0435\u0432\u0435\u043b\u0438\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<pre><code class=\"bash\">* 0.69s user 1.01s system 1% cpu 2:05.08 total * 0.65s user 0.95s system 1% cpu 1:58.51 total * 0.68s user 0.99s system 1% cpu 1:59.31 total * 0.64s user 0.95s system 1% cpu 1:59.82 total<\/code><\/pre>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u0432 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0430\u043c\u044b\u043c \u0443\u0437\u043a\u0438\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u0432 \u0441\u0431\u043e\u0440\u043a\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432\u0441\u0435\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u044b).\u00a0\u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434.\u00a0\u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 BuildKit \u043d\u0435 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h3>\u0421\u043b\u043e\u0438, \u0441\u043b\u043e\u0438, \u0441\u043b\u043e\u0438<\/h3>\n<p>\u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u0443\u0441\u0438\u043b\u0438\u044f \u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445.\u00a0\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<em>\u0441\u043b\u043e\u0438<\/em>\u00a0\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043b\u043e\u0439, \u0432\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e.<\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u043b\u043e\u0435\u0432, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u043e\u0435, \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043b\u043e\u0439, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e.\u00a0\u041d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u041d\u043e\u0432\u044b\u0439 <code>Dockerfile <\/code>\u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442  \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e79\/bac\/379\/e79bac379c9647698b63a8a53b913528.png\" alt=\"Dockerfile \" title=\"Dockerfile \" width=\"621\" height=\"465\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e79\/bac\/379\/e79bac379c9647698b63a8a53b913528.png\"\/><figcaption>Dockerfile <\/figcaption><\/figure>\n<ol>\n<li>\n<p>Maven \u0446\u0435\u043b\u044c <code>go-offline <\/code>\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0420\u0418\u041c\u0415\u0427\u0410\u041d\u0418\u0415:\u00a0<code>go-offline <\/code>\u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0441\u0435.\u00a0\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u044e <code>-o <\/code>(\u0432 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435).\u00a0\u042d\u0442\u043e\u00a0<a href=\"https:\/\/issues.apache.org\/jira\/browse\/MDEP-82\" rel=\"noopener noreferrer nofollow\">\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0442\u0430\u0440\u044b\u0439 \u0431\u0430\u0433<\/a>.\u00a0\u0412\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u044d\u0442\u043e \u00ab\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e\u00bb.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<pre><code>time docker build -t fast-maven:1.2 .<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439:<\/p>\n<pre><code>0.84s user 1.21s system 1% cpu 2:35.47 total<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435.\u00a0\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432\u043b\u0438\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0438 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 (\u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430) \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code>* 0.23s user 0.36s system 5% cpu 9.913 total * 0.21s user 0.33s system 5% cpu 9.923 total * 0.22s user 0.38s system 6% cpu 9.990 total * 0.21s user 0.34s system 5% cpu 9.814 total * 0.22s user 0.37s system 5% cpu 10.454 total<\/code><\/pre>\n<h3>\u041c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u043c\u0430 \u0432 \u0441\u0431\u043e\u0440\u043a\u0435<\/h3>\n<p>\u0421\u043b\u043e\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438.\u00a0\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435.\u00a0\u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.\u00a0\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u043e\u0439 \u043d\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, BuildKit \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442\u00a0<strong>\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043c\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438<\/strong>\u00a0(\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f).\u00a0\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442\u00a0<a href=\"https:\/\/github.com\/moby\/buildkit\/blob\/master\/frontend\/dockerfile\/docs\/syntax.md#run---mounttypecache\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u044d\u0448\u0430<\/a>.\u00a0\u042d\u0442\u043e\u00a0<em>\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f<\/em>\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0435\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fcc\/9bb\/e1e\/fcc9bbe1ec20437f246b9d9bb289d605.png\" alt=\"Dockerfile\" title=\"Dockerfile\" width=\"617\" height=\"418\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fcc\/9bb\/e1e\/fcc9bbe1ec20437f246b9d9bb289d605.png\"\/><figcaption>Dockerfile<\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435\u0441\u044c \u043a \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c<\/p>\n<\/li>\n<li>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u044d\u0448\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<pre><code>time docker build -t fast-maven:1.3 .<\/code><\/pre>\n<p>\u0412\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u043b\u043e\u0435\u0432:<\/p>\n<pre><code class=\"bash\">0.71s user 1.01s system 1% cpu 1:50.50 total<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u043e\u044f\u043c:<\/p>\n<pre><code class=\"bash\">* 0.22s user 0.33s system 5% cpu 9.677 total * 0.30s user 0.36s system 6% cpu 10.603 total * 0.24s user 0.37s system 5% cpu 10.461 total * 0.24s user 0.39s system 6% cpu 10.178 total * 0.24s user 0.35s system 5% cpu 10.283 total<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u043b\u043e\u0435\u0432, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.\u00a0\u0417\u0434\u0435\u0441\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0432\u0435\u0440\u0441\u0438\u044e Kotlin \u0441\u00a0<code>1.5.30<\/code>\u043d\u0430\u00a0<code>1.5.31<\/code>:<\/p>\n<p><em>pom.xml<\/em><\/p>\n<pre><code class=\"xml\">&lt;properties>     &lt;kotlin.version>1.5.31&lt;\/kotlin.version> &lt;\/properties><\/code><\/pre>\n<p>\u042d\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<pre><code>* 0.41s user 0.57s system 2% cpu 44.710 total<\/code><\/pre>\n<h3>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043c\u043e\u043d\u0430 Maven<\/h3>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u0441\u0442\u0435, \u043a\u0430\u0441\u0430\u044e\u0449\u0435\u043c\u0441\u044f\u00a0<a href=\"https:\/\/blog.frankel.ch\/faster-maven-builds\/1\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a Maven<\/a>, \u044f \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b \u0434\u0435\u043c\u043e\u043d Maven.\u00a0\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043d\u0430\u0448\u0443 \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/98c\/70d\/1ac\/98c70d1ac538bb576ddf6d28ead0a798.png\" alt=\"Dockerfile\" title=\"Dockerfile\" width=\"829\" height=\"600\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/98c\/70d\/1ac\/98c70d1ac538bb576ddf6d28ead0a798.png\"\/><figcaption>Dockerfile<\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0435\u043c\u043e\u043d\u0430 Maven<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0430\u043a\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u00a0unzip<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043a\u0430\u0447\u0430\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 &lt;1>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u0440\u0445\u0438\u0432\u0430 \u0432 \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0mvnd \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 Maven<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<pre><code>docker build -t fast-maven:1.4 .<\/code><\/pre>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code>* 0.70s user 1.01s system 1% cpu 1:51.96 total * 0.72s user 0.98s system 1% cpu 1:47.93 total * 0.66s user 0.93s system 1% cpu 1:46.07 total * 0.76s user 1.04s system 1% cpu 1:50.35 total * 0.80s user 1.18s system 1% cpu 2:01.45 total<\/code><\/pre>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u043d\u0435\u0442.<\/p>\n<p>\u042f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439\u00a0<code>mvnd <\/code>\u043e\u0431\u0440\u0430\u0437 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f71\/b60\/c1e\/f71b60c1e4859b9c254354f5afd5bf77.png\" alt=\"mvnd.Dockerfile\" title=\"mvnd.Dockerfile\" width=\"798\" height=\"256\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f71\/b60\/c1e\/f71b60c1e4859b9c254354f5afd5bf77.png\"\/><figcaption>mvnd.Dockerfile<\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d3e\/057\/26d\/d3e05726da6c0458b95a2cde1e93c5e2.png\" alt=\"Dockerfile\" title=\"Dockerfile\" width=\"659\" height=\"113\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d3e\/057\/26d\/d3e05726da6c0458b95a2cde1e93c5e2.png\"\/><figcaption>Dockerfile<\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>mvnd <\/code>\u0445\u043e\u0440\u043e\u0448\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043c\u043e\u043d \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432.\u00a0\u042f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Docker.\u00a0\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0438, \u043a\u0430\u043a \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u0441\u043a\u0430\u0436\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043c\u043d\u0435.<\/p>\n<p>\u0412\u043e\u0442 \u0441\u0432\u043e\u0434\u043a\u0430 \u0432\u0441\u0435\u0445 \u0432\u0440\u0435\u043c\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b40\/3dc\/77b\/b403dc77b193bca7af7f990ee9fb2f6c.png\" width=\"721\" height=\"583\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b40\/3dc\/77b\/b403dc77b193bca7af7f990ee9fb2f6c.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043e\u043a Maven \u0432\u043d\u0443\u0442\u0440\u0438 Docker \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a.\u00a0\u0412 Docker \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0441\u0442\u0440\u044f\u043b\u0438 \u043d\u0430 \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0438 \u0434\u043b\u044f \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u0421 BuildKit \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u044d\u0448\u0430, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u0441\u0435\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0435\u0441\u043b\u0438 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d.<\/p>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u00a0<a href=\"https:\/\/github.com\/ajavageek\/fast-maven-builds\" rel=\"noopener noreferrer nofollow\">Github<\/a>.<\/p>\n<h3>\u041f\u0440\u043e\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435:<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/blog.frankel.ch\/faster-maven-builds\/1\/\" rel=\"noopener noreferrer nofollow\">Faster Maven builds<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/blog.mobyproject.org\/introducing-buildkit-17e056cc5317\" rel=\"noopener noreferrer nofollow\">Introducing BuildKit<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/mydeveloperplanet.com\/2019\/03\/13\/docker-layers-explained\/\" rel=\"noopener noreferrer nofollow\">Docker Layers Explained<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/moby\/buildkit\/blob\/master\/frontend\/dockerfile\/docs\/syntax.md#build-mounts-run---mount\" rel=\"noopener noreferrer nofollow\">Build Mounts<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/583600\/\"> https:\/\/habr.com\/ru\/articles\/583600\/<\/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<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u043e\u043f\u0438\u0441\u0430\u043b\u00a0<a href=\"https:\/\/habr.com\/ru\/post\/582688\/\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b<\/a>\u00a0\u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0438\u0445 Maven \u0441\u0431\u043e\u0440\u043e\u043a.\u00a0<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043e\u043a Maven\u00a0<em>\u0432\u043d\u0443\u0442\u0440\u0438 Docker<\/em>.<\/p>\n<p>\u041c\u0435\u0436\u0434\u0443 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043c\u044b \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043e\u0434\u043d\u0443 \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443;\u00a0\u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0436\u0434\u044b\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u043c \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u043e\u0439 \u200b\u200b\u0441\u0431\u043e\u0440\u043a\u0438.\u00a0\u0418\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.\u00a0\u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0446\u0435\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 <a href=\"https:\/\/github.com\/nfrankel\/fast-maven-builds\" rel=\"noopener noreferrer nofollow\">Kotlin\u00a0\u043f\u0440\u043e\u0435\u043a\u0442<\/a>.<\/p>\n<p>\u0412\u043e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439\u00a0<code>Dockerfile<\/code>:<\/p>\n<figure class=\"full-width\"><figcaption>Dockerfile <\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u043e\u0431\u0440\u0430\u0437\u0430 JDK \u0434\u043b\u044f \u044d\u0442\u0430\u043f\u0430 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 JAR<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 JRE \u0434\u043b\u044f \u0448\u0430\u0433\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 JAR \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u041f\u043e\u043a\u0430 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u043a\u0430 \u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043e \u043d\u0435\u0439 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u044f\u0442\u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432:<\/p>\n<pre><code>* 0.36s user 0.53s system 0% cpu 1:53.06 total * 0.36s user 0.56s system 0% cpu 1:52.50 total * 0.35s user 0.55s system 0% cpu 1:56.92 total * 0.36s user 0.56s system 0% cpu 2:04.55 total * 0.38s user 0.61s system 0% cpu 2:04.68 total<\/code><\/pre>\n<h3>Buildkit \u0434\u043b\u044f \u043f\u043e\u0431\u0435\u0434\u044b<\/h3>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u044b <code>DOCKER_BUILDKIT<\/code>.\u00a0\u042d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043a\u0430\u0437\u0430\u0442\u044c Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u0434\u0432\u0438\u0436\u043e\u043a.\u00a0\u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0438 Docker, \u0437\u043d\u0430\u0447\u0438\u0442, \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044d\u0442\u043e\u0442 \u0434\u0432\u0438\u0436\u043e\u043a.\u00a0\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f\u00a0<a href=\"https:\/\/github.com\/moby\/buildkit\" rel=\"noopener noreferrer nofollow\">BuildKit<\/a>\u00a0\u0437\u0430\u043c\u0435\u043d\u0438\u043b \u0435\u0433\u043e \u0438 \u0441\u0442\u0430\u043b \u043d\u043e\u0432\u044b\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>BuildKit \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0431\u043e\u0440 \u043c\u0443\u0441\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\/\u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u043a\u044d\u0448\u0430 \u0441\u0431\u043e\u0440\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0438 \u0442.\u043f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u043d\u043e\u0432\u043e\u043c \u0434\u0432\u0438\u0436\u043a\u0435:<\/p>\n<pre><code class=\"bash\">time docker build -t fast-maven:1.1 .<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n<pre><code class=\"bash\">...  => => transferring context: 4.35kB  => [build 2\/6] COPY .mvn .mvn  => [build 3\/6] COPY mvnw .  => [build 4\/6] COPY pom.xml .  => [build 5\/6] COPY src src  => [build 6\/6] RUN .\/mvnw -B package ...  0.68s user 1.04s system 1% cpu 2:06.33 total<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u043e\u0439 \u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"bash\">...  => => transferring context: 1.82kB  => CACHED [build 2\/6] COPY .mvn .mvn  => CACHED [build 3\/6] COPY mvnw .  => CACHED [build 4\/6] COPY pom.xml .  => [build 5\/6] COPY src src  => [build 6\/6] RUN .\/mvnw -B package ...<\/code><\/pre>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043c\u0438.\u00a0\u0424\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u043c, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e <code>.mvn<\/code>, <code>mvnw <\/code>\u0438 <code>pom.xml<\/code>, <em>\u043a\u044d\u0448\u0438\u0440\u0443\u044e\u0442\u0441\u044f <\/em>BuildKit. \u041d\u043e \u044d\u0442\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0435\u0432\u0435\u043b\u0438\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<pre><code class=\"bash\">* 0.69s user 1.01s system 1% cpu 2:05.08 total * 0.65s user 0.95s system 1% cpu 1:58.51 total * 0.68s user 0.99s system 1% cpu 1:59.31 total * 0.64s user 0.95s system 1% cpu 1:59.82 total<\/code><\/pre>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u0432 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0430\u043c\u044b\u043c \u0443\u0437\u043a\u0438\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u0432 \u0441\u0431\u043e\u0440\u043a\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432\u0441\u0435\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u044b).\u00a0\u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434.\u00a0\u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 BuildKit \u043d\u0435 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h3>\u0421\u043b\u043e\u0438, \u0441\u043b\u043e\u0438, \u0441\u043b\u043e\u0438<\/h3>\n<p>\u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u0443\u0441\u0438\u043b\u0438\u044f \u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445.\u00a0\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<em>\u0441\u043b\u043e\u0438<\/em>\u00a0\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043b\u043e\u0439, \u0432\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e.<\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u043b\u043e\u0435\u0432, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u043e\u0435, \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043b\u043e\u0439, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e.\u00a0\u041d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u041d\u043e\u0432\u044b\u0439 <code>Dockerfile <\/code>\u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442  \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><figcaption>Dockerfile <\/figcaption><\/figure>\n<ol>\n<li>\n<p>Maven \u0446\u0435\u043b\u044c <code>go-offline <\/code>\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0420\u0418\u041c\u0415\u0427\u0410\u041d\u0418\u0415:\u00a0<code>go-offline <\/code>\u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0441\u0435.\u00a0\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u044e <code>-o <\/code>(\u0432 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435).\u00a0\u042d\u0442\u043e\u00a0<a href=\"https:\/\/issues.apache.org\/jira\/browse\/MDEP-82\" rel=\"noopener noreferrer nofollow\">\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0442\u0430\u0440\u044b\u0439 \u0431\u0430\u0433<\/a>.\u00a0\u0412\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u044d\u0442\u043e \u00ab\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e\u00bb.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<pre><code>time docker build -t fast-maven:1.2 .<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439:<\/p>\n<pre><code>0.84s user 1.21s system 1% cpu 2:35.47 total<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435.\u00a0\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432\u043b\u0438\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0438 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 (\u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430) \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code>* 0.23s user 0.36s system 5% cpu 9.913 total * 0.21s user 0.33s system 5% cpu 9.923 total * 0.22s user 0.38s system 6% cpu 9.990 total * 0.21s user 0.34s system 5% cpu 9.814 total * 0.22s user 0.37s system 5% cpu 10.454 total<\/code><\/pre>\n<h3>\u041c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u043c\u0430 \u0432 \u0441\u0431\u043e\u0440\u043a\u0435<\/h3>\n<p>\u0421\u043b\u043e\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438.\u00a0\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435.\u00a0\u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.\u00a0\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u043e\u0439 \u043d\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, BuildKit \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442\u00a0<strong>\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043c\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438<\/strong>\u00a0(\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f).\u00a0\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442\u00a0<a href=\"https:\/\/github.com\/moby\/buildkit\/blob\/master\/frontend\/dockerfile\/docs\/syntax.md#run---mounttypecache\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u044d\u0448\u0430<\/a>.\u00a0\u042d\u0442\u043e\u00a0<em>\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f<\/em>\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0435\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c:<\/p>\n<figure class=\"full-width\"><figcaption>Dockerfile<\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435\u0441\u044c \u043a \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c<\/p>\n<\/li>\n<li>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u044d\u0448\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<pre><code>time docker build -t fast-maven:1.3 .<\/code><\/pre>\n<p>\u0412\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u043b\u043e\u0435\u0432:<\/p>\n<pre><code class=\"bash\">0.71s user 1.01s system 1% cpu 1:50.50 total<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u043e\u044f\u043c:<\/p>\n<pre><code class=\"bash\">* 0.22s user 0.33s system 5% cpu 9.677 total * 0.30s user 0.36s system 6% cpu 10.603 total * 0.24s user 0.37s system 5% cpu 10.461 total * 0.24s user 0.39s system 6% cpu 10.178 total * 0.24s user 0.35s system 5% cpu 10.283 total<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u043b\u043e\u0435\u0432, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.\u00a0\u0417\u0434\u0435\u0441\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0432\u0435\u0440\u0441\u0438\u044e Kotlin \u0441\u00a0<code>1.5.30<\/code>\u043d\u0430\u00a0<code>1.5.31<\/code>:<\/p>\n<p><em>pom.xml<\/em><\/p>\n<pre><code class=\"xml\">&lt;properties>     &lt;kotlin.version>1.5.31&lt;\/kotlin.version> &lt;\/properties><\/code><\/pre>\n<p>\u042d\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<pre><code>* 0.41s user 0.57s system 2% cpu 44.710 total<\/code><\/pre>\n<h3>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043c\u043e\u043d\u0430 Maven<\/h3>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u0441\u0442\u0435, \u043a\u0430\u0441\u0430\u044e\u0449\u0435\u043c\u0441\u044f\u00a0<a href=\"https:\/\/blog.frankel.ch\/faster-maven-builds\/1\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a Maven<\/a>, \u044f \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b \u0434\u0435\u043c\u043e\u043d Maven.\u00a0\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043d\u0430\u0448\u0443 \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<figure class=\"full-width\"><figcaption>Dockerfile<\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0435\u043c\u043e\u043d\u0430 Maven<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0430\u043a\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u00a0unzip<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043a\u0430\u0447\u0430\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 &lt;1>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u0440\u0445\u0438\u0432\u0430 \u0432 \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0mvnd \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 Maven<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n<pre><code>docker build -t fast-maven:1.4 .<\/code><\/pre>\n<p>\u0416\u0443\u0440\u043d\u0430\u043b \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code>* 0.70s user 1.01s system 1% cpu 1:51.96 total * 0.72s user 0.98s system 1% cpu 1:47.93 total * 0.66s user 0.93s system 1% cpu 1:46.07 total * 0.76s user 1.04s system 1% cpu 1:50.35 total * 0.80s user 1.18s system 1% cpu 2:01.45 total<\/code><\/pre>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u043d\u0435\u0442.<\/p>\n<p>\u042f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439\u00a0<code>mvnd <\/code>\u043e\u0431\u0440\u0430\u0437 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439:<\/p>\n<figure class=\"full-width\"><figcaption>mvnd.Dockerfile<\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption>Dockerfile<\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>mvnd <\/code>\u0445\u043e\u0440\u043e\u0448\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043c\u043e\u043d \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432.\u00a0\u042f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Docker.\u00a0\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0438, \u043a\u0430\u043a \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u0441\u043a\u0430\u0436\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043c\u043d\u0435.<\/p>\n<p>\u0412\u043e\u0442 \u0441\u0432\u043e\u0434\u043a\u0430 \u0432\u0441\u0435\u0445 \u0432\u0440\u0435\u043c\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043e\u043a Maven \u0432\u043d\u0443\u0442\u0440\u0438 Docker \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a.\u00a0\u0412 Docker \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0441\u0442\u0440\u044f\u043b\u0438 \u043d\u0430 \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0438 \u0434\u043b\u044f \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u0421 BuildKit \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u044d\u0448\u0430, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u0441\u0435\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0435\u0441\u043b\u0438 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d.<\/p>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u00a0<a href=\"https:\/\/github.com\/ajavageek\/fast-maven-builds\" rel=\"noopener noreferrer nofollow\">Github<\/a>.<\/p>\n<h3>\u041f\u0440\u043e\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435:<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/blog.frankel.ch\/faster-maven-builds\/1\/\" rel=\"noopener noreferrer nofollow\">Faster Maven builds<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/blog.mobyproject.org\/introducing-buildkit-17e056cc5317\" rel=\"noopener noreferrer nofollow\">Introducing BuildKit<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/mydeveloperplanet.com\/2019\/03\/13\/docker-layers-explained\/\" rel=\"noopener noreferrer nofollow\">Docker Layers Explained<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/moby\/buildkit\/blob\/master\/frontend\/dockerfile\/docs\/syntax.md#build-mounts-run---mount\" rel=\"noopener noreferrer nofollow\">Build Mounts<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/583600\/\"> https:\/\/habr.com\/ru\/articles\/583600\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-382378","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/382378","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=382378"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/382378\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=382378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=382378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=382378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}