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
|
||||
|
||||
jobs:
|
||||
buildx:
|
||||
build:
|
||||
name: Build Multi-Platform Image and Upload to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -19,32 +19,19 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: 'master'
|
||||
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
run: |
|
||||
# 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
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build and Push
|
||||
env:
|
||||
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
||||
run: |
|
||||
# Login
|
||||
docker login -u "$USERNAME" -p "$DOCKER_TOKEN"
|
||||
echo "$DOCKER_TOKEN" | docker login -u "$USERNAME" --password-stdin
|
||||
|
||||
# Setup build parameters
|
||||
BUILD_PARAMS="--platform="$PLATFORMS" --push"
|
||||
|
|
Loading…
Reference in a new issue