Im new to docker and tried a few different setups in my Dockerfile and it works great. Now when I try to use apt-get install inside my docker file (docker build .) it just breaks and I get the following error:
=> ERROR [ 6/14] RUN apt-get install -y php8.0-gd ------ > [ 6/14] RUN apt-get install -y php8.0-gd: #11 0.213 Reading package lists... #11 0.670 Building dependency tree... #11 0.767 Reading state information... #11 0.846 E: Unable to locate package php8.0-gd #11 0.846 E: Couldn't find any package by glob 'php8.0-gd' #11 0.846 E: Couldn't find any package by regex 'php8.0-gd'
I’ve tried to change to other apt-get install packages but same result no matter what package I try to install. I’ve also tried to install all packages in one RUN command, bud rewrote the code as shown below, to see if it was one specific package that crashed it.
Here is my code:
FROM php:8.0-apache-buster RUN mkdir /workdir WORKDIR /workdir COPY . . RUN apt-get update -y RUN apt-get install -y php8.0-gd RUN apt-get install -y php8.0-imagick RUN apt-get install -y php8.0-pgsql RUN apt-get install -y php-gettext RUN apt-get install -y php8.0-curl RUN apt-get install -y php8.0-soap RUN apt-get install -y php-bcmath RUN apt-get install -y language-pack-ko-base RUN a2enmod rewrite EXPOSE 80 CMD ["/usr/sbin/apache2ctl","-DFOREGROUND"]
I’ve searched and search but cannot find someone with the same problem. I am really new to Docker and I havn’t figgured out if it is better to set this up in the docker-composer.yml file?
Source: Docker Questions