E:软件包"mysql-client"在使用docker compose的php-fpm映像构建中没有安装候选对象 [英] E: Package 'mysql-client' has no installation candidate in php-fpm image build using docker compose

查看:154
本文介绍了E:软件包"mysql-client"在使用docker compose的php-fpm映像构建中没有安装候选对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对docker来说还很陌生,所以我尝试使用laravel项目来了解更多有关它的信息,我将按照本教程进行学习:

Im fairly new to docker and so im trying to learn more about it using a laravel project, im following this tutorial:

https://www.digitalocean.com/community/tutorials/how-to-set-up-laravel-nginx-and-mysql-with-docker-compose?comment=77842

我已经根据教程中的内容对Dockerfile进行了一些调整,但是即使教程文件也会导致相同的结果.

Ive adjusted the Dockerfile a bit from what the tutorial has but even the tutorial file causes the same result.

FROM php:7.3-fpm

# Copy composer.lock and composer.json
COPY composer.lock composer.json /var/www/
# Install dependencies
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
    apt-get update && apt-get install -y mysql-client \


RUN npm install -g npm

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*


# Install extensions
RUN docker-php-ext-install pdo pdo_mysql

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www

# Copy existing application directory contents
COPY . /var/www

# Copy existing application directory permissions
COPY --chown=www:www . /var/www

# Change current user to www
USER www
# Set working directory
WORKDIR /var/www
# Expose port 9000 and start php-fpm server
EXPOSE 9000

CMD ["php-fpm"]

但是当我运行docker-compose up -d时,我仍然收到以下错误消息:

But i keep getting the following error when i run docker-compose up -d:

E: Package 'mysql-client' has no installation candidate
ERROR: Service 'app' failed to build: The command '/bin/sh -c curl -sL https://deb.nodesource.com/setup_10.x | bash - &&     apt-get update && apt-get install -y mysql-client     nodejs     build-essential     vim     git     curl' returned a non-zero code: 100

我想念什么吗?

我希望这能够正常工作,因为我在安装mysql-client之前正在运行apt-get update.

I expected this to work since i am running apt-get update before installing mysql-client.

谢谢.

推荐答案

php:7.3-fpm现在使用Debian 10(Buster)作为其

php:7.3-fpm now use Debian 10 (Buster) as its base image and Buster ships with MariaDB, so just replace mysql-client with mariadb-client should fix it.

这篇关于E:软件包"mysql-client"在使用docker compose的php-fpm映像构建中没有安装候选对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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