Check if reading and writing from the registry named by an image is
allowed when the transport is "docker".
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #1056
Approved by: rhatdan
The image library's copy routine doesn't itself consult the registries
configuration in order to decide whether or not to disable TLS
verification when communicating with a registry, so it's on us to use
the name of a source or destination image to decide whether to set the
flag for that behavior.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #1056
Approved by: rhatdan
Instead of throwing out the upstream error message, save it and return
it if we can't come up with a more-specific suggestion. This softens
the approach from 043fd2e3 (Add registry errors for pull,
2018-06-01, #747), because that could make debugging harder [1].
[1]: https://github.com/projectatomic/buildah/issues/849
Signed-off-by: W. Trevor King <wking@tremily.us>
Closes: #1014
Approved by: rhatdan
- The result is not used anywhere
- In the common case of pulling from docker:// this does not do
anything notable (only sets up configuration, no network checks)
- ... but it can be pretty expensive for compressed archives,
creating an uncompressed on-disk copy.
- copy.Image soon after the removed code calls srcRef.NewImageSource
internally anyway.
This should not change behavior on success; it may change which error is
reported if there is more than one reason for the pull to fail.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Closes: #922
Approved by: TomSweeneyRedHat
Provide a Pull() function that can be called directly, to go with the
Push() function.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #918
Approved by: rhatdan
Instead of ignoring the global --registries-conf option and using only
$REGISTRIES_CONFIG_PATH, use it for the option default.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #854
Approved by: rhatdan
pushing with format <transport>:<path> is valid now.
Add support to pull images from oci-archive that have no image ref name.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #697
Approved by: rhatdan
Changes to paramters in functions.
Change to the error returned by the oci and oci-archive transport.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #578
Approved by: rhatdan
buildah from now supports pulling images using the following transports:
docker-archive, oci-archive, and dir.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #524
Approved by: TomSweeneyRedHat
When locating an image for pulling, inspection, or pushing, if we're
given an image name that doesn't include a domain/registry, try building
a set of candidate names using the configured registries as domains, and
then pull/inspect/push using the first of those names that works.
If a name that we're given corresponds to a prefix of the ID of a local
image, skip completion and use the ID directly instead.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #360
Approved by: rhatdan
buildah push supports manifest type conversion when pushing using the 'dir' transport
Manifest types include oci, v2s1, and v2s2
e.g buildah push --format v2s2 alpine dir:my-directory
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Closes: #321
Approved by: rhatdan
Whenever we create a containers/image/signature.PolicyContext, make sure
we don't forget to destroy it.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #231
Approved by: rhatdan
Replace --registry command line flags with --transport. For backward
compatibility, add Transport as an addtional setting that we prepend to
the still-optional Registry setting if the Transport and image name
alone don't provide a parseable image reference.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #235
Approved by: rhatdan
Fix our instantiation behavior when the source image reference is not a
named reference.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #235
Approved by: rhatdan
Impove error reporting by wrapping all returned err functions with
error.Wrapf
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #124
Approved by: nalind
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #125
Approved by: nalind
Have 'from', 'commit', and 'build-using-dockerfile' report progress via
stderr (so that capturing output from 'from' and 'commit' still works as
expected) unless --quiet is used to suppress the reporting.
Closes#94.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #98
Approved by: rhatdan
When we pull down an image to use as a starting point, we no longer need
to attach any additional names to it, as the image library can now find
it correctly without requiring us to do so.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #99
Approved by: rhatdan
Correctly set the tag portion of the name that we assign to images that
we've pulled.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #42
Approved by: nalind
types.ImageSource.Close() can return an error now, and ParseImageName()
moved to containers/image/transports/alltransports.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Pull most of the core logic from the CLI into a package that should be
easier to consume as a library. Add a "config" command that updates the
builder object's configuration.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>