Commit Graph

54 Commits

Author SHA1 Message Date
Daniel J Walsh
121973dd50 Fix cut and paste error in buildah images
Closes: #54
Approved by: rhatdan
2017-03-28 21:29:54 +00:00
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
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
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
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
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
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
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
37d3ab9dca Merge pull request #26 from rhatdan/link
Remove link from CLI
2017-03-24 12:46:19 -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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Nalin Dahyabhai
80691e654d mount: print the mountpoint
After we mount a filesystem, print the root filesystem location.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-27 15:37:15 +01:00
Nalin Dahyabhai
57841cce77 Rename: stevedore -> lumper
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-27 13:26:51 +01:00
Nalin Dahyabhai
4899f4f7fb Flesh out v1 image configuration a bit
Basically finish building v1 images.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-27 13:26:51 +01:00