Commit Graph

81 Commits

Author SHA1 Message Date
Nalin Dahyabhai 318fc8940f Enforce "blocked" for registries for the "docker" transport
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
2018-10-05 15:30:11 +00:00
Nalin Dahyabhai 62c01da3e4 Correctly set DockerInsecureSkipTLSVerify when pulling images
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
2018-10-05 15:30:11 +00:00
Daniel J Walsh ba012ddec6
Move buildah from projecatatomic/buildah to containers/buildah
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-09-18 08:06:11 -04:00
W. Trevor King 0d39b40e02 pull: Return image-pulling errors from pullImage
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
2018-09-14 18:41:39 +00:00
Miloslav Trmač 344fbdc882 Remove an unused srcRef.NewImageSource in pullImage
- 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
2018-08-10 20:31:27 +00:00
Nalin Dahyabhai 618bf54c74 Export a Pull() function
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
2018-08-09 18:18:11 +00:00
TomSweeneyRedHat 338b23ea3e Revert pull error handling from 881
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #910
Approved by: rhatdan
2018-08-04 07:58:21 +00:00
TomSweeneyRedHat ba976ed310 Return policy error on pull
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #881
Approved by: rhatdan
2018-08-03 17:29:14 +00:00
Nalin Dahyabhai 8be2b62372 Fix handling of --registries-conf
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
2018-07-07 10:48:44 +00:00
TomSweeneyRedHat 043fd2e300 Add registry errors for pull
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2018-06-06 13:05:56 -04:00
umohnani8 2749191a5f buildah push/from can push and pull images with no reference
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
2018-05-16 18:49:37 +00:00
Daniel J Walsh 37ecc5d42a Simple changes to allow buildah to pass make validate
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #606
Approved by: rhatdan
2018-04-20 09:57:35 +00:00
umohnani8 9ffd47edca Vendor in latest containers/image and containers/storage
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
2018-04-13 16:56:21 +00:00
umohnani8 1ca41dcbcb Add various transport support to buildah from
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
2018-03-22 17:22:47 +00:00
Nalin Dahyabhai 47ac96155f Use configured registries to resolve image names
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
2017-12-14 22:21:16 +00:00
Urvashi Mohnani 4419612150 Add manifest type conversion to buildah push
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
2017-11-15 13:38:28 +00:00
Daniel J Walsh 8ecefa978c Vendor in changes to support sirupsen/logrus
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-10-10 17:30:11 +00:00
TomSweeneyRedHat 498f0ae9d7 Add credentials to buildah from
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Add credentials to buildah from

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #204
Approved by: nalind
2017-08-22 18:55:38 +00:00
Nalin Dahyabhai 265d2da6cf Always free signature.PolicyContexts
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
2017-08-14 12:02:07 +00:00
Nalin Dahyabhai 94f2bf025a Replace --registry with --transport
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
2017-08-03 15:55:13 +00:00
Nalin Dahyabhai 262b43a866 Improve "from" behavior with unnamed references
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
2017-08-03 15:55:13 +00:00
Dan Walsh 33c2a8a418 gccgo is giving errors about using copy
golang-bin-1.8.1-1.fc26.x86_64
gcc-go-7.1.1-1.fc26.x86_64

Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #135
Approved by: nalind
2017-06-06 19:40:56 +00:00
Dan Walsh 8ced1276e5 Change functions that use a fmt.Errorf to wrap an err to error.Wrapf
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
2017-06-02 14:17:04 +00:00
Dan Walsh 95c2a2d99c Vendor in containers/storage and containers/image
Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #103
Approved by: nalind
2017-05-17 21:19:24 +00:00
Nalin Dahyabhai 12e582ee1a Report pull/commit progress by default
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
2017-05-10 12:53:25 +00:00
Nalin Dahyabhai 6d03588e83 Don't bother setting redundant image names
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
2017-05-09 20:13:04 +00:00
Nalin Dahyabhai b7a598ca21 Fixup metalinter errors
Fix a number of issues flagged by gometalinter.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #62
Approved by: rhatdan
2017-04-12 21:25:35 +00:00
Nalin Dahyabhai 943191c7c2 Correctly set tags on the names of pulled images
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
2017-03-24 22:47:33 +00:00
Nalin Dahyabhai f0b508598a Update implementation to match dependencies
types.ImageSource.Close() can return an error now, and ParseImageName()
moved to containers/image/transports/alltransports.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-22 16:33:24 -04:00
Nalin Dahyabhai 22422cc399 Update to match API changes in dependencies
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-13 17:21:45 -05:00
Nalin Dahyabhai 0ab0890e4e Massive refactoring
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>
2017-02-10 11:48:15 -05:00