aerokube / images

Browser images for Selenoid and Moon 1.x
https://aerokube.com/images/latest/
Apache License 2.0
167 stars 125 forks source link

Using the documentation on the site to build new images fails. #662

Open Expoverse opened 8 months ago

Expoverse commented 8 months ago

The build fails due to apt-key being deprecated and automatically switching to "keyring files in trusted.gpg.d" with error "gpg: no valid OpenPGP data found."

This can be duplicated by cloning the images repository, and running

$ go install github.com/markbates/pkger/cmd/pkger@latest
$ go generate github.com/aerokube/images
$ go build

The example build command on https://aerokube.com/images/latest/#_building_images

sudo ./images chrome -b 78.0.3904.97-1 -d 78.0.3904.70 -t selenoid/chrome:78.0 && sudo docker system prune -f

AND

Trying to build chromium fails when using build-chromium.sh.

https://github.com/aerokube/images/blob/cad20941c30643bed44a909b935d094de14e2b6b/build-chromium.sh#L1-L24

Stack overflow issue has verified this for newer ubuntu versions. https://stackoverflow.com/questions/68992799/warning-apt-key-is-deprecated-manage-keyring-files-in-trusted-gpg-d-instead

The location of the issue for building chrome is: https://github.com/aerokube/images/blob/cad20941c30643bed44a909b935d094de14e2b6b/static/chrome/apt/Dockerfile#L9C1-L18C53

The location of the issue for building chromium is, chromium doesn't have any keys imported at all: https://github.com/aerokube/images/blob/cad20941c30643bed44a909b935d094de14e2b6b/static/chromium/apt/Dockerfile#L8C1-L16C49

I'm not familiar with this, as I tried fixing the problem in a separate branch using the recommended fixes available online with no luck.

2024/01/12 01:27:10 running command: docker build -t selenoid/dev_chrome:78.0.3904.97 --build-arg VERSION=78.0.3904.97-1 /tmp/images3113830128/chrome/apt
Sending build context to Docker daemon   2.56kB
Step 1/6 : FROM browsers/base:7.4.1
 ---> cdced1d5a502
Step 2/6 : ARG VERSION
 ---> Using cache
 ---> 4535f33ae1e9
Step 3/6 : ARG PACKAGE=google-chrome-stable
 ---> Running in f787c1bf80f6
Removing intermediate container f787c1bf80f6
 ---> e45a7df7e262
Step 4/6 : ARG INSTALL_DIR=chrome
 ---> Running in a1c7399623f5
Removing intermediate container a1c7399623f5
 ---> b64d00362529
Step 5/6 : LABEL browser=$PACKAGE:$VERSION
 ---> Running in fd2733bc58f3
Removing intermediate container fd2733bc58f3
 ---> 5604825311c4
Step 6/6 : RUN         curl -s https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&         echo 'deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google.list &&         apt-get update &&         apt-get -y --no-install-recommends install iproute2 $PACKAGE=$VERSION &&         sed -i -e 's@exec -a "$0" "$HERE/chrome"@& --no-sandbox --disable-gpu@' /opt/google/$INSTALL_DIR/google-chrome &&         chown root:root /opt/google/$INSTALL_DIR/chrome-sandbox &&         chmod 4755 /opt/google/$INSTALL_DIR/chrome-sandbox &&         google-chrome --version &&         rm -Rf /tmp/* && rm -Rf /var/lib/apt/lists/*
 ---> Running in d101ed403239
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
gpg: no valid OpenPGP data found.
W: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '' executing apt-key.
The command '/bin/sh -c curl -s https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&         echo 'deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google.list &&         apt-get update &&         apt-get -y --no-install-recommends install iproute2 $PACKAGE=$VERSION &&         sed -i -e 's@exec -a "$0" "$HERE/chrome"@& --no-sandbox --disable-gpu@' /opt/google/$INSTALL_DIR/google-chrome &&         chown root:root /opt/google/$INSTALL_DIR/chrome-sandbox &&         chmod 4755 /opt/google/$INSTALL_DIR/chrome-sandbox &&         google-chrome --version &&         rm -Rf /tmp/* && rm -Rf /var/lib/apt/lists/*' returned a non-zero code: 2
2024/01/12 01:27:12 command error: build dev image: command execution error: exit status 2