Commit Graph

79 Commits

Author SHA1 Message Date
Daniel J Walsh
80f73013cd Remove link from CLI
We have decided not to support using the --link param in the CLI.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-03-23 14:59:20 -04:00
Nalin Dahyabhai
711e0f420f Merge pull request #22 from rhatdan/BUILDAHROOT
Default --root option to ENV BUILDAHROOT
2017-03-22 16:48:38 -04:00
Daniel J Walsh
2ca263ad1e Default --root option to ENV BUILDAHROOT
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-03-22 16:33:46 -04:00
Nalin Dahyabhai
bdc7aa9235 Merge pull request #24 from nalind/errors
Correctly report errors returned by commands
2017-03-22 16:32:04 -04:00
Nalin Dahyabhai
8292693fc8 Correctly report errors returned by commands
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>
2017-03-22 15:17:53 -04:00
Nalin Dahyabhai
9cb2e7b62b Merge pull request #16 from nalind/cli-parsing
Changes to the CLI parsing and --help output
2017-03-22 10:09:55 -04:00
Nalin Dahyabhai
010184cebb Merge pull request #17 from nalind/chrootarchive
Use chrootarchive to head off tar shenanigans
2017-03-21 15:47:02 -04:00
Nalin Dahyabhai
95312390d7 Use chrootarchive to head off tar shenanigans
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>
2017-03-21 14:26:00 -04:00
Nalin Dahyabhai
9edc229948 commit: "do-not-compress" -> "disable-compression"
Rename the "commit" "--do-not-compress" flag to be called
"--disable-compression" instead.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-20 16:30:01 -04:00
Nalin Dahyabhai
6135c2a947 Note that "scratch" is an accepted image name
Note that "scratch" is an option in the usage text for "from"'s --image
flag.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-20 16:11:30 -04:00
Nalin Dahyabhai
ae1295b0c9 Tweak more help usage and descriptions
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-20 15:51:35 -04:00
Nalin Dahyabhai
ce13780b83 Add a couple of tests for "run"
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-17 18:53:04 -04:00
Nalin Dahyabhai
0d83d9ebfa Pull required flag values from the arguments list
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>
2017-03-17 18:46:16 -04:00
Nalin Dahyabhai
f2fc0c7e5f Remove single-character aliases for subcommands
Remove the single-character aliases for subcommands.  They were not
popular.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-17 18:46:16 -04:00
Nalin Dahyabhai
2f545788b6 Default "from" to --pull=true
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>
2017-03-17 18:46:16 -04:00
Nalin Dahyabhai
9d42fecce0 Show defaults for global options in help output
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>
2017-03-17 18:46:16 -04:00
Nalin Dahyabhai
f4be6fdc48 Don't mix "config" in with "run" and "commit"
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>
2017-03-17 18:46:15 -04:00
Nalin Dahyabhai
631cda1e5f Update flag Usage strings to highlight arg types
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>
2017-03-17 18:46:15 -04:00
Nalin Dahyabhai
16dc82bd9b Merge pull request #9 from nalind/postmove
Catch up to the projectatomic move
2017-03-16 10:59:07 -04:00
Nalin Dahyabhai
a2ccec8c43 Catch up to the projectatomic move
Catch up import paths and docs to build correctly now that we're in
projectatomic.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-16 10:54:45 -04:00
Nalin Dahyabhai
83a1ec775e Clarify that we can find containers by name or ID
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>
2017-03-16 10:19:05 -04:00
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