Commit Graph

181 Commits

Author SHA1 Message Date
Nalin Dahyabhai
fc880bcc86 Maintain multiple working container configs
Maintain the container configuration in multiple formats in the Buildah
object, initializing one based on the other, depending on which format
the source image used for its configuration.

Replace directly manipulated fields in the Buildah object (Annotations,
CreatedBy, OS, Architecture, Maintainer, User, Workdir, Env, Cmd,
Entrypoint, Expose, Labels, and Volumes) with accessor functions which
update both configurations and which read from whichever one we consider
to be authoritative.  Drop Args because we weren't using them.

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

Closes: #102
Approved by: rhatdan
2017-05-18 18:28:44 +00:00
Nalin Dahyabhai
58e56e3efc Import container.{Config,HealthCheck},nat.PortSet
Import the container.Config and container.HealthCheck API types, and the
nat.Port and nat.PortSet types from go-connections.  Use the strslice
package from containers/image instead of rolling or importing our own.

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

Closes: #102
Approved by: rhatdan
2017-05-18 18:28:44 +00:00
Dan Walsh
95c2a2d99c Vendor in containers/storage and containers/image
Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #103
Approved by: nalind
2017-05-17 21:19:24 +00:00
TomSweeneyRedHat
59c440aee8 Few install touchups to README.md
Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Touchup README.md, add skopeo pkg

Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Closes: #101
Approved by: nalind
2017-05-12 21:59:36 +00:00
Nalin Dahyabhai
12e582ee1a Report pull/commit progress by default
Have 'from', 'commit', and 'build-using-dockerfile' report progress via
stderr (so that capturing output from 'from' and 'commit' still works as
expected) unless --quiet is used to suppress the reporting.

Closes #94.

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

Closes: #98
Approved by: rhatdan
2017-05-10 12:53:25 +00:00
Nalin Dahyabhai
6d03588e83 Don't bother setting redundant image names
When we pull down an image to use as a starting point, we no longer need
to attach any additional names to it, as the image library can now find
it correctly without requiring us to do so.

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

Closes: #99
Approved by: rhatdan
2017-05-09 20:13:04 +00:00
Nalin Dahyabhai
4d155b93b4 imagebuildah: add AdditionalTags
Add an AdditionalTags field to the imagebuildah options structure, to
provide for additional tags which we'll want to apply to the image that
we're writing.

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

Closes: #88
Approved by: rhatdan
2017-05-08 18:05:31 +00:00
TomSweeneyRedHat
e06a697040 Update README.md with a few install changes
Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Closes: #93
Approved by: rhatdan
2017-05-08 17:58:58 +00:00
Nalin Dahyabhai
60b9159485 Add a "go vet" validation step
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #91
Approved by: rhatdan
2017-05-08 17:50:38 +00:00
Dan Walsh
126b578d8e Contribute buildah.spec
Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #70
Approved by: rhatdan
2017-05-08 17:44:23 +00:00
Nalin Dahyabhai
a930251d21 Bump github.com/mattn/go-shellwords
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
f4e6ca7233 Bump github.com/containers/image
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
d2e102d910 Bump github.com/docker/distribution
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
6c84328107 Bump github.com/containers/storage
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
06b927513b Bump golang.org/x/sys
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
d0719eef96 Bump golang.org/x/text
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Daniel J Walsh
4c66c03b3d Remove --mount from buildah-from
We don't have a good way of identifying to a user where a container
was mounted on the file system when doing a buildah from.

A user can just do a buildah mount CID /mnt, after the from line to
handle this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #86
Approved by: nalind
2017-04-24 21:45:07 +00:00
Nalin Dahyabhai
04ce6f39c4 imagebuildah: Reexport some things
Have imagebuildah reexport some constants and its own Mount type, to
reduce the number of our dependencies that a prospective consumer of
this package would also need to import directly.

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

Closes: #84
Approved by: rhatdan
2017-04-24 14:33:43 +00:00
Nalin Dahyabhai
e63b5d4586 imagebuildah: Prepare() accepts a source image now
Update to mimic an API change in imagebuilder, which now allows us to
provide the FROM image directly via an API, potentially overriding the
first one named in the Dockerfile.

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

Closes: #83
Approved by: rhatdan
2017-04-24 14:28:00 +00:00
Dan Walsh
c038712e2a Add table of buildah commands to readme.md
Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #81
Approved by: rhatdan
2017-04-24 12:56:26 +00:00
Nalin Dahyabhai
406a8b9057 Updated vendored deps
Re-vendor github.com/docker/docker and github.com/opencontainers/runc,
which we now use less of than we did previously.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
e0008f810f Bump golang.org/x/text
Update the version of golang.org/x/text that we vendor.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
5c00086866 Bump opencontainers/runtime-spec and runtime-tools
Update the versions of github.com/opencontainers/runtime-spec and
github.com/opencontainers/runtime-tools that we vendor.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
a24d24e929 Bump golang.org/x/crypto
Update the version of golang.org/x/crypto that we vendor.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
d94b22845c Bump golang.org/x/net
Update the version of golang.org/x/net that we vendor.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
8b8320b282 Bump golang.org/x/sys
Update the version of golang.org/x/sys that we vendor.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
4a8e4b2c12 Bump fsouza/go-dockerclient
Update the version of github.com/fsouza/go-dockerclient that we vendor,
and pick up its new dependency on github.com/moby/moby.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
9a6dc67054 Bump and pin github.com/docker/go-connections
Update and pin the version of github.com/docker/go-connections that we
vendor.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
50fa09528f Pin gopkg.in/cheggaaa/pb.v1
Update and pin the version of gopkg.in/cheggaaa/pb.v1 that we vendor.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:24 +00:00
Nalin Dahyabhai
abf01462b0 Pin gopkg.in/yaml.v2
Update and pin the version of gopkg.in/yaml.v2 that we vendor.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:24 +00:00
Nalin Dahyabhai
21c71b634b Bump containers/image and image-spec
Update to the current github.com/containers/image and
github.com/opencontainers/image-spec packages.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:24 +00:00
Nalin Dahyabhai
3ca21d0bc3 Bump containers/storage and pick up its new dep
Update to the current containers/storage and vendor its new dependency
on github.com/tchap/go-patricia.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:24 +00:00
Nalin Dahyabhai
52b13eec59 Pin github.com/opencontainers/{go-digest,selinux}
Pin the versions of github.com/opencontainers/go-digest and
github.com/opencontainers/selinux that we vendor.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:24 +00:00
Nalin Dahyabhai
cbfae6b0f6 Bump github.com/docker/docker
Update our version of github.com/docker/docker.  Now that we've got #75
merged, we end up pulling in quite a bit less of it.

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

Closes: #79
Approved by: nalind
2017-04-20 15:38:24 +00:00
Nalin Dahyabhai
ce3505a4d7 Internalize some Docker types
Internalize the type declaration of a Docker image, so that we don't
need to pull in code when we just want to know how to parse out a JSON
object.  Carry a copy of the license that covered the sources from which
the definitions came.

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

Closes: #75
Approved by: nalind
2017-04-19 19:05:06 +00:00
Nalin Dahyabhai
ce87a52ef4 bud: Add flags for specifying the runtime command
So long as it's possible to have an incompatible version of runc
installed, we're going to want to easily point to another version, as we
already allow for with the "run" command.

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

Closes: #76
Approved by: nalind
2017-04-19 18:58:13 +00:00
Nalin Dahyabhai
1b05c67961 imagebuildah: Commit() doesn't need a parser node
The Commit() method doesn't use its parser node argument, and the
Commit() method in the dockerclient builder in imagebuilder doesn't, so
switch to match its signature.

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

Closes: #74
Approved by: rhatdan
2017-04-18 20:56:04 +00:00
Dan Walsh
767389c87d Fix handling of man page for make install
Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #72
Approved by: nalind
2017-04-18 20:20:10 +00:00
Nalin Dahyabhai
d0f7e88806 imagebuildah: Provide logging callbacks
Add a Log() callback and Out and Err io.Writers to the set of options
that imagebuildah can accept.  If Log is not specified, log to Err.  If
Err is not specified, log to os.Stderr.

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

Closes: #73
Approved by: rhatdan
2017-04-18 20:13:07 +00:00
Dan Walsh
8c8a13fdc2 Small cleanup on buildah rmi to make code cleaner
While adding rmi to ocid, I was asked to make this change, so want
to keep the code in buildah and ocid for these functions as close as
possible to the same.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #69
Approved by: nalind
2017-04-17 18:40:17 +00:00
Nalin Dahyabhai
cbeb888e30 Clean up image pulling policy
Change how we represent image pulling policy from a pair of booleans to
a single field which can take three values (never, if-missing, always),
with the default value being if-missing.

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

Closes: #71
Approved by: rhatdan
2017-04-17 18:16:13 +00:00
Nalin Dahyabhai
aff92e565c Miscellaneous man page updates
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #67
Approved by: rhatdan
2017-04-14 10:12:01 +00:00
Nalin Dahyabhai
d68d986d0f rm/rmi: Don't exit until we've tried them all
If we're told to remove more than one container or image, actually try
to remove them all, but still return an error if we fail at any of them.

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

Closes: #68
Approved by: rhatdan
2017-04-14 09:37:24 +00:00
Nalin Dahyabhai
d410ce9aea Update bash-completions for build-using-dockerfile
Add completion for build-using-dockerfile and our renaming of the
containers/images --no-truncate flag to --notruncate during the CLI
overhaul.

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

Closes: #59
Approved by: rhatdan
2017-04-13 21:42:51 +00:00
Nalin Dahyabhai
31b6e7b485 Add a man page for buildah-bud(1)
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #59
Approved by: rhatdan
2017-04-13 21:42:51 +00:00
Nalin Dahyabhai
761597056c Add a few tests for building images
It's nowhere near exhaustive, but it's a start.

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

Closes: #59
Approved by: rhatdan
2017-04-13 21:42:51 +00:00
Nalin Dahyabhai
0b51d4990a Add a build-using-dockerfile command
Add a build-using-dockerfile command (alias: bud) which uses
openshift/imagebuilder to wrap parsing and dispatching, and runc (or
another OCI runtime) to handle RUN instructions.

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

Closes: #59
Approved by: rhatdan
2017-04-13 21:42:51 +00:00
Nalin Dahyabhai
a532522624 Vendor openshift/imagebuilder
Vendor openshift/imagebuilder and its dependencies, and pick up new
dependencies on golang.org/x/text and github.com/opencontainers/selinux.

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

Closes: #59
Approved by: rhatdan
2017-04-13 21:42:51 +00:00
Nalin Dahyabhai
bed75252b0 Use imagebuilder's definition of "scratch"
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #59
Approved by: rhatdan
2017-04-13 21:42:51 +00:00
Nalin Dahyabhai
e67d2e7356 The "all" target shouldn't do any installing
Remove "install.tools" as a dependency of the top-level "all" target,
and make it a dependency of the "install" target.

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

Closes: #62
Approved by: rhatdan
2017-04-12 21:25:35 +00:00