Skip to content

Commit

Permalink
Update Dockerfile paths and add recursive flag for hadolint (#381)
Browse files Browse the repository at this point in the history
* Update Dockerfile paths and add recursive flag for hadolint

* Update hadolint.yml to include recursive scanning

* Remove unused environment variable and update hadolint configuration

* Verify hadolint runs

* Remove unnecessary EXPOSE instruction

* Update branch restriction for push event
  • Loading branch information
hspaans authored Dec 26, 2023
1 parent c0a10a4 commit dae41de
Show file tree
Hide file tree
Showing 13 changed files with 221 additions and 6 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/container-release-debian-10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Container Release (Debian 10)

on:
push:
branches:
- master
paths:
- "debian-10/Dockerfile"
- ".github/workflows/container-release-debian-10.yml"
workflow_dispatch:

jobs:
build-release:
name: Build and Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
file: debian-10/Dockerfile
tags: ghcr.io/hspaans/molecule-containers:debian-10
43 changes: 43 additions & 0 deletions .github/workflows/container-release-debian-11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Container Release (Debian 11)

on:
push:
branches:
- master
paths:
- "debian-11/Dockerfile"
- ".github/workflows/container-release-debian-11.yml"
workflow_dispatch:

jobs:
build-release:
name: Build and Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
file: debian-11/Dockerfile
tags: ghcr.io/hspaans/molecule-containers:debian-11
43 changes: 43 additions & 0 deletions .github/workflows/container-release-debian-12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Container Release (Debian 12)

on:
push:
branches:
- master
paths:
- "debian-12/Dockerfile"
- ".github/workflows/container-release-debian-12.yml"
workflow_dispatch:

jobs:
build-release:
name: Build and Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
file: debian-12/Dockerfile
tags: ghcr.io/hspaans/molecule-containers:debian-12
43 changes: 43 additions & 0 deletions .github/workflows/container-release-ubuntu-2004.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Container Release (Ubuntu 20.04)

on:
push:
branches:
- master
paths:
- "ubuntu-20.04/Dockerfile"
- ".github/workflows/container-release-ubuntu-2004.yml"
workflow_dispatch:

jobs:
build-release:
name: Build and Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
file: ubuntu-20.04/Dockerfile
tags: ghcr.io/hspaans/molecule-containers:ubuntu-20.04
43 changes: 43 additions & 0 deletions .github/workflows/container-release-ubuntu-2204.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Container Release (Ubuntu 22.04)

on:
push:
branches:
- master
paths:
- "ubuntu-22.04/Dockerfile"
- ".github/workflows/container-release-ubuntu-2204.yml"
workflow_dispatch:

jobs:
build-release:
name: Build and Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
file: ubuntu-22.04/Dockerfile
tags: ghcr.io/hspaans/molecule-containers:ubuntu-22.04
4 changes: 2 additions & 2 deletions .github/workflows/container-release-ubuntu-2404.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches:
- master
paths:
- "Dockerfile.ubuntu-24.04"
- "ubuntu-24.04/Dockerfile"
- ".github/workflows/container-release-ubuntu-2404.yml"
workflow_dispatch:

Expand Down Expand Up @@ -39,5 +39,5 @@ jobs:
with:
platforms: linux/amd64,linux/arm64
push: true
file: Dockerfile.ubuntu-24.04
file: ubuntu-24.04/Dockerfile
tags: ghcr.io/hspaans/molecule-containers:ubuntu-24.04
8 changes: 4 additions & 4 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ name: Hadolint

on:
push:
branches: [ "master", "v*" ]
branches: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
branches: ["master"]
schedule:
- cron: '31 22 * * 1'
- cron: "31 22 * * 1"

permissions:
contents: read
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Run hadolint
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf
with:
dockerfile: ./Dockerfile
recursive: true
format: sarif
output-file: hadolint-results.sarif
no-fail: true
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit dae41de

Please sign in to comment.