I am trying to install php7.2-ldap
in Laradock and I've set
WORKSPACE_INSTALL_LDAP=true
and
PHP_FPM_INSTALL_LDAP=true
and then tries to build the image like
docker-compose build workspace
And I get this error message. Part of the log
The following NEW packages will be installed:
php7.2-ldap
0 upgraded, 1 newly installed, 0 to remove and 28 not upgraded.
Need to get 23.1 kB of archives.
After this operation, 101 kB of additional disk space will be used.
Err:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php7.2-ldap amd64 7.2.4-1+ubuntu16.04.1+deb.sury.org+1
404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.2/php7.2-ldap_7.2.4-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: Service 'workspace' failed to build: The command '/bin/sh -c if [ ${INSTALL_LDAP} = true ]; then apt-get install -y libldap2-dev && apt-get install -y php${PHP_VERSION}-ldap ;fi' returned a non-zero code: 100
What's happening here and why can't I install this?
I am answering my own question.
This was fixed by adding
apt-get update -yqq && \
before
apt-get install -y libldap2-dev && \
in workspace/Dockerfile
and php-fpm\\Dockerfile
.
A complete block will look like this:
File: workspace\\Dockerfile
###########################################################################
# LDAP:
###########################################################################
ARG INSTALL_LDAP=false
ARG PHP_VERSION=${PHP_VERSION}
RUN if [ ${INSTALL_LDAP} = true ]; then \
apt-get update -yqq && \
apt-get install -y libldap2-dev && \
apt-get install -y php${PHP_VERSION}-ldap \
;fi
Why did this happen? A quote from Github issue :
What appears to be happening here is that there are a few apt-get install commands for several packages are called while the local package repo is out of sync with the remote. In an interactive environment, this would be seen by the user and an appropriate apt-get update would be run. However, the Dockerfile does not contain any package repo update commands, as such the current layer has a different package repo list than the remote. This is in general the "problem" with dockers layers as they will be re-used if their command didn't change (something I, too, had to learn the hard way).
By: Philipp Tempel
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.