Update Dockerfile with lsphp80-dev or lsphp81-dev

tto

New Member
#1
Based on https://hub.docker.com/r/litespeedtech/openlitespeed I wanted to use lsphp80-dev / lsphp81-dev and therefore Created this dockerfile:


Code:
FROM litespeedtech/openlitespeed:1.7.16-lsphp80
WORKDIR /var/www/vhosts

RUN apt update
RUN apt install -y wget
RUN wget http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh
RUN bash enable_lst_debian_repo.sh

RUN apt install -y lsphp80-dev
But I always get a 404 with line https://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh altough
- it exists when accessing within browser
- I can use wget on my host OS (also ubuntu)

So I only get the 404 within the docker build process



Full docker build output:

Code:
docker build . --no-cache                                                                                                                                                                                                                                                                                                                                                                       
[+] Building 12.2s (8/10)                                                                                                                                                                                                                                                                                                                                                                                                                                
=> [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                                                                                                 0.1s
=> => transferring dockerfile: 373B                                                                                                                                                                                                                                                                                                                                                                                                                 0.0s
=> [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                                                                                                    0.1s
=> => transferring context: 2B                                                                                                                                                                                                                                                                                                                                                                                                                      0.0s
=> [internal] load metadata for docker.io/litespeedtech/openlitespeed:1.7.16-lsphp80                                                                                                                                                                                                                                                                                                                                                                1.2s
=> [1/7] FROM docker.io/litespeedtech/openlitespeed:1.7.16-lsphp80@sha256:3d4deeae05bc146d8217b68634f9bfa42802c2389929c00eec7d157c5e86901d                                                                                                                                                                                                                                                                                                          0.0s
=> CACHED [2/7] WORKDIR /var/www/vhosts                                                                                                                                                                                                                                                                                                                                                                                                             0.0s
=> [3/7] RUN apt update                                                                                                                                                                                                                                                                                                                                                                                                                             7.1s
=> [4/7] RUN apt install -y wget                                                                                                                                                                                                                                                                                                                                                                                                                    2.6s
=> ERROR [5/7] RUN wget http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh                                                                                                                                                                                                                                                                                                                                                              0.9s
------                                                                                                                                                                                                                                                                                                                                                                                                                                                   
> [5/7] RUN wget http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh:                                                                                                                                                                                                                                                                                                                                                                        
#8 0.574 --2023-01-24 12:33:45--  http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh                                                                                                                                                                                                                                                                                                                                                         
#8 0.574 Resolving rpms.litespeedtech.com (rpms.litespeedtech.com)... ::ffff:52.55.120.73, 52.55.120.73                                                                                                                                                                                                                                                                                                                                                  
#8 0.602 Connecting to rpms.litespeedtech.com (rpms.litespeedtech.com)|::ffff:52.55.120.73|:80... connected.
#8 0.604 HTTP request sent, awaiting response... 404 Not Found
#8 0.884 2023-01-24 12:33:46 ERROR 404: Not Found.
#8 0.884
------
 

tto

New Member
#3
I tried both - basically it is not working - see below:

1) With HTTPS:

Code:
FROM litespeedtech/openlitespeed:1.7.16-lsphp80
WORKDIR /var/www/vhosts
RUN apt update
RUN apt install -y wget
RUN wget https://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh
RUN bash enable_lst_debian_repo.sh
RUN apt install -y lsphp80-dev
I get the following result:

Code:
[+] Building 55.0s (10/10) FINISHED
 => [internal] load build definition from Dockerfile0.0s
 => => transferring dockerfile: 290B0.0s
 => [internal] load .dockerignore 0.0s
 => => transferring context: 2B 0.0s
 => [internal] load metadata for docker.io/litespeedtech/openlitespeed:1.7.16-lsphp80 0.9s
 => [1/7] FROM docker.io/litespeedtech/openlitespeed:1.7.16-lsphp80@sha256:3d4deeae05bc146d8217b68634f9bfa42802c2389929c00eec7d157c5e86901d 0.0s
 => CACHED [2/7] WORKDIR /var/www/vhosts0.0s
 => [3/7] RUN apt update2.7s
 => [4/7] RUN apt install -y wget 1.3s
 => [5/7] RUN wget https://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh0.9s 
 => [6/7] RUN bash enable_lst_debian_repo.sh2.2s 
 => ERROR [7/7] RUN apt install -y lsphp80-dev 46.8s 
------ 
 > [7/7] RUN apt install -y lsphp80-dev: 
#10 0.569
#10 0.569 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#10 0.569
#10 0.594 Reading package lists... 
#10 1.088 Building dependency tree...
#10 1.206 Reading state information...
#10 1.294 The following additional packages will be installed:
#10 1.294 autoconf automake autopoint autotools-dev binutils binutils-common
#10 1.294 binutils-x86-64-linux-gnu bsdextrautils build-essential cpp cpp-11 debhelper

<..... cut some lines ....>

#10 46.43 Get:115 http://archive.ubuntu.com/ubuntu jammy/main amd64 php-xml all 2:8.1+92ubuntu1 [1850 B]
#10 46.60 Get:116 http://archive.ubuntu.com/ubuntu jammy/main amd64 php-pear all 1:1.10.12+submodules+notgz+20210212-1ubuntu3 [293 kB]
#10 46.73 Get:117 http://archive.ubuntu.com/ubuntu jammy/main amd64 pkg-php-tools all 1.42build1 [33.5 kB]
#10 46.74 E: Failed to fetch http://rpms.litespeedtech.com/debian/pool/main/jammy/lsphp80-common_8.0.27-1%2bjammy_all.deb404Not Found [IP: 52.55.120.73 80]
#10 46.74 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
#10 46.74 Fetched 87.9 MB in 45s (1938 kB/s)
------
executor failed running [/bin/sh -c apt install -y lsphp80-dev]: exit code: 100

2) Without enable_lst_debian_repo.sh:

Code:
FROM litespeedtech/openlitespeed:1.7.16-lsphp80
WORKDIR /var/www/vhosts

RUN apt update

RUN apt install -y lsphp80-dev
I get the following result:

Code:
[+] Building 37.8s (7/7) FINISHED
 => [internal] load build definition from Dockerfile0.0s
 => => transferring dockerfile: 31B 0.0s
 => [internal] load .dockerignore 0.1s
 => => transferring context: 2B 0.0s
 => [internal] load metadata for docker.io/litespeedtech/openlitespeed:1.7.16-lsphp80 0.9s
 => [1/4] FROM docker.io/litespeedtech/openlitespeed:1.7.16-lsphp80@sha256:3d4deeae05bc146d8217b68634f9bfa42802c2389929c00eec7d157c5e86901d 0.0s
 => CACHED [2/4] WORKDIR /var/www/vhosts0.0s
 => [3/4] RUN apt update3.4s
 => ERROR [4/4] RUN apt install -y lsphp80-dev 33.4s
------ 
 > [4/4] RUN apt install -y lsphp80-dev: 
#7 0.478 
#7 0.478 WARNING: apt does not have a stable CLI interface. Use with caution in scripts. 
#7 0.478 
#7 0.499 Reading package lists...
#7 1.011 Building dependency tree...
#7 1.132 Reading state information...

<..... cut some lines ....>

#7 32.82 Get:115 http://archive.ubuntu.com/ubuntu jammy/main amd64 php-xml all 2:8.1+92ubuntu1 [1850 B]
#7 32.82 Get:116 http://archive.ubuntu.com/ubuntu jammy/main amd64 php-pear all 1:1.10.12+submodules+notgz+20210212-1ubuntu3 [293 kB]
#7 33.33 Get:117 http://archive.ubuntu.com/ubuntu jammy/main amd64 pkg-php-tools all 1.42build1 [33.5 kB]
#7 33.38 Fetched 87.9 MB in 32s (2742 kB/s)
#7 33.38 E: Failed to fetch http://rpms.litespeedtech.com/debian/pool/main/jammy/lsphp80-common_8.0.27-1%2bjammy_all.deb  404  Not Found [IP: 52.55.120.73 80]
#7 33.38 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
------
executor failed running [/bin/sh -c apt install -y lsphp80-dev]: exit code: 100
 

tto

New Member
#4
It works with replacing http with https within enable_lst_debian_repo.sh

Code:
RUN sed -i 's/http/https/g' enable_lst_debian_repo.sh
resulting in:

Code:
FROM litespeedtech/openlitespeed:1.7.16-lsphp80
WORKDIR /var/www/vhosts
RUN apt update
RUN apt install -y wget

RUN wget https://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh
RUN sed -i 's/http/https/g' enable_lst_debian_repo.sh
RUN bash enable_lst_debian_repo.sh

RUN apt install -y lsphp80-dev

What I don't understand:
1) Why did it work without this line some month ago?
2) Why does this problem exists within a docker container / during docker build process but not in case I execute the same operations on my local ubuntu
3) I get the same error when executing this docker file (which seems to be used for generating the official docker images): https://github.com/litespeedtech/ols-dockerfiles/blob/master/template/Dockerfile
 

Cold-Egg

Administrator
#5
Not sure why it happens on your server, I just did a quick test and there's no such issue.
You can try either using the "wget --no-check-certificate" in the future or update the "ca-certificates" package
 
Top