Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

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

Closed
Expoverse opened this issue Jan 12, 2024 · 0 comments
Closed

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

Expoverse opened this issue Jan 12, 2024 · 0 comments

Comments

@Expoverse
Copy link

Expoverse commented Jan 12, 2024

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.

#!/bin/bash
VERSION=${1:-101.0.4951.64-0ubuntu0.18.04.1}
TAG=${2:-chromium_101.0}
BASE_TAG=${3:-7.3.6}
# Cleanup stuff
export BUILDKIT_PROGRESS=plain
docker rmi -f selenoid/vnc:$TAG browsers/base:$BASE_TAG $(docker images -q selenoid/dev_chromium:*)
rm -rf ../selenoid-container-tests
# Prepare for building images
go install github.com/markbates/pkger/cmd/pkger@latest
go generate github.com/aerokube/images
go build
# Forked tests with a bugfix
git clone -b add-missing-dependency https://github.com/sskorol/selenoid-container-tests.git ../selenoid-container-tests
# Force build browsers/base image as it has arm64-specific updates
cd ./selenium/base && docker build --no-cache --build-arg UBUNTU_VERSION=18.04 -t browsers/base:$BASE_TAG . && docker system prune -f
# Build chromium image
cd ../../ && ./images chromium -b $VERSION -t selenoid/vnc:$TAG --test && docker system prune -f

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
@aandryashin aandryashin closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants