Not all the error cases from getGitAttributes returned
appendNoneFunc. When nil was returned it caused a panic.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
When building from same stream all nodes need to read
data from the same stream. In order to achive that there
is a new SyncMultiReader wrapper that sends the stream
concurrently to all readers. Readers must read at similar
speed or pauses will happen while they wait for each other.
Dockerfiles were already written to disk before sent. Now
the file written by first node is reused for others.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Some errors can appear without a stacktrace or progress record,
eg. wrong Dockerfile name passed. In that case when building many
targets with bake it might be hard to figure out which target
failed as in the progressbar there will only be steps that
were cancelled.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Detect cases where multiple bake targets would use the same
local source. For such cases a separate session request is
made in addition to session per target and local source
is made available in that source as well.
The new sessionID is sent with the request so the frontend
can ask associate it with the local source it needs.
The sources are still available in the main request session
as well. This would be used if frontend ignores the local-sessionid
parameter and makes sure that old version continue working.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This is a preparation to shared local sources for bake
targets and makes it possible to have equality check
between locals from different targets.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
When LocalDirs were changed to LocalMounts, this broke the
sharedKey computation that was based on the context directory
path. SharedKey defines if directory is valid candidate for
incremental context transfer and if not set properly then
different directories do metadata-based transfers to same destination.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This makes the code slightly more idiomatic, but the errors produced will
change slightly to prevent having to path NamedContext as argument.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This package is part of the classic builder, and was currently only used
for the IsURL utility, which is a very rudimentary check for a string having
a "https://" or "http://" scheme.
This patch copies the code as non-exported functions where they're used to
remove the dependency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
hasDigest would always be true when reaching this code, because the function
would return with an error when failing to resolve the digest;
if !hasDigest {
return nil, errors.Errorf("oci-layout reference %q could not be resolved", v.Path)
}
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
hasTag was always true as it was set to "true" when missing, in which case
the default (`:latest`) tag was applied;
localPath, tag, hasTag := strings.Cut(localPath, ":")
if !hasTag {
tag = "latest"
hasTag = true
}
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Currently it is possible for boot() to be called
multiple times, resulting multiple slow requests to
establish connection (eg. multiple container inspects
for container driver).
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Contexts using target: schema are replaced by input: pointing
to previous build result before build request is sent. Currently
this replacement did not work if multiple contexts pointed to
the same target name.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>