Skip to content

Commit 232ce35

Browse files
committed
workflow and makeile added for multi arch support
1 parent 128c343 commit 232ce35

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

.github/workflows/docker-buildx.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: buildx
22

33
on:
44
pull_request:
5-
branches: master
5+
branches: test
66
push:
7-
branches: master
7+
branches: test
88
tags:
99

1010
jobs:
@@ -24,10 +24,20 @@ jobs:
2424
-
2525
name: Available platforms
2626
run: echo ${{ steps.buildx.outputs.platforms }}
27+
-
28+
name: docker login
29+
env:
30+
DOCKER_USER: ${{secrets.DOCKER_USER}}
31+
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
32+
run: |
33+
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
2734
-
2835
name: Run Buildx
2936
run: |
3037
docker buildx build \
3138
--platform linux/amd64,linux/arm64 \
32-
--output "type=image,push=false" \
39+
--output "type=image,push=true" \
3340
--file ./Dockerfile .
41+
42+
43+

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ RUN set -ex \
5252
py3-setuptools \
5353
scapy \
5454
socat \
55+
speedtest-cli \
5556
strace \
5657
tcpdump \
5758
tcptraceroute \

Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.PHONY: build-x86 build-arm64 push all
2+
3+
# Build Vars
4+
IMAGENAME=nicolaka/netshoot
5+
VERSION=0.1
6+
7+
8+
.DEFAULT_GOAL := all
9+
10+
build-x86:
11+
@docker build --platform linux/amd64 -t ${IMAGENAME}:${VERSION} .
12+
build-arm64:
13+
@docker build --platform linux/arm64 -t ${IMAGENAME}:${VERSION} .
14+
build-all:
15+
@docker buildx build --platform linux/amd64,linux/arm64 --output "type=image,push=false" --file ./Dockerfile .
16+
push:
17+
@docker push ${IMAGENAME}:${VERSION}
18+
all: build-all push
19+
20+
21+

0 commit comments

Comments
 (0)