Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ env:
DOCKER_IMAGE: wyrihaximusnet/php
DOCKER_BUILDKIT: 1
DOCKER_IMAGE_REGISTRIES_SECRET_MAPPING: '{"ghcr.io":"GHCR_TOKEN","docker.io":"HUB_PASSCODE"}'
DOCKER_CLI_EXPERIMENTAL: enabled
on:
push:
branches:
Expand Down Expand Up @@ -129,6 +130,12 @@ jobs:
image: ${{ fromJson(needs.image-matrix.outputs.image) }}
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v3
with:
buildx-version: latest
qemu-version: latest
- run: mkdir ./docker-image/
- run: ./build-php.sh $(echo "${{ matrix.image }}" | tr '-' ' ')
- run: cat ./docker-image/image.tags | xargs -I % docker inspect --format='%={{.Id}}:{{index .Config.Env 7}}' %
Expand Down
11 changes: 10 additions & 1 deletion build-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,19 @@ declare -a target=(
"-slim-dev-root"
)

declare -a arch=(
"linux/amd64"
"linux/arm64"
"linux/arm/v7"
)

docker pull "php:${IMAGE_TAG}"

for buildTarget in "${target[@]}"
do
sed -E "s/${IMAGE_ORIGINAL_TAG}/${IMAGE_TAG}/g" "Dockerfile-${DST_IMAGE}-${OS}" | docker build --label org.label-schema.build-date=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --label org.label-schema.vcs-ref=`git rev-parse --short HEAD` -t "${WYRIHAXIMUSNET_TAG}${buildTarget}" --target="${DST_IMAGE}${buildTarget}" -f - .
for buildArch in "${arch[@]}"
do
sed -E "s/${IMAGE_ORIGINAL_TAG}/${IMAGE_TAG}/g" "Dockerfile-${DST_IMAGE}-${OS}" | docker buildx build --platform "${buildArch}" --output "type=docker" --label org.label-schema.build-date=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --label org.label-schema.vcs-ref=`git rev-parse --short HEAD` -t "${WYRIHAXIMUSNET_TAG}${buildTarget}" --target="${DST_IMAGE}${buildTarget}" -f - .
done
echo "${WYRIHAXIMUSNET_TAG}${buildTarget}" >> "$TAG_FILE"
done