Skip to content

Commit

Permalink
Add manifest build
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer committed Oct 22, 2021
1 parent 0028b68 commit 5e9d812
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 16 deletions.
66 changes: 57 additions & 9 deletions .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,36 @@ on:
push:
branches: [ main, dev ]
# paths:
# - 'Dockerfile'
# - './amd64/Dockerfile'
# - './i386/Dockerfile'
# - './armv6/Dockerfile'
# - './armv7/Dockerfile'
# - './arm64/Dockerfile'

jobs:
release:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- {
dir: amd64,
name: amd64,
docker-arch: linux/amd64
}
- {
dir: i386,
name: i386,
docker-arch: linux/i386
}
- {
dir: armv6,
name: armv6,
docker-arch: linux/arm/v6
}
- {
dir: armv7,
name: armv7,
docker-arch: linux/arm/v7
}
- {
dir: arm64,
name: arm64,
docker-arch: linux/arm64/v8
}
steps:
Expand Down Expand Up @@ -58,5 +62,49 @@ jobs:
password: ${{ secrets.DOCKER_HUB_SECRET }}

- name: Build Docker image and push to registries
working-directory: ./${{ matrix.arch.dir }}
run: docker buildx build --push --platform ${{ matrix.arch.docker-arch }} -t ghcr.io/compose-generator/compose-generator-toolbox:dev -t chillibits/compose-generator-toolbox:dev .
working-directory: ./${{ matrix.arch.name }}
run: |
docker buildx build --push --platform ${{ matrix.arch.docker-arch }} \
-t ghcr.io/compose-generator/compose-generator-toolbox:${{ matrix.arch.name }}-dev \
-t chillibits/compose-generator-toolbox:${{ matrix.arch.name }}-dev .
manifest:
runs-on: ubuntu-latest
needs: build
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Docker login GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Docker login Docker Hub
uses: docker/login-action@v1
with:
registry: docker.io
username: chillibits
password: ${{ secrets.DOCKER_HUB_SECRET }}

- name: Build manifest Docker Hub
run: |
docker manifest create chillibits/compose-generator-toolbox:dev \
chillibits/compose-generator-toolbox:amd64-dev \
chillibits/compose-generator-toolbox:i386-dev \
chillibits/compose-generator-toolbox:armv6-dev \
chillibits/compose-generator-toolbox:armv7-dev \
chillibits/compose-generator-toolbox:arm64-dev \
docker manifest push chillibits/compose-generator-toolbox:dev
- name: Build manifest DHCR
run: |
docker manifest create ghcr.io/chillibits/compose-generator-toolbox:dev \
ghcr.io/chillibits/compose-generator-toolbox:amd64-dev \
ghcr.io/chillibits/compose-generator-toolbox:i386-dev \
ghcr.io/chillibits/compose-generator-toolbox:armv6-dev \
ghcr.io/chillibits/compose-generator-toolbox:armv7-dev \
ghcr.io/chillibits/compose-generator-toolbox:arm64-dev \
docker manifest push ghcr.io/chillibits/compose-generator-toolbox:dev
94 changes: 91 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,31 @@ on:
- '*'

jobs:
release:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- {
name: amd64,
docker-arch: linux/amd64
}
- {
name: i386,
docker-arch: linux/i386
}
- {
name: armv6,
docker-arch: linux/arm/v6
}
- {
name: armv7,
docker-arch: linux/arm/v7
}
- {
name: arm64,
docker-arch: linux/arm64/v8
}
steps:
- name: Get version name
id: get_version
Expand Down Expand Up @@ -37,5 +60,70 @@ jobs:
username: chillibits
password: ${{ secrets.DOCKER_HUB_SECRET }}

- name: Build Docker image and push to registries # ToDo: ,linux/i386,linux/arm/v5,linux/arm/v6,linux/arm/v7,linux/arm64/v8
run: docker buildx build --push --platform linux/amd64 -t ghcr.io/compose-generator/compose-generator-toolbox:latest -t ghcr.io/compose-generator/compose-generator-toolbox:${{ steps.get_version.outputs.version }} -t chillibits/compose-generator-toolbox:latest -t chillibits/compose-generator-toolbox:${{ steps.get_version.outputs.version }} .
- name: Build Docker image and push to registries
working-directory: ./${{ matrix.arch.name }}
run: |
docker buildx build --push --platform ${{ matrix.arch.docker-arch }} \
-t ghcr.io/compose-generator/compose-generator-toolbox:${{ matrix.arch.name }}-${{ steps.get_version.outputs.version }} \
-t chillibits/compose-generator-toolbox:${{ matrix.arch.name }}-${{ steps.get_version.outputs.version }} .
manifest:
runs-on: ubuntu-latest
needs: build
steps:
- name: Get version name
id: get_version
uses: battila7/get-version-action@v2

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

