fpm alpine mysql,错误:约束无法满足-在php:7-fpm-alpine上

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

Errors produced are:

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

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?

解决方案

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值