Skip to content

Docker Ubuntu images should be upgraded to 20.04 #517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Absolucy opened this issue Feb 1, 2021 · 13 comments · Fixed by #591
Closed

Docker Ubuntu images should be upgraded to 20.04 #517

Absolucy opened this issue Feb 1, 2021 · 13 comments · Fixed by #591

Comments

@Absolucy
Copy link

Absolucy commented Feb 1, 2021

Outdated Ubuntu is starting to cause issues for cross-compiling some things, see mlua-rs/mlua#32 for a real-world example of an issue caused by an outdated image (in this case, 16.04 in aarch64-unknown-linux-gnu).

@JNissi
Copy link

JNissi commented Feb 8, 2021

Please update the images. I have a miserable time trying to compile GTK stuff either for Nokia N900 Maemo Leste (arm-unknown-linux-gnueabihf) or the Pinephone (aarch64-unknown-linux-gnu).

I managed to whip up a working Ubuntu 20.04 image for the N900, but trying the same approach for the Pinephone failed miserably, so I guess that counts as not production ready. =/

When I have some time to clean up the N900 image and maybe base it on the latest config here so it works reliably I can share the docker files.

For non-Linux embedded stuff I've tried (like an nrf52 dev board and PineTime) the old Ubuntu images seem to work quite well enough.

@JNissi
Copy link

JNissi commented Feb 21, 2021

I got 20.10 working for Pinephone cross compilation with as little as:

diff --git a/docker/Dockerfile.aarch64-unknown-linux-gnu b/docker/Dockerfile.aarch64-unknown-linux-gnu
index 675d4bc..da43e96 100644
--- a/docker/Dockerfile.aarch64-unknown-linux-gnu
+++ b/docker/Dockerfile.aarch64-unknown-linux-gnu
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:20.10
 
 COPY common.sh lib.sh /
 RUN /common.sh
diff --git a/docker/linux-image.sh b/docker/linux-image.sh
index 1fd03e9..511179d 100755
--- a/docker/linux-image.sh
+++ b/docker/linux-image.sh
@@ -6,7 +6,7 @@ set -euo pipefail
 main() {
     # arch in the rust target
     local arch="${1}" \
-          kversion=4.19.0-11
+          kversion=5.8.0-25
 
     local debsource="deb http://http.debian.net/debian/ buster main"
     debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main"
@@ -21,7 +21,7 @@ main() {
     case "${arch}" in
         aarch64)
             arch=arm64
-            kernel="${kversion}-arm64"
+            kernel="${kversion}-generic"
             ;;
         armv7)
             arch=armhf

@Alexhuszagh
Copy link
Contributor

I'm currently working on updating all images to the latest LTS release (20.04) here. Afterwards, ideally we can update the Qemu versions. Testing building all the images currently, should have a PR within the next day or 2.

@2opremio
Copy link

@Alexhuszagh any news?

@2opremio
Copy link

For armv7-unknown-linux-gnueabihf it was as simple as applying this patch:

diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabihf b/docker/Dockerfile.armv7-unknown-linux-gnueabihf
index ba2c184..f9670bf 100644
--- a/docker/Dockerfile.armv7-unknown-linux-gnueabihf
+++ b/docker/Dockerfile.armv7-unknown-linux-gnueabihf
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:20.04
 
 COPY common.sh lib.sh /
 RUN /common.sh

and then running ./build-docker-image.sh armv7-unknown-linux-gnueabihf

bors bot added a commit that referenced this issue Jul 10, 2022
591: Update all GNU docker images to latest LTS version on Docker. r=Emilgardis a=Alexhuszagh

Increment Ubuntu base image versions to 20.04.

Update linux-image script to latest kernel and debian versions.

Update by default to kernel version 5.10.0-8. This means updating our debian source to bullseye from buster. 32-bit big-endian mips was discontinued in bullseye, so we revert to buster. For some images, due to constantly updating linux kernel versions, we need to use wildcards otherwise the build step breaks. Since there may be more than one relevant package, we've added a function to manually expand wildcards and select the best kernel version, `max_kernel_version`. Likewise, on 32-bit big-endian mips, we need to specify the ncurses version.

Created temporary symlinks for autconf and autom4te due to the build expecting a hard-coded version (2.69) of these binaries. Fixed the patch for `debian/rules` due to changed line numbers. Updated the patch to use dwarf rather than sjlj exceptions to patch the template file (`debian/gcc-mingw-w64-i686.install.in`) since `debian/gcc-mingw-w64-i686.install` is overwritten during the build.

