forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 276
107 lines (102 loc) · 3.45 KB
/
docker-arm64.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Docker-arm64
on:
workflow_dispatch:
inputs:
tag:
description: "tag of this image (suffix -arm64 is added automatically)"
required: true
type: string
jobs:
build-and-push-arm64-image:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- aarch64
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name multiarch --driver docker-container --use
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build docker image
uses: docker/build-push-action@v2
with:
platforms: linux/arm64
context: .
file: Dockerfile
push: true
tags: scrolltech/l2geth:${{inputs.tag}}-arm64
build-and-push-amd64-image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Extract docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: scrolltech/l2geth
tags: |
type=ref,event=tag,enable=${{ github.event_name == 'push' }}
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
flavor: |
latest=false
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: scrolltech/l2geth:${{inputs.tag}}-amd64
publish-multi-arch-image:
runs-on: ubuntu-latest
needs:
- build-and-push-amd64-image
- build-and-push-arm64-image
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Extract docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: scrolltech/l2geth
tags: |
type=ref,event=tag,enable=${{ github.event_name == 'push' }}
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
flavor: |
latest=false
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build multiarch image
run: |
docker manifest create scrolltech/l2geth:${image_multiarch_name} --amend scrolltech/l2geth:${image_amd64_name} --amend scrolltech/l2geth:${image_arm64_name} && \
docker manifest push scrolltech/l2geth:${image_multiarch_name}
env:
image_arm64_name: "${{ steps.meta.outputs.tags }}-arm64"
image_amd64_name: "${{ steps.meta.outputs.tags }}-amd64"
image_multiarch_name: "${{ steps.meta.outputs.tags }}-multiarch"