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

Improvement/Bug – Build/Publish arm64 binaries and images #32

Closed
lbarnkow opened this issue Feb 28, 2022 · 15 comments
Closed

Improvement/Bug – Build/Publish arm64 binaries and images #32

lbarnkow opened this issue Feb 28, 2022 · 15 comments

Comments

@lbarnkow
Copy link

Please consider adding arm64 as target architecture to your CI/CD pipeline.

@bakito
Copy link
Owner

bakito commented Mar 2, 2022

@lbarnkow
Copy link
Author

lbarnkow commented Mar 2, 2022

Thank you for getting back to me and pointing out the arm64-reference in the pipeline! 👍 ❤️

I didn't look into my issue in too much detail before. My initial "problem" when trying out the container was this:

$ podman run --rm ghcr.io/bakito/sealed-secrets-web:v2.7.0 bash
[dumb-init] /opt/go/sealed-secrets-web: Exec format error

I've encountered the "Exec format error" message multiple times in the past and it always meant there was no docker image for arm64. This issue is similar but different. dumb-init is clearly built for arm64, however, the sealed-secrets-web binary doesn't seem to be.

$ podman cp ssw_container:/usr/bin/dumb-init .                                                                                                                                                                                      
$ podman cp ssw_container:/opt/go/sealed-secrets-web .

$ file dumb-init 
dumb-init: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped

$ file sealed-secrets-web 
sealed-secrets-web: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, no section header

The "culprit" seems to be a x86-64 binary of sealed-secrets-web in an arm64 docker image. So this issue is actually more like a bug than a feature request.

@lbarnkow lbarnkow changed the title Improvement – Build/Publish arm64 binaries and images Improvement/Bug – Build/Publish arm64 binaries and images Mar 2, 2022
@bakito
Copy link
Owner

bakito commented Mar 3, 2022

@lbarnkow could you please also check the binary /usr/local/bin/kubeseal if this also is amd64 formatted.
I currently to not have the possibility to verify arm64

bakito added a commit that referenced this issue Mar 3, 2022
bakito added a commit that referenced this issue Mar 3, 2022
bakito added a commit that referenced this issue Mar 3, 2022
@bakito
Copy link
Owner

bakito commented Mar 3, 2022

@lbarnkow I split the build config into separate amd/arm builds, images are being pushed under tag main.
Could you please verify if the 3 binaries dumb-init, sealed-secrets-web and kubeseal are correct now?

@lbarnkow
Copy link
Author

lbarnkow commented Mar 4, 2022

I pulled ghcr.io/bakito/sealed-secrets-web:main both on amd64 and arm64 machines.

There is no amd64-image anymore available at tag :main. Don't know if you were aware.

On arm64 everything is fine now: 👍

$ podman  pull ghcr.io/bakito/sealed-secrets-web:main
Trying to pull ghcr.io/bakito/sealed-secrets-web:main...
Getting image source signatures
Copying blob 11c1139baea4 done  
Copying blob 1a34f183c49c done  
Copying blob 9b3977197b4f done  
Copying blob 0d22d12edcc0 done  
Copying blob 4dacc96e0b4d done  
Copying config 8a8930a769 done  
Writing manifest to image destination
Storing signatures
8a8930a7698a9901738d73ed8d69469592b173c66f11505f47e84c2185d83219

$ podman inspect ghcr.io/bakito/sealed-secrets-web:main | grep Arch
        "Architecture": "arm64",

$ podman run --rm -d --entrypoint /bin/sh ghcr.io/bakito/sealed-secrets-web:main -c 'sleep 600'
38dd00a4c3acf2d351d2e81cfc0e2f9b9926d2be6a6bbd6adcd4cd2a8aa19d37

$ podman cp 38:/usr/local/bin/kubeseal .
$ podman cp 38:/usr/bin/dumb-init .
$ podman cp 38:/opt/go/sealed-secrets-web .

$ file dumb-init 
dumb-init: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped

$ file kubeseal 
kubeseal: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, no section header

$ file sealed-secrets-web 
sealed-secrets-web: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, no section header

bakito added a commit that referenced this issue Mar 4, 2022
bakito added a commit that referenced this issue Mar 4, 2022
bakito added a commit that referenced this issue Mar 4, 2022
bakito added a commit that referenced this issue Mar 4, 2022
@bakito
Copy link
Owner

bakito commented Mar 4, 2022

😲 no I was not ware of this!!
Thank you very much for mentioning this.

I could fix it, there are again 2 versions and also the arch of sealed-secrets-web and kubeseal is automatically checked during the build.

Could you please verify it yourself with the latest main tag?

@lbarnkow
Copy link
Author

lbarnkow commented Mar 5, 2022

Both images look good to me. 🎉

arm64 👍

$ podman pull ghcr.io/bakito/sealed-secrets-web:main
Trying to pull ghcr.io/bakito/sealed-secrets-web:main...
Getting image source signatures
Copying blob 9b3977197b4f done  
Copying blob c08dd47a5ca8 done  
Copying blob d84855a25753 done  
Copying blob 3b7698224f64 done  
Copying blob 382f1d341db6 done  
Copying config a6b0faa0f2 done  
Writing manifest to image destination
Storing signatures

$ podman inspect ghcr.io/bakito/sealed-secrets-web:main | grep Arch
        "Architecture": "arm64",

$ podman run --rm -d --entrypoint /bin/sh ghcr.io/bakito/sealed-secrets-web:main -c 'sleep 600'
9c2ca4c412868125915da230127dc4231fc14609c7f53266f8eb2995a354334b

$ podman cp 9c:/usr/local/bin/kubeseal .                                                       
$ podman cp 9c:/usr/bin/dumb-init .     
$ podman cp 9c:/opt/go/sealed-secrets-web .

$ file dumb-init 
dumb-init: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped

$ file kubeseal 
kubeseal: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, no section header

$ file sealed-secrets-web 
sealed-secrets-web: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, no section header

amd64 👍

$ docker pull ghcr.io/bakito/sealed-secrets-web:main
main: Pulling from bakito/sealed-secrets-web
59bf1c3509f3: Already exists 
c08dd47a5ca8: Pull complete 
e763a41b9068: Pull complete 
e3f590a4144d: Pull complete 
f985368c3d35: Pull complete 
Digest: sha256:7aef59e6778bce5d795948d2a4dc73f502be72244900ac8288f42229e2f74853
Status: Downloaded newer image for ghcr.io/bakito/sealed-secrets-web:main
ghcr.io/bakito/sealed-secrets-web:main

$ docker inspect ghcr.io/bakito/sealed-secrets-web:main | grep Arch
        "Architecture": "amd64",

$ docker run --rm -d --entrypoint /bin/sh ghcr.io/bakito/sealed-secrets-web:main -c 'sleep 600'
3e4669378f368f8c58ef1c3b9b35975176a8c15d776e3c893a96dbf98d247a54

$ docker cp 3e:/usr/local/bin/kubeseal .
$ docker cp 3e:/usr/bin/dumb-init .
$ docker cp 3e:/opt/go/sealed-secrets-web .

$ file dumb-init 
dumb-init: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

$ file kubeseal 
kubeseal: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, no section header

$ file sealed-secrets-web 
sealed-secrets-web: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, no section header

@lbarnkow
Copy link
Author

lbarnkow commented Mar 5, 2022

Thank you very much for the quick work on this! ❤️

@bakito bakito closed this as completed in cd67565 Mar 6, 2022
@bakito
Copy link
Owner

bakito commented Mar 6, 2022

@purduemike
Copy link

I'm still seeing this error in ghcr.io/bakito/sealed-secrets-web:v3.1.0.

[dumb-init] /opt/go/sealed-secrets-web: Exec format error

Is there some flag you need to set to use arm64?

@purduemike
Copy link

AFAICT this broke in 3.0.0. The last working version for arm64 is 2.8.3.

Could you fix?

@bakito
Copy link
Owner

bakito commented May 31, 2023

@purduemike
Copy link

Yes, main works perfectly!

@bakito
Copy link
Owner

bakito commented May 31, 2023

Please check https://github.com/bakito/sealed-secrets-web/releases/tag/v3.1.1

@purduemike
Copy link

@bakito Thank you for the quick turn around!

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