- name: Docker login GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Docker login Docker Hub
uses: docker/login-action@v1
with:
registry: docker.io
username: chillibits
password: ${{ secrets.DOCKER_HUB_SECRET }}

- name: Build manifest Docker Hub
run: |
docker manifest create chillibits/compose-generator-toolbox:latest \
chillibits/compose-generator-toolbox:amd64-${{ steps.get_version.outputs.version }} \
chillibits/compose-generator-toolbox:i386-${{ steps.get_version.outputs.version }} \
chillibits/compose-generator-toolbox:armv6-${{ steps.get_version.outputs.version }} \
chillibits/compose-generator-toolbox:armv7-${{ steps.get_version.outputs.version }} \
chillibits/compose-generator-toolbox:arm64-${{ steps.get_version.outputs.version }} \
docker manifest push chillibits/compose-generator-toolbox:latest
docker manifest create chillibits/compose-generator-toolbox:${{ steps.get_version.outputs.version }} \
chillibits/compose-generator-toolbox:amd64-${{ steps.get_version.outputs.version }} \
chillibits/compose-generator-toolbox:i386-${{ steps.get_version.outputs.version }} \
chillibits/compose-generator-toolbox:armv6-${{ steps.get_version.outputs.version }} \
chillibits/compose-generator-toolbox:armv7-${{ steps.get_version.outputs.version }} \
chillibits/compose-generator-toolbox:arm64-${{ steps.get_version.outputs.version }} \
docker manifest push chillibits/compose-generator-toolbox:${{ steps.get_version.outputs.version }}
- name: Build manifest DHCR
run: |
docker manifest create ghcr.io/chillibits/compose-generator-toolbox:latest \
ghcr.io/chillibits/compose-generator-toolbox:amd64-${{ steps.get_version.outputs.version }} \
ghcr.io/chillibits/compose-generator-toolbox:i386-${{ steps.get_version.outputs.version }} \
ghcr.io/chillibits/compose-generator-toolbox:armv6-${{ steps.get_version.outputs.version }} \
ghcr.io/chillibits/compose-generator-toolbox:armv7-${{ steps.get_version.outputs.version }} \
ghcr.io/chillibits/compose-generator-toolbox:arm64-${{ steps.get_version.outputs.version }} \
docker manifest push ghcr.io/chillibits/compose-generator-toolbox:latest
docker manifest create ghcr.io/chillibits/compose-generator-toolbox:${{ steps.get_version.outputs.version }} \
ghcr.io/chillibits/compose-generator-toolbox:amd64-${{ steps.get_version.outputs.version }} \
ghcr.io/chillibits/compose-generator-toolbox:i386-${{ steps.get_version.outputs.version }} \
ghcr.io/chillibits/compose-generator-toolbox:armv6-${{ steps.get_version.outputs.version }} \
ghcr.io/chillibits/compose-generator-toolbox:armv7-${{ steps.get_version.outputs.version }} \
ghcr.io/chillibits/compose-generator-toolbox:arm64-${{ steps.get_version.outputs.version }} \
docker manifest push ghcr.io/chillibits/compose-generator-toolbox:${{ steps.get_version.outputs.version }}
8 changes: 6 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: Dockerfile Validation

on:
push:
paths:
- 'Dockerfile'
# paths:
# - './amd64/Dockerfile'
# - './i386/Dockerfile'
# - './armv6/Dockerfile'
# - './armv7/Dockerfile'
# - './arm64/Dockerfile'

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Please note, that this Docker image is based on Linux Alpine and only supports a
- create-react-app
- curl
- django-admin
- dotnet
- dotnet (not for armv6, armv7, arm64)
- git
- go
- go (not for i386)
- make
- ng
- npm
Expand Down

0 comments on commit 5e9d812

Please sign in to comment.