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

E: Package 'libpng12-dev' has no installation candidate #682

Closed
alexsabau86 opened this issue Jul 4, 2018 · 2 comments
Closed

E: Package 'libpng12-dev' has no installation candidate #682

alexsabau86 opened this issue Jul 4, 2018 · 2 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@alexsabau86
Copy link

alexsabau86 commented Jul 4, 2018

Trying to install this from a Dockerfile - I've already tried using libpng-dev which in turn is giving the following error: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/gd.so' - libpng16.so.16: cannot open shared object file: No such file or directory in Unknown on line 0

I'm installing gd as well, so not sure what is going on.

Docker file looks like this:

FROM php:7.1-apache

RUN a2enmod rewrite remoteip

RUN set -ex \
        && buildDeps=' \
                libjpeg62-turbo-dev \
                libpng12-dev \
                libpq-dev \
        ' \
        && apt-get update && apt-get install -y --no-install-recommends $buildDeps mysql-client git unzip && rm -rf /var/lib/apt/lists/* \
        && docker-php-ext-configure gd \
                --with-jpeg-dir=/usr \
                --with-png-dir=/usr \
        && docker-php-ext-install -j "$(nproc)" exif gd mbstring opcache pdo pdo_mysql pdo_pgsql mysqli zip \
        && apt-mark manual \
                libjpeg62-turbo \
                libpq5 \
        && apt-get purge -y --auto-remove $buildDeps

RUN { \
                echo 'opcache.memory_consumption=128'; \
                echo 'opcache.interned_strings_buffer=8'; \
                echo 'opcache.max_accelerated_files=4000'; \
                echo 'opcache.revalidate_freq=60'; \
                echo 'opcache.fast_shutdown=1'; \
                echo 'opcache.enable_cli=1'; \
        } > /usr/local/etc/php/conf.d/opcache-recommended.ini

COPY . /var/www/html
WORKDIR /var/www/html
RUN rm -rf /var/www/html/vendor/* \
    && php /var/www/html/composer.phar config -g github-oauth.github.com k092739874283749823jg732989839283 \
    && php /var/www/html/composer.phar -n install \
    && php /var/www/html/composer.phar -n update \
    && rm -f /var/www/html/composer.phar \
    && chown -R www-data:www-data /var/www/html
@wglambert wglambert added the question Usability question, not directly related to an error with the image label Jul 5, 2018
@wglambert
Copy link

Is this relevant #662

You might need to change php:7.1-apache to php:7.1-apache-jessie

@yosifkit
Copy link
Member

yosifkit commented Jul 6, 2018

Answered in reply to your other comment in #485:

@alexsabau86 did you apt-get purge --auto-remove libpng-dev after using docker-php-ext-install? Unless you specifically also installed libpng16-16 it would be removed in the purge and thus the .so would be missing.

#485 (comment)

So change libpng12-dev to libpng-dev and add libpng16-16 to your apt mark manual. Or switch to the -jessieversion of the image as suggested above.

@yosifkit yosifkit closed this as completed Jul 6, 2018
ItsReddi added a commit to ItsReddi/docker-php that referenced this issue Jul 13, 2018
ItsReddi added a commit to ItsReddi/docker-php that referenced this issue Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

3 participants