C
C#3mo 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 User3mo ago
Message Not Public
Sign In & Join Server To View
sexysexysamthorpe
Have you done anything weird in your dockerfile Show your dockerfile
Sella
Sella3mo 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
Petris3mo ago
Are you running the arm image on a x64 machine?
Sella
Sella3mo ago
I'm not quite sure what architecture the Ubuntu runners from GitHub use but I guess it's x64, yes
Petris
Petris3mo 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
Sella3mo 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
Petris3mo ago
You need to use a runner that has the corresponding architecture X64 for x64 and arm64 for arm64
Henkypenky
Henkypenky3mo ago
you sure macos runners are on the M platform?
Petris
Petris3mo ago
They made the arm64 ones public like 3 months ago They were enterprise only before
Henkypenky
Henkypenky3mo ago
oh nice
Petris
Petris3mo 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
Sella3mo ago
Yeah the ubuntu runners are free in private I guess 2.000 mins was it
Henkypenky
Henkypenky3mo ago
maybe you can ask for ubuntu/arm64 ?
Sella
Sella3mo ago
I'm not sure if one customer asking is gonna let GitHub provide ARM64 runners lol
Henkypenky
Henkypenky3mo ago
no, in the yaml
Sella
Sella3mo ago
And how exactly?
Petris
Petris3mo 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
Sella3mo ago
Tried the Free Tier already until they were at max capacity and won't let me create any servers anymore
Petris
Petris3mo ago
Yeah but only for open source iirc They have no free minutes for private macos arm64 iirc
Sella
Sella3mo ago
Nope only for Ubuntu
Henkypenky
Henkypenky3mo ago
do you have a university email?
Sella
Sella3mo ago
I'm open source anyway so no issues
Petris
Petris3mo ago
Ah I thought you weren't
Sella
Sella3mo 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
Petris3mo ago
@Filip Navara wanna fix QEMU after naot win x86? :kekw:
Filip Navara
Filip Navara3mo ago
nah
Sella
Sella3mo 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
Henkypenky3mo ago
jobs: S
Sella
Sella3mo 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
Sella3mo ago
No description
No description
Sella
Sella3mo 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
MODiX3mo ago
Petris
And setup a self hosted runner there
React with ❌ to remove this embed.
Sella
Sella3mo ago
Probably the best idea sigh
Henkypenky
Henkypenky3mo ago
can you send the link of that issue i want to see the linux arm64
Henkypenky
Henkypenky3mo ago
can you try ubuntu-latest docker with linux/arm64 flag
Sella
Sella3mo ago
I already have It's not available in the images section
Henkypenky
Henkypenky3mo ago
not that it's an x86_64 image with docker with platform arm64 like docker build ...... --platform linux/arm64
Sella
Sella3mo ago
Yeah I already have before I always used the ubuntu-latest runners
Henkypenky
Henkypenky3mo ago
can you share the repo
Sella
Sella3mo 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
Henkypenky3mo ago
is it failing on the linux or windows arm64 image pull?
Sella
Sella3mo 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
Henkypenky3mo ago
you only have 1 runner configure more
Sella
Sella3mo ago
Yeah read about this in the aftermath. Anyway it works - thanks all for helping the case. 🙂
Henkypenky
Henkypenky3mo ago
now apply for the private beta of linux/arm64
Sella
Sella3mo ago
There's a private beta?
Henkypenky
Henkypenky3mo 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
Sella3mo ago
And where is this private beta? I don't see anything in the issue
Petris
Petris3mo ago
No description
Henkypenky
Henkypenky3mo ago
teams is 4 bucks a month
Sella
Sella3mo ago
But you need at least 2 people And guess what, I'm alone lol
Henkypenky
Henkypenky3mo ago
still a good investment
Sella
Sella3mo ago
Still need another peep
Henkypenky
Henkypenky3mo ago
where did you read it's at least 2 people?
Sella
Sella3mo 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
Henkypenky3mo ago
i just proceeded to checkout on a new org and i could purchase a single license you have to select individual
Sella
Sella3mo ago
Well Individual is GitHub Pro IIRC
Henkypenky
Henkypenky3mo ago
i dont think github pro exists anymore
No description
Sella
Sella3mo ago
No description
Henkypenky
Henkypenky3mo ago
that's your personal account you should create an organization https://github.com/organizations/plan
Sella
Sella3mo ago
Yeah because GitHub Pro is only available for Personal accounts aka Individuals
Henkypenky
Henkypenky3mo ago
they changed it a bit now an organization can be an individual can belong to * and be, if you want to
Sella
Sella3mo 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
Henkypenky3mo 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
Sella3mo 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
Henkypenky3mo ago
i didn't check but are you uploading the images to docker hub?
Sella
Sella3mo 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
Henkypenky3mo ago
github will eventually "catch up" with arm stuff don't worry
Sella
Sella3mo ago
Usually I'm with the saying "Self-host over Cloud" so it's no issue for me lol
Henkypenky
Henkypenky3mo ago
be careful with your github tokens
Sella
Sella3mo ago
Yeah I use secrets so nothing to worry by now
Henkypenky
Henkypenky3mo ago
found your problem 😁 i think
Sella
Sella3mo ago
QEMU unable to compile as every time?
Henkypenky
Henkypenky3mo ago
it's due to multiplatform
Henkypenky
Henkypenky3mo ago
No description
Sella
Sella3mo ago
🤨 But why does it work when I specify the ARCH?
Henkypenky
Henkypenky3mo 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
Sella3mo ago
Yeah I can see
Henkypenky
Henkypenky3mo 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
Henkypenky3mo ago
works fine :harold:
Sella
Sella3mo ago
But if you do Multiplatform it fucks up This is weird
Henkypenky
Henkypenky3mo ago
i just pull 8 and it uses the appropiate stuff
No description
Henkypenky
Henkypenky3mo ago
there was a breaking change on .net8 docker pulls it comes from debian now
Sella
Sella3mo ago
Mhh let me check
Henkypenky
Henkypenky3mo ago
https://github.com/dotnet/dotnet-docker/discussions/4549 this one but i think it's coming from multi platform docker container target
Sella
Sella3mo ago
I changed my workflow and docker file let's see if it breaks
Henkypenky
Henkypenky3mo ago
start easy just target linux/arm64 or you going for the home run?
Sella
Sella3mo ago
I'm going for the revert
No description
Henkypenky
Henkypenky3mo ago
yes because of the breaking change i just posted above you need to explicitly say it's for windows now
Sella
Sella3mo ago
Why windows lol it should use Linux as docker container
Henkypenky
Henkypenky3mo 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
Sella3mo ago
Guess I'm just moving on with my approach - works at least
Henkypenky
Henkypenky3mo ago
yeah xd just wanted to find the bug
Sella
Sella3mo 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
Henkypenky3mo ago
You can’t run docker in windows without virtualization I think there is something native but it’s exclusive to windows server
Sella
Sella3mo ago
So there is basically no need for adding windows/amd64 docker images?
Henkypenky
Henkypenky3mo ago
This is a discord bot right?
Sella
Sella3mo ago
Yes
Henkypenky
Henkypenky3mo 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
Sella3mo ago
Well I use it on windows too but mainly for debugging
Henkypenky
Henkypenky3mo 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
Sella3mo ago
Fair points
Henkypenky
Henkypenky3mo 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
Sella3mo 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
Henkypenky3mo ago
nice
Sella
Sella3mo 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
More Posts
✅ How to get value of DatePicker from nested UserControl Avalonia```xml <!-- in new user view --> <UserControl xmlns:uc="clr-namespace:MathGame.Views.UserControls;as✅ Styling Avalonia DatePicker ControlMy Code: https://pastebin.com/v057vZCS Avalonia Code For DatePicker Style: https://pastebin.com/Qewx✅ Key bind for closing a console program while console/visual studio is out of focusHello, I wonder if there is a key bind that closes/stops a running program in Visual studio. It is Powershellwhy i cannot delete powershell, or add file in drivers folder (I think the reason is the same) by c#I want to make a dynamic compiler of c# code and with that have a console on the web page, using thiI want to make a dynamic compiler of c# code and with that have a console on the web page, using thiDownloading and extracting a .7z file from within a WinUI applicationI'm currently developing an application installer using WinUI3, and I'm stuck at the part where the Steel Battalion controller lightsHello. I need some help figuring out how to do one of two things with my Steel Battalion controller.C# WinForms ChatI'm looking to make a chat application where users can send chats over a server. I already have a sHelp about possible internship interview questionsI want to study possible internship interview questions. what subjects are critical for an interview✅ Allow user to select profile image avaloniahttps://docs.avaloniaui.net/docs/concepts/services/storage-provider/file-picker-options I found thi