When copying or adding a source directory, copy the directory's contents
to the destination directory, to better match Dockerfile COPY behavior.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #50
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
When computing a default container name from the name of a source image,
drop tags and any leading components from the image name before
attempting to use it as part of a container name.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #33
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
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
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
When we run a command in Run(), since it's sharing the host's network
namespace, also have it share the host's DNS settings.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #34
Approved by: rhatdan
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
Add a YAML file to hook up this repo to redhat-ci. I ported over the
tests and environment from the .travis.yml file, though feel free to
customize it to your needs. For more information on supported YAML
fields, please see:
https://github.com/jlebon/redhat-ci/blob/master/sample.redhat-ci.yml
RHCI does also support containerized builds, though the container
environment is unprivileged, which means the tests won't be able to e.g.
mount things. Instead, I set it up so it provisions an Atomic Host on
which we run a privileged container. This is a workflow that will be
made easier in the future.
Closes: #37
Approved by: jlebon
Clarify that we're referring to a buildah.Builder object here, and it's
not a capitalization mistake.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
In Copy(), instead of flagging a container not being mounted as an
error, do what we do in Run(), which is to mount it first and then
unmount when we're done.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Change copy behavior so that the destination can be a file rather than a
directory if we're copying a single item.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Always make sure the working directory exists before attempting to run
anything inside of it, and before attempting to copy contents into it or
one of its subdirectories.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
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>
Use the chrootarchive package instead of the archive package in the
implementation of "add", in an attempt to avoid problems with tarballs
with unusual paths in their headers.
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>