-
Notifications
You must be signed in to change notification settings - Fork 527
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
Docker container does not run on Apple silicon #3648
Comments
Hi @tigloo, we don't have any Apple Silicon devices on the team (I'm still rocking the last gen intel i9) so this will be a difficult issue for us. I've done research on this in the past however. Usually it's been the SQL container that causes issues not the .NET container. Can you ensure that you have "Rosetta for x86/amd64 emulation" enabled in your Docker configuration? |
Thanks for the quick response! Rosetta is turned on in Docker. The SQL container seems to run fine, at least it prints the same log lines as on an Ubuntu x86 VM where everything works. If there's anything I can do to troubleshoot, let me know. I cannot build the docker container on my system either - I'm not familiar with .NET at all so I don't know if it is something trivial or not. If I could at least build it, I would probably be able to pinpoint the area where it gets stuck in the debugger. |
Interesting, first time I've seen this. I think it could be due to our recent switch from alpine to mariner as our base container. In your compose file, can you change the tag of the FHIR container like below and try again?
|
I'm pasting the logs for Log for
Logs for
Edit: I thought that the exception that the fhir server throws could be related to a race condition with the SQL server starting at the same time, so I tried restarting it (while the SQL server is still running). It then shows the corrupted memory crash below. This crash will only go away when deleting the container from Docker and redownloading it.
|
I looked at the mariner image we are using for latest - it should support apple silicone. I was incorrect there my bad. The corrupted data exception mentioned in the first post could be a SQL error - can you try the default image again and provide the exception? Also you should be able to build the docker file on Apple Silicone. You need to
|
I also ran into an issue with I was able to identity a workaround. If you add My version: "3"
services:
fhir-api:
image: "mcr.microsoft.com/healthcareapis/r4-fhir-server"
restart: on-failure
environment:
FHIRServer__Security__Enabled: "false"
SqlServer__ConnectionString: "Server=tcp:sql,1433;Initial Catalog=FHIR;Persist Security Info=False;User ID=sa;Password=${SAPASSWORD};MultipleActiveResultSets=False;Connection Timeout=30;TrustServerCertificate=true;"
SqlServer__AllowDatabaseCreation: "true"
SqlServer__Initialize: "true"
SqlServer__SchemaOptions__AutomaticUpdatesEnabled: "true"
DataStore: "SqlServer"
DOTNET_EnableWriteXorExecute: 0
ports:
- "8080:8080"
depends_on:
- sql
sql:
image: "mcr.microsoft.com/mssql/server"
environment:
SA_PASSWORD: ${SAPASSWORD}
ACCEPT_EULA: "Y"
healthcheck:
test: ["CMD", "/opt/mssql-tools/bin/sqlcmd","-U sa -P ${SAPASSWORD} -Q 'SELECT * FROM INFORMATION_SCHEMA.TABLES'"]
interval: 10s
timeout: 10s
retries: 6 @mikaelweave I'd be happy to collaborate and work a fix into the project for ARM64 scenarios 👍 |
Sorry for not responding earlier, lost track of this during New Year. @liammoat , thank you very much for the docker-compose.yaml! With your change the server seems to start and I can download a capability statement. I will use your version for our CI/CD setup. |
Thanks so much @liammoat for finding this!! We're currently in discussions on how to make this capability native without modifications to the compose file. |
Describe the bug
Trying to run the published docker container on an Apple M1 or M1 Max doesn't work. The server seems to start, then freezes. Latest when trying to access http://localhost:8080/metadata, CPU will go to 100%. The container stays in this state. Trying to restart it will throw an exception about corrupted data and invalid memory access. Deleting the container and recreating it will repeat the pattern: on first start it freezes, on subsequent restarts it will print a corrupted data exception.
FHIR Version?
R4B
Data provider?
SQL Server
To Reproduce
Use the
docker-compose.yaml
from the samples directory and rundocker-compose up
. The file is pasted in full below - the only change is pulling the FHIR server's container from Microsoft's container registry instead of building it directly (which doesn't work on Apple Silicon as well).I tried running the file above on an x86 Ubuntu VM and confirmed that it works just fine there. Server starts without issues.
Expected behavior
The server starts normally and can be accessed at http://localhost:8080/metadata.
Actual behavior
The server freezes on first attempt, eventually going to 100% CPU and staying in that state. On subsequent restarts, it immediately exits with a corrupted data exception.
AB#119536
The text was updated successfully, but these errors were encountered: