digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
Other
803 stars 203 forks source link

daml-sdk docker arm support for m1 Mac [FEATURE REQUEST] #13211

Open MarkNBroadhead opened 2 years ago

MarkNBroadhead commented 2 years ago

What is the problem you want to solve?

I am trying to build an automated dockerized demo and automated tests using the DAML sandbox docker image on my ARM M1 Mac. This fails with memory errors, which I believe are due to incompatible binaries.

What is the solution you would propose?

Could Digital Asset start publishing ARM compatible daml-sdk docker images?

Describe alternatives you've considered

cocreature commented 2 years ago

Can you share the error message you are seeing?

MarkNBroadhead commented 2 years ago

Here is the console output:

➜  docker git:(main) ✗ docker-compose up 
[+] Running 1/0
 ⠿ Container daml-sandbox  Recreated                                                                                                                   0.1s
Attaching to daml-sandbox
daml-sandbox exited with code 139

And here is my docker-compose file

services:
  daml:
    image: digitalasset/daml-sdk:1.8.1
    container_name: daml-sandbox
    ports:
      - "6865:6865"
    command: daml start --sandbox-option --ledgerid=<removed>
stefanobaghino-da commented 2 years ago

Here is the console output:

➜  docker git:(main) ✗ docker-compose up 
[+] Running 1/0
 ⠿ Container daml-sandbox  Recreated                                                                                                                   0.1s
Attaching to daml-sandbox
daml-sandbox exited with code 139

And here is my docker-compose file

services:
  daml:
    image: digitalasset/daml-sdk:1.8.1
    container_name: daml-sandbox
    ports:
      - "6865:6865"
    command: daml start --sandbox-option --ledgerid=<removed>

To set expectations right, while we may want to work on this in the future, it's unlikely that we will backport it to a version which is already more than one year old (1.8.1 was released in January 2021).

Furthermore, for future reference, the output of starting docker is likely to be more telling than that of docker-compose, which only shows the process exit code.

garyverhaegen-da commented 2 years ago

The daml-sdk image is not built for M1 support, and that's unlikely to change any time soon given competing priorities.

Even on x86, I'd recommend building your own Docker images based on individual JAR files rather than relying on the daml-sdk images. There are very few use-cases where you'd actually want the full SDK in a Docker image.

I'll also take this opportunity to point out that the daml-sdk image is not meant for any kind of production use. Production-ready Docker images are available as part of the Enterprise license.