{"id":297958,"date":"2020-01-30T15:00:26","date_gmt":"2020-01-30T15:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=297958"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=297958","title":{"rendered":"Alpine \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 Docker \u0431\u0438\u043b\u0434\u044b \u043f\u043e\u0434 Python \u0432 50 \u0440\u0430\u0437 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0439, \u0430 \u043e\u0431\u0440\u0430\u0437\u044b \u0432 2 \u0440\u0430\u0437\u0430 \u0442\u044f\u0436\u0435\u043b\u0435\u0439"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486202\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hg\/51\/dn\/hg51dne-v3zvjg--xoybqzk67fa.jpeg\"><\/p>\n<p>  Alpine Linux \u2014 \u0447\u0430\u0441\u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u0430\u043a \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f Docker`\u0430. \u0412\u0430\u043c \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Alpine \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u0431\u0438\u043b\u0434\u044b \u043c\u0435\u043d\u044c\u0448\u0435, \u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0439.<\/p>\n<p>  \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Alpine Linux \u0434\u043b\u044f Python \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u043e \u043e\u043d:<\/p>\n<ul>\n<li>\u0414\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u0431\u0438\u043b\u0434\u044b \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0439<\/li>\n<li>\u0414\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u043e\u0431\u0440\u0430\u0437\u044b \u0431\u043e\u043b\u044c\u0448\u0435<\/li>\n<li>\u0422\u0440\u0430\u0442\u0438\u0442 \u0432\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f<\/li>\n<li>\u0418 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a><br \/>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 Alpine \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u0430\u043c \u0432\u0441\u0435 \u0436\u0435 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043c\u0435\u0441\u0442\u0435 \u0441 Python.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043b\u044e\u0434\u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 Alpine?<\/h3>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c gcc \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c Alpine Linux vs Ubuntu 18.04, \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0441\u043a\u0430\u0447\u0430\u0435\u043c \u0434\u0432\u0430 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440:<\/p>\n<pre><code class=\"bash\">$ docker pull --quiet ubuntu:18.04 docker.io\/library\/ubuntu:18.04 $ docker pull --quiet alpine docker.io\/library\/alpine:latest $ docker image ls ubuntu:18.04 REPOSITORY          TAG        IMAGE ID         SIZE ubuntu              18.04      ccc6e87d482b     64.2MB $ docker image ls alpine REPOSITORY          TAG        IMAGE ID         SIZE alpine              latest     e7d92cdc71fe     5.59MB <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f Alpine \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c gcc \u0438 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 Ubuntu:<\/p>\n<pre><code class=\"bash\">FROM ubuntu:18.04 RUN apt-get update &amp;&amp; \\     apt-get install --no-install-recommends -y gcc &amp;&amp; \\     apt-get clean &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/* <\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0445 Dockerfile \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/p><\/blockquote>\n<p>  \u0417\u0430\u043c\u0435\u0440\u0438\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<pre><code class=\"bash\">$ time docker build -t ubuntu-gcc -f Dockerfile.ubuntu --quiet . sha256:b6a3ee33acb83148cd273b0098f4c7eed01a82f47eeb8f5bec775c26d4fe4aae  real    0m29.251s user    0m0.032s sys     0m0.026s $ docker image ls ubuntu-gcc REPOSITORY   TAG      IMAGE ID      CREATED         SIZE ubuntu-gcc   latest   b6a3ee33acb8  9 seconds ago   150MB <\/code><\/pre>\n<p>  \u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0432\u0441\u0435 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f Alpine (Dockerfile):<\/p>\n<pre><code class=\"bash\">FROM alpine RUN apk add --update gcc <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<pre><code class=\"bash\">$ time docker build -t alpine-gcc -f Dockerfile.alpine --quiet . sha256:efd626923c1478ccde67db28911ef90799710e5b8125cf4ebb2b2ca200ae1ac3  real    0m15.461s user    0m0.026s sys     0m0.024s $ docker image ls alpine-gcc REPOSITORY   TAG      IMAGE ID       CREATED         SIZE alpine-gcc   latest   efd626923c14   7 seconds ago   105MB <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0438 \u043e\u0431\u0435\u0449\u0430\u043d\u043e, \u043e\u0431\u0440\u0430\u0437\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 Alpine \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0439 \u0438 \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043c\u0435\u043d\u044c\u0448\u0435: 15 \u0441\u0435\u043a\u0443\u043d\u0434\u0430 \u0432\u043c\u0435\u0441\u0442\u043e 30 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u0440\u0430\u0437\u0430 105MB \u043f\u0440\u043e\u0442\u0438\u0432 150MB. \u042d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e!<\/p>\n<p>  \u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0443 Python \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e \u0432\u0441\u0435 \u043d\u0435 \u0442\u0430\u043a \u0440\u0430\u0434\u0443\u0436\u043d\u043e.<\/p>\n<h3>Python \u043e\u0431\u0440\u0430\u0437<\/h3>\n<p>  Python \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 pandas \u0438 matplotlib. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432\u0437\u044f\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043d\u0430 \u0431\u0430\u0437\u0435 Debian, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0430\u043a\u043e\u0439 Dockerfile:<\/p>\n<pre><code class=\"bash\">FROM python:3.8-slim RUN pip install --no-cache-dir matplotlib pandas <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"bash\">$ docker build -f Dockerfile.slim -t python-matpan. Sending build context to Docker daemon  3.072kB Step 1\/2 : FROM python:3.8-slim  ---&gt; 036ea1506a85 Step 2\/2 : RUN pip install --no-cache-dir matplotlib pandas  ---&gt; Running in 13739b2a0917 Collecting matplotlib   Downloading matplotlib-3.1.2-cp38-cp38-manylinux1_x86_64.whl (13.1 MB) Collecting pandas   Downloading pandas-0.25.3-cp38-cp38-manylinux1_x86_64.whl (10.4 MB) ... Successfully built b98b5dc06690 Successfully tagged python-matpan:latest  real    0m30.297s user    0m0.043s sys     0m0.020s <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0432 363MB.<br \/>  \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u043b\u0443\u0447\u0448\u0435 \u0441 Alpine? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c:<\/p>\n<pre><code class=\"bash\">FROM python:3.8-alpine RUN pip install --no-cache-dir matplotlib pandas <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">$ docker build -t python-matpan-alpine -f Dockerfile.alpine .                                  Sending build context to Docker daemon  3.072kB                                                Step 1\/2 : FROM python:3.8-alpine                                                               ---&gt; a0ee0c90a0db                                                                             Step 2\/2 : RUN pip install --no-cache-dir matplotlib pandas                                                    ---&gt; Running in 6740adad3729                                                                  Collecting matplotlib                                                                            Downloading matplotlib-3.1.2.tar.gz (40.9 MB)                                                    ERROR: Command errored out with exit status 1:                                                  command: \/usr\/local\/bin\/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'\/ tmp\/pip-install-a3olrixa\/matplotlib\/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'\/tmp\/pip-install-a3olrixa\/matplotlib\/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\\r\\n'&quot;'&quot;', '&quot;'&quot;'\\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' egg_info --egg-base \/tmp\/pip-install-a3olrixa\/matplotlib\/pip-egg-info                                ... ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. The command '\/bin\/sh -c pip install matplotlib pandas' returned a non-zero code: 1 <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<\/p>\n<h3>Alpine \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 wheels<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0431\u0438\u043b\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 Debian, \u0442\u043e \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043e\u043d \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 matplotlib-3.1.2-cp38-cp38-manylinux1_x86_64.<b>whl<\/b>.<\/p>\n<p>  \u042d\u0442\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0434\u043b\u044f wheel. Alpine \u0436\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 `matplotlib-3.1.2.tar.<b>gz<\/b>`, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 <a href=\"https:\/\/pythonwheels.com\/\">wheels<\/a>.<\/p>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443? \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e Linux \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 GNU \u0432\u0435\u0440\u0441\u0438\u044e (glibc) \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 C, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 C, \u0432\u043a\u043b\u044e\u0447\u0430\u044f Python. \u041d\u043e Alpine \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 `musl`, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f `glibc`, \u043e\u043d\u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u043d\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Alpine, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 C, \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 Python.<\/p>\n<p>  \u0410\u0445, \u0434\u0430, \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043d\u0443\u0436\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u0430\u043c\u0438\u043c.<br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0435:<\/p>\n<pre><code class=\"bash\">FROM python:3.8-alpine RUN apk --update add gcc build-base freetype-dev libpng-dev openblas-dev RUN pip install --no-cache-dir matplotlib pandas <\/code><\/pre>\n<p>  \u0418 \u0432\u0440\u0435\u043c\u044f \u0431\u0438\u043b\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u2026<\/p>\n<p>  \u2026 25 \u043c\u0438\u043d\u0443\u0442 57 \u0441\u0435\u043a\u0443\u043d\u0434! \u0410 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u0440\u0430\u0437\u0430 851MB.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0437\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 Alpine \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043b\u044c\u0448\u0435, \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043e\u043d\u0438 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0432\u0430\u043c \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u041c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/pythonspeed.com\/articles\/smaller-python-docker-images\/\">multi-stage builds<\/a> \u043d\u043e \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  \u042d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435!<\/p>\n<h3>Alpine \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0430\u0433\u043e\u0432 \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435<\/h3>\n<p>  <\/p>\n<ul>\n<li>\u0412 \u0442\u0435\u043e\u0440\u0438\u0438 musl \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 glibc, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0418 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442, \u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043d\u0435\u043f\u0440\u0438\u044f\u043d\u044b\u0435. \u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c:<\/li>\n<li>Alpine \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0435\u043a\u0430 \u043f\u043e\u0442\u043e\u043a\u0430, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a <a href=\"https:\/\/bugs.python.org\/issue32307\">\u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432 Python<\/a><\/li>\n<li>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e <a href=\"https:\/\/superuser.com\/questions\/1219609\/why-is-the-alpine-docker-image-over-50-slower-than-the-ubuntu-image\">Python \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0439<\/a> \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e \u043a\u0430\u043a, musl \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c (\u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 glibc).<\/li>\n<li>\u041e\u0434\u0438\u043d \u0438\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 <a href=\"https:\/\/github.com\/iron-io\/dockers\/issues\/42#issuecomment-290763088\">\u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0430\u0442\u044b<\/a><\/li>\n<\/ul>\n<p>  \u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u044d\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0443\u0436\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438, \u043d\u043e \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \u0435\u0449\u0435.<\/p>\n<h3>\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u044b Alpine \u0434\u043b\u044f Python<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0438 \u0434\u043e\u043b\u0433\u0438\u043c\u0438 \u0431\u0438\u043b\u0434\u0430\u043c\u0438, \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u2014 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Alpine Linux \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430. <a href=\"https:\/\/pythonspeed.com\/articles\/base-image-python-docker-images\/\">\u0421hoosing a good base image<\/a>.<\/div>\n<p> \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\/post\/486202\/\"> https:\/\/habr.com\/ru\/post\/486202\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486202\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hg\/51\/dn\/hg51dne-v3zvjg--xoybqzk67fa.jpeg\"><\/p>\n<p>  Alpine Linux \u2014 \u0447\u0430\u0441\u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u0430\u043a \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f Docker`\u0430. \u0412\u0430\u043c \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Alpine \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u0431\u0438\u043b\u0434\u044b \u043c\u0435\u043d\u044c\u0448\u0435, \u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0439.<\/p>\n<p>  \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Alpine Linux \u0434\u043b\u044f Python \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u043e \u043e\u043d:<\/p>\n<ul>\n<li>\u0414\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u0431\u0438\u043b\u0434\u044b \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0439<\/li>\n<li>\u0414\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u043e\u0431\u0440\u0430\u0437\u044b \u0431\u043e\u043b\u044c\u0448\u0435<\/li>\n<li>\u0422\u0440\u0430\u0442\u0438\u0442 \u0432\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f<\/li>\n<li>\u0418 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435<\/li>\n<\/ul>\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-297958","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297958","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=297958"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297958\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=297958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=297958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=297958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}