There are EOL spaces in the README preventing the `dnf install` command from being used in copy-pasta.
Signed-off-by: Joshua "jag" Ginsberg <jag@flowtheory.net>
Closes: #128
Approved by: rhatdan
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
Test setting and importing of configuration settings by saving to both
formats, and then checking that the values in both configuration fields
has the right data when we use either image type as a source image.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #118
Approved by: rhatdan
Add a test helper for examining image metadata and checking their types,
and add tests that use it to verify that after writing either Docker v2
or OCI v1 images, that the manifest and configuration blobs that we
stored for them successfully decode as the correct data types.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #118
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
Build configuration and manifest data for both output formats that we
support, and select one or the other based on the list of manifest types
that would be accepted as a source image.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #118
Approved by: rhatdan
Since V2S1 image manifests don't include a config blob, when we
initialize a builder using an image with a V2S1 manifest, try to dig
configuration information out of the manifest's layer history, and build
a V2S2 image configuration using the results.
Leave the diffID list unpopulated, because we compute the right values
when we push the image, and to prevent us from mistakes if we ever try
to use them before that in the future.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #118
Approved by: rhatdan
Import more manifest and schema variables and types, and rename some of
them to incorporate version numbers.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #118
Approved by: rhatdan
The CLI tool also incorporates types from the 'docker' subdirectory, so
add it as a build-time dependency to check.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #117
Approved by: nalind
Increase the timeout that we set for running the metalinter from 2
minutes to 4 minutes, for cases where the calling environment is more
heavily loaded than we expected.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #119
Approved by: rhatdan
Other tools use --storage-opt, buildah should be consistent
Cleanup buildah.1 man page
add options to buildah man page
add missing commands
Finally sort the commands in the buildah command.
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #112
Approved by: rhatdan
When we decode map elements, either from our own data, or when importing
from elsewhere, maps that don't contain any keys aren't created
automatically, so we need to check, and potentially create, maps when we
want to add something to them.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #114
Approved by: rhatdan
If we're building on an OCI image, initialize the Builder object's
annotations using the annotations from the source image.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #116
Approved by: rhatdan
Add an "inspect" command, which can be used to dump the contents of the
Buildah object for a working container, or the starting one we'd get for
a specified image.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #109
Approved by: rhatdan
Add a function for returning a Builder initialized from an image's
metadata, but which isn't tied to a container, so it can't be saved.
This refactored the existing importBuilder() implementation to split the
bits which locate the image based on the information it's given about a
container from the bits which build the structure using information read
from the image.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #109
Approved by: rhatdan
Update comments which reference where the types in docker/types.go came
from to reflect renames of the upstream repositories. The contents of
the types themselves, since they are encoded into images that are kept
on disk, shouldn't change often, if ever.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #102
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
Import the container.Config and container.HealthCheck API types, and the
nat.Port and nat.PortSet types from go-connections. Use the strslice
package from containers/image instead of rolling or importing our own.
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
When we pull down an image to use as a starting point, we no longer need
to attach any additional names to it, as the image library can now find
it correctly without requiring us to do so.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #99
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
We don't have a good way of identifying to a user where a container
was mounted on the file system when doing a buildah from.
A user can just do a buildah mount CID /mnt, after the from line to
handle this.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #86
Approved by: nalind
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
Re-vendor github.com/docker/docker and github.com/opencontainers/runc,
which we now use less of than we did previously.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #79
Approved by: nalind
Update the versions of github.com/opencontainers/runtime-spec and
github.com/opencontainers/runtime-tools that we vendor.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #79
Approved by: nalind