chobugroup
(CHOBU Group)
September 16, 2022, 2:32am
1
I’m using a docker ecs context to produce a CloudFormation template on a linux/arm64 platform, and targeting a linux/arm64 deployment in aws. Running my docker compose up (using the ecs context) produces the TaskDefinition below as part of the outputted CloudFormation template. This TaskDefinition makes reference to a docker/ecs-searchdomain-sidecar:1.0 image which apparently only supports an amd64 architecture. Consequently the “_ResolvConf_InitContainer” component of the resulting deployment fails to startup on the target arm64 platform (runtime error → “exec /resolv: exec format error”). FWIW, if I remove the relevant section of the TaskDefinmition of the template everything deploys fine to aws and executes without issue on the target arm64 platform.
So it seems that I either need to somehow locate an arm64-compatible image of ecs-searchdomain-sidecar:1.0, or is there a different recommended approach for using docker compose using an ecs context to perform an arm64 deployment to aws fargate?
Docker Hub entry for ecs-searchdomain-sidecar … Docker Hub
ApiTaskDefinition:
Properties:
ContainerDefinitions:
- Command:
- us-west-2.compute.internal
- buildingscience-analyzer.local
Essential: false
Image: docker/ecs-searchdomain-sidecar:1.0
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group:
Ref: LogGroup
awslogs-region:
Ref: AWS::Region
awslogs-stream-prefix: buildingscience-analyzer
Name: Api_ResolvConf_InitContainer
- DependsOn:
- Condition: SUCCESS
ContainerName: Api_ResolvConf_InitContainer
Environment:
- Name: SERVER_PORT
Value: "80"
Essential: true
Image: <my-app-image>
LinuxParameters: {}
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group:
Ref: LogGroup
awslogs-region:
Ref: AWS::Region
awslogs-stream-prefix: buildingscience-analyzer
Name: api
PortMappings:
- ContainerPort: 80
HostPort: 80
Protocol: tcp
Cpu: "256"
ExecutionRoleArn:
Ref: ApiTaskExecutionRole
Family: buildingscience-analyzer-api
Memory: "512"
NetworkMode: awsvpc
RequiresCompatibilities:
- FARGATE
RuntimePlatform:
CpuArchitecture: ARM64
OperatingSystemFamily: LINUX
Type: AWS::ECS::TaskDefinition
rimelek
(Ákos Takács)
September 16, 2022, 5:37pm
2
I think opening the issue on Github was a good idea.
opened 01:40AM - 14 Sep 22 UTC
I'm using a docker ecs context to produce a CloudFormation template on a linux/a… rm64 platform, and targeting a linux/arm64 deployment in aws. Running my docker compose up (using the ecs context) produces the TaskDefinition below as part of the outputted CloudFormation template. This TaskDefinition makes reference to a docker/ecs-searchdomain-sidecar:1.0 image which apparently only supports an amd64 architecture. Consequently the "_ResolvConf_InitContainer" component of the resulting deployment fails to startup on the target arm64 platform (runtime error --> "exec /resolv: exec format error"). FWIW, if I remove the relevant section of the TaskDefinmition of the template everything deploys fine to aws and executes without issue on the target arm64 platform.
So it seems that I either need to somehow locate an arm64-compatible image of ecs-searchdomain-sidecar:1.0, or is there a different recommended approach for using docker compose using an ecs context to perform an arm64 deployment to aws fargate?
Docker Hub entry for ecs-searchdomain-sidecar ... https://hub.docker.com/r/docker/ecs-searchdomain-sidecar/tags
```
ApiTaskDefinition:
Properties:
ContainerDefinitions:
- Command:
- us-west-2.compute.internal
- buildingscience-analyzer.local
Essential: false
Image: docker/ecs-searchdomain-sidecar:1.0
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group:
Ref: LogGroup
awslogs-region:
Ref: AWS::Region
awslogs-stream-prefix: buildingscience-analyzer
Name: Api_ResolvConf_InitContainer
- DependsOn:
- Condition: SUCCESS
ContainerName: Api_ResolvConf_InitContainer
Environment:
- Name: SERVER_PORT
Value: "80"
Essential: true
Image: <my-app-image>
LinuxParameters: {}
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group:
Ref: LogGroup
awslogs-region:
Ref: AWS::Region
awslogs-stream-prefix: buildingscience-analyzer
Name: api
PortMappings:
- ContainerPort: 80
HostPort: 80
Protocol: tcp
Cpu: "256"
ExecutionRoleArn:
Ref: ApiTaskExecutionRole
Family: buildingscience-analyzer-api
Memory: "512"
NetworkMode: awsvpc
RequiresCompatibilities:
- FARGATE
RuntimePlatform:
CpuArchitecture: ARM64
OperatingSystemFamily: LINUX
Type: AWS::ECS::TaskDefinition
```
Based on the message I assume you opened it. It was 3 days ago and no reply yet, but since you mentioned fargate, I found an other issue for you in which they mention something that might help you:
opened 12:22AM - 25 Nov 21 UTC
***Description***
AWS have just announced support for ARM64 in Fargate:
ht… tps://aws.amazon.com/about-aws/whats-new/2021/11/aws-fargate-amazon-ecs-aws-graviton2-processors/
It would be good to have docker compose auto detect platform linux/arm64 and include CpuArchitecture: ARM64 chunk in the CloudFormation template, and also to have the docker/ecs-secrets-sidecar and docker/ecs-searchdomain-sidecar containers built as multi-platform images.
```
Resources:
FooTaskDefinition:
Properties:
RuntimePlatform:
CpuArchitecture: ARM64
```
chobugroup
(CHOBU Group)
September 22, 2022, 9:24pm
3
Until there is a multi-arch version of ecs-searchdomain-sidecar:1.0 officially published within docker hub, ### mtelvers provided a nice workaround for this issue in my similar post in GitHub ( No ARM64 version of docker/ecs-searchdomain-sidecar which is needed for Docker ECS context · Issue #2190 · docker/compose-cli · GitHub ). This workaround worked fine for me. But hopefully docker will publish an official multi-arch version soon so we don’t need to use an overlay within our respective compose files.