'failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed

My Dockerfile

FROM centos:7

# Install Apache
RUN yum -y update
RUN yum -y install httpd httpd-tools

# Install EPEL Repo
RUN yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

# Install PHP
RUN yum install yum-utils
RUN yum-config-manager --enable remi-php73

RUN yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo

# Update Apache Configuration
RUN sed -E -i -e '/<Directory "\/var\/www\/html">/,/<\/Directory>/s/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf
RUN sed -E -i -e 's/DirectoryIndex (.*)$/DirectoryIndex index.php \1/g' /etc/httpd/conf/httpd.conf

EXPOSE 80

# Start Apache
CMD ["/usr/sbin/httpd","-D","FOREGROUND"]

When I want to build this image I get

failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm]: runc did not terminate successfully

How can build a docker image with centos apache and PHP 73?



Solution 1:[1]

remove the three lines

# Install EPEL Repo
RUN yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

those commands don't exist, I suspect you tried to copy instruction for dnf and replaced dnf with yum, that won't work. And anyways you don't need those.

If you do need them, you can try

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

or maybe

RUN yum -y update; \
    yum install -y epel-release; \
    rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1