2859 Commits

Author SHA1 Message Date
Tonis Tiigi
72c3d4a237
bake: make FS entitlements error by default
Change FS entitlements checks from warning to error
by default as expressed in initial PR. Users can still
opt-out with environment variable if the choose to.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-19 17:14:35 -08:00
Tõnis Tiigi
5c5bc510ac
Merge pull request #2848 from jsternberg/bake-composable-attributes-attests
bake: implement composable attributes for attestations
2024-12-18 13:11:50 -08:00
Tõnis Tiigi
0dfc4a1019
Merge pull request #2871 from jsternberg/bake-empty-variable-tests
bake: test empty override
2024-12-18 11:00:49 -08:00
Jonathan A. Sternberg
1e992b295c
bake: test empty override
Co-authored-by: CrazyMax <github@crazymax.dev>
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-12-18 11:56:19 -06:00
Jonathan A. Sternberg
4f81bcb5c8
bake: implement composable attributes for attestations
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-12-18 11:48:50 -06:00
Tõnis Tiigi
3771fe2034
Merge pull request #2814 from jsternberg/bake-composable-attributes-phase2
bake: various fixes for composable attributes
2024-12-18 09:35:35 -08:00
Jonathan A. Sternberg
5dd4ae0335
bake: various fixes for composable attributes
This changes how the composable attributes are implemented and provides
various fixes to the first iteration.

Cache-from and cache-to now no longer print sensitive values that are
automatically added. These automatically added attributes are added when
the protobuf is created rather than at the time of parsing so they will
no longer be printed. If they are part of the original configuration
file, they will still be printed.

Empty strings will now be skipped. This was the original behavior and
composable attributes removed this functionality accidentally. This
functionality is now restored.

This also expands the available syntax that works with each of the
composable attributes. It is now possible to interleave the csv syntax
with the object syntax without any problems. The canonical form is still
the object syntax and variables are resolved according to that syntax.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-12-18 10:26:15 -06:00
CrazyMax
567361d494
Merge pull request #2847 from thaJeztah/vendor_docker
vendor: github.com/docker/docker, github.com/docker/cli v27.4.0
2024-12-17 11:37:55 +01:00
CrazyMax
21b1be1667
Merge pull request #2860 from tonistiigi/entitlements-path-validation-fix
bake: change evaluation of entitlement paths
2024-12-17 10:01:35 +01:00
CrazyMax
876e003685
Merge pull request #2865 from tonistiigi/update-buildkit-v0.18.2
update test BuildKit to v0.18.2
2024-12-17 09:59:27 +01:00
Tonis Tiigi
a53ed0a354
add additional test coverage for FS entitlement paths
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-16 22:29:35 -08:00
Tonis Tiigi
737da6959d
bake: change evaluation of entitlement paths
Currently, to compare the local path used by bake against the paths allowed
by entitlements, symlinks were evaluated for path normalization so that the
local path used by build was allowed to not exist while the path allowed by
entitlement needed to exist. If the path used by the build did not exist,
then the deepest existing parent path was used instead. This was concistent
with entitlement rules as that parent path would be the actual path access
is needed.

This raised an issue with `--set` if one provides a non-existing path as
an argument, as these paths are supposed to be allowed automatically. With
the above restrictions set to allowed paths, this meant the build would fail
as it can't grant entitlement to the non-existing paths.

This changes the evaluation logic for allowing paths so that they do not
need to exist. If such a case appears, then the path is evaluated to the
last component that exists, and then the rest of the path is appended as is.

This means that for example, if `output = /tmp/out/foo/` is set in HCL
and `/tmp` is the last component that exists then invoking build with
`--allow fs.write=/tmp/out/foo` will not fail with stat error anymore
but will fail in entitlements validation as build would also need to
write `/tmp/out` that is not inside the allowed `/tmp/out/foo` path. The
same would apply to `--set` as well so that if it points to
a non-existing path, then an additional `--allow` rule is needed
providing access to writing to the last existing component of that path.
This may or may not be unexpected.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-16 22:29:24 -08:00
Tonis Tiigi
6befa70cc8
update test BuildKit to v0.18.2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-16 15:47:45 -08:00
Sebastiaan van Stijn
2d051bde96
vendor: github.com/docker/cli v27.4.0
full diff: https://github.com/docker/cli/compare/v27.4.0-rc.2...v27.4.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 22:14:30 +01:00
Sebastiaan van Stijn
63985b591b
vendor: github.com/docker/docker v27.4.0
full diff: https://github.com/docker/docker/compare/v27.4.0-rc.2...v27.4.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 22:14:30 +01:00
CrazyMax
695200c81a
Merge pull request #2857 from ndeloof/bump
bump compose-go v2.4.6
2024-12-16 11:57:12 +01:00
Nicolas De Loof
828c1dbf98
bump compose-go v2.4.6
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-12-16 11:46:05 +01:00
CrazyMax
f321d4ac95
Merge pull request #2854 from docker/dependabot/github_actions/softprops/action-gh-release-2.2.0
build(deps): bump softprops/action-gh-release from 2.1.0 to 2.2.0
2024-12-16 10:17:42 +01:00
dependabot[bot]
0d13bf6606
build(deps): bump softprops/action-gh-release from 2.1.0 to 2.2.0
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](01570a1f39...7b4da11513)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-11 18:19:22 +00:00
Tõnis Tiigi
3e3242cfdd
Merge pull request #2851 from crazy-max/dockerfile-pin-alpine
dockerfiles: pin alpine version
2024-12-10 10:47:04 -08:00
CrazyMax
f9e2d07b30
Merge pull request #2830 from thaJeztah/bump_engine_27.4
Dockerfile: update to docker v27.4.0
2024-12-10 15:29:27 +01:00
Sebastiaan van Stijn
c281e18892
Dockerfile: update to docker v27.4.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-10 10:56:06 +01:00
CrazyMax
98d4cb1eb3
dockerfiles: pin alpine version
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-12-10 10:25:50 +01:00
CrazyMax
70f2fb6442
Merge pull request #2849 from tonistiigi/update-xx-v1.6.0
update xx to v1.6.1
2024-12-10 09:32:13 +01:00
Tonis Tiigi
fdac6d5fe7
update xx to v1.6.1
Fixes compatibility issues with Alpine 3.21

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-09 18:48:50 -08:00
Tõnis Tiigi
d4eca07af8
Merge pull request #2834 from tonistiigi/bake-entitlements-output-fix
bake: fix entitlements path checks for local outputs
2024-12-06 13:52:48 -08:00
CrazyMax
95e77da0fa
Merge pull request #2838 from tonistiigi/update-test-buildkit
update buildkit used for tests
2024-12-04 09:42:27 +01:00
Tonis Tiigi
6810a7c69c
update buildkit used for tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-03 17:59:08 -08:00
Tonis Tiigi
dd596d6542
bake: allow entitlements from overrides automatically
If override specifies a path, mark it automatically allowed
so there is no need to use duplicate flags for defining the
same feature.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-02 17:16:28 -08:00
Tonis Tiigi
c6e403ad7f
bake: fix entitlements path checks for local outputs
Previous check based on dest attributes was not correct
as the attributes already get converted before validation happens.

Because the local path is not preserved for single-file
outputs and gets replaced by io.Writer, a temporary array variable
was needed. This value should instead be added to ExportEntry
struct in BuildKit in future revision.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-02 15:00:29 -08:00
CrazyMax
d6d713aac6
Merge pull request #2828 from crazy-max/ci-buildx-edge
ci: use edge releases of buildx
2024-11-28 18:09:04 +01:00
CrazyMax
f148976e6e
Merge pull request #2829 from glours/bump-compose-go-v2.4.5
bump compose-go to v2.4.5
2024-11-28 18:05:11 +01:00
Guillaume Lours
8f70196de1
bump compose-go to v2.4.5
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-11-28 15:01:24 +01:00
CrazyMax
e196855bed
ci: use edge releases of buildx
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-11-28 15:01:09 +01:00
Tõnis Tiigi
71c7889719
Merge pull request #2821 from tonistiigi/update-buildkit-v0.18.0
vendor: update buildkit to v0.18.0
v0.19.0
2024-11-26 14:49:31 -08:00
Tonis Tiigi
a3418e0178
vendor: update buildkit to v0.18.0
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-26 13:57:25 -08:00
Tõnis Tiigi
6a1cf78879
Merge pull request #2818 from tonistiigi/vendor-buildkit-v0.18.0-rc2
vendor: update buildkit to v0.18.0-rc2
v0.19.0-rc2
2024-11-25 17:52:46 -08:00
Tonis Tiigi
ec1f712328
vendor: update buildkit to v0.18.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-25 17:42:30 -08:00
CrazyMax
5ce6597c07
Merge pull request #2812 from crazy-max/bake-win-fs-ent
bake: add wildcard to fs entitlements to allow any paths
2024-11-25 20:29:14 +01:00
CrazyMax
9c75071793
bake: add wildcard to fs entitlements to allow any paths
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-11-25 20:13:27 +01:00
Tõnis Tiigi
d612139b19
Merge pull request #2811 from crazy-max/update-buildkit
dockerfile: update buildkit to v0.17.2
2024-11-25 10:11:09 -08:00
Tõnis Tiigi
42f7898c53
Merge pull request #2815 from tonistiigi/entitlements-symlink-tests
bake: fix entitlement test when running from symlink temp
2024-11-25 10:08:19 -08:00
Tonis Tiigi
3148c098a2
bake: remove unnecessary GetLongPathName calls
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-25 08:26:02 -08:00
Tonis Tiigi
f95d574f94
bake: fix entitlement test when running from symlink temp
As the paths returned by validator have the symlinks resolved,
the test needs to resolve the symlinks also in the expected
values. Previously this would fail if t.TempDir() or os.GetWd()
returned a path that contained a symlink.

The issue was purely in the test and not in the entitlements
validation logic.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-25 00:03:54 -08:00
CrazyMax
60822781be
ci: update buildkit to v0.17.2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-11-22 13:00:07 +01:00
CrazyMax
4c83475703
dockerfile: update buildkit to v0.17.2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-11-22 11:27:33 +01:00
Tõnis Tiigi
17eff25fe5
Merge pull request #2807 from tonistiigi/buildkit-v0.18.0-rc1
vendor: update buildkit to v0.18.0-rc1
v0.19.0-rc1
2024-11-21 14:29:29 -08:00
Tõnis Tiigi
9c8ffb77d6
Merge pull request #2806 from tonistiigi/vendor-compose-v2.4.4
vendor: update compose to v2.4.4
2024-11-21 14:29:18 -08:00
Tonis Tiigi
13a426fca6
vendor: update buildkit to v0.18.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-21 12:57:27 -08:00
Tõnis Tiigi
1a039115bc
Merge pull request #2758 from jsternberg/bake-composable-attributes
bake: initial set of composable bake attributes
2024-11-21 12:54:54 -08:00