Skip to content

Commit 36fc8c3

Browse files
authored
Feature/multiarch (#8)
* increase version * implement multi-arc build * fix linter issue
1 parent 6b2f3e4 commit 36fc8c3

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

.github/workflows/build-and-push-container-image.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,19 @@ jobs:
2929
exit 1
3030
fi
3131
echo "tag=${image_version}" >> $GITHUB_OUTPUT
32-
- name: Build container image
33-
run: docker build . --file Dockerfile --tag oitc/modbus-server:${{steps.application-version.outputs.tag}}
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v2
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v2
3436
- name: Login to container registry
35-
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
36-
- name: Push container image to container registry
37-
run: docker push oitc/modbus-server:${{steps.application-version.outputs.tag}}
37+
uses: docker/login-action@v2
38+
with:
39+
username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
41+
- name: Build and push
42+
uses: docker/build-push-action@v4
43+
with:
44+
push: true
45+
context: .
46+
platforms: linux/amd64, linux/arm64
47+
tags: oitc/modbus-server:${{steps.application-version.outputs.tag}},oitc/modbus-server:latest

.github/workflows/container-image-build-validation.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ jobs:
1111
name: Build
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout GIT repository
15-
uses: actions/checkout@v3
16-
- name: Build container image
17-
run: |
18-
docker build . --file Dockerfile --tag container-build:test
14+
- name: Checkout GIT repository
15+
uses: actions/checkout@v3
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v2
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v2
20+
- name: Test build
21+
uses: docker/build-push-action@v4
22+
with:
23+
push: false
24+
context: .
25+
platforms: linux/amd64, linux/arm64
26+
tags: container-build:test

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LABEL site.local.os.version="3.17"
88
LABEL site.local.runtime.name="Python"
99
LABEL site.local.runtime.version="3.10.9"
1010
LABEL site.local.program.name="Python Modbus TCP Server"
11-
LABEL site.local.program.version="1.1.2"
11+
LABEL site.local.program.version="1.1.3"
1212

1313
RUN addgroup -g 1000 -S pythonuser \
1414
&& adduser -u 1000 -S pythonuser -G pythonuser \

app/modbus_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# default configuration file path
2121
config_file='/opt/modbus_server/etc/modbus_server.json'
22-
VERSION='1.1.2'
22+
VERSION='1.1.3'
2323
"""
2424
###############################################################################
2525
# F U N C T I O N S

0 commit comments

Comments
 (0)