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
Add a test that makes sure that "buildah run" fails if it can't resolve
the name of the user for the container.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #313
Approved by: rhatdan
Change our behavior when we're given USER with a numeric UID and no GID,
so that we no longer error out if the UID doesn't correspond to a known
user so that we can use that user's primary GID. Instead, use GID 0.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #313
Approved by: rhatdan
Add a test that makes sure we catch cases where we attempt to open a
file in the container's tree that's actually a symlink that points out
of the tree.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #313
Approved by: rhatdan
We don't need to mount the container for this test or add files to it,
and switching to a smaller base image that already includes a "hostname"
command means we don't need to run a package installer in the container.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #320
Approved by: nalind
Default to running integration tests using /var/tmp as scratch space,
since it's more likely to support proper SELinux labeling than /tmp,
which is more likely to be on a tmpfs.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #320
Approved by: nalind
This is no simpler then putting the transport in the image page,
we should default to the registry specified in containers/image
and not override it. People are confused by this option, and I
see no value.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #234
Approved by: rhatdan
We have implemented most of this code in kpod export, and we now
have kpod import/load/save. No reason to implement them in both
commands.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #245
Approved by: nalind
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
It looks like the metalinter is running out of memory while running
tests under PAPR, so give this a try.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #221
Approved by: rhatdan
Add a CI test that ensures that we can build an RPM package on the
current version (as of this writing, 26) of Fedora, using the .spec file
under contrib.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #208
Approved by: jlebon
Try to ensure that we have runc, so that we can test the "run" command
in CI. In the absence of a compatible packaged version of runc, we may
have to build our own.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #202
Approved by: rhatdan
Add a test to compare the version we claim to be with the version
recorded in the RPM .spec file.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #202
Approved by: rhatdan
If you specify an option in a buildah run command, the command fails.
The proper syntax for this is to add --
buildah run $ctr -- ls -l /
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #197
Approved by: nalind
I think this would be good practice to eliminate wasted disk space.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #189
Approved by: rhatdan
Just build imgtype once, and reuse the flags we use for the main binary.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #174
Approved by: rhatdan
Logging at Fatal calls os.Exit(), which keeps us from shutting down
storage properly, which prevents test cleanup from succeeding.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #162
Approved by: rhatdan
In the imgtype test helper, add a -debug flag, correctly handle things
on the off chance that we need to call a reexec handler, and read the
manifest using the Manifest() method of an image that we're already
opening, rather than creating a source image just so that we can call
its GetManifest() method.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #162
Approved by: rhatdan
Make the tests use the storage driver named in $STORAGE_DRIVER, if one's
set, instead of hard-coding the default of "vfs".
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #162
Approved by: rhatdan
When "run" isn't explicitly given a command, mix the command and
entrypoint options and configured values together correctly.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #160
Approved by: rhatdan
Ensure that volume points are created, if they don't exist, when they're
defined in a Dockerfile (#151), and that if we create them, we create
them with 0755 permissions (#152).
When processing RUN instructions or the run command, if we're not
mounting something in a volume's location, create a copy of the volume's
initial contents under the container directory and bind mount that.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #154
Approved by: rhatdan
Add a "push" command, which pulls an image's layers from local storage,
recomputes the image's digest and manifest, and uses the image library
to write the result to the specified location.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #141
Approved by: rhatdan
We weren't properly passing the preferred output format to the Commit()
method when committing images that we were building using
build-with-dockerfile. Fix that.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #127
Approved by: rhatdan
Test setting and importing of configuration settings by saving to both
formats, and then checking that the values in both configuration fields
has the right data when we use either image type as a source image.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #118
Approved by: rhatdan
Add a test helper for examining image metadata and checking their types,
and add tests that use it to verify that after writing either Docker v2
or OCI v1 images, that the manifest and configuration blobs that we
stored for them successfully decode as the correct data types.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #118
Approved by: rhatdan
Increase the timeout that we set for running the metalinter from 2
minutes to 4 minutes, for cases where the calling environment is more
heavily loaded than we expected.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #119
Approved by: rhatdan
Add an "inspect" command, which can be used to dump the contents of the
Buildah object for a working container, or the starting one we'd get for
a specified image.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #109
Approved by: rhatdan
Add an AdditionalTags field to the imagebuildah options structure, to
provide for additional tags which we'll want to apply to the image that
we're writing.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #88
Approved by: rhatdan
Add a "validate" target to the top level Makefile that checks formatting
of source files with golint, signed-off-by tags with git-validate, and
for various other warnings with gometalinter.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #62
Approved by: rhatdan
When we have cgo, use fgetpwent() to try to look up user IDs and primary
GIDs in containers. If that fails for any reason (or if we don't have
cgo), fall back to doing what we were doing before (i.e., trying to look
up the information on the host).
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #63
Approved by: rhatdan
Make Run() default to running the command with a PTY if we're being run
with stdout connected to terminal, and provide options to force the
decision one way or the other.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #64
Approved by: rhatdan