buildah push and from now use the credentials stored in ${XDG_RUNTIME_DIR}/containers/auth.json by kpod login
if the auth file path is changed, buildah push and from can get the credentials from the custom auth file
using the --authfile flag
e.g buildah push --authfile /tmp/auths/myauths.json alpine docker://username/image
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Closes: #325
Approved by: rhatdan
Replace --registry command line flags with --transport. For backward
compatibility, add Transport as an addtional setting that we prepend to
the still-optional Registry setting if the Transport and image name
alone don't provide a parseable image reference.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #235
Approved by: rhatdan
Ensure that volume points are created, if they don't exist, when they're
defined in a Dockerfile (#151), and that if we create them, we create
them with 0755 permissions (#152).
When processing RUN instructions or the run command, if we're not
mounting something in a volume's location, create a copy of the volume's
initial contents under the container directory and bind mount that.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #154
Approved by: rhatdan
Use Errorf() from 'errors' rather than 'fmt' to help with stack traces.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #130
Approved by: rhatdan
Impove error reporting by wrapping all returned err functions with
error.Wrapf
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #124
Approved by: nalind
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #125
Approved by: nalind
We weren't properly passing the preferred output format to the Commit()
method when committing images that we were building using
build-with-dockerfile. Fix that.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #127
Approved by: rhatdan
Make it possible to select the output format for Commit() and the
imagebuildah package, and wire that through to a --format option in the
CLI's "commit" and "bud" commands.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #118
Approved by: rhatdan
Preserve and pass in more container configuration settings when
initializing and imagebuildah object, and pull more settings back out
when committing an image. This should fix most of #97.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #102
Approved by: rhatdan
When we attempt to commit an image, if we encounter an error parsing the
destination location, return an error before logging that we're in the
COMMIT step.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #102
Approved by: rhatdan
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
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
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
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
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
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
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