Trying to create an image (from a working one) I got this error, been googling the solution but couldn’t find a proper one, I asume something’s wrong with libraries. Don’t fully understand what “Error relocating symbol not found” means, the previous steps ran successfully, this is the error output:
Executing busybox-1.28.4-r1.trigger
Executing ca-certificates-20171114-r3.trigger
OK: 142 MiB in 67 packages
+ mkdir -p /usr/src/php/ext
+ wget https://pecl.php.net/get/memcached
Error relocating /lib/libssl.so.45: explicit_bzero: symbol not found
Error relocating /lib/libssl.so.45: getentropy: symbol not found
Error relocating /lib/libcrypto.so.43: explicit_bzero: symbol not found
Error relocating /lib/libcrypto.so.43: getentropy: symbol not found
Removing intermediate container e3b8422b922a
The command '/bin/sh -c set -xe && apk add --no-cache py-setuptools git wget bash py-setuptools zlib-dev libpng-dev freetype-dev libjpeg-turbo-dev libmcrypt-dev libmemcached-dev icu-dev libxml2-dev && apk add --no-cache libressl-dev cyrus-sasl-dev --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ rabbitmq-c-dev gnu-libiconv --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted && mkdir -p /usr/src/php/ext && wget https://pecl.php.net/get/memcached && tar -xf memcached && rm memcached && mv memcached-* /usr/src/php/ext/memcached && wget https://pecl.php.net/get/redis && tar -xf redis && rm redis && mv redis-* /usr/src/php/ext/redis && wget https://pecl.php.net/get/amqp && tar -xf amqp && rm amqp && mv amqp-* /usr/src/php/ext/amqp && wget https://pecl.php.net/get/igbinary && tar -xf igbinary && rm igbinary && mv igbinary-* /usr/src/php/ext/igbinary && wget https://pecl.php.net/get/apcu && tar -xf apcu && rm apcu && mv apcu-* /usr/src/php/ext/apcu && wget https://pecl.php.net/get/mcrypt && tar -xf mcrypt && rm mcrypt && mv mcrypt-* /usr/src/php/ext/mcrypt && git clone --recursive --depth=1 https://github.com/kjdev/php-ext-snappy.git && mv php-ext-snappy /usr/src/php/ext/snappy && docker-php-ext-install pdo_mysql opcache zip pcntl mcrypt iconv soap intl xml amqp igbinary redis snappy apcu && docker-php-ext-configure memcached --enable-memcached-igbinary --disable-memcached-sasl && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install gd memcached && echo 'extension = "apcu.so"' > /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini && echo 'apc.shm_size = 256M' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini' returned a non-zero code: 127
2
Answers
The solution was changing:
to
within the
/etc/apk/repositories
file and then runningapk update && apk upgrade
.There are well-documented incompatibilities between the minimal (musl) system C library (
libc.so
) that ships with Alpine Linux and the bigger (GNU) libc that ships with more typical Linux distributions. Those error messages hint that you’re tripping over something like that.If you’re installing 142 MB of development packages you’re not really building a “tiny” Docker image, and the easiest fix is to change your image to be based on
ubuntu:18.04
instead of the Alpine base it’s presumably using now. Your final image will wind up being more like 400 MB than like 200 MB, but it’s unlikely you’ll notice any practical differences.