automating multi-platform builds
This commit is contained in:
parent
fa0997486f
commit
0e5a4f7cf7
1 changed files with 22 additions and 39 deletions
35
.github/workflows/docker-autobuild.yml
vendored
35
.github/workflows/docker-autobuild.yml
vendored
|
@ -4,35 +4,21 @@ on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-upload:
|
buildx:
|
||||||
name: Build Muilti-Platform Image and Upload to Docker Hub
|
name: Build Muilti-Platform Image and Upload to Docker Hub
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
|
||||||
name: Build Docker buildx
|
|
||||||
run: |
|
|
||||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
|
||||||
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
|
|
||||||
|
|
||||||
-
|
|
||||||
name: Docker Version
|
|
||||||
run: |
|
|
||||||
echo "DOCKER VERSION:"
|
|
||||||
docker version
|
|
||||||
echo "BUILDX VERSION:"
|
|
||||||
docker buildx version
|
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Checkout Repo
|
name: Checkout Repo
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Create Builder Instance
|
name: Setup Docker Buildx
|
||||||
run: |
|
uses: crazy-max/ghaction-docker-buildx@v1
|
||||||
docker run --rm --privileged docker/binfmt:66f9012c56a8316f9244ffd7622d7c21c1f6f28d
|
|
||||||
docker buildx create --use --name mybuilder
|
-
|
||||||
|
name: Available Platforms
|
||||||
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Build and Upload
|
name: Build and Upload
|
||||||
|
@ -43,11 +29,8 @@ jobs:
|
||||||
TAG=$(date +%y.%m)
|
TAG=$(date +%y.%m)
|
||||||
NAME=silentdigit/letsencrypt
|
NAME=silentdigit/letsencrypt
|
||||||
|
|
||||||
# Build image
|
|
||||||
docker build --tag ${NAME}:${TAG} .
|
|
||||||
|
|
||||||
# Build image as TAG version
|
# Build image as TAG version
|
||||||
docker buildx build -t ${NAME}:${TAG} --platform=linux/arm,linux/arm64,linux/amd64 . --push
|
docker buildx build -t ${NAME}:${TAG} --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x --push .
|
||||||
|
|
||||||
# Build image as latest version
|
# Build image as latest version
|
||||||
docker buildx build -t ${NAME}:latest --platform=linux/arm,linux/arm64,linux/amd64 . --push
|
docker buildx build -t ${NAME}:latest --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x --push .
|
||||||
|
|
Loading…
Reference in a new issue