containers
containers copied to clipboard
add riscv64 support
Ubuntu has now added official images for Oracular (24.10) so I've added this for now
I cannot recreate the error locally when building like this:
docker buildx build --platform linux/riscv64 -t foo .
docker run --platform linux/riscv64 foo java -version
openjdk version "21.0.2" 2024-01-16 LTS
OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode, sharing)
CC @tianon @yosifkit as they may have some extra insight here
> [2/5] RUN set -eux; apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget fontconfig ca-certificates p11-kit binutils tzdata locales ; echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; locale-gen en_US.UTF-8; rm -rf /var/lib/apt/lists/*:
0.156 exec /bin/sh: exec format error
------
Dockerfile:28
--------------------
27 |
28 | >>> RUN set -eux; \
29 | >>> apt-get update; \
30 | >>> DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
31 | >>> wget \
32 | >>> # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory
33 | >>> # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager
34 | >>> # https://github.com/docker-library/openjdk/pull/235#issuecomment-4244[66](https://github.com/adoptium/containers/actions/runs/8278932317/job/22652358248?pr=509#step:5:67)077
35 | >>> fontconfig \
36 | >>> # utilities for keeping Ubuntu and OpenJDK CA certificates in sync
37 | >>> # https://github.com/adoptium/containers/issues/293
38 | >>> ca-certificates p11-kit \
39 | >>> # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351
40 | >>> # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory
41 | >>> binutils \
42 | >>> tzdata \
43 | >>> # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8
44 | >>> locales \
45 | >>> ; \
46 | >>> echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
47 | >>> locale-gen en_US.UTF-8; \
48 | >>> rm -rf /var/lib/apt/lists/*
49 |
--------------------
ERROR: failed to solve: process "/bin/sh -c set -eux; apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget fontconfig ca-certificates p11-kit binutils tzdata locales ; echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen; locale-gen en_US.UTF-8; rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 1
Error: Process completed with exit code 1.
I cannot recreate the error locally when building like this:
For what it's worth when I tried running on an Ubuntu 23.04 host (native riscv64) I had an issue with the repositories for sid:
$ docker run -it debian:sid-slim
root@a166693ac07f:/# apt-get -y update
Get:1 http://deb.debian.org/debian-ports sid InRelease [80.4 kB]
Get:2 http://deb.debian.org/debian-ports unreleased InRelease [54.1 kB]
Fetched 134 kB in 1s (122 kB/s)
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-riscv64/Packages' as repository 'http://deb.debian.org/debian-ports sid InRelease' doesn't support architecture 'riscv64'
N: Skipping acquire of configured file 'main/binary-riscv64/Packages' as repository 'http://deb.debian.org/debian-ports unreleased InRelease' doesn't support architecture 'riscv64'
0.156 exec /bin/sh: exec format error
I think this error is because GitHub actions runners aren't automatically setup with user-mode qemu like when using Docker Desktop.
As far as adding Debian Unstable based builds, we wouldn't do it in images we directly maintain since it is actually unstable (https://wiki.debian.org/DebianUnstable)
having images based on Debian Unstable leads to a lot of not-unexpected instability both in our own builds and in the downstream builds of our users - https://github.com/docker-library/golang/issues/435#issuecomment-1648671784
0.156 exec /bin/sh: exec format error
I think this error is because GitHub actions runners aren't automatically setup with user-mode qemu like when using Docker Desktop.
As far as adding Debian Unstable based builds, we wouldn't do it in images we directly maintain since it is actually unstable (https://wiki.debian.org/DebianUnstable)
having images based on Debian Unstable leads to a lot of not-unexpected instability both in our own builds and in the downstream builds of our users
Right okay, I'll see if I can implement some changes to set. the user-mode qemu when running non intel builds.
As for the base image, it sounds like we're stuck until Ubuntu add support to their official images again. Do you know who I can reach out to resolve this?