imohd23 / Terraws-script

This repo made to support this article, New Documentation is coming
MIT License
3 stars 18 forks source link

Use of apt-get not supported in Amazon Linux version #5

Open calidude25 opened 2 years ago

calidude25 commented 2 years ago

From the Dockerfile in the https://github.com/imohd23/aws_TerraPress/blob/master/nginx/Dockerfile repo apt-get is being called and not supported on Amazon Linux version as the specified AMI to use for the project.

https://stackoverflow.com/questions/32592956/amazon-linux-apt-get-command-not-found

Yum is supported however the version of Php being specified is not supported either....

FROM nginx:stable-perl

WORKDIR '/var/www/html'

Install php and some resources

RUN ["apt-get","update"] RUN ["apt-get","install","php7.3","-y"] RUN ["apt-get","install","php7.3-cgi","-y"] RUN ["apt-get","install","php7.3-fpm","-y"] RUN ["apt-get","install","php-mysqlnd"] RUN ["apt-get","install","php7.3-curl"] RUN ["apt-get","install","php7.3-dom"]

Replacing apt-get with yum yields -

[ec2-user@ip-10-0-101-151 nginx]$ sudo docker-compose -f /home/ec2-user/aws_TerraPress/docker-compose.yaml up --build -d Building nginx Step 1/15 : FROM nginx:stable-perl ---> a5bbd1de97f7 Step 2/15 : WORKDIR '/var/www/html' ---> Using cache ---> a443664b1491 Step 3/15 : RUN ["yum","update"] ---> Running in e1e2edc420a7 ERROR: Service 'nginx' failed to build: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "yum": executable file not found in $PATH: unknown

imohd23 commented 2 years ago

This repo was developed a while ago. I'll work on upgrading it to work with the latest configuration. In the time that I published this repo, all was working as described but I guess it needs some maintenance.

calidude25 commented 2 years ago

Thanks as want to get this up and running, let me know how I can help as like what you are doing and think the project could grow as happy to do some PR's if you want.

I'm struggling with trying to find examples to fix this part online and was back and forth of where to solve it either by using a different Linux flavor or by utilizing Amazon's package tools as technically they all want their own to install package -

Fedora (CentOS/RHEL) - yum Debian (Ubuntu) apt-get

Amazon is using amazon-linux-extras with the yum installer - https://aws.amazon.com/premiumsupport/knowledge-center/ec2-install-extras-library-software/

Hope that helps...