環境
windows11
Docker version 20.10.16
DockerでPHP8の環境を構築しようとして失敗する
DockerでPHP8の開発環境を用意するために、DockerFile内でremiファイルをインストールしてからPHPをインストールする流れにしたかったのですが、remiのインストールにどうしても失敗してしまいます。
windows10のPCから今回のPCに買い替えて、同じ設定ファイルで”docker-compose up -d --build”したのですが、初めて見るエラーで調べても解決しませんでした。
エラー内容
GitBash
#27 [docker-apache stage-0 11/31] RUN dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm #27 3.647 Extra Packages for Enterprise Linux 8 - x86_64 3.6 MB/s | 11 MB 00:03 #27 6.645 Extra Packages for Enterprise Linux Modular 8 - 1.2 MB/s | 1.0 MB 00:00 #27 6.867 Last metadata expiration check: 0:00:01 ago on 2022年06月08日 17時21分33秒. #27 8.506 remi-release-8.rpm 32 kB/s | 29 kB 00:00 #27 8.541 Error: #27 8.541 Problem: conflicting requests #27 8.541 - nothing provides redhat-release >= 8.6 needed by remi-release-8.6-1.el8.remi.noarch #27 8.541 (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages) #27 ERROR: executor failed running [/bin/sh -c dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm]: exit code: 1 ------ > [docker-apache stage-0 11/31] RUN dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm: #27 3.647 Extra Packages for Enterprise Linux 8 - x86_64 3.6 MB/s | 11 MB 00:03 #27 6.645 Extra Packages for Enterprise Linux Modular 8 - 1.2 MB/s | 1.0 MB 00:00 #27 6.867 Last metadata expiration check: 0:00:01 ago on 2022年06月08日 17時21分33秒. #27 8.506 remi-release-8.rpm 32 kB/s | 29 kB 00:00 #27 8.541 Error: #27 8.541 Problem: conflicting requests #27 8.541 - nothing provides redhat-release >= 8.6 needed by remi-release-8.6-1.el8.remi.noarch #27 8.541 (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages) ------ failed to solve: executor failed running [/bin/sh -c dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm]: exit code: 1
Dockerfile
FROM centos:8 # CentOS更新 RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* &&\ sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-* RUN dnf clean all RUN dnf -y update RUN dnf -y upgrade RUN dnf -y install dnf-utils RUN dnf -y install glibc-locale-source glibc-langpack-en RUN localedef -f UTF-8 -i ja_JP ja_JP.UTF-8 ENV LANG="ja_JP.UTF-8" \ LANGUAGE="ja_JP:ja" \ LC_ALL="ja_JP.UTF-8" # タイムゾーンをJSTに合わせる RUN ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime # <今回エラーになっている箇所> # PHPリポジトリを有効化 RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm RUN dnf install -y http://rpms.remirepo.net/enterprise/remi-release-8.rpm RUN dnf module enable php:remi-8.0 -y # PHP追加モジュールをインストール RUN dnf -y install php RUN dnf -y install php-mbstring RUN dnf -y install php-zip RUN dnf -y install php-gd RUN dnf -y install php-xml RUN dnf -y install php-opcache RUN dnf -y install php-fpm # MySQL/MariaDBインストール RUN dnf -y install php-mysqli RUN dnf -y install php-mysqlnd # PostgreSQLインストール RUN dnf install -y php-pgsql RUN dnf install -y php-pdo RUN dnf install -y unzip # php-fpm COPY php-fpm.d/www.conf /etc/php-fpm.d/www.conf RUN mkdir -p /var/run/php-fpm COPY --from=composer:2.1.6 /usr/bin/composer /usr/bin/composer COPY php.ini /etc/php.d/50-docker.ini # Apacheを入れる RUN dnf install -y httpd RUN apachectl -v RUN systemctl enable httpd.service # RUN apachectl start EXPOSE 80 ENV APACHE_DOCUMENT_ROOT /path/to/new/root CMD ["/usr/sbin/httpd", "-DFOREGROUND"]
まだ回答がついていません
会員登録して回答してみよう