FossilRepo

Build ARM64 image for t4g EC2 (docker buildx + QEMU)

lmata 2026-04-07 06:06 trunk
Commit d8ce3f74e2e122af62f40b309b5a70606d4657f770bb8b4ce06e88aa3d1176e7
--- .github/workflows/deploy.yaml
+++ .github/workflows/deploy.yaml
@@ -34,21 +34,25 @@
3434
aws-region: ${{ env.AWS_REGION }}
3535
3636
- uses: aws-actions/amazon-ecr-login@v2
3737
id: ecr
3838
39
- - name: Build and push image
39
+ - uses: docker/setup-qemu-action@v3
40
+
41
+ - uses: docker/setup-buildx-action@v3
42
+
43
+ - name: Build and push image (ARM64)
4044
env:
4145
ECR_REGISTRY: ${{ steps.ecr.outputs.registry }}
4246
IMAGE_TAG: ${{ github.sha }}
4347
run: |
44
- docker build \
48
+ docker buildx build \
49
+ --platform linux/arm64 \
50
+ --push \
4551
-t $ECR_REGISTRY/$ECR_REPO:$IMAGE_TAG \
4652
-t $ECR_REGISTRY/$ECR_REPO:latest \
4753
.
48
- docker push $ECR_REGISTRY/$ECR_REPO:$IMAGE_TAG
49
- docker push $ECR_REGISTRY/$ECR_REPO:latest
5054
5155
- name: Deploy to EC2 via SSM
5256
run: |
5357
aws ssm send-command \
5458
--instance-ids "$INSTANCE_ID" \
5559
--- .github/workflows/deploy.yaml
+++ .github/workflows/deploy.yaml
@@ -34,21 +34,25 @@
34 aws-region: ${{ env.AWS_REGION }}
35
36 - uses: aws-actions/amazon-ecr-login@v2
37 id: ecr
38
39 - name: Build and push image
 
 
 
 
40 env:
41 ECR_REGISTRY: ${{ steps.ecr.outputs.registry }}
42 IMAGE_TAG: ${{ github.sha }}
43 run: |
44 docker build \
 
 
45 -t $ECR_REGISTRY/$ECR_REPO:$IMAGE_TAG \
46 -t $ECR_REGISTRY/$ECR_REPO:latest \
47 .
48 docker push $ECR_REGISTRY/$ECR_REPO:$IMAGE_TAG
49 docker push $ECR_REGISTRY/$ECR_REPO:latest
50
51 - name: Deploy to EC2 via SSM
52 run: |
53 aws ssm send-command \
54 --instance-ids "$INSTANCE_ID" \
55
--- .github/workflows/deploy.yaml
+++ .github/workflows/deploy.yaml
@@ -34,21 +34,25 @@
34 aws-region: ${{ env.AWS_REGION }}
35
36 - uses: aws-actions/amazon-ecr-login@v2
37 id: ecr
38
39 - uses: docker/setup-qemu-action@v3
40
41 - uses: docker/setup-buildx-action@v3
42
43 - name: Build and push image (ARM64)
44 env:
45 ECR_REGISTRY: ${{ steps.ecr.outputs.registry }}
46 IMAGE_TAG: ${{ github.sha }}
47 run: |
48 docker buildx build \
49 --platform linux/arm64 \
50 --push \
51 -t $ECR_REGISTRY/$ECR_REPO:$IMAGE_TAG \
52 -t $ECR_REGISTRY/$ECR_REPO:latest \
53 .
 
 
54
55 - name: Deploy to EC2 via SSM
56 run: |
57 aws ssm send-command \
58 --instance-ids "$INSTANCE_ID" \
59

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button