简体   繁体   中英

Missing php-redis repository in docker debian stretch image

I'm missing the repository that includes the php-redis package. Inside my debian 9/stretch docker container I run the following:

root@dcc82d674095 [19:36:46] [/var/www/html]
-> # apt-get install php-redis
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php-redis is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php-redis' has no installation candidate

However if I run apt search php-redis I can see that it is "there":

root@dcc82d674095 [19:41:18] [/var/www/html]
-> # apt search php-redis
Sorting... Done
Full Text Search... Done
php-redis/stable,stable 3.1.1-1 amd64
  (none)

My /etc/apt/sources.list looks like this:

deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main
deb http://deb.debian.org/debian stretch-updates main

My guess is that I'm missing a resource in that sources.list file. What repo am I missing? I'd also like to know how I find where the source is from so a similar situation happens again I can figure it out rather than asking another question.

I looked at this page - but couldn't figure out any link that looked like I should add it to my sources.list file. (That's just my assumption of what is going wrong).

https://packages.debian.org/source/stretch/php-redis


EDIT:

While I am still interested in finding an answer to my question, I found a work around by installing the package through pecl. In my docker file I added the following:

# printf statement mocks answering the prompts from the pecl install
RUN printf "\n \n" | pecl install redis && docker-php-ext-enable redis

如果您使用 php:7.1-fpm-stretch 容器,则所有 php-*** 包都被阻止安装,请参阅此处的详细信息: https : //github.com/docker-library/php/issues/713

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM