C
C#10mo ago
Sella

Segmentation fault using Debian Bookworm ARM64v8 image during dotnet restore in docker

I'm getting a strange error named "Segmentation fault (core dumped)" when trying to build my dockerfile on the ARM64v8 Bookworm image coming from microsoft dotnet/runtime. this occurs every time on the dotnet restore command while it's not occuring on the AMD64 Bookworm image. Using .NET 8 Some log:
#11 [build 4/5] RUN dotnet restore --force --no-cache
#11 28.61 Segmentation fault (core dumped)
#11 ERROR: process "/bin/sh -c dotnet restore --force --no-cache" did not complete successfully: exit code: 139

#12 [stage-1 3/16] RUN apt install -y wget apt-transport-https gpg libicu72
#12 CANCELED
------
> [build 4/5] RUN dotnet restore --force --no-cache:
13.07 Determining projects to restore...
28.61 Segmentation fault (core dumped)
------
Dockerfile:6
--------------------
4 | WORKDIR /src
5 | COPY ./AzzyBot ./
6 | >>> RUN dotnet restore --force --no-cache
7 | RUN dotnet publish -c Docker -o out
8 |
--------------------
ERROR: failed to solve: process "/bin/sh -c dotnet restore --force --no-cache" did not complete successfully: exit code: 139
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c dotnet restore --force --no-cache" did not complete successfully: exit code: 139
#11 [build 4/5] RUN dotnet restore --force --no-cache
#11 28.61 Segmentation fault (core dumped)
#11 ERROR: process "/bin/sh -c dotnet restore --force --no-cache" did not complete successfully: exit code: 139

#12 [stage-1 3/16] RUN apt install -y wget apt-transport-https gpg libicu72
#12 CANCELED
------
> [build 4/5] RUN dotnet restore --force --no-cache:
13.07 Determining projects to restore...
28.61 Segmentation fault (core dumped)
------
Dockerfile:6
--------------------
4 | WORKDIR /src
5 | COPY ./AzzyBot ./
6 | >>> RUN dotnet restore --force --no-cache
7 | RUN dotnet publish -c Docker -o out
8 |
--------------------
ERROR: failed to solve: process "/bin/sh -c dotnet restore --force --no-cache" did not complete successfully: exit code: 139
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c dotnet restore --force --no-cache" did not complete successfully: exit code: 139
111 Replies
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
sexysexysamthorpe
Have you done anything weird in your dockerfile Show your dockerfile
Sella
SellaOP10mo ago
https://github.com/Sella-GH/AzzyBot/blob/feat/dockerfile/Dockerfile The AMD64 part goes through without issues, only the ARM64v8 part makes issues
Petris
Petris9mo ago
Are you running the arm image on a x64 machine?
Sella
SellaOP9mo ago
I'm not quite sure what architecture the Ubuntu runners from GitHub use but I guess it's x64, yes
Petris
Petris9mo ago
It's emulating via QEMU then Which is not supported It should work though if you try the macos arm64 runner as host I think And like completely doesn't work
Sella
SellaOP9mo ago
Do I have to use the macos runner for every image then? I use a matrix strategy from GitHub Actions to compile the images
Petris
Petris9mo ago
You need to use a runner that has the corresponding architecture X64 for x64 and arm64 for arm64
Henkypenky
Henkypenky9mo ago
you sure macos runners are on the M platform?
Petris
Petris9mo ago
They made the arm64 ones public like 3 months ago They were enterprise only before
Henkypenky
Henkypenky9mo ago
oh nice
Petris
Petris9mo ago
But note that if your repo isn't open source, they're always paid iirc Unlike the other runners which have some limited free capacity even for private repos
Sella
SellaOP9mo ago
Yeah the ubuntu runners are free in private I guess 2.000 mins was it
Henkypenky
Henkypenky9mo ago
maybe you can ask for ubuntu/arm64 ?
Sella
SellaOP9mo ago
I'm not sure if one customer asking is gonna let GitHub provide ARM64 runners lol
Henkypenky
Henkypenky9mo ago
no, in the yaml
Sella
SellaOP9mo ago
And how exactly?
Petris
Petris9mo ago
There are no ubuntu arm64 runners iirc But you could try to get an Oracle Always Free VPS Which are Arm64 And setup a self hosted runner there
Sella
SellaOP9mo ago
Tried the Free Tier already until they were at max capacity and won't let me create any servers anymore
Petris
Petris9mo ago
Yeah but only for open source iirc They have no free minutes for private macos arm64 iirc
Sella
SellaOP9mo ago
Nope only for Ubuntu
Henkypenky
Henkypenky9mo ago
do you have a university email?
Sella
SellaOP9mo ago
I'm open source anyway so no issues
Petris
Petris9mo ago
Ah I thought you weren't
Sella
SellaOP9mo ago
If you've asked me this 2 years ago I'd have said yes This dockerfile is open source if I see this correctly lol
Petris
Petris9mo ago
@Filip Navara wanna fix QEMU after naot win x86? :kekw:
Filip Navara
Filip Navara9mo ago
nah
Sella
SellaOP9mo ago
Well big question then, if I have to use ARM64 runners for the respecting images how can I combine all of the digests into one action in the end and upload one tag with all images?
Henkypenky
Henkypenky9mo ago
jobs: S
Sella
SellaOP9mo ago
According to this site they also support macOS 13 to use ARM64 runners, not only macOS 14 (like I falsely assumed) https://github.com/actions/runner-images?tab=readme-ov-file#available-images However, seems I can't get docker running on the machines.. not sure what I am doing wrong
Sella
SellaOP9mo ago
No description
No description
Sella
SellaOP9mo ago
Well that's it. No docker for the M1 images - I guess I can't compile ARM64 images on GitHub Actions
No description
MODiX
MODiX9mo ago
Petris
And setup a self hosted runner there
React with ❌ to remove this embed.
Sella
SellaOP9mo ago
Probably the best idea sigh
Henkypenky
Henkypenky9mo ago
can you send the link of that issue i want to see the linux arm64
Henkypenky
Henkypenky9mo ago
can you try ubuntu-latest docker with linux/arm64 flag
Sella
SellaOP9mo ago
I already have It's not available in the images section
Henkypenky
Henkypenky9mo ago
not that it's an x86_64 image with docker with platform arm64 like docker build ...... --platform linux/arm64
Sella
SellaOP9mo ago
Yeah I already have before I always used the ubuntu-latest runners
Henkypenky
Henkypenky9mo ago
can you share the repo
Sella
SellaOP9mo ago
https://github.com/Sella-GH/AzzyBot/blob/feat/dockerfile/.github/workflows/docker.yml Well that's an issue because if I run a self-hosted runner for a public repository...
We recommend that you only use self-hosted runners with private repositories. This is because forks of your public repository can potentially run dangerous code on your self-hosted runner machine by creating a pull request that executes the code in a workflow.
https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#self-hosted-runner-security
Henkypenky
Henkypenky9mo ago
is it failing on the linux or windows arm64 image pull?
Sella
SellaOP9mo ago
Both Okay using the self-hosted runner for ARM64 now and seems to work so far... But there's a side effect - it can only compile one Docker image at a time
Henkypenky
Henkypenky9mo ago
you only have 1 runner configure more
Sella
SellaOP9mo ago
Yeah read about this in the aftermath. Anyway it works - thanks all for helping the case. 🙂
Henkypenky
Henkypenky9mo ago
now apply for the private beta of linux/arm64
Sella
SellaOP9mo ago
There's a private beta?
Henkypenky
Henkypenky9mo ago
yes, everyone is forcefully delaying the implementation of arm64 because it's gaining market my opinion is that is not that hard to implement but they are delaying it as much as possible
Sella
SellaOP9mo ago
And where is this private beta? I don't see anything in the issue
Petris
Petris9mo ago
No description
Henkypenky
Henkypenky9mo ago
teams is 4 bucks a month
Sella
SellaOP9mo ago
But you need at least 2 people And guess what, I'm alone lol
Henkypenky
Henkypenky9mo ago
still a good investment
Sella
SellaOP9mo ago
Still need another peep
Henkypenky
Henkypenky9mo ago
where did you read it's at least 2 people?
Sella
SellaOP9mo ago
Last time I was in an organization I read about that you need at least two people or I've got some wrong info
Henkypenky
Henkypenky9mo ago
i just proceeded to checkout on a new org and i could purchase a single license you have to select individual
Sella
SellaOP9mo ago
Well Individual is GitHub Pro IIRC
Henkypenky
Henkypenky9mo ago
i dont think github pro exists anymore
No description
Sella
SellaOP9mo ago
No description
Henkypenky
Henkypenky9mo ago
that's your personal account you should create an organization https://github.com/organizations/plan
Sella
SellaOP9mo ago
Yeah because GitHub Pro is only available for Personal accounts aka Individuals
Henkypenky
Henkypenky9mo ago
they changed it a bit now an organization can be an individual can belong to * and be, if you want to
Sella
SellaOP9mo ago
This whole runner stuff took enough time for me today tbh Made a cleanup job now otherwise this thing runs out of space in like 2 hours
Henkypenky
Henkypenky9mo ago
maybe you are focusing too much on something that isn't adding a ton of value? xd also, it's failing on docker, not on arm64 so you can still have all your docker images for standard and release arm64 non docker for now
Sella
SellaOP9mo ago
Maybe I've got a different POV on stuff but IMHO it's waaaaay better to have a fully automated build CI and release CD. This stuff saves a good amount of time if you have to do that again and again and again
Henkypenky
Henkypenky9mo ago
i didn't check but are you uploading the images to docker hub?
Sella
SellaOP9mo ago
I'm still wanting to distribute non-docker images of the stuff. Docker is just for the "lazy". As I don't expect to go through the roof with this niche piece of software I made I still found out it's a good thing to learn stuff for future needs Yes
Henkypenky
Henkypenky9mo ago
github will eventually "catch up" with arm stuff don't worry
Sella
SellaOP9mo ago
Usually I'm with the saying "Self-host over Cloud" so it's no issue for me lol
Henkypenky
Henkypenky9mo ago
be careful with your github tokens
Sella
SellaOP9mo ago
Yeah I use secrets so nothing to worry by now
Henkypenky
Henkypenky9mo ago
found your problem 😁 i think
Sella
SellaOP9mo ago
QEMU unable to compile as every time?
Henkypenky
Henkypenky9mo ago
it's due to multiplatform
Henkypenky
Henkypenky9mo ago
No description
Sella
SellaOP9mo ago
🤨 But why does it work when I specify the ARCH?
Henkypenky
Henkypenky9mo ago
https://github.com/JuanchiBruzzone/AzzyBot/actions/runs/8412293180/job/23032959698 can you see that? the push fail is on purpose i'm just doing restore and build
Sella
SellaOP9mo ago
Yeah I can see
Henkypenky
Henkypenky9mo ago
i didn't investigate why but maybe github keeps the container and tries to do multi platform and that is fucking up QEMU because if you single target arm64 it works perfectly using ubuntu-latest, as it should
Henkypenky
Henkypenky9mo ago
works fine :harold:
Sella
SellaOP9mo ago
But if you do Multiplatform it fucks up This is weird
Henkypenky
Henkypenky9mo ago
i just pull 8 and it uses the appropiate stuff
No description
Henkypenky
Henkypenky9mo ago
there was a breaking change on .net8 docker pulls it comes from debian now
Sella
SellaOP9mo ago
Mhh let me check
Henkypenky
Henkypenky9mo ago
https://github.com/dotnet/dotnet-docker/discussions/4549 this one but i think it's coming from multi platform docker container target
Sella
SellaOP9mo ago
I changed my workflow and docker file let's see if it breaks
Henkypenky
Henkypenky9mo ago
start easy just target linux/arm64 or you going for the home run?
Sella
SellaOP9mo ago
I'm going for the revert
No description
Henkypenky
Henkypenky9mo ago
yes because of the breaking change i just posted above you need to explicitly say it's for windows now
Sella
SellaOP9mo ago
Why windows lol it should use Linux as docker container
Henkypenky
Henkypenky9mo ago
otherwise it pulls debian weren't your running multiple containers? or just ubuntu? you are doing windows amd64 you need to tell it go look for windows image or just do linux container linux/amd64
Sella
SellaOP9mo ago
Guess I'm just moving on with my approach - works at least
Henkypenky
Henkypenky9mo ago
yeah xd just wanted to find the bug
Sella
SellaOP9mo ago
Now I've got an issue regarding docker volumes but that doesn't involve .NET anymore But a question for the end: Is it even possible to run docker natively on Windows so that you need a native docker image for the platform? IIRC docker desktop uses either WSL2 or Hyper-V with Linux as base OS
Henkypenky
Henkypenky9mo ago
You can’t run docker in windows without virtualization I think there is something native but it’s exclusive to windows server
Sella
SellaOP9mo ago
So there is basically no need for adding windows/amd64 docker images?
Henkypenky
Henkypenky9mo ago
This is a discord bot right?
Sella
SellaOP9mo ago
Yes
Henkypenky
Henkypenky9mo ago
People would usually run it from a server Linux server And develop on windows docker Linux Based I think you are going overkill Just target Linux amd and arm64 And docker
Sella
SellaOP9mo ago
Well I use it on windows too but mainly for debugging
Henkypenky
Henkypenky9mo ago
But I can just do docker pull And it’s Linux It’s just a better experience I am on macOS so I gladly accept a Linux arm64 image That adds value I don’t think windows adds that much value Windows servers are expensive And if the run it locally they most likely will use docker
Sella
SellaOP9mo ago
Fair points
Henkypenky
Henkypenky9mo ago
I see that there is a big learning experience for you here so focus on important stuff and have a pipeline for stuff that maybe doesn’t add that much value but it’s good for you to learn !
Sella
SellaOP9mo ago
I removed the Windows images now, just building the linux ones now (ARM and x64) at first for docker, later then for the full release stuff then. Need to catch some sleep and fix the remaining issues tomorrow.... I'm feeling so close to the end of this nightmare lol
Henkypenky
Henkypenky9mo ago
nice
Sella
SellaOP9mo ago
I've got it finally working in docker without any issues 🎉 Thanks everyone for helping!
Want results from more Discord servers?
Add your server