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

The arm64 base image does not have the cross-build command in the Aarc64 architecture. #538

Open
iamkhalidbashir opened this issue Mar 6, 2025 · 3 comments

Comments

@iamkhalidbashir
Copy link

As mentioned in the title, the Golang cross-build base debian 12 image does not have the cross-build command in the arm64 architecture, but in the x86-64 architecture. This does not get executed correctly on an ARM 64 runtime of Docker and throws an execution format error.

root@dev-server:~/# docker run --rm -it --entrypoint=/bin/bash --platform linux/arm64 docker.elastic.co/beats-dev/golang-crossbuild:1.24.0-base-debian12

root@bfa61bae9f2e:/app# readelf -h /crossbuild
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:               0x474b20
  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:         25
  Section header string table index: 22
root@bfa61bae9f2e:/app# uname -a
Linux bfa61bae9f2e 6.8.0-52-generic #53-Ubuntu SMP PREEMPT_DYNAMIC Sat Jan 11 00:06:25 UTC 2025 aarch64 GNU/Linux
@cmacknz
Copy link
Member

cmacknz commented Mar 7, 2025

@dliappis I think we fixed this already, but I can't pick out exactly at which point in the commit history. https://github.com/elastic/golang-crossbuild/commits/main/

Is this fixed already or is this still in progress?

@dliappis
Copy link
Contributor

dliappis commented Mar 7, 2025

@cmacknz so far the docker.elastic.co/beats-dev/golang-crossbuild:1.24.0-base-debian9 is correct.

There are open PRs to fix the debian11 and other variants too

@iamkhalidbashir
Copy link
Author

I cant use debian9 because the repos are archived and have other issues
Cant the PR be merged ?

Err:10 http://deb.debian.org/debian stretch/main arm64 Packages
  404  Not Found
Ign:11 http://deb.debian.org/debian stretch-updates/main all Packages
Err:12 http://deb.debian.org/debian stretch-updates/main arm64 Packages
  404  Not Found
Reading package lists...
W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-arm64/Packages  404  Not Found [IP: 151.101.130.132 80]
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-arm64/Packages  404  Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-arm64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 100
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 100

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

No branches or pull requests

3 participants