Commit Graph

115 Commits

Author SHA1 Message Date
Daniel J Walsh
d7880327ae Add truncation to buildah containers|images
Closes: #52
Approved by: rhatdan
2017-03-28 19:48:15 +00:00
Nalin Dahyabhai
ce254f51fc Tweak ADDing/COPYing directories to copy contents
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
2017-03-28 19:42:47 +00:00
Nalin Dahyabhai
53f12844b2 Accept commit targets which are just store refs
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
2017-03-28 19:33:07 +00:00
Daniel J Walsh
df71b8fe6a Update vendor patches
Closes: #51
Approved by: rhatdan
2017-03-28 19:22:27 +00:00
Nalin Dahyabhai
fc27a56f12 Rename "list"/"delete" to "containers"/"rm"
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
2017-03-28 17:59:09 +00:00
Nalin Dahyabhai
75c13530ac Update example scripts to use the new CLI syntax
Update the scripts in examples/ to adapt to changes in the CLI.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #48
Approved by: rhatdan
2017-03-28 16:22:28 +00:00
Daniel J Walsh
b8214c4cff Switch buildah list quiet option to only list container id's
Add `noheading` option to eliminate headings

Closes: #44
Approved by: rhatdan
2017-03-28 16:18:18 +00:00
Daniel J Walsh
e63629bfc6 Add some obvious short options
Closes: #44
Approved by: rhatdan
2017-03-28 16:18:18 +00:00
Nalin Dahyabhai
6715edfd18 Add some more options for Run
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
2017-03-28 15:53:18 +00:00
Nalin Dahyabhai
4c982a3799 Strip the image name down more for container names
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
2017-03-27 19:22:36 +00:00
Nalin Dahyabhai
e96ba381a2 Add some more options for Run
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
2017-03-27 19:07:38 +00:00
Daniel J Walsh
b58b778ef3 Move all command definitions out of main.go into implementation source
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
2017-03-27 19:03:28 +00:00
Daniel J Walsh
56f61d944a buildah delete should be able to delete multiple containers
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
2017-03-27 16:05:10 +00:00
Daniel J Walsh
547afe50a0 Remove --destination flag from buildah add|copy
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
2017-03-24 22:50:34 +00:00
Nalin Dahyabhai
943191c7c2 Correctly set tags on the names of pulled images
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
2017-03-24 22:47:33 +00:00
Nalin Dahyabhai
c6a4a06454 Bind mount /etc/hosts, /etc/resolv.conf in Run()
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
2017-03-24 20:37:06 +00:00
Nalin Dahyabhai
e202577172 Make Run() commands share the host's network
Make commands we run in Run() use the host's networking.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #34
Approved by: rhatdan
2017-03-24 20:37:06 +00:00
Nalin Dahyabhai
aacaf34354 Only attempt to shut down a Store if we opened one
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
2017-03-24 20:34:11 +00:00
Nalin Dahyabhai
fd3a1f09d6 Merge pull request #27 from rhatdan/name
Remove all --name and --root options
2017-03-24 14:57:31 -04:00
Jonathan Lebon
e62d7d9a60 hook up to redhat-ci
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
2017-03-24 18:42:00 +00:00
Daniel J Walsh
a07369f50d Merge pull request #38 from nalind/comment
Clarify a comment
2017-03-24 14:34:05 -04:00
Daniel J Walsh
c0b38746d3 Remove all --name and --root options
Also fix up buildah commit to require name and image
2017-03-24 14:05:25 -04:00
Nalin Dahyabhai
3bd2228516 Clarify a comment
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>
2017-03-24 13:48:39 -04:00
Nalin Dahyabhai
37d3ab9dca Merge pull request #26 from rhatdan/link
Remove link from CLI
2017-03-24 12:46:19 -04:00
Nalin Dahyabhai
737fb9183d Merge pull request #29 from nalind/mount-copy
Mount the container for Copy
2017-03-24 12:14:19 -04:00
Daniel J Walsh
d6a8a1800c Merge pull request #23 from TomSweeneyRedHat/dev/tsweeney/manpages/1
First of several submits for buildah manpages
2017-03-24 08:31:36 -04:00
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