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>
Move our data from the container's metadata to a file in the container's
per-container directory, so that we can use any OCI container as our
working container.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Default to mounting tmpfs over a container's volume mount points. Add a
RunOption for adding mounts to a run container, and use it as the
default set, adding any volume mounts and others that don't conflict
with them to it before running the container.
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>
Drop supplemental group resolution for the "run" command. The necessary
functions weren't in go 1.5, and the runtime spec doesn't give us a
place to put supplemental group information anyway.
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>
Add a few sample commands to the list that we might add that we have in
the README. A build command would probably want to have
openshift/imagebuilder handle the file parsing, with us providing an
Executor for one of its Builder objects. A run command would use runc,
or another OCI-compatible runtime, or maybe bubblewrap.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Fix builds against go 1.5. This should be temporary, since code we
vendor which depends on engine-api should be moving to something else.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Drop back to a slightly older version of the runtime spec.
Vendor github.com/docker/docker to get type definitions.
Switch to the containers version of storage.
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>
Refine the test for the "libdm_no_deferred_remove" build tag so that we
actually check if we can link with the deferred removal function.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Use trusty for Travis CI builds - the btrfs-tools package in precise
didn't include headers that we needed.
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>
Do some symlink-based trickery to make sure that we can always set
GOPATH to a value that we expect to work.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Figure out the right build tags to use for btrfs and libdm support, and
make sure we tell Travis to install libgpgme11-dev, because we also
build against it.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
The github.com/gorilla/mux package requires github.com/gorilla/context,
so we need to vendor it, too.
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>
Rough out simple image configuration edits, though apparently there's
more out there than just OCI v1.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Log a debug message when we're finished reading a layer, as we already
did for the configuration blob.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>