Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brian McNally 18 posts 106 karma points
    18 days ago
    Brian McNally
    0

    Setting up local development site on a MAC with an M1 chip for Umbraco Cloud v13 site using MSSQL

    That title is a mouthful but kind of says it all. I was really hoping to be able to setup a local development environment for my Umbraco cloud v13 site on my MacBook (Apple M1 Pro chip).

    Below is my latest message from ChatGPT and is WAY over my head. Is there any way to somewhat easily accomplish this? In the meantime, I'm just asking my IT department to set me up with a separate windows laptop just for this purpose.

    “It seems that the sqlpackage tool you're using is not compatible with the ARM architecture of the M1 chip when running in the container. The error indicates that it's expecting an x86-64 shared library that isn't available. To resolve this, we'll need to ensure we're running everything in an environment compatible with the ARM architecture. Unfortunately, SQL Server itself does not have native ARM support, so running it directly on an ARM machine can be challenging. One possible workaround is to use an x86-64 emulation environment for both the SQL Server and the SQLPackage tool. However, since this approach has not worked, another approach is to use Docker's multi-arch support or run everything in Rosetta 2 emulation on the host itself. Here is an alternative approach that involves using Docker's QEMU emulation support for running x86-64 images on ARM:”

  • Sæve 6 posts 79 karma points
    18 days ago
    Sæve
    1

    If you're alright with using Docker, then it's actually pretty easy.
    This is my docker-compose.yml for a V13 Cloud project that I'm developing on a M2 Mac.

    ---
    services:
      db:
        image: mcr.microsoft.com/mssql/server:2022-CU12-ubuntu-22.04
        platform: linux/amd64
        container_name: "my-project-db"
        hostname: "my-project-db"
        user: root
        environment:
          SA_PASSWORD: "P@ssw0rd"
          ACCEPT_EULA: "Y"
        ports:
          - "11466:1433"
        restart: unless-stopped
        volumes:
          - myproject_db_data:/var/opt/mssql/data
    
    volumes:
      myproject_db_data:
        name: myproject_db_data
        driver: local
    

    You should replace the "myproject" and "my-project" with whatever name you want to use, as long as it's compatible with the Docker naming rules.

    The database can be started with: docker compose up -d.
    If you want to destroy the database and start over, then run this:
    docker compose down --volumes

    I have my database version pinned, but you can swap to latest if needed.
    There should also be a Azure SQL image that is compatible with Umbraco, but this works for us and ensures everyone has the same environment.

    This does require you to ensure Docker is using the Rosetta translation layer to ensure performance doesn't suffer too much. enter image description here

    Remember to update your connection strings to point to the correct database.

Please Sign in or register to post replies

Write your reply to:

Draft