catthehacker / docker_images

Docker images
MIT License
212 stars 75 forks source link

running java-tools.sh fail on apt-get update #87

Closed evantill closed 1 year ago

evantill commented 1 year ago

Hi, I would like to create a custom image based on catthehacker/ubuntu:act-latest with java installed.

Running java-tools.sh raise this error E: The repository 'https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy Release' does not have a Release file.

Reproduce steps:

docker pull catthehacker/ubuntu:act-latest
docker run --rm -it catthehacker/ubuntu:act-latest
/imagegeneration/installers/java-tools.sh

Details

output of the command with the error ```shell root@fac95a3cc82b:/tmp# /imagegeneration/installers/java-tools.sh + . /etc/environment ++ PATH=/opt/hostedtoolcache/node/16.19.1/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin ++ IMAGE_OS=ubuntu22 ++ ImageOS=ubuntu22 ++ LSB_RELEASE=22.04 ++ AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache ++ RUN_TOOL_CACHE=/opt/hostedtoolcache ++ DEPLOYMENT_BASEPATH=/opt/runner ++ USER=root ++ RUNNER_USER=root ++ LSB_OS_VERSION=2204 + . /imagegeneration/installers/helpers/os.sh + . /imagegeneration/installers/helpers/install.sh + . /imagegeneration/installers/helpers/etc-environment.sh + enableRepositories + wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public + apt-key add - Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). OK + add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ Repository: 'deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ jammy main' Description: Archive for codename: jammy components: main More info: https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ Adding repository. Adding deb entry to /etc/apt/sources.list.d/archive_uri-https_adoptopenjdk_jfrog_io_adoptopenjdk_deb_-jammy.list Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-https_adoptopenjdk_jfrog_io_adoptopenjdk_deb_-jammy.list Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB] Get:2 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease [3065 B] Get:3 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease [23.8 kB] Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB] Get:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB] Get:6 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] Get:7 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages [52.4 kB] Get:8 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main all Packages [713 B] Get:9 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB] Get:10 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB] Ign:11 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy InRelease Get:12 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy/main amd64 Packages [2956 B] Get:13 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB] Err:14 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy Release 404 [IP: 34.74.126.177 443] Get:15 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB] Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1125 kB] Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [10.9 kB] Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1189 kB] Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [880 kB] Get:21 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.0 kB] Get:22 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [22.4 kB] Get:23 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [5557 B] Get:24 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [883 kB] Get:25 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [855 kB] Get:20 https://packagecloud.io/github/git-lfs/ubuntu jammy InRelease [24.4 kB] Get:26 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [823 kB] Get:27 https://packagecloud.io/github/git-lfs/ubuntu jammy/main amd64 Packages [1274 B] Reading package lists... Done E: The repository 'https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. + wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public + apt-key add - Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). OK + add-apt-repository --yes https://packages.adoptium.net/artifactory/deb/ Repository: 'deb https://packages.adoptium.net/artifactory/deb/ jammy main' Description: Archive for codename: jammy components: main More info: https://packages.adoptium.net/artifactory/deb/ Adding repository. Adding deb entry to /etc/apt/sources.list.d/archive_uri-https_packages_adoptium_net_artifactory_deb_-jammy.list Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-https_packages_adoptium_net_artifactory_deb_-jammy.list Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:3 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Hit:5 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease Hit:6 http://security.ubuntu.com/ubuntu jammy-security InRelease Ign:7 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy InRelease Err:8 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy Release 404 [IP: 34.74.126.177 443] Get:10 https://packages.adoptium.net/artifactory/deb jammy InRelease [6632 B] Hit:9 https://packagecloud.io/github/git-lfs/ubuntu jammy InRelease Get:11 https://packages.adoptium.net/artifactory/deb jammy/main amd64 Packages [3707 B] Reading package lists... Done E: The repository 'https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: https://packages.adoptium.net/artifactory/deb/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. + isUbuntu18 + . /etc/os-release ++ PRETTY_NAME='Ubuntu 22.04.1 LTS' ++ NAME=Ubuntu ++ VERSION_ID=22.04 ++ VERSION='22.04.1 LTS (Jammy Jellyfish)' ++ VERSION_CODENAME=jammy ++ ID=ubuntu ++ ID_LIKE=debian ++ HOME_URL=https://www.ubuntu.com/ ++ SUPPORT_URL=https://help.ubuntu.com/ ++ BUG_REPORT_URL=https://bugs.launchpad.net/ubuntu/ ++ PRIVACY_POLICY_URL=https://www.ubuntu.com/legal/terms-and-policies/privacy-policy ++ UBUNTU_CODENAME=jammy + [[ 22.04 =~ ^18\.(.*)$ ]] + apt-get update Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease Hit:2 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease Hit:3 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease Hit:4 http://archive.ubuntu.com/ubuntu jammy InRelease Hit:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Ign:7 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy InRelease Err:8 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy Release 404 [IP: 34.74.126.177 443] Hit:10 https://packages.adoptium.net/artifactory/deb jammy InRelease Hit:9 https://packagecloud.io/github/git-lfs/ubuntu jammy InRelease Reading package lists... Done E: The repository 'https://adoptopenjdk.jfrog.io/adoptopenjdk/deb jammy Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: https://packages.adoptium.net/artifactory/deb/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. ```
evantill commented 1 year ago

Updating the script with the latest script of actions/runner-images solve the problem I will make a PR

evantill commented 1 year ago

The lines that solve the problem : java-tools.sh#L44-L48

    if isUbuntu18 || isUbuntu20; then
        # Add Adopt PPA
        wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | gpg --dearmor > /usr/share/keyrings/adopt.gpg
        echo "deb [signed-by=/usr/share/keyrings/adopt.gpg] https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ $osLabel main" > /etc/apt/sources.list.d/adopt.list
    fi
ChristopherHX commented 1 year ago

Your PR has been merged, but this issue wasn't linked