mirror of
https://github.com/docker/build-push-action.git
synced 2026-03-06 07:53:07 +08:00
remove legacy export-build tool support
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
1d41182205
commit
61cac19eba
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
@ -1464,35 +1464,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DOCKER_BUILD_RECORD_RETENTION_DAYS: ${{ matrix.days }}
|
DOCKER_BUILD_RECORD_RETENTION_DAYS: ${{ matrix.days }}
|
||||||
|
|
||||||
export-legacy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
legacy:
|
|
||||||
- false
|
|
||||||
- true
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
path: action
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
|
||||||
driver-opts: |
|
|
||||||
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
|
||||||
-
|
|
||||||
name: Build
|
|
||||||
uses: ./action
|
|
||||||
with:
|
|
||||||
file: ./test/Dockerfile
|
|
||||||
env:
|
|
||||||
DOCKER_BUILD_EXPORT_LEGACY: ${{ matrix.legacy }}
|
|
||||||
|
|
||||||
checks:
|
checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
@ -277,7 +277,6 @@ The following outputs are available:
|
|||||||
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
|
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
|
||||||
| `DOCKER_BUILD_RECORD_UPLOAD` | Bool | `true` | If `false`, build record upload as [GitHub artifact](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts) is disabled |
|
| `DOCKER_BUILD_RECORD_UPLOAD` | Bool | `true` | If `false`, build record upload as [GitHub artifact](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts) is disabled |
|
||||||
| `DOCKER_BUILD_RECORD_RETENTION_DAYS` | Number | | Duration after which build record artifact will expire in days. Defaults to repository/org [retention settings](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy) if unset or `0` |
|
| `DOCKER_BUILD_RECORD_RETENTION_DAYS` | Number | | Duration after which build record artifact will expire in days. Defaults to repository/org [retention settings](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy) if unset or `0` |
|
||||||
| `DOCKER_BUILD_EXPORT_LEGACY` | Bool | `false` | If `true`, exports build using legacy export-build tool instead of [`buildx history export` command](https://docs.docker.com/reference/cli/docker/buildx/history/export/) |
|
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
|
|||||||
14
src/main.ts
14
src/main.ts
@ -175,8 +175,8 @@ actionsToolkit.run(
|
|||||||
core.info(`Build summary skipped for ${inputs.call} subrequest`);
|
core.info(`Build summary skipped for ${inputs.call} subrequest`);
|
||||||
} else if (GitHub.isGHES) {
|
} else if (GitHub.isGHES) {
|
||||||
core.info('Build summary is not yet supported on GHES');
|
core.info('Build summary is not yet supported on GHES');
|
||||||
} else if (!(await toolkit.buildx.versionSatisfies('>=0.13.0'))) {
|
} else if (!(await toolkit.buildx.versionSatisfies('>=0.23.0'))) {
|
||||||
core.info('Build summary requires Buildx >= 0.13.0');
|
core.info('Build summary requires Buildx >= 0.23.0');
|
||||||
} else if (!ref) {
|
} else if (!ref) {
|
||||||
core.info('Build summary requires a build reference');
|
core.info('Build summary requires a build reference');
|
||||||
} else {
|
} else {
|
||||||
@ -202,8 +202,7 @@ actionsToolkit.run(
|
|||||||
|
|
||||||
const buildxHistory = new BuildxHistory();
|
const buildxHistory = new BuildxHistory();
|
||||||
const exportRes = await buildxHistory.export({
|
const exportRes = await buildxHistory.export({
|
||||||
refs: stateHelper.buildRef ? [stateHelper.buildRef] : [],
|
refs: stateHelper.buildRef ? [stateHelper.buildRef] : []
|
||||||
useContainer: buildExportLegacy()
|
|
||||||
});
|
});
|
||||||
core.info(`Build record written to ${exportRes.dockerbuildFilename} (${Util.formatFileSize(exportRes.dockerbuildSize)})`);
|
core.info(`Build record written to ${exportRes.dockerbuildFilename} (${Util.formatFileSize(exportRes.dockerbuildSize)})`);
|
||||||
|
|
||||||
@ -298,10 +297,3 @@ function buildRecordRetentionDays(): number | undefined {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildExportLegacy(): boolean {
|
|
||||||
if (process.env.DOCKER_BUILD_EXPORT_LEGACY) {
|
|
||||||
return Util.parseBool(process.env.DOCKER_BUILD_EXPORT_LEGACY);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user