{% for distro in distros %}{% if distro.name == target -%} {% set d = distro.docker -%} {% if d == "static" %}{{ fail("Docker for " ~ target ~ " is static, edit that file directly and don't forget to commit the changes into Git.") }}{% endif -%} # Autogenerated Dockerfile for {{ target }}. # Update data in gitlab/data.yml.j2 and gitlab/Dockerfile.j2 # to change this file. # Request a manual pipeline to rebuild the image here: # https://gitlab.nic.cz/labs/bird/-/pipelines/new FROM {{ d.parent }} {%- if distro.type == "deb" %} ENV DEBIAN_FRONTEND=noninteractive RUN find /etc/apt/sourc* -type f -exec grep -nH '.*' '{}' + {%- for ca in distro.crossarch %} RUN dpkg --add-architecture {{ ca }} {%- endfor %} {%- if distro.name == "ubuntu-22.04-amd64" %} RUN find /etc/apt/sourc* -type f -exec sed -i 's/^deb /deb [arch=amd64] /' '{}' + RUN find /etc/apt/sourc* -type f -exec sed -r '/^deb /{s#arch=amd64#arch={{ distro.crossarch | join(",") }}#;s#https?://[^ ]+#http://ports.ubuntu.com/ubuntu-ports/#}' '{}' + > /etc/apt/sources.list.d/crossbuild.list {%- elif distro.shortname == "ubuntu" and distro.crossarch %} RUN find /etc/apt/sourc* -type f -exec sed -i '/Components: /a\ Architectures: amd64' '{}' + RUN find /etc/apt/sourc* -type f -exec sed 's#URIs: .*#URIs: http://ports.ubuntu.com/ubuntu-ports/#;s#Architectures: amd64#Architectures: {{ distro.crossarch | join(",") }}#' '{}' + > /etc/apt/sources.list.d/crossbuild.sources {%- endif %} RUN find /etc/apt/sourc* -type f -exec grep -nH '.*' '{}' + RUN apt-get -y update RUN apt-get -y upgrade RUN apt-get -y --no-install-recommends install \ {%- if distro.shortname == "ubuntu" %} tzdata \ {%- endif %} build-essential \ flex \ bison \ autoconf \ ncurses-dev \ libreadline-dev \ {{ d.libssh_kind }}-dev \ {%- for ca in distro.crossarch %} crossbuild-essential-{{ ca }} \ libreadline-dev:{{ ca }} \ ncurses-dev:{{ ca }} \ {%- endfor %} {%- if distro.crossarch %} qemu-user \ qemu-user-binfmt \ binfmt-support \ {%- endif %} linuxdoc-tools-latex \ texlive-latex-extra \ opensp \ docbook-xsl \ xsltproc{% if d.needs_adduser %} \ adduser{% endif %} RUN apt-get -y --no-install-recommends install \ git \ dpkg-dev \ debhelper \ lsb-release \ apt-utils \ quilt \ python3 \ python3-pip \ python3-setuptools \ python3-venv RUN apt-get -y clean {%- elif distro.type == "rpm" %} {%- if d.preinstall %} {{ d.preinstall }} {%- endif %} RUN {{ d.installer }} up{% if d.installer[:6] != "zypper" %}grade{% endif %} RUN {{ d.installer }} install \ gcc \ make \ flex \ bison \ autoconf \ {%- if d.pkgconfig %} pkgconfig \ {%- endif %} libssh-devel \ ncurses-devel \ readline-devel RUN {{ d.installer }} install \ git \ {%- if d.alternative_lsb %} {{ d.alternative_lsb }} \ {%- else %} lsb-release \ {%- endif %} rpm-build \ {%- if d.faketime == "lib" %} libfaketime \ {%- elif d.faketime %} faketime \ {%- endif %} {%- if d.systemd %} systemd \ {%- endif %} systemd-rpm-macros \ {%- if d.sysuser %} sysuser-tools \ {%- endif %} python3 \ python3-pip \ python3-setuptools {%- endif %} {%- endif %}{% endfor %}