summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiaan van Stijn <thaJeztah@users.noreply.github.com>2023-05-11 18:07:35 +0200
committerGitHub <noreply@github.com>2023-05-11 18:07:35 +0200
commit9983d896defb758e450112e69434006358e7310c (patch)
tree696c368e38fb23a2514ef1d139f460d86386d72a
parent7c43e8c45a39ef0ee08c32d02ed2a5bca9697c8a (diff)
parent135d8f04f9e2845b995a24d343c5cc76dd6efce0 (diff)
downloaddocker-9983d896defb758e450112e69434006358e7310c.tar.gz
Merge pull request #45519 from crazy-max/bin-image
bin-image bake target
-rw-r--r--.github/workflows/bin-image.yml72
-rw-r--r--docker-bake.hcl28
2 files changed, 100 insertions, 0 deletions
diff --git a/.github/workflows/bin-image.yml b/.github/workflows/bin-image.yml
new file mode 100644
index 0000000000..f8992042cf
--- /dev/null
+++ b/.github/workflows/bin-image.yml
@@ -0,0 +1,72 @@
+name: bin-image
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - 'master'
+ - '[0-9]+.[0-9]+'
+ tags:
+ - 'v*'
+ pull_request:
+
+env:
+ PLATFORM: Moby Engine
+ PRODUCT: Moby
+ DEFAULT_PRODUCT_LICENSE: Moby
+ PACKAGER_NAME: Moby
+
+jobs:
+ validate-dco:
+ uses: ./.github/workflows/.dco.yml
+
+ build:
+ runs-on: ubuntu-20.04
+ needs:
+ - validate-dco
+ steps:
+ -
+ name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ -
+ name: Docker meta
+ id: meta
+ uses: docker/metadata-action@v4
+ with:
+ images: moby-bin
+ ### versioning strategy
+ ## push semver tag v23.0.0
+ # moby/moby-bin:23.0.0
+ # moby/moby-bin:latest
+ ## push semver prelease tag v23.0.0-beta.1
+ # moby/moby-bin:23.0.0-beta.1
+ ## push on master
+ # moby/moby-bin:master
+ ## push on 23.0 branch
+ # moby/moby-bin:23.0
+ tags: |
+ type=semver,pattern={{version}}
+ type=ref,event=branch
+ type=ref,event=pr
+ -
+ name: Set up QEMU
+ uses: docker/setup-qemu-action@v2
+ -
+ name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v2
+ -
+ name: Build
+ uses: docker/bake-action@v2
+ with:
+ files: |
+ ./docker-bake.hcl
+ ${{ steps.meta.outputs.bake-file }}
+ targets: bin-image-cross
+ set: |
+ *.output=type=cacheonly
diff --git a/docker-bake.hcl b/docker-bake.hcl
index 899551f9e4..0eb078aebc 100644
--- a/docker-bake.hcl
+++ b/docker-bake.hcl
@@ -59,6 +59,11 @@ variable "GITHUB_SHA" {
default = ""
}
+# Special target: https://github.com/docker/metadata-action#bake-definition
+target "docker-metadata-action" {
+ tags = ["moby-bin:local"]
+}
+
# Defines the output folder
variable "DESTDIR" {
default = ""
@@ -153,6 +158,29 @@ target "all-cross" {
}
#
+# bin image
+#
+
+target "bin-image" {
+ inherits = ["all", "docker-metadata-action"]
+ output = ["type=docker"]
+}
+
+target "bin-image-cross" {
+ inherits = ["bin-image"]
+ output = ["type=image"]
+ platforms = [
+ "linux/amd64",
+ "linux/arm/v6",
+ "linux/arm/v7",
+ "linux/arm64",
+ "linux/ppc64le",
+ "linux/s390x",
+ "windows/amd64"
+ ]
+}
+
+#
# dev
#