Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS challenges with Kubernetes and Alpine #716

Closed
olvlvl opened this issue Sep 13, 2018 · 5 comments
Closed

DNS challenges with Kubernetes and Alpine #716

olvlvl opened this issue Sep 13, 2018 · 5 comments
Labels
Request Request for image modification or feature

Comments

@olvlvl
Copy link

olvlvl commented Sep 13, 2018

Hi,

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.

@tianon
Copy link
Member

tianon commented Sep 13, 2018

Would you consider adding support for ubuntu:bionic? Its file size is comparable to Alpine's ...

I'm not sure where this idea comes from, but I don't think it's accurate:

alpine:3.8           4.41MB
alpine:3.7           4.21MB
ubuntu:xenial        115MB
ubuntu:trusty        188MB
ubuntu:cosmic        71.3MB
ubuntu:bionic        84.1MB
debian:wheezy-slim   46.9MB
debian:stretch-slim  55.3MB
debian:sid-slim      66.6MB
debian:jessie-slim   79.2MB
debian:buster-slim   66.1MB

(We're currently based on debian:stretch-slim.)

@wglambert wglambert added the Request Request for image modification or feature label Sep 13, 2018
@olvlvl
Copy link
Author

olvlvl commented Sep 13, 2018

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?

Base image Size With CLI Increase
alpine:3.8 4.41MB 77.5MB 73MB
debian:stretch-slim 55.3MB 368MB 312MB

@tianon
Copy link
Member

tianon commented 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_DEPS for what I'm talking about) -- I imagine those are probably a pretty sizeable contributor to that difference in increase.

@tianon
Copy link
Member

tianon commented Sep 13, 2018

If you do docker history on each image, you should be able to get a little more granular:

$ docker history php:7.2-cli-alpine
IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
1163be6aecce        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-cli
IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
71c6a3058357        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              

@tianon
Copy link
Member

tianon commented 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. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

3 participants