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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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