For `x86_64-unknown-linux-gnu`, building the linux image fails unless we download specific versions of `libgcc-s1` and `libstdc++6`, since the pre-installed Ubuntu versions are higher than the Debian versions. We therefore extract the specific versions. However, while building the linux image, it prefers these system versions, so we must uninstall them or else while running `qemu-system` it cannot find `libgcc_s1.so.1`. Since `apt` and basically every other package besides `dpkg` relies on `libgcc-s1`, we have to temporarily delete it and reinstall it.

Closes #616.
Closes #557. We've already addressed the Qemu fixes, which will be applied automatically.
Closes #517.
Closes #417.

Replaces #481.

Co-authored-by: Alex Huszagh <[email protected]>
bors bot added a commit that referenced this issue Jul 16, 2022
591: Update all GNU docker images to latest LTS version on Docker. r=Emilgardis a=Alexhuszagh

Increment Ubuntu base image versions to 20.04.

Update linux-image script to latest kernel and debian versions.

Update by default to kernel version 5.10.0-8. This means updating our debian source to bullseye from buster. 32-bit big-endian mips was discontinued in bullseye, so we revert to buster. For some images, due to constantly updating linux kernel versions, we need to use wildcards otherwise the build step breaks. Since there may be more than one relevant package, we've added a function to manually expand wildcards and select the best kernel version, `max_kernel_version`. Likewise, on 32-bit big-endian mips, we need to specify the ncurses version.

Created temporary symlinks for autconf and autom4te due to the build expecting a hard-coded version (2.69) of these binaries. Fixed the patch for `debian/rules` due to changed line numbers. Updated the patch to use dwarf rather than sjlj exceptions to patch the template file (`debian/gcc-mingw-w64-i686.install.in`) since `debian/gcc-mingw-w64-i686.install` is overwritten during the build.

For `x86_64-unknown-linux-gnu`, building the linux image fails unless we download specific versions of `libgcc-s1` and `libstdc++6`, since the pre-installed Ubuntu versions are higher than the Debian versions. We therefore extract the specific versions. However, while building the linux image, it prefers these system versions, so we must uninstall them or else while running `qemu-system` it cannot find `libgcc_s1.so.1`. Since `apt` and basically every other package besides `dpkg` relies on `libgcc-s1`, we have to temporarily delete it and reinstall it.

Closes #616.
Closes #557. We've already addressed the Qemu fixes, which will be applied automatically.
Closes #517.
Closes #417.

Replaces #481.

Co-authored-by: Alex Huszagh <[email protected]>
@bjesus
Copy link

bjesus commented Jul 16, 2022

Any reason not to update again to the latest LTS?
Ubuntu 20.04 doesn't have gtk-4-dev, making it a pain to build GTK4 applications...

@Alexhuszagh
Copy link
Contributor

Alexhuszagh commented Jul 16, 2022

Any reason not to update again to the latest LTS? Ubuntu 20.04 doesn't have gtk-4-dev, making it a pain to build GTK4 applications...

Two major reasons: backwards compatibility with glibc reasons, and also the work of implementation. Once we merge #591, I'll start working on upgrading the images in another PR to 22.04. People use systems such as RHEL7, Debian servers, etc. as a building point for a long period of time. We do have images like in #591 for a reason that are above the current version to it's fairly easy to integrate newer Linux versions in.

Specifically, Ubuntu 20.04 is based off of bullseye/sid, and we need to be able to provide glibc compatibility with that right now.

@bors bors bot closed this as completed in 06690f4 Jul 16, 2022
@knitHacker
Copy link

This is closed but i'm using latest and it is still pulling 16.04. Are the updated versions not on the registry yet?

@Alexhuszagh
Copy link
Contributor

Alexhuszagh commented Jul 28, 2022

This is closed but i'm using latest and it is still pulling 16.04. Are the updated versions not on the registry yet?

They are, for main and edge. You may need to pull the image, since if the image exists, we don't automatically check for a newer version: docker pull ghcr.io/cross-rs/$TARGET:main. Let me know if that doesn't fix the issue. v0.2.4 and older still use the Ubuntu 16.04 bases.

@crazystylus
Copy link

I tried pulling ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5 which is greater than v0.2.4 and it still uses Ubuntu 16.04 Xenial!!

root@d965fa0b314d:/# cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.7 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.7 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
``

@Emilgardis
Copy link
Member

0.2.5 is a backport, use :main instead for now, the change to 20.04 will be in 0.3.0

@pvshvp-oss
Copy link

pvshvp-oss commented Mar 14, 2024

0.2.5 is a backport, use :main instead for now, the change to 20.04 will be in 0.3.0

Could you please provide me a brief summary of what I will need to do to add Ubuntu 22 support? I want to be able to use Gtk4 packages from the distribution. I would like know how much effort is involved. If it just entails changing the base docker image's version, I will be able to create a custom image that I could use.

@Emilgardis
Copy link
Member

@pvshvp-oss see #1450 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants