Add a --source-date-epoch flag, defaulting to $SOURCE_DATE_EPOCH if set,
which sets the created-on date and the timestamp for the new history
entries, but does not default to modifying the timestamps on contents in
new layers.
Add a --rewrite-timestamp flag, which "clamps" timestamps in the new
layers to not be later than the --source-date-epoch value if both
the --rewrite-timestamp and --source-date-epoch flags were set.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Merge the two tar filters, if we need two, that we use when committing
an image. Try to improve passing of error information from the writing
end of a pipe to the reader, so that it can be reported better.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Podman adds an Error: to every error message. So starting an error
message with "error" ends up being reported to the user as
Error: error ...
This patch removes the stutter.
Also ioutil.ReadFile errors report the Path, so wrapping the err message
with the path causes a stutter.
Signed-off-by: Daniel J Walsh dwalsh@redhat.com
[NO NEW TESTS NEEDED]
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Use the copier package to rework how we handle ADD and COPY.
When evaluating cache for content that's being copied/added in, switch
from (digest the data, check for a cache entry, then maybe copy the data
and create the new layer) to (copy the data and create the new layer,
digesting as we go, check for a cache entry, either commit or discard
the new layer).
Use the copier package for ADD, COPY, and for ensuring that a specified
directory exists in the working container's rootfs.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When processing .dockerignore files, we produce mini-archives for each
individual item being copied as part of a directory tree, so if we pass
them through a tarFilterer, it needs to not give up when it hits the end
of the first archive that it sees.
Add a flag to the tarFilterer that it sets when it closes the writing
end of the pipe that it's reading, and if the flag isn't set when the
reader finds an EOF, have the reader gear up to read another archive
instead of just refusing to process any more data.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Rework CompositeDigester so that it can handle type "".
Add a newTarFilterer() inspired by imagebuilder's, that we'll be able to
use to adjust headers before digesting them.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Use digests of the added content in history entries that we create for
ADD and COPY instructions, tightening up cache checking just a little
bit more.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #1792
Approved by: TomSweeneyRedHat