Skip to content

Commit 62c0f94

Browse files
authored
dec-18 lint and prepare multi arch for docker file (#8)
1 parent f4f51c4 commit 62c0f94

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

.github/workflows/docker-pipeline.yaml

+34-5
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,43 @@ run-name: ${{ github.actor }} docker pipeline
55
on:
66
push:
77
branches:
8-
- "*"
8+
- "create-github-pipeline-for-docker"
9+
- "main"
910
pull_request:
1011

1112
jobs:
1213
lint:
1314
name: lint dockerfiles
14-
runs-on: ubuntu-test
15+
runs-on: [ubuntu-latest]
1516
steps:
16-
- name: Checkout Code
17-
uses: actions/checkout@v3
18-
17+
- name: Checkout Code
18+
uses: actions/checkout@v3
19+
- name: Install hadolint
20+
run: |
21+
sudo wget -O /usr/local/bin/hadolint \
22+
https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64
23+
sudo chmod +x /usr/local/bin/hadolint
24+
- name: Find and Lint Dockerfiles
25+
run: |
26+
find . -name "Dockerfile" | while read dockerfile; do
27+
echo "Linting $dockerfile"
28+
hadolint "$dockerfile" || echo "Warnings found in $dockerfile"
29+
done
30+
build:
31+
name: Build multi arch docker image
32+
runs-on: [ubuntu-latest]
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v3
36+
37+
- name: Set up QEMU for multi-arch build
38+
uses: docker/setup-qemu-action@v2
39+
with:
40+
platforms: "linux/amd64,linux/arm64"
41+
42+
- name: Setup docker buildx
43+
uses: docker/setup-buildx-action@v2
44+
45+
46+
47+

0 commit comments

Comments
 (0)