Commit Graph

6639 Commits

Author SHA1 Message Date
Nalin Dahyabhai d00be0fbbd Merge pull request #31 from nalind/copy-file
Teach "copy" to allow copying to a destination file
2017-03-23 17:39:00 -04:00
Nalin Dahyabhai 5354e9e04f Mount the container for Copy
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>
2017-03-23 17:37:23 -04:00
Nalin Dahyabhai 8bbc3a5a9c Tweak copying behavior so that dest can be a file
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>
2017-03-23 17:28:51 -04:00
Nalin Dahyabhai 933eecf71d Merge pull request #30 from nalind/make-working-dir
Always make sure the working directory exists
2017-03-23 17:28:21 -04:00
Nalin Dahyabhai 5b8579d897 Merge pull request #25 from nalind/vendor-updates
Vendor updates
2017-03-23 16:49:24 -04:00
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 ae1fffb3fd Always make sure the working directory exists
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>
2017-03-23 14:57:00 -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 f0b508598a Update implementation to match dependencies
types.ImageSource.Close() can return an error now, and ParseImageName()
moved to containers/image/transports/alltransports.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-22 16:33:24 -04:00
Nalin Dahyabhai f33ae08da5 Update vendored dependencies
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-22 16:33:24 -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
TomSweeneyRedHat a5e1ac3761 First of several submits for buildah manpages 2017-03-22 16:14:23 -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
TomSweeneyRedHat 98dc5672bc First of several submits for buildah manpages 2017-03-22 14:40:31 -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