You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alpine has a known issue regarding DNS resolving. Our only solution right now is to use Debian images instead, but they are bigger, like ~5 times bigger. Would you consider adding support for ubuntu:bionic? Its file size is comparable to Alpine's and it's working fine, at least on our infrastructure.
I tried to create an image using ubuntu:bionic but it failed on COPY docker-php-source /usr/local/bin/. I see that debian's base image is pretty slim, bionic might not be an improvement. Still, what's up with the resulting image?
For Alpine-based images we're able to get a lot more aggressive about removing packages and re-adding them at runtime when users need them since packages typically install very quickly (see PHPIZE_DEPS for what I'm talking about) -- I imagine those are probably a pretty sizeable contributor to that difference in increase.
If you do docker history on each image, you should be able to get a little more granular:
$ docker history php:7.2-cli-alpineIMAGE CREATED CREATED BY SIZE COMMENT1163be6aecce 44 hours ago /bin/sh -c #(nop) CMD ["php" "-a"] 0B <missing> 44 hours ago /bin/sh -c #(nop) ENTRYPOINT ["docker-php-e… 0B <missing> 44 hours ago /bin/sh -c docker-php-ext-enable sodium 168kB <missing> 44 hours ago /bin/sh -c #(nop) COPY multi:2cdcedabcf5a3b9… 6.42kB <missing> 44 hours ago /bin/sh -c set -xe && apk add --no-cache --… 58.1MB <missing> 44 hours ago /bin/sh -c #(nop) COPY file:207c686e3fed4f71… 587B <missing> 44 hours ago /bin/sh -c set -xe; apk add --no-cache --v… 12.2MB <missing> 44 hours ago /bin/sh -c #(nop) ENV PHP_SHA256=3585c1222e… 0B <missing> 44 hours ago /bin/sh -c #(nop) ENV PHP_URL=https://secur… 0B <missing> 44 hours ago /bin/sh -c #(nop) ENV PHP_VERSION=7.2.9 0B <missing> 44 hours ago /bin/sh -c #(nop) ENV GPG_KEYS=1729F83938DA… 0B <missing> 45 hours ago /bin/sh -c #(nop) ENV PHP_LDFLAGS=-Wl,-O1 -… 0B <missing> 45 hours ago /bin/sh -c #(nop) ENV PHP_CPPFLAGS=-fstack-… 0B <missing> 45 hours ago /bin/sh -c #(nop) ENV PHP_CFLAGS=-fstack-pr… 0B <missing> 45 hours ago /bin/sh -c mkdir -p $PHP_INI_DIR/conf.d 0B <missing> 45 hours ago /bin/sh -c #(nop) ENV PHP_INI_DIR=/usr/loca… 0B <missing> 45 hours ago /bin/sh -c set -x && addgroup -g 82 -S www-… 4.85kB <missing> 45 hours ago /bin/sh -c apk add --no-cache --virtual .per… 2.69MB <missing> 45 hours ago /bin/sh -c #(nop) ENV PHPIZE_DEPS=autoconf … 0B <missing> 47 hours ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B <missing> 47 hours ago /bin/sh -c #(nop) ADD file:25c10b1d1b41d46a1… 4.41MB
$ docker history php:7.2-cliIMAGE CREATED CREATED BY SIZE COMMENT71c6a3058357 6 days ago /bin/sh -c #(nop) CMD ["php" "-a"] 0B <missing> 6 days ago /bin/sh -c #(nop) ENTRYPOINT ["docker-php-e… 0B <missing> 6 days ago /bin/sh -c docker-php-ext-enable sodium 20B <missing> 6 days ago /bin/sh -c #(nop) COPY multi:2cdcedabcf5a3b9… 6.42kB <missing> 6 days ago /bin/sh -c set -eux; savedAptMark="$(apt-m… 89.6MB <missing> 8 days ago /bin/sh -c #(nop) COPY file:207c686e3fed4f71… 587B <missing> 8 days ago /bin/sh -c set -xe; fetchDeps=' wget ';… 13.4MB <missing> 8 days ago /bin/sh -c #(nop) ENV PHP_SHA256=3585c1222e… 0B <missing> 8 days ago /bin/sh -c #(nop) ENV PHP_URL=https://secur… 0B <missing> 8 days ago /bin/sh -c #(nop) ENV PHP_VERSION=7.2.9 0B <missing> 8 days ago /bin/sh -c #(nop) ENV GPG_KEYS=1729F83938DA… 0B <missing> 8 days ago /bin/sh -c #(nop) ENV PHP_LDFLAGS=-Wl,-O1 -… 0B <missing> 8 days ago /bin/sh -c #(nop) ENV PHP_CPPFLAGS=-fstack-… 0B <missing> 8 days ago /bin/sh -c #(nop) ENV PHP_CFLAGS=-fstack-pr… 0B <missing> 8 days ago /bin/sh -c mkdir -p $PHP_INI_DIR/conf.d 0B <missing> 8 days ago /bin/sh -c #(nop) ENV PHP_INI_DIR=/usr/loca… 0B <missing> 8 days ago /bin/sh -c apt-get update && apt-get install… 209MB <missing> 8 days ago /bin/sh -c #(nop) ENV PHPIZE_DEPS=autoconf … 0B <missing> 8 days ago /bin/sh -c set -eux; { echo 'Package: php… 46B <missing> 9 days ago /bin/sh -c #(nop) CMD ["bash"] 0B <missing> 9 days ago /bin/sh -c #(nop) ADD file:e6ca98733431f75e9… 55.3MB
Closing given that there's not really much we can do here (as far as I can see).
One other thing you could try is to use something like https://github.com/frol/docker-alpine-glibc in order to get an Alpine build of PHP + glibc (to try and overcome the DNS issues), but that's definitely out of scope for this repository. 👍
Activity
tianon commentedon Sep 13, 2018
I'm not sure where this idea comes from, but I don't think it's accurate:
(We're currently based on
debian:stretch-slim.)olvlvl commentedon Sep 13, 2018
I tried to create an image using
ubuntu:bionicbut it failed onCOPY docker-php-source /usr/local/bin/. I see that debian's base image is pretty slim,bionicmight not be an improvement. Still, what's up with the resulting image?tianon commentedon Sep 13, 2018
For Alpine-based images we're able to get a lot more aggressive about removing packages and re-adding them at runtime when users need them since packages typically install very quickly (see
PHPIZE_DEPSfor what I'm talking about) -- I imagine those are probably a pretty sizeable contributor to that difference in increase.tianon commentedon Sep 13, 2018
If you do
docker historyon each image, you should be able to get a little more granular:tianon commentedon Feb 6, 2019
Closing given that there's not really much we can do here (as far as I can see).
One other thing you could try is to use something like https://github.com/frol/docker-alpine-glibc in order to get an Alpine build of PHP + glibc (to try and overcome the DNS issues), but that's definitely out of scope for this repository. 👍