Skip to content
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

arm64 image on Docker #182

Open
kentala opened this issue Jun 6, 2024 · 13 comments
Open

arm64 image on Docker #182

kentala opened this issue Jun 6, 2024 · 13 comments
Assignees
Milestone

Comments

@kentala
Copy link

kentala commented Jun 6, 2024

On https://hub.docker.com/r/luzifer/ots/tags only amd64 builds are present.

Can you make other builds available via Docker Hub (specifically arm64)? Starting up the container on Raspberry Pi 5 results in a exec /usr/local/bin/ots: exec format error.

@Luzifer
Copy link
Owner

Luzifer commented Jun 6, 2024

The DockerHub image will not gain multi-arch capabilities as those images are subject to deletion.

Need to have a look how to add multi-arch capabilities to the GHCR image

@Luzifer
Copy link
Owner

Luzifer commented Sep 22, 2024

Please have a look at the latest develop image tag. It is displayed as having both amd64 as well as arm64 images. I can confirm the amd64 works… …if the arm64 does too we can apply that to the release images with the upcoming release.

The only thing is… …the baked-in versions do not work properly… …need to have a look at that.

@Luzifer Luzifer self-assigned this Sep 22, 2024
@Luzifer Luzifer added this to the 1.14.0 milestone Sep 22, 2024
@jimmypw
Copy link
Contributor

jimmypw commented Oct 25, 2024

I tried getting this running on a pi. I'm getting exec format error from the container.

uname -a

Linux tp1n1 6.6.51+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux

Output

exec /usr/local/bin/ots: exec format error

image:

image: ghcr.io/luzifer/ots:develop@sha256:f47e7e92d92f8db0dd71faf7fbd7f497aaf3a16308d3dc4d66bf57728facfd06

@jimmypw
Copy link
Contributor

jimmypw commented Oct 25, 2024

The amd64 binary is making it in to the arm image somehow. I've looked at your actions there's nothing i wouldn't do in there.

Picking apart ghcr.io/luzifer/ots:develop@sha256:f47e7e92d92f8db0dd71faf7fbd7f497aaf3a16308d3dc4d66bf57728facfd06 I see:

readelf -h ots 
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x4791a0
  Start of program headers:          64 (bytes into file)
  Start of section headers:          400 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         6
  Size of section headers:           64 (bytes)
  Number of section headers:         23
  Section header string table index: 20

The busybox binary is -amd64- arm64 however

@jimmypw
Copy link
Contributor

jimmypw commented Oct 25, 2024

Digging through the build log i found this

https://github.com/Luzifer/ots/actions/runs/11001132707/job/30545104419#step:7:319

Although the context is being run in arm64, x86_64 packages are being pulled by the build container.

@Luzifer
Copy link
Owner

Luzifer commented Oct 25, 2024

# docker export $(docker create ghcr.io/luzifer/ots:develop@sha256:f47e7e92d92f8db0dd71faf7fbd7f497aaf3a16308d3dc4d66bf57728facfd06) | tar -x
WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested

# file usr/local/bin/ots
usr/local/bin/ots: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=UwFSHRU6UoivEga-ZpNm/rNldv0Jk3UEH6ph1pHqr/cR7-06xfRhgVDzyFCJdr/5_y0FZGube169U8c5m9A, with debug_info, not stripped

Hmm looks like the binary was build wrong… 🤔 …but how, and why and… …what?

@Luzifer
Copy link
Owner

Luzifer commented Oct 25, 2024

Although the context is being run in arm64, x86_64 packages are being pulled by the build container.

I'd say that explains my question :D

@jimmypw
Copy link
Contributor

jimmypw commented Oct 25, 2024

The build container is archlinux, arch doesn't support ARM. that's why.

I see you're building off your own image so I won't submit a PR in this instance and build my own separate pipeline. Happy to pitch in if needed. I want to get this working in my setup, it's exactly what i need.

Sorry if you're getting spammed by these messages.

@Luzifer
Copy link
Owner

Luzifer commented Oct 25, 2024

Yeah need to change the build image to match the output image…

@jimmypw
Copy link
Contributor

jimmypw commented Oct 25, 2024

If you're happy for the build image to change I'll put together a mr now ;)

@Luzifer
Copy link
Owner

Luzifer commented Oct 25, 2024

Yeah basically just change to golang:alpine, add node, bake everything and we're good…

@Luzifer
Copy link
Owner

Luzifer commented Oct 25, 2024

Can change that later today if you want…

@Luzifer
Copy link
Owner

Luzifer commented Oct 25, 2024

# docker export $(docker create ghcr.io/luzifer/ots:develop@sha256:064debe231181ba6a0a3df08f602cdad2fb67cb95216e88158bd8f9e741fabc2) | tar -x
WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested

# file usr/local/bin/ots
usr/local/bin/ots: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=IkJR4CRMarC7-OX09-eN/DivvDNI7ceotgLryKXu4/OcXR5cJYUoCkSEcJgCvM/-u6gnJgVCIzBYWsJTNYj, with debug_info, not stripped
# docker export $(docker create ghcr.io/luzifer/ots:develop@sha256:22aa8ba40d5710c14d669683d80758b1880c382ea0b5de2a3b7743a3e6849b74) | tar -x

# file usr/local/bin/ots
usr/local/bin/ots: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=sgR6G8xq7NW-Ua6lkn2G/R5Hj7cwHzcJzql4FAGdJ/EKM4_vc2dXSyu0XcccEz/ud23Zr2AsGMWowfo8v-z, with debug_info, not stripped

Nice. Those two look better. Please try again - and thanks for taking over the fix! 🙂

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

No branches or pull requests

3 participants