php - Docker PHP Addons E: 包 'php-json' 没有安装候选
问题描述
今天我尝试为默认的 php docker 容器安装一些 PHP 扩展。我的 dockerfile 看起来像这样:
FROM php:7.2-cli
#remove apt install restriction
RUN rm /etc/apt/preferences.d/no-debian-php
#Install php-addons
RUN apt-get update \
&& apt-get install -y php-zip php-xml php-json php-mbstring
COPY . /
WORKDIR /
默认情况下我有2个错误。
错误:1 http://deb.debian.org/debian stretch InRelease 解决“deb.debian.org”临时失败无法解析“archive.ubuntu.com”
和
E: 包 'php-json' 没有安装候选
解决方案
解决方案是:
E: 包 'php-json' 没有安装候选
用 dockerfile 中的这一行修复
RUN rm /etc/apt/preferences.d/no-debian-php
和
错误:1 http://deb.debian.org/debian stretch InRelease 解决“deb.debian.org”临时失败无法解析“archive.ubuntu.com”
固定与
Uncomment the following line in /etc/default/docker
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
推荐阅读
- javascript - How can I display images in React.js app from a json file?
- css - angular 8 getting alternate color on rows that uses ngFor
- python - 逻辑回归算法引发收敛警告
- postgresql - Postgresql重复主字符串键
- angular - Angular - 无法在 mat-select 中调用“keypress”事件的方法
- vb.net - 使用 vb.NET 和 Cognito API 获取 AWS Cognito 令牌
- g++ - 我在 ubuntu g++ 中正确编译了我的程序,但它找不到我的文件?
- css - ::after 将 less 文件编译为 css 时内容更改为奇怪的字符
- javascript - 将unix时间戳转换为时间
- c# - 在 C# 中验证 Crypto Node.JS 生成的 RSA 签名