This patch will allow commands like
buildah run $ctr ls -lZ /
To work correctly.
Need to update vendor of urfave cli.
Also changed all commands to no longer accept global options after the COMMAND.
Single boolean options can now be passed together.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #493
Approved by: rhatdan
Add the remaining --volume and --shm-size flags to buildah bud and from
--volume supports the following options: rw, ro, z, Z, private, slave, shared
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #491
Approved by: rhatdan
buildah bud was failing to get the secrets data
The issue was buildah bud was not being given the /usr/share/containers/mounts.conf file path
so it had no secrets to mount
Also reworked the way the secrets data was being copied from the host to the container
Signed-off-by: umohnani8 <umohnani@redhat.com>
Figured that these options need to be in from and bud instead.
Removed the options from the documentation of run and bud for now.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #470
Approved by: rhatdan
--add-host
--cgroup-parent
--cpu-period
--cpu-quota
--cpu-shares
--cpuset-mems
--memory
--memory-swap
--security-opt
--ulimit
These flags are going to be used by buildah run and bud.
The implementation will follow in another PR.
Signed-off-by: umohnani8 <umohnani@redhat.com>
No new line was returned when using the --format flag for buildah
inspect.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #442
Approved by: rhatdan
buildah containers now supports oretty-printing using a Go template
with the --format flag. And output can be filtered based on id, name, or
ancestor.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #437
Approved by: rhatdan
Allows rmi to remove all dangling images (images without a tag and without a child image)
Add new test case
Signed-off-by: Arthur Mello <amello@redhat.com>
Closes: #418
Approved by: rhatdan
The --runtime-flag flag for buildah run and bud would fail
whenever the global flags of the runtime were passed to it.
Changed it to accept the format [global-flag]=[value] where
global-flag would be converted to --[global-flag] in the code.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #431
Approved by: rhatdan
quiet was overriding format, but we want format to override quiet
if both the flags are set for buildah images.
Changed it so that it errors out if both quiet and format are set.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #426
Approved by: rhatdan
By default, the JSON encoder from the Go standard library
escapes the HTML characters which causes the maintainer output
looks strange:
"maintainer": "NGINX Docker Maintainers \u003cdocker-maint@nginx.com\u003e"
Instead of:
"maintainer": "NGINX Docker Maintainers <docker-maint@nginx.com>"
This patch fixes this issue in "buildah-inspect" only as this is
the only place that such characters are displayed.
Note: if the output of "buildah-inspect" is piped or redirected
then the HTML characters are not escaped.
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Closes: #421
Approved by: rhatdan
During the creation of a new builder object there are errors
that are only logged into "logrus.Debugf".
If in the end of the process "ref" or "img" are nil and "options.FromImage"
is set then it means that there was an issue.
By default, it was assumed that the image name is wrong. Yet,
this assumption isn't always correct. For example, it might fail due to
authorization or connection errors.
In this patch, I am attempting to fix this problem by checking the
last error stored in the "err" variable and returning the cause
of the failure.
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Closes: #406
Approved by: rhatdan
This change gives a better error message when the commit fails
because of bad authentication.
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Closes: #385
Approved by: rhatdan
Use NewImageSource() instead of NewImage() when checking if an image is
actually there, since it makes the image library do less work while
answering the same question for us.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #381
Approved by: rhatdan
Builder has the Config and the Manifest fields which are []byte.
The type is []byte because it's eaiser to serialize them that way.
However, when these fields are displayed in the following way:
buildah inspect -f '{{.Config}} {{.Manifest}}' IMAGE
they might be shown as a byte slice.
This patch suggests to use a struct that wraps Builder's exposed
fields such as Config, Manifest and Container as strings and
thus make them readable when inspecting specific field.
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Closes: #368
Approved by: rhatdan
When locating an image for pulling, inspection, or pushing, if we're
given an image name that doesn't include a domain/registry, try building
a set of candidate names using the configured registries as domains, and
then pull/inspect/push using the first of those names that works.
If a name that we're given corresponds to a prefix of the ID of a local
image, skip completion and use the ID directly instead.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #360
Approved by: rhatdan
buildah bud was not setting the mount label on the image
so SELinux in enforcing mode is blocking writing to the image
This patch also fixes a similar problem with the `buildah mount`
command
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #332
Approved by: TomSweeneyRedHat
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
buildah push supports manifest type conversion when pushing using the 'dir' transport
Manifest types include oci, v2s1, and v2s2
e.g buildah push --format v2s2 alpine dir:my-directory
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Closes: #321
Approved by: rhatdan
This patch will allow for the possibility of a valid "-"
option value. This is often used for taking from STDIN,
and should future proof us from this breaking if ever added.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Add options for specifying the root location when we're running unit
tests, so that we don't try to use the system's default location, which
we should avoid messing with if we can.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
In unit tests that assume that one or more images are present, make sure
we actually have pulled some images.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When we added more spaces between the columns of output from the
"images" command, we didn't update the test to expect it.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>