gpt4 book ai didi

docker - 错误 : Service 'ubuntu' failed to build: The command '/bin/sh -c apt-get update

转载 作者:行者123 更新时间:2023-12-02 19:17:43 25 4
gpt4 key购买 nike

当我执行命令 docker-compose up --build -d我收到这些错误:

E: Unable to locate package php7.4 E: Couldn't find any package byglob 'php7.4' E: Couldn't find any package by regex 'php7.4' E: Unableto locate package php7.4-fpm E: Couldn't find any package by glob'php7.4-fpm' E: Couldn't find any package by regex 'php7.4-fpm' ERROR:Service 'ubuntu' failed to build: The command '/bin/sh -c apt-getupdate && apt-get install -y curl zip unzip php7.4php7.4-fpm gettext-base sudo' returned a non-zero code:100


请问我的 dockerfile有什么问题吗?和 docker-compose.yml ?
这是我的 dockerfile
FROM  ubuntu:18.04

# ENV PORT=80
# ENV FPMSTREAM=9000

RUN apt-get update \
&& apt-get install -y curl zip unzip \
php7.4 php7.4-fpm \
gettext-base sudo



COPY ./webapp /var/www/webapp

WORKDIR /var/www/webapp

ADD default.conf /etc/nginx/conf.d/default.conf

RUN chown -R www-data:www-data /var/www && \
chmod -R 775 /var/www && \
useradd -m docker && echo "docker:docker" | chpasswd && \
adduser docker sudo

USER docker

docker-compose.yml
version: "3.8"
services:

ubuntu:
build: .
container_name: ubuntu-container
external_links:
- nginx
- db

nginx:
image: nginx:stable
container_name: nginx-container
ports:
- "80:80"
expose:
- 9000
volumes:
- ./code:/var/www/webapp
- ./default.conf:/etc/nginx/conf.d/default.conf

db:
image: mysql:8.0
container_name: mysql-container
command: --default-authentication-plugin=mysql_native_password
restart: always
env_file:
- .env
volumes:
- ./mysql-data:/var/lib/mysql
expose:
- 3306
ports:
- "3306:3306"

最佳答案

您的问题是您正在尝试安装 Ubuntu 18.04 中不可用的 PHP 版本。

最新可用版本是7.2,所以需要替换php7.4 php7.4-fpmphp php-fpmphp7.2 php7.2-fpm

关于docker - 错误 : Service 'ubuntu' failed to build: The command '/bin/sh -c apt-get update,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62229057/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com