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
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
We don't have a good way of identifying to a user where a container
was mounted on the file system when doing a buildah from.
A user can just do a buildah mount CID /mnt, after the from line to
handle this.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #86
Approved by: nalind
Have imagebuildah reexport some constants and its own Mount type, to
reduce the number of our dependencies that a prospective consumer of
this package would also need to import directly.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #84
Approved by: rhatdan
So long as it's possible to have an incompatible version of runc
installed, we're going to want to easily point to another version, as we
already allow for with the "run" command.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #76
Approved by: nalind
While adding rmi to ocid, I was asked to make this change, so want
to keep the code in buildah and ocid for these functions as close as
possible to the same.
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #69
Approved by: nalind
Change how we represent image pulling policy from a pair of booleans to
a single field which can take three values (never, if-missing, always),
with the default value being if-missing.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #71
Approved by: rhatdan
If we're told to remove more than one container or image, actually try
to remove them all, but still return an error if we fail at any of them.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #68
Approved by: rhatdan
Add a build-using-dockerfile command (alias: bud) which uses
openshift/imagebuilder to wrap parsing and dispatching, and runc (or
another OCI runtime) to handle RUN instructions.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #59
Approved by: rhatdan
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>