blob: 31ab98e56825ca9015100a0a16aa545cd6e90c02 [file] [log] [blame]
Mohammed Naser37694382024-04-02 21:11:31 -04001FROM ubuntu
2COPY trusted.gpg.d/* /etc/apt/trusted.gpg.d/
3
4ARG RELEASE
5RUN <<EOF bash -xe
6source /etc/os-release
7
8if [ "\${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; \
24else
25 echo "Unsupported release"; \
26 exit 1; \
27fi
28EOF