Mohammed Naser | 3769438 | 2024-04-02 21:11:31 -0400 | [diff] [blame] | 1 | FROM ubuntu |
| 2 | COPY trusted.gpg.d/* /etc/apt/trusted.gpg.d/ |
| 3 | |
| 4 | ARG RELEASE |
| 5 | RUN <<EOF bash -xe |
| 6 | source /etc/os-release |
| 7 | |
| 8 | if [ "\${VERSION_CODENAME}" = "jammy" ]; then \ |
| 9 | if [ "${RELEASE}" = "yoga" ]; then \ |
| 10 | # NOTE: Yoga shipped with 22.04, so no need to add an extra repository. |
| 11 | echo "" > /etc/apt/sources.list.d/cloudarchive.list; \ |
| 12 | elif [ "${RELEASE}" = "zed" ]; then \ |
| 13 | echo "deb http://ubuntu-cloud.archive.canonical.com/ubuntu \${VERSION_CODENAME}-updates/${RELEASE} main" > /etc/apt/sources.list.d/cloudarchive.list; \ |
| 14 | elif [ "${RELEASE}" = "2023.1" ]; then \ |
| 15 | echo "deb http://ubuntu-cloud.archive.canonical.com/ubuntu \${VERSION_CODENAME}-updates/antelope main" > /etc/apt/sources.list.d/cloudarchive.list; \ |
| 16 | elif [ "${RELEASE}" = "2023.2" ]; then \ |
| 17 | echo "deb http://ubuntu-cloud.archive.canonical.com/ubuntu \${VERSION_CODENAME}-updates/bobcat main" > /etc/apt/sources.list.d/cloudarchive.list; \ |
| 18 | elif [ "${RELEASE}" = "master" ]; then \ |
| 19 | echo "deb http://ubuntu-cloud.archive.canonical.com/ubuntu \${VERSION_CODENAME}-updates/caracal main" > /etc/apt/sources.list.d/cloudarchive.list; \ |
| 20 | else \ |
| 21 | echo "${RELEASE} is not supported on \${VERSION_CODENAME}"; \ |
| 22 | exit 1; \ |
| 23 | fi; \ |
| 24 | else |
| 25 | echo "Unsupported release"; \ |
| 26 | exit 1; \ |
| 27 | fi |
| 28 | EOF |