错误:约束无法满足-在php:7-fpm-alpine上 [英] ERROR: unsatisfiable constraints - on php:7-fpm-alpine

查看:377
本文介绍了错误:约束无法满足-在php:7-fpm-alpine上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑在fpm-alpine容器上设置laravel。遇到下面的Dockerfile产生一些错误的问题...

I'm looking at setting up laravel on an fpm-alpine container. Running into a snag where the below Dockerfile is producing some errors...

FROM php:7-fpm-alpine

# install extensions needed for Laravel
RUN apk --update add \
  php7-mysqli \
  php7-mcrypt \
  php7-mbstring \
  rm /var/cache/apk/*

产生的错误是:

Building fpm
Step 1 : FROM php:7-fpm-alpine
 ---> 9e6811cb8bac
Step 2 : RUN apk --update add   php7-mysqli   php7-mcrypt   php7-mbstring   rm /var/cache/apk/*
 ---> Running in 87364957eb57
fetch http://dl-cdn.alpinelinux.org/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.3/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  /var/cache/apk/* (missing):
    required by: world[/var/cache/apk/*]
  php7-mbstring (missing):
    required by: world[php7-mbstring]
  php7-mcrypt (missing):
    required by: world[php7-mcrypt]
  php7-mysqli (missing):
    required by: world[php7-mysqli]
  rm (missing):
    required by: world[rm]
ERROR: Service 'fpm' failed to build: The command '/bin/sh -c apk --update add   php7-mysqli   php7-mcrypt   php7-mbstring   rm /var/cache/apk/*' returned a non-zero code: 5

我可以搜索这些软件包名称和在高山linux网站上找到它们。关于如何解决这个问题有任何想法吗?就像没有更新apt缓存...而是添加一个LS,我可以在那里看到内容:

I can search for these package names and find them on the alpine linux web site. Any thoughts on how I can work around this? It's like it's not updating the apt cache... but adding an LS I can see contents there:

Building fpm
Step 1 : FROM php:7-fpm-alpine
 ---> 9e6811cb8bac
Step 2 : RUN apk update
 ---> Using cache
 ---> 9ef09f3aa2a2
Step 3 : RUN ls /var/cache/apk
 ---> Running in e126a083a306
APKINDEX.5a59b88b.tar.gz
APKINDEX.7c1f02d6.tar.gz

关于如何解决该问题的任何想法?

Any ideas on what I can do to resolve this?

推荐答案

我没有使用 docker-php-ext-install ,这是在容器中添加工作时必需的...

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/*

这篇关于错误:约束无法满足-在php:7-fpm-alpine上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