Commit Graph
349 Commits
Author SHA1 Message Date
CrazyMax 92905a8f5a bake: support unix output in formattimestamp
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-25 11:59:24 +01:00
CrazyMax 2798e134e9 bake: add formattimestamp and tighten unix timestamp parsing
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-25 11:46:49 +01:00
CrazyMax 11395747a6 bake: add unixtimestampparse function
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-25 11:46:48 +01:00
CrazyMax 50fa13d859 bake: preserve git subdir in remote bake context paths
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-03 17:47:07 +01:00
Tonis Tiigi d39a81e456 bake: fix remote named context subdir handling
Fix using CopyDirContentsOnly when projecting remote named contexts so
subdir contexts keep the same root semantics as local bake runs.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-27 17:06:32 -08:00
CrazyMax 26c7ae6fbf bake: derive git auth host from remote URL
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-24 18:09:52 +01:00
Tõnis TiigiandGitHub 7940a9650d Merge pull request #3646 from crazy-max/urlutil
history: don't import build package
2026-02-11 10:59:05 -08:00
CrazyMax 7899695fa6 history: don't import build package
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-11 10:29:47 +01:00
CrazyMax f60c7c9069 bake: set input:context for remote builds
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-09 13:50:19 +01:00
Tonis Tiigi c5322ca727 bake: add --var flag for setting variable values
This provides alternative way to set values for Bake
variables without adding them the global environment variables.
This can also be used then environment variable access
is disabled with BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-15 23:17:28 -08:00
Tonis Tiigi d27c7f8e9f bake: allow disabling env lookup for bake
Allow bake to be run in a mode where the local environment
variable values can't be captured by bake definition.

In future we will likely also add --var k=v for alternative
way to pass values to variables.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 14:18:26 -08:00
Tonis Tiigi 9f1daffb32 policy: implement policy support for bake
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:34:23 -08:00
Tonis Tiigi c5154b3169 update linters for go1.25 base version
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-09 18:54:15 -08:00
Tõnis Tiigi 37e283ceb0 auth: add option to load docker config for specific repo/scope
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-07 11:45:04 -08:00
CrazyMax 3836aeb949 bake: add semvercmp func to stdlib
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-06 09:34:10 +01:00
Roberto Villarreal 3301329d57 Ensure typed variables with no value still carry type
A value-less, untyped variable has always been converted to an empty
string.  The intention was that value-less, typed variables convert to a
 typed null, which was even specified in a code comment, but was never
actually implemented.

This resulted in a null value with a nil type.  A value with a nil type
cannot be coerced ("unified") with any other standard types.  When this
mismatch occurs, HCL attempts to return a diagnostic error, which in
turn panics as the nil type is literally a nil pointer.

Signed-off-by: Roberto Villarreal <rrjjvv@yahoo.com>
2025-10-10 20:10:04 -06:00
Tonis Tiigi 1f39ad2001 vendor: update buildkit to v0.24.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-08-29 14:49:16 -07:00
CrazyMax a8f546eea5 build: fail early if trying to export index annotations with moby exporter
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-27 11:17:31 +02:00
Tõnis TiigiandGitHub c6d1e397a8 Merge pull request #3352 from crazy-max/compose-pull-nocache
bake: pull and no-cache support for compose
2025-08-11 11:55:06 +03:00
CrazyMax c365f015b1 compose: sanitize value of named contexts for target type
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-08 14:43:48 +02:00
Sebastiaan van Stijn 36b18a4c7a remove some intermediate vars
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-06 23:00:24 +02:00
CrazyMax 669fd1df2f bake: pull and no-cache support for compose
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-05 11:49:37 +02:00
CrazyMax e4b49a8cd9 bake: add homedir func
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-05 10:21:55 +02:00
CrazyMax 9d56b30c42 bake: fix dockerfile default if empty
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-31 10:02:44 +02:00
Guillaume Lours 19304c0c54 bump compose-go to v2.8.0
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-07-23 13:16:22 +02:00
CrazyMax 98f04b1290 bake: fix compose files validation
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-22 10:18:14 +02:00
Nicolas De Loof 08e74f8b62 do not assume intput is a compose file on .env parsing error
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-07-21 09:02:10 +02:00
Tõnis TiigiandGitHub f6d2c5ed7a Merge pull request #3292 from crazy-max/compose-filtered-spec
bake: ignore unrelated fields when parsing compose files
2025-07-13 23:36:05 -07:00
Tõnis TiigiandGitHub 661a1593f6 Merge pull request #3289 from crazy-max/bake-stdlib-description
bake: set missing stdlib functions description
2025-07-11 17:27:15 -07:00
Tõnis TiigiandGitHub 9a07004534 Merge pull request #3290 from thaJeztah/fix_lint
fix some linting issues
2025-07-10 08:30:29 -07:00
CrazyMax c124b14978 bake: ignore unrelated fields when parsing compose files
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-04 08:09:14 +02:00
Sebastiaan van Stijn 5da2ff5990 bake/hclparser/gohcl: fix typo
Looks like we forked this code, including the typo. As we already modify
the code to add the `//nolint`, we may as well fix the typo itself instead.
https://github.com/hashicorp/hcl/blob/dfa124f3c93ff1764fda03702a7a9aa8c9db48d8/gohcl/decode_test.go#L417-L423

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-03 13:27:37 +02:00
CrazyMax ddec7679f6 bake: set missing stdlib functions description
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-03 08:17:42 +02:00
CrazyMax 6997d61998 docs: generate docs for bake standard library functions
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-02 23:57:02 +02:00
Tõnis TiigiandGitHub 2b5a8c661f Merge pull request #3280 from crazy-max/bake-target-pattern
bake: add pattern matching for targets input
2025-07-01 09:31:32 -07:00
CrazyMax 7c22db3c34 bake: add pattern matching for targets input
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-01 10:53:02 +02:00
CrazyMax 68b49403a3 compose: evaluate vars from current env in dotenv file
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-01 09:43:17 +02:00
CrazyMax 40e3e5a27e compose: ignore dotenv that is a directory
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-30 17:11:54 +02:00
CrazyMax 989978a42b bake: multi ips support for extra hosts
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-16 11:55:17 +02:00
CrazyMax b514ed45fb bake: extra-hosts support
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-11 19:38:01 +02:00
CrazyMax 3f49ee5a90 bake: hcl merged tests
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-06 17:16:56 +02:00
Jonathan A. Sternberg 1d7cda1232 controller: remove remaining parts of the controller
Removes all references to the controller and moves the remaining
sections of code to other packages.

Processes has been moved to monitor where it is used and the data
structs have been removed so buildflags is used directly. The controller
build function has been moved to the commands package.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-05 11:57:03 -05:00
Roberto Villarreal b40b2caf1a Show types during variable list operation
If a type was explicitly provided, it will be displayed in the variable
listing.  Inferred type names are not displayed, as they likely would
not match the user's intent.

Previously only `string` and `bool` default values were displayed in the
 listing.  All default values, regardless of type, are now displayed.

Signed-off-by: Roberto Villarreal <rrjjvv@yahoo.com>
2025-05-29 17:36:46 -06:00
CrazyMax 291c353575 bake: TestEmptyVariable
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-21 16:15:30 +02:00
Roberto Villarreal 3c0f5c5c21 Consider typed, value-less variables to have null value
A variable with a type but no default value or override resulted in an
empty string.  This matches the legacy behavior of untyped variables,
but does not make sense when using types (an empty string is itself a
type violation for everything except `string`).  All variables defined
with a type but with no value are now a typed `null`.

A variable explicitly typed `any` was previously treated as if the
typing was omitted; with no defined value or override, that resulted in
an empty string.  The `any` type is now distinguished from an omitted
type; these variables, with no default or override, are also `null`.

In other respects, the behavior of `any` is unchanged and largely
behaves as if the type was omitted.  It's not clear whether it should be
 supported, let alone how it should behave, so these tests were removed.
It's being treated as undefined behavior.

Signed-off-by: Roberto Villarreal <rrjjvv@yahoo.com>
2025-05-20 13:09:13 -06:00
CrazyMax 1383aa30c1 lint: modernize fix
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-13 20:44:57 +02:00
CrazyMax b606e2f6bb update golangci-lint to v2.1.5
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-13 16:54:43 +02:00
Roberto Villarreal 56d39e619d Skip case-sensitive test on Windows
Signed-off-by: Roberto Villarreal <rrjjvv@yahoo.com>
2025-05-09 18:36:11 -06:00
Roberto VillarrealandCopilot 65aea3028f Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Roberto Villarreal <rrjjvv@yahoo.com>
2025-05-09 18:36:11 -06:00
Roberto Villarreal 956fc0c9eb Use unique environment variables to separate JSON from default parsing
The primary intent is to make JSON parsing explicitly opt-in rather than
 using heuristics to determine intent.

With some exceptions, given bake variable `VAR`, an environment variable
 `VAR_JSON` must be used to provide JSON content.  The value in
 `VAR_JSON` will be ignored when:
* a bake built-in of that same name exists
* a user-provided variable of that same name exists
* typing (attribute `type`) is not present

The first is unlikely to happen as built-ins will likely start with
`BUILDX_BAKE_`, an unlikely prefix for end users.  The second may be a
real scenario, where users have `VAR_JSON` dedicated to accepting a
string with JSON content and decoding via an HCL function.  This will
continue to work as-is, but can be simplified by removing the variable
from their bake file (`VAR_JSON`) and applying typing (to `VAR`).

Signed-off-by: Roberto Villarreal <rrjjvv@yahoo.com>
2025-05-09 18:36:11 -06:00