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 completion for build-using-dockerfile and our renaming of the
containers/images --no-truncate flag to --notruncate during the CLI
overhaul.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #59
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
Vendor openshift/imagebuilder and its dependencies, and pick up new
dependencies on golang.org/x/text and github.com/opencontainers/selinux.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #59
Approved by: rhatdan
Remove "install.tools" as a dependency of the top-level "all" target,
and make it a dependency of the "install" target.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #62
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
Some of our dependencies expect 1.7's "context" package and fields of
http.Transport which aren't in 1.6.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #65
Approved by: rhatdan
When saving the contents of a URL to a local file, attempt to set mtime
based on the response's Last-Modified header, if there is one.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #58
Approved by: nalind
We can use "scratch" now as a source for building images, so speed
things up a bit by using it instead of pulling alpine in tests where it
isn't expected to affect the test result.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #55
Approved by: rhatdan
When the destination for an ADD or COPY operation ends with a path
separator, take that as an indicator that the destination should be a
directory, that we should create it if it doesn't already exist, and
that any files we're copying should be placed in the directory.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #56
Approved by: rhatdan
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>