updated buildx tasks for faster builds
This commit is contained in:
parent
06670f4a2d
commit
52ba8cfd60
1 changed files with 6 additions and 19 deletions
25
.github/workflows/docker-build.yml
vendored
25
.github/workflows/docker-build.yml
vendored
|
@ -11,7 +11,7 @@ env:
|
||||||
PLATFORMS: linux/arm/v7,linux/arm64,linux/amd64
|
PLATFORMS: linux/arm/v7,linux/arm64,linux/amd64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
buildx:
|
build:
|
||||||
name: Build Multi-Platform Image and Upload to Docker Hub
|
name: Build Multi-Platform Image and Upload to Docker Hub
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -20,31 +20,18 @@ jobs:
|
||||||
with:
|
with:
|
||||||
ref: 'master'
|
ref: 'master'
|
||||||
|
|
||||||
|
- name: Setup QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
run: |
|
uses: docker/setup-buildx-action@v1
|
||||||
# Build docker buildx from source
|
|
||||||
export DOCKER_BUILDKIT=1
|
|
||||||
docker build --platform=local -o . git://github.com/docker/buildx
|
|
||||||
mkdir -p ~/.docker/cli-plugins
|
|
||||||
mv buildx ~/.docker/cli-plugins/docker-buildx
|
|
||||||
|
|
||||||
# Docker version information
|
|
||||||
echo "DOCKER VERSION:"
|
|
||||||
docker info
|
|
||||||
echo "BUILDX VERSION:"
|
|
||||||
docker buildx version
|
|
||||||
|
|
||||||
# Install qemu-user-static container
|
|
||||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
||||||
docker buildx create --name builder --driver docker-container --use
|
|
||||||
docker buildx inspect --bootstrap
|
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
env:
|
env:
|
||||||
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
# Login
|
# Login
|
||||||
docker login -u "$USERNAME" -p "$DOCKER_TOKEN"
|
echo "$DOCKER_TOKEN" | docker login -u "$USERNAME" --password-stdin
|
||||||
|
|
||||||
# Setup build parameters
|
# Setup build parameters
|
||||||
BUILD_PARAMS="--platform="$PLATFORMS" --push"
|
BUILD_PARAMS="--platform="$PLATFORMS" --push"
|
||||||
|
|
Loading…
Reference in a new issue