mirror of
https://github.com/docker/build-push-action.git
synced 2025-06-14 23:27:12 +02:00
Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
ca877d9245 | |||
d2fe919bb5 | |||
f0fc9ece82 | |||
67a2d409c0 | |||
0b1b1c9c43 | |||
b6a7c2c4ee | |||
31ca4e5d51 | |||
e613db9d5a | |||
b32b51a8ed | |||
594bf46f0f | |||
fd37bd55af | |||
e6478a2405 | |||
78785bddff | |||
128779fed7 | |||
7e094594be | |||
32ee877a58 | |||
d1a4129c41 | |||
49c623eaf8 | |||
bcc9f4afe7 | |||
da5b6c75b9 | |||
11be14d908 | |||
f5a8591a7f | |||
8796455d32 | |||
750f367828 |
3
.github/workflows/.e2e-run.yml
vendored
3
.github/workflows/.e2e-run.yml
vendored
@ -65,10 +65,11 @@ jobs:
|
||||
if: inputs.type == 'local'
|
||||
run: |
|
||||
if [ ! -e /etc/docker/daemon.json ]; then
|
||||
echo '{}' | tee /etc/docker/daemon.json >/dev/null
|
||||
echo '{}' | sudo tee /etc/docker/daemon.json >/dev/null
|
||||
fi
|
||||
DOCKERD_CONFIG=$(jq '.+{"insecure-registries":["http://${{ env.REGISTRY_FQDN }}"]}' /etc/docker/daemon.json)
|
||||
sudo tee /etc/docker/daemon.json <<<"$DOCKERD_CONFIG" >/dev/null
|
||||
cat /etc/docker/daemon.json
|
||||
sudo service docker restart
|
||||
-
|
||||
name: Install ${{ inputs.name }}
|
||||
|
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@ -15,12 +15,9 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: test
|
||||
-
|
||||
|
16
.github/workflows/validate.yml
vendored
16
.github/workflows/validate.yml
vendored
@ -15,16 +15,17 @@ jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets: ${{ steps.targets.outputs.matrix }}
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Targets matrix
|
||||
id: targets
|
||||
run: |
|
||||
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
|
||||
name: List targets
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/list-targets@v6
|
||||
with:
|
||||
target: validate
|
||||
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
@ -35,11 +36,8 @@ jobs:
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
24
README.md
24
README.md
@ -60,18 +60,18 @@ jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
@ -132,18 +132,18 @@ jobs:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
|
24
dist/index.js
generated
vendored
24
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -1,3 +1,9 @@
|
||||
target "_common" {
|
||||
args = {
|
||||
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||
}
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["build"]
|
||||
}
|
||||
@ -11,42 +17,49 @@ group "validate" {
|
||||
}
|
||||
|
||||
target "build" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "build-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "format" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "format-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "lint" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "lint"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "vendor" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "vendor-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "test" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test-coverage"
|
||||
output = ["./coverage"]
|
||||
|
@ -27,7 +27,7 @@
|
||||
"packageManager": "yarn@3.6.3",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.11.1",
|
||||
"@docker/actions-toolkit": "0.46.0",
|
||||
"@docker/actions-toolkit": "0.53.0",
|
||||
"handlebars": "^4.7.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -132,7 +132,12 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
|
||||
});
|
||||
if (await toolkit.buildx.versionSatisfies('>=0.8.0')) {
|
||||
await Util.asyncForEach(inputs['build-contexts'], async buildContext => {
|
||||
args.push('--build-context', buildContext);
|
||||
args.push(
|
||||
'--build-context',
|
||||
handlebars.compile(buildContext)({
|
||||
defaultContext: Context.gitContext()
|
||||
})
|
||||
);
|
||||
});
|
||||
} else if (inputs['build-contexts'].length > 0) {
|
||||
core.warning("Build contexts are only supported by buildx >= 0.8.0; the input 'build-contexts' is ignored.");
|
||||
|
@ -1,5 +1,6 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM --platform=$BUILDPLATFORM golang:alpine AS build
|
||||
|
||||
FROM --platform=$BUILDPLATFORM alpine AS build
|
||||
ARG TARGETPLATFORM
|
||||
ARG BUILDPLATFORM
|
||||
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
|
||||
@ -12,7 +13,7 @@ RUN apk --update --no-cache add \
|
||||
&& rm -rf /tmp/* /var/cache/apk/*
|
||||
|
||||
USER buildx
|
||||
RUN sudo chown buildx. /log
|
||||
RUN sudo chown buildx: /log
|
||||
USER root
|
||||
|
||||
FROM alpine
|
||||
|
56
yarn.lock
56
yarn.lock
@ -12,9 +12,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@actions/artifact@npm:^2.1.11":
|
||||
version: 2.1.11
|
||||
resolution: "@actions/artifact@npm:2.1.11"
|
||||
"@actions/artifact@npm:^2.2.1":
|
||||
version: 2.2.1
|
||||
resolution: "@actions/artifact@npm:2.2.1"
|
||||
dependencies:
|
||||
"@actions/core": ^1.10.0
|
||||
"@actions/github": ^5.1.1
|
||||
@ -29,13 +29,13 @@ __metadata:
|
||||
jwt-decode: ^3.1.2
|
||||
twirp-ts: ^2.5.0
|
||||
unzip-stream: ^0.3.1
|
||||
checksum: dbdafaad11cc573768a00f6b8a7f5109f587eb9461564ae8f15ea8fd1d6a719041df45a92ec204a43a8a1e7ce2c21d8e4229543579b89a3ca8ea30dedddf2fc9
|
||||
checksum: 6ce4e62d941f17743c845637cdd832ca34c77efe0c31cf7f6ab3ad0531e54e62d4379198e8af5e84463b5f5ae0bc0ea11d41cc77c5fae7e511c7ef01742892ea
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@actions/cache@npm:^3.3.0":
|
||||
version: 3.3.0
|
||||
resolution: "@actions/cache@npm:3.3.0"
|
||||
"@actions/cache@npm:^4.0.0":
|
||||
version: 4.0.0
|
||||
resolution: "@actions/cache@npm:4.0.0"
|
||||
dependencies:
|
||||
"@actions/core": ^1.11.1
|
||||
"@actions/exec": ^1.0.1
|
||||
@ -45,8 +45,10 @@ __metadata:
|
||||
"@azure/abort-controller": ^1.1.0
|
||||
"@azure/ms-rest-js": ^2.6.0
|
||||
"@azure/storage-blob": ^12.13.0
|
||||
"@protobuf-ts/plugin": ^2.9.4
|
||||
semver: ^6.3.1
|
||||
checksum: f0761b1491b7706a80b44d68ed52eb48c04653fc939525a7c7b606e9d9251c40c7e4ac20846ab92ac32db6869e1a6f0f574bd6b7fec1ab9378c8e199c5acc9c9
|
||||
twirp-ts: ^2.5.0
|
||||
checksum: 8ab819a67b578a5ce6de984f4ef8420066f8270e1f9db053700f4a8f084d0bbe4f911114f7088a95a987372ea63078550355d99849412152dd0efdf688bf9144
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -140,17 +142,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@actions/tool-cache@npm:^2.0.1":
|
||||
version: 2.0.1
|
||||
resolution: "@actions/tool-cache@npm:2.0.1"
|
||||
"@actions/tool-cache@npm:^2.0.2":
|
||||
version: 2.0.2
|
||||
resolution: "@actions/tool-cache@npm:2.0.2"
|
||||
dependencies:
|
||||
"@actions/core": ^1.2.6
|
||||
"@actions/core": ^1.11.1
|
||||
"@actions/exec": ^1.0.0
|
||||
"@actions/http-client": ^2.0.1
|
||||
"@actions/io": ^1.1.1
|
||||
semver: ^6.1.0
|
||||
uuid: ^3.3.2
|
||||
checksum: 33f6393b9b163e4af2b9759e8d37cda4f018f10ddda3643355bb8a9f92d732e5bdff089cf8036b46d181e1ef2b3210b895b2f746fdf54487afe88f1d340aa9e1
|
||||
checksum: c2bab4297be752bdda9dd61f8159a201ad0d37d026134b960f1edcc9418a80387f44d1f24a070fe992c44dcfc28a152f70600e76669bb0578132789a6f37a596
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -1073,18 +1074,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@docker/actions-toolkit@npm:0.46.0":
|
||||
version: 0.46.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.46.0"
|
||||
"@docker/actions-toolkit@npm:0.53.0":
|
||||
version: 0.53.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.53.0"
|
||||
dependencies:
|
||||
"@actions/artifact": ^2.1.11
|
||||
"@actions/cache": ^3.3.0
|
||||
"@actions/artifact": ^2.2.1
|
||||
"@actions/cache": ^4.0.0
|
||||
"@actions/core": ^1.11.1
|
||||
"@actions/exec": ^1.1.1
|
||||
"@actions/github": ^6.0.0
|
||||
"@actions/http-client": ^2.2.3
|
||||
"@actions/io": ^1.1.3
|
||||
"@actions/tool-cache": ^2.0.1
|
||||
"@actions/tool-cache": ^2.0.2
|
||||
"@azure/storage-blob": ^12.15.0
|
||||
"@octokit/core": ^5.1.0
|
||||
"@octokit/plugin-rest-endpoint-methods": ^10.4.0
|
||||
@ -1098,7 +1099,7 @@ __metadata:
|
||||
semver: ^7.6.3
|
||||
tar-stream: ^3.1.7
|
||||
tmp: ^0.2.3
|
||||
checksum: cd34682d1b801c17c81f7f6791c4c81a69018f02413a1f7a7c2c1086bf0ee98c9afb5b44e6d5b8827df188819913eec47fa5b54b63f522b4a87c216de0b5725f
|
||||
checksum: 9b14d8e0d17cbf52a38e66e85c1d04f599a64633aaaac550f9dcbed51567f7cc2c36ad2c748884fecf3355f25dc05b783e500e621014f43348a776f5433de927
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -1901,7 +1902,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@protobuf-ts/plugin@npm:^2.2.3-alpha.1":
|
||||
"@protobuf-ts/plugin@npm:^2.2.3-alpha.1, @protobuf-ts/plugin@npm:^2.9.4":
|
||||
version: 2.9.4
|
||||
resolution: "@protobuf-ts/plugin@npm:2.9.4"
|
||||
dependencies:
|
||||
@ -3161,7 +3162,7 @@ __metadata:
|
||||
resolution: "docker-build-push@workspace:."
|
||||
dependencies:
|
||||
"@actions/core": ^1.11.1
|
||||
"@docker/actions-toolkit": 0.46.0
|
||||
"@docker/actions-toolkit": 0.53.0
|
||||
"@types/node": ^20.12.12
|
||||
"@typescript-eslint/eslint-plugin": ^7.9.0
|
||||
"@typescript-eslint/parser": ^7.9.0
|
||||
@ -6624,15 +6625,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"uuid@npm:^3.3.2":
|
||||
version: 3.4.0
|
||||
resolution: "uuid@npm:3.4.0"
|
||||
bin:
|
||||
uuid: ./bin/uuid
|
||||
checksum: 58de2feed61c59060b40f8203c0e4ed7fd6f99d42534a499f1741218a1dd0c129f4aa1de797bcf822c8ea5da7e4137aa3673431a96dae729047f7aca7b27866f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"uuid@npm:^8.3.0, uuid@npm:^8.3.2":
|
||||
version: 8.3.2
|
||||
resolution: "uuid@npm:8.3.2"
|
||||
|
Reference in New Issue
Block a user