jlesage / docker-baseimage-gui

A minimal docker baseimage to ease creation of X graphical application containers
MIT License
1.2k stars 179 forks source link

htpasswd - The requested URL returned error: 404 #140

Closed NeoCortex3 closed 3 months ago

NeoCortex3 commented 3 months ago

Hi there, I'm trying to build a simple xterm docker image.

In "Dockerfile" I set:

#syntax=docker/dockerfile:1.4
#baseimage-gui Dockerfile
#https://github.com/jlesage/docker-baseimage-gui

ARG BASEIMAGE=jlesage/baseimage-gui:alpine-3.19-v4

and at the end of the file:

RUN add-pkg xterm font-dejavu python3
COPY startapp.sh /startapp.sh
RUN set-cont-env APP_NAME "Xterm"

(by the way how do I know the versions of an baseimage? alpine-3.20-v1 gave an error)

Now, when I try "Docker build -t docker-xterm ." I get the error:

(...)
51.65 (86/91) Installing libedit (20240517.3.1-r0)
51.67 (87/91) Installing libedit-dev (20240517.3.1-r0)
51.70 (88/91) Installing libpcre2-16 (10.43-r0)
51.73 (89/91) Installing libpcre2-32 (10.43-r0)
51.81 (90/91) Installing pcre2-dev (10.43-r0)
52.08 (91/91) Installing util-linux-static (2.40.1-r1)
56.62 OK: 573 MiB in 143 packages
56.76 >>> Downloading httpd...
56.84 curl: (22) The requested URL returned error: 404
56.84
56.85 tar: invalid magic
56.85 tar: short read
------
Dockerfile:183
--------------------
 181 |     COPY --from=xx / /
 182 |     COPY src/htpasswd /tmp/build-htpasswd
 183 | >>> RUN /tmp/build-htpasswd/build.sh
 184 |     RUN xx-verify --static /tmp/httpd-install/usr/bin/htpasswd
 185 |     COPY --from=upx /usr/bin/upx /usr/bin/upx
--------------------
ERROR: failed to solve: process "/bin/sh -c /tmp/build-htpasswd/build.sh" did not complete successfully: exit code: 1

To me it looks like the download for htpasswd just 404ed... anything I can do about this?

Thanks, Julix

jlesage commented 3 months ago

It looks like you have something else in your Dockerfile, or you are not building from the correct directory ?

NeoCortex3 commented 3 months ago

image

This is my directory /Docker_Compose/aniworld_scraper/

This https://pastebin.com/J8cNGkSc is my complete "Dockerfile" only change I made is at the start "arg baseimage" and

RUN add-pkg xterm font-dejavu python3
COPY startapp.sh /startapp.sh
RUN set-cont-env APP_NAME "Xterm"

at the end of the file.

NeoCortex3 commented 3 months ago

I have taken a look at the scripts.

In "/src/htpasswd/build.sh" we have

# Define software versions.
HTTPD_VERSION=2.4.59

# Define software download URLs.
HTTPD_URL=https://dlcdn.apache.org/httpd/httpd-${HTTPD_VERSION}.tar.gz

which will resolve to: https://dlcdn.apache.org/httpd/httpd-2.4.59.tar.gz

which indeed 404ed.

jlesage commented 3 months ago

If you want to build your own app, follow the steps indicated at https://github.com/jlesage/docker-baseimage-gui?tab=readme-ov-file#getting-started.

You need to do this in a new directory, otherwise you are building the baseimage itself instead of your app.

NeoCortex3 commented 3 months ago

I know, but in fact I actualy need an xterm docker-image for some tests. So this is on purpose.

As mentioned before changing the version in "/src/htpasswd/build.sh" on line 14 to

# Define software versions.
HTTPD_VERSION=2.4.62

fixes the htpasswd error.

Now the build runs into another problem:

(...)
311.5  /usr/bin/install -c -m 644 include/sndfile.h include/sndfile.hh '//usr/include'
311.5  ./build-aux/install-sh -c -d '//usr/lib/pkgconfig'
311.5  /usr/bin/install -c -m 644 sndfile.pc '//usr/lib/pkgconfig'
311.6 make[3]: Leaving directory '/tmp/libsndfile'
311.6 make[2]: Leaving directory '/tmp/libsndfile'
311.6 make[1]: Leaving directory '/tmp/libsndfile'
311.6 make: Leaving directory '/tmp/libsndfile'
311.6 >>> Downloading PulseAudio...
##O=#  #                                                                       curl: (60) SSL: no alternative certificate subject name matches target hostname 'freedesktop.org'
312.1 More details here: https://curl.se/docs/sslcerts.html
312.1
312.1 curl failed to verify the legitimacy of the server and therefore could not
312.1 establish a secure connection to it. To learn more about this situation and
312.1 how to fix it, please visit the webpage mentioned above.
312.1
312.1 xz: (stdin): File format not recognized
312.1 tar: Child returned status 1
312.1 tar: Error is not recoverable: exiting now
------
Dockerfile:152
--------------------
 150 |     COPY --from=xx / /
 151 |     COPY src/pulseaudio /build-pulseaudio
 152 | >>> RUN /build-pulseaudio/build.sh
 153 |     RUN xx-verify --static /tmp/pulseaudio-install/usr/bin/pulseaudio
 154 |     COPY --from=upx /usr/bin/upx /usr/bin/upx
--------------------
ERROR: failed to solve: process "/bin/sh -c /build-pulseaudio/build.sh" did not complete successfully: exit code: 2

Looks like this time pulseaudio can't be downloaded because of an SSL error.

NeoCortex3 commented 3 months ago

In "/src/pulseaudio/build.sh"

we got

# Define software versions.
PULSEAUDIO_VERSION=16.1
LIBSNDFILE_VERSION=1.2.2

# Define software download URLs.
PULSEAUDIO_URL=https://freedesktop.org/software/pulseaudio/releases/pulseaudio-${PULSEAUDIO_VERSION}.tar.xz
LIBSNDFILE_URL=https://github.com/libsndfile/libsndfile/releases/download/${LIBSNDFILE_VERSION}/libsndfile-${LIBSNDFILE_VERSION}.tar.xz

which will resolve to https://freedesktop.org/software/pulseaudio/releases/pulseaudio-16.1.tar.xz which gives a certificate error if you try to visit it. disabling ssl/tls in "/src/pulseaudio/build.sh" on line 93 with the -k parameter did not work. curl -# -k -L -f ${PULSEAUDIO_URL} | tar -xJ --strip 1 -C /tmp/pulseaudio

Will have to give this another look tomorrow.

sgpublic commented 3 months ago

which gives a certificate error if you try to visit it.

Yes, based on the latest commit, if you want to build successfully, you need to make the following changes:

jlesage commented 3 months ago

I know, but in fact I actualy need an xterm docker-image for some tests.

I'm still not sure why you need to re-build the baseimage. The example of the quick start will give you exactly this.

NeoCortex3 commented 3 months ago

I know, but in fact I actualy need an xterm docker-image for some tests.

I'm still not sure why you need to re-build the baseimage. The example of the quick start will give you exactly this.

Because I'm gonna reiterrate on it, play around with it, add some own scripts.

Thanks to @sgpublic these changes fix the baseimage and thank you @jlesage for adding them in so quickly.