We were interpreting the ignoreUnrecognizedInstructions incorrectly, so
fix that, and call out the unrecognized instruction keyword in the error
message (or debug message, if we're ignoring it).
Should fix#451.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #452
Approved by: rhatdan
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
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
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
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
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
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
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
Update shallowCopy() to work with the newer version of image.
Remove things from Push() that we don't need to do any more.
Preserve digests in image names, make sure we update creation times, and
add a test to ensure that we can pull, commit, and push using such names
as sources.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #187
Approved by: rhatdan
Bump the GIT_VALIDATION_EPOCH in tests/validate/git-validation.sh to a
later commit.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #340
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
Add a test that makes sure that "buildah run" fails if it can't resolve
the name of the user for the container.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #313
Approved by: rhatdan
Change our behavior when we're given USER with a numeric UID and no GID,
so that we no longer error out if the UID doesn't correspond to a known
user so that we can use that user's primary GID. Instead, use GID 0.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #313
Approved by: rhatdan
Add a test that makes sure we catch cases where we attempt to open a
file in the container's tree that's actually a symlink that points out
of the tree.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #313
Approved by: rhatdan
We don't need to mount the container for this test or add files to it,
and switching to a smaller base image that already includes a "hostname"
command means we don't need to run a package installer in the container.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #320
Approved by: nalind
Default to running integration tests using /var/tmp as scratch space,
since it's more likely to support proper SELinux labeling than /tmp,
which is more likely to be on a tmpfs.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #320
Approved by: nalind
This is no simpler then putting the transport in the image page,
we should default to the registry specified in containers/image
and not override it. People are confused by this option, and I
see no value.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #234
Approved by: rhatdan
We have implemented most of this code in kpod export, and we now
have kpod import/load/save. No reason to implement them in both
commands.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #245
Approved by: nalind
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
Fix our instantiation behavior when the source image reference is not a
named reference.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #235
Approved by: rhatdan