--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>
When we encounter the MAINTAINER keyword in a Dockerfile, imagebuilder
updates the Author field in the imagebuilder.Builder structure. Pick up
that value when we go to commit the image.
Should fix#448.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #450
Approved by: rhatdan
When setting a container name the getImageName function goes through
all the names of the resolved image and finds the name that contains
the given name by the user.
However, if the user is specifying "docker.io/tagged-image"
the Docker transport returns "docker.io/library/tagged-image" which
makes getImageName returns the original image name because it does
not find a match.
To resolve this issue before calling getImageName the image given
by the user will be trimmed to be just the name.
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Closes: #422
Approved by: rhatdan
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
In commit 47ac96155f the image name that is used
for setting the container name is taken from the resolved image
unless it is empty.
The image has the "Names" field and right now the first name is
taken. However, when the image is a tagged image, the container name
will end up using the original name instead of the given one.
For example:
$ buildah tag busybox busybox1
$ buildah from busybox1
Will set the name of the container as "busybox-working-container"
while it was expected to be "busybox1-working-container".
This patch fixes this particular issue.
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Closes: #399
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
When a v2s1 image is stored to disk, some of the layer blobs listed in
its manifest may be discarded as. Account for this.
Start treating a failure to decode v1compat information as a fatal error
instead of trying to fake it.
Tweak how we build the created-by field in history when generating one
from v2s1 information to better match what we see in v2s2 images.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #383
Approved by: rhatdan
When building an image's config blob, add a sanity check that the number
of diffIDs that we're including matches the number of entries in the
history which don't claim to be empty layers.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #383
Approved by: rhatdan
When we warn about not processing a secrets configuration file, actually
skip anything we might have salvaged from it to make our behavior match
the warning.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #380
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
We often use err as a variable inside of subblocks, and
we don't want golint to complain about it.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #379
Approved by: nalind
I have made a subpackage of libpod to handle chrootuser,
using the user code from buildah.
This patch removes user handling from buildah and uses
projectatomic/libpod/pkg/chrootuser
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #377
Approved by: nalind
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
Add a test to ensure that 'buildah rmi' works if passed a truncated
version of an image's ID.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #361
Approved by: rhatdan