Repository: getmoto/moto (python)

Issue:
Docker image support for Apple Silicon?
Not sure if this is the correct repo, I don't see any other repos under this organisation for the docker images.

I tried searching issues for `docker` and also `m1`, but didn't see any obvious results for previous threads on this topic.

---

It seems that the docker image for `Moto` doesn't support Apple Silicon (e.g `linux/arm64/v8`). Is this a known issue, is it planned to publish images built for Apple Silicon?

https://hub.docker.com/r/motoserver/moto/tags 

Thanks!

Pull request:
Enable Apple M1 support for Docker-builds with latest-tag
Fixes #5858 

Related to #5553 - this applies the same solution to our `latest`-releases

Patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8891b5ae6..efe3fe77d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -209,6 +209,8 @@ jobs:
           docker build -t motoserver/moto . --tag moto:latest
       # Required to get the correct Digest
       # See https://github.com/docker/build-push-action/issues/461
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v2
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v2
       - name: Login to DockerHub
@@ -220,6 +222,7 @@ jobs:
         uses: docker/build-push-action@v3
         with:
           push: true
+          platforms: linux/amd64,linux/arm64
           tags: motoserver/moto:latest
       - name: Get version number
         run: |
diff --git a/moto/ecs/models.py b/moto/ecs/models.py
index 7374ce403..5ce3aa848 100644
--- a/moto/ecs/models.py
+++ b/moto/ecs/models.py
@@ -808,7 +808,7 @@ class EC2ContainerServiceBackend(BaseBackend):
             service_region, zones, "ecs"
         )
 
-    def _get_cluster(self, name):
+    def _get_cluster(self, name: str) -> Cluster:
         # short name or full ARN of the cluster
         cluster_name = name.split("/")[-1]
 
@@ -1333,10 +1333,10 @@ class EC2ContainerServiceBackend(BaseBackend):
         return service
 
     def list_services(self, cluster_str, scheduling_strategy=None, launch_type=None):
-        cluster_name = cluster_str.split("/")[-1]
+        cluster = self._get_cluster(cluster_str)
         service_arns = []
         for key, service in self.services.items():
-            if cluster_name + ":" not in key:
+            if cluster.name + ":" not in key:
                 continue
 
             if (


Test patch:
diff --git a/tests/test_ecs/test_ecs_boto3.py b/tests/test_ecs/test_ecs_boto3.py
index 161212b01..94b81554e 100644
--- a/tests/test_ecs/test_ecs_boto3.py
+++ b/tests/test_ecs/test_ecs_boto3.py
@@ -701,6 +701,17 @@ def test_list_services():
     cluster1_fargate_services["serviceArns"][0].should.equal(test_ecs_service2_arn)
 
 
+@mock_ecs
+@pytest.mark.parametrize("args", [{}, {"cluster": "foo"}], ids=["no args", "unknown"])
+def test_list_unknown_service(args):
+    client = boto3.client("ecs", region_name="us-east-1")
+    with pytest.raises(ClientError) as exc:
+        client.list_services(**args)
+    err = exc.value.response["Error"]
+    err["Code"].should.equal("ClusterNotFoundException")
+    err["Message"].should.equal("Cluster not found.")
+
+
 @mock_ecs
 def test_describe_services():
     client = boto3.client("ecs", region_name="us-east-1")