ERROR: unsatisfiable constraints - on php:7-fpm-alpine

拥有回忆 提交于 2019-12-05 08:48:42
medve

Base Docker image probably references an incorrect repository.

Pass over the correct repositories to the apk add command like this:

RUN apk add --update \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
php7-mysqli php7-mcrypt php7-mbstring

I wasn't using docker-php-ext-install which is required when adding working within the container...

FROM php:7-fpm-alpine

# install extensions needed for Laravel
RUN apk update \
    && apk add libmcrypt-dev \
    && docker-php-ext-install mcrypt mysqli pdo_mysql \
    && rm /var/cache/apk/*

I met the same error, and tried the solution here, found the apk update is crucial.

I met the same error. Solved it by removing the package version from its name:

https://github.com/docker-library/php/issues/225#issuecomment-220339154

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!