If you specify an option in a buildah run command, the command fails.
The proper syntax for this is to add --
buildah run $ctr -- ls -l /
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #197
Approved by: nalind
The current buildah images command prints the heading twice, this
bug was introduced when --json flag was added.
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #195
Approved by: rhatdan
I think this would be good practice to eliminate wasted disk space.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #189
Approved by: rhatdan
Update to adjust to new types and method signatures in just-updated
vendored code.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #174
Approved by: rhatdan
Just build imgtype once, and reuse the flags we use for the main binary.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #174
Approved by: rhatdan
Bump containers/storage and containers/image, and pin them to their
current versions. This requires that we update image-spec to rc6 and
add github.com/ostreedev/ostree-go, which adds build-time requirements
on glib2-devel and ostree-devel.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #174
Approved by: rhatdan
Logging at Fatal calls os.Exit(), which keeps us from shutting down
storage properly, which prevents test cleanup from succeeding.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #162
Approved by: rhatdan
In the imgtype test helper, add a -debug flag, correctly handle things
on the off chance that we need to call a reexec handler, and read the
manifest using the Manifest() method of an image that we're already
opening, rather than creating a source image just so that we can call
its GetManifest() method.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #162
Approved by: rhatdan
Make the tests use the storage driver named in $STORAGE_DRIVER, if one's
set, instead of hard-coding the default of "vfs".
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #162
Approved by: rhatdan
Consumers of the buildah output will need structured text like
the JSON format. This commit adds a --json option to
buildah containers.
Example output:
```
[
{
"ID": "8911b523771cb2e0a26ab9bb324fb5be4e992764fdd5ead86a936aa6de964d9a",
"Builder": true,
"ImageId": "26db5ad6e82d85265d1609e6bffc04331537fdceb9740d36f576e7ee4e8d1be3",
"ImageName": "docker.io/library/alpine:latest",
"ContainerName": "alpine-working-container"
}
]
```
Signed-off-by: Brent Baude <bbaude@redhat.com>
Closes: #164
Approved by: rhatdan
The Atomic CLI will eventually need to be able to consume
structured output (in something like JSON). This commit
adds a -j option to output to trigger JSON output of
images.
Example output:
```
[
{
"id": "aa66247d48aedfa3e9b74e4a41d2c9e5d2529122c8f0d43417012028a66f4f3b",
"names": [
"docker.io/library/busybox:latest"
]
},
{
"id": "26db5ad6e82d85265d1609e6bffc04331537fdceb9740d36f576e7ee4e8d1be3",
"names": [
"docker.io/library/alpine:latest"
]
}
]
```
Signed-off-by: Brent Baude <bbaude@redhat.com>
Closes: #161
Approved by: rhatdan
Update the target name that we use when committing an image in the
example script to not mention the local storage transport, since the
default is to use it anyway.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #163
Approved by: rhatdan
When "run" isn't explicitly given a command, mix the command and
entrypoint options and configured values together correctly.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #160
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
Add a --all option to "buildah containers" that causes it to go through
the full list of containers, providing information about the ones that
aren't buildah containers in addition to the ones that are.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #148
Approved by: rhatdan
Modify shallowCopy() to not use a temporary image. Assume that the big
data items that we formerly added to the temporary image are small
enough that we can just hang on to them.
Write everything to the destination reference instead of a temporary
image, read it all back using the low level APIs, delete the image, and
then recreate it using the new layer and the saved items and names.
This lets us lift the requirement that we shallowCopy only to images
with names, so that build-using-dockerfile will work without them again.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #150
Approved by: rhatdan
Add a note that the version we record in our state file isn't
necessarily the package version, but is meant to change when we make
incompatible changes to the contents of the state file.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #147
Approved by: rhatdan
container/storage now supports remote shares and having a configuration
file. We need to merge this to demonstrate using buildah with nfs shares.
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #145
Approved by: nalind
Add a "push" command, which pulls an image's layers from local storage,
recomputes the image's digest and manifest, and uses the image library
to write the result to the specified location.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #141
Approved by: rhatdan
Don't overwrite an image configuration's information about the source
image unless we're intending to create a new working container.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #141
Approved by: rhatdan
Add CommitOption option that to allow a caller to specify a creation
timestamp to use in images.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #141
Approved by: rhatdan
Factor out logic that fakes up a source image using a container to be
able to do so using either a container or an image, by passing in names
and the starting layer ID directly, and by making the addition of a
history element for the layer optional (true for a container, since it's
going to add a new layer, false for an image that we're just exporting).
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #141
Approved by: rhatdan
When writing to local storage, take a couple of shortcuts: instead of
recompressing layers to ensure that the values we store in the image
manifest will be correct for content-addressibility, just pretend that
the layer ID is a blob hash value, and that it's a valid layer diffID.
Local storage doesn't generally care if these values are correct, and we
already have to recompute these values when exporting an image, but this
saves us quite a bit of time.
The image library's Copy() routine actually cares about and
sanity-checks these things, so if we're going to take advantage of the
shortcuts, we need to use its higher-level APIs to write a layer, write
the configuration, and write the manifest, then move those items that it
writes to an image with the right set of layers.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #141
Approved by: rhatdan
Ensure that "created" timestamps in Images and ImageSources derived from
an image reference that we synthesize don't vary, since we want to
compute the exact same image configuration and manifest every time we
read the image using that reference.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #141
Approved by: rhatdan
The commit logic incorporates routines from the 'util' subdirectory, so
add it as a build-time dependency to check.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #141
Approved by: rhatdan
Add a --volume/-v flag to "buildah run" to allow volume bind mounts to
be specified on the command line.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #144
Approved by: rhatdan
Fix the infinitely self-recursing, but immediately replaced, version of
the "umount" completion function with the missing "unmount" completion
function.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #143
Approved by: rhatdan
container/storage now supports remote shares and having a configuration
file. We need to merge this to demonstrate using buildah with nfs shares.
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #140
Approved by: nalind
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
Include the versions from the image-spec and runtime-spec that we were
built with as part of our --version and --help output.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #131
Approved by: nalind
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