Accept commit target names which don't include a transport name by
checking if they parse as valid containers-storage references after they
fail to parse as a general reference.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #49
Approved by: rhatdan
Rename the "list" and "delete" commands to "containers" and "rm",
respectively, and add "images" and "rmi" counterparts for them.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #32
Approved by: rhatdan
Add options to Run() for passing in additional environment variables,
overriding the default command, user, and working directory, and a flag
for controlling whether or not we attach to the host's network.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #46
Approved by: rhatdan
Closes: #39
Approved by: nalind
This will allow us to more easily share these source modules between
kpod and buildah as well as move keep the definition with the implementation.
Closes: #45
Approved by: rhatdan
Simple change to allow users to specify multiple containers to delete.
This would support cleaning up all containers
buildah delete $( buildah list -q)
Closes: #43
Approved by: rhatdan
We need to match the syntax of Dockerfile, three forms
buildah copy $CID SOURCE
buildah copy $CID SOURCE DESTINATION
buildah copy $CID SOURCE SOURCE SOURCE DESTINATION
Closes: #40
Approved by: nalind
Only attempt to Shutdown() the default storage.Store if we actually
opened it to begin with. This avoids some unnecessary churn with
storage in cases where argument parsing flags an invocation error.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #41
Approved by: rhatdan
types.ImageSource.Close() can return an error now, and ParseImageName()
moved to containers/image/transports/alltransports.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When running our various subcommands, report errors that they return
correctly, and ensure that in those cases we don't exit with status 0.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When flags that we'd require be specified aren't, if there are command
line arguments, use their values as flag values.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Change the behavior of "from" to default to have --pull be true, rather
than the previous default of false.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Read the library defaults from the storage library before we parse our
command line, so that help output will correctly show the default
storage locations.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Don't mix "config" options in with the "run" and "commit" commands. It
might have made sense before "config" was a separate command, but it
doesn't any more, and it might suggest that settings changed during
"run" are temporary, when they are not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Update the Usage strings that we include in Flag structures so that the
type of argument displayed in help output isn't just "value".
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Clarify that the --name option can also specify a container ID, and the
right things will still happen.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Add "add" and "copy" CLI commands, which end up calling the same buildah
method, differing only in whether or not they tell it to attempt to
extract local sources when those sources appear to be archive files
("add" does, "copy" does not).
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When we're given the name of a container on the command line, make every
command that attempts to open an in-progress build container fall back
to creating a new build configuration file for the specified container
if the container exists but wasn't originally created for a build.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When we encounter an error parsing the target (new) image name during
"commit", don't use the container's name in the error message where we
meant to mention the image's name.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Provide RunOptions which can be used to change the runtime to something
other than "runc", and add an option that allows passing in additional
global arguments for the runtime.
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>
First pass at converting configuration information from docker images to
the OCIv1 format. Fix time zones for dates. Take a guess at fixing the
order of history items.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Add a TODO note that, once we can pull in a newer image-spec, make use
of its new media type to distinguish between compressed and uncompressed
layers in the output image.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When committing an image, default to compressing the layer using Gzip.
This can lead to problems pulling the image back out of
containers/storage if the package that pulls it out was built using a
different version of go, but it works around a problem where
containers/image might not be able to detect that an uncompressed layer
is actually a layer.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Change the --signature-policy flag from being a global option to being
specific to the "from" command, which is the only place it's used.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Roll back to slightly older versions of some of our dependencies in
order to get them all to play well together.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Add the container's layer to the layer list in the image configuration,
along with a history entry for it.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>