Commit Graph

58 Commits

Author SHA1 Message Date
Nalin Dahyabhai
3e7e08be90 Add a "list" command, for listing active builders
Add a "list" command which lists all known buildah working containers.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-15 17:34:13 -04:00
Nalin Dahyabhai
a64f7d1187 Better distinguish between image names and IDs
When recording the origins of working containers, take better care to
distinguish between image names and IDs.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-15 17:29:18 -04:00
Nalin Dahyabhai
f51e520e99 Add a library function for listing all builders
Add OpenAllBuilders(), for listing all open builders.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-15 17:29:18 -04:00
Nalin Dahyabhai
5a6a88b5ed More on importing containers that we didn't create
Continue the work from a0d394af74 by
making open-by-path work correctly again.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-15 17:29:18 -04:00
Nalin Dahyabhai
6afcabc1aa Test looking up containers by name and root
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-15 17:29:18 -04:00
Nalin Dahyabhai
462df7238f Update the README: we actually have some CI tests
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-15 13:55:26 -04:00
Nalin Dahyabhai
cebd2b263c Sanitize base64 characters in pathnames in tests
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-07 16:02:12 -05:00
Nalin Dahyabhai
01a148a00b Fixup cleanliness in tests
Clean up the tests so that data files that we generate don't get dropped
in the root directory of the host, or in a part of ${TMPDIR} that we
won't clean up.  Add tests to exercise "add"'s extracting logic.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-07 15:54:51 -05:00
Nalin Dahyabhai
3b44a3e3b3 Simplify copy/add logic to better match dockerd's
Simplify our implementation of copy/add to always assume that the
destination location will be a directory.  Trying to be cleverer, like
cp is, would just be confusing.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-07 13:26:17 -05:00
Nalin Dahyabhai
b9b4335173 Update the copy example script
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-07 10:41:52 -05:00
Nalin Dahyabhai
2d4c308343 Fix a lint error
Don't just discard an error value.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-07 10:41:25 -05:00
Nalin Dahyabhai
cd27adf0b4 Add another example script
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-06 20:32:55 -05:00
Nalin Dahyabhai
2160a9e803 Add some integration tests
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-06 18:47:51 -05:00
Nalin Dahyabhai
b8f939db45 Fix parsing of the --storage-driver option
In the CLI tool, that's a string flag, not a boolean.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-06 17:20:44 -05:00
Nalin Dahyabhai
e467bea0aa Add "add" and "copy" commands
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>
2017-03-06 15:39:22 -05:00
Nalin Dahyabhai
a0d394af74 Try to import containers that we didn't create
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>
2017-02-24 15:18:35 -05:00
Nalin Dahyabhai
0bbb076df8 Fix a copy/paste error in an error message
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>
2017-02-24 15:14:52 -05:00
Nalin Dahyabhai
f5c2b5f21f Move our data to a file in the containerdir
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>
2017-02-23 17:56:48 -05:00
Nalin Dahyabhai
691266d40c Handle volumes in "run"
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>
2017-02-17 13:58:34 -05:00
Nalin Dahyabhai
c46716525c Make the runtime for "run" more configurable
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>
2017-02-17 13:58:11 -05:00
Nalin Dahyabhai
5b7aa1add5 Drop supplemental groups for "run"
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>
2017-02-13 17:46:37 -05:00
Nalin Dahyabhai
22422cc399 Update to match API changes in dependencies
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-13 17:21:45 -05:00
Nalin Dahyabhai
165f985fc3 Update vendored deps to match other vendored deps
Get vendored deps to play with a newer version of the runtime spec.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-13 17:21:45 -05:00
Nalin Dahyabhai
b04e523c8d Update vendored dependencies
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-13 17:21:45 -05:00
Nalin Dahyabhai
2963474e17 Add a "run" command, using runc
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-13 17:21:45 -05:00
Nalin Dahyabhai
eea9ad4a1f Correct a variable naming inconsistency
This was bound to get confusing later.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-10 15:34:04 -05:00
Nalin Dahyabhai
27a97cdc3d Make the example script exit on error
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-10 15:00:09 -05:00
Nalin Dahyabhai
20f2cb9dbe Fix a number of issues flagged by golint
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-10 14:46:09 -05:00
Nalin Dahyabhai
3707445bc5 Drop auto-GOPATHing, it's too fragile
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-10 14:46:09 -05:00
Nalin Dahyabhai
0ab0890e4e Massive refactoring
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>
2017-02-10 11:48:15 -05:00
Nalin Dahyabhai
6efaa3d56e Another stab at getting go1.6 builds working
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-06 14:58:10 -05:00
Nalin Dahyabhai
4bca993699 Start building a list of commands to add in README
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>
2017-02-06 14:40:32 -05:00
Nalin Dahyabhai
084b9e4694 Fixup vendored engine-api for go 1.5
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>
2017-02-06 14:38:56 -05:00
Nalin Dahyabhai
c2305273eb Add an initial README
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-06 13:54:27 -05:00
Nalin Dahyabhai
9516d58c56 Start to vendor docker, update other deps
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>
2017-02-02 18:32:00 -05:00
Nalin Dahyabhai
1475aab796 First pass at converting docker image configs
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>
2017-02-02 18:30:26 -05:00
Nalin Dahyabhai
0cb316d737 Refine the libdm_no_deferred_remove tag check
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>
2017-02-02 15:24:02 -05:00
Nalin Dahyabhai
a4ca99f108 Use trusty for Travis CI builds
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>
2017-02-02 15:20:55 -05:00
Nalin Dahyabhai
18c3ab42ab Add a script for use in a lightning talk
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-28 11:27:34 +01:00
Nalin Dahyabhai
10a8d3bf0b Make a note to distinguish compression of layers
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>
2017-01-28 08:34:15 +01:00
Nalin Dahyabhai
a15a927d8d Compress committed image layers by default
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>
2017-01-28 08:18:02 +01:00
Nalin Dahyabhai
d0a4816fe1 Ensure that we always set GOPATH right for builds
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>
2017-01-28 06:24:04 +01:00
Nalin Dahyabhai
1497e5af35 Suss out build tags, add a missing Travis dep
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>
2017-01-28 06:20:22 +01:00
Nalin Dahyabhai
6e489ae1f0 Add missing github.com/gorilla/context package
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>
2017-01-28 06:14:18 +01:00
Nalin Dahyabhai
5a2e7ac561 Make the --signature-policy flag "from"-only
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>
2017-01-28 06:09:49 +01:00
Nalin Dahyabhai
80ea423b9d Add an initial configuration for Travis
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-28 06:00:59 +01:00
Nalin Dahyabhai
931372925b Include our vendored dependencies
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-28 05:59:37 +01:00
Nalin Dahyabhai
84afb117be Roll back to stable versions of some of our deps
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>
2017-01-27 22:20:28 +01:00
Nalin Dahyabhai
02f30c773e Rename: lumper -> buildah
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-27 16:55:04 +01:00
Nalin Dahyabhai
59139af5c7 Add the container layer to the image metadata
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>
2017-01-27 15:38:32 +01:00