Commit Graph

206 Commits

Author SHA1 Message Date
TomSweeneyRedHat
cafc73e5e0 Touch up small typo in README.md
Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Closes: #129
Approved by: rhatdan
2017-05-31 12:51:19 +00:00
Joshua "jag" Ginsberg
ab9bbe032b Make README dnf command copy-pastable
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
2017-05-30 21:05:15 +00:00
TomSweeneyRedHat
2128b99ee9 Update README.md to show Dockerfile functionality
Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Closes: #126
Approved by: rhatdan
2017-05-30 20:57:49 +00:00
Nalin Dahyabhai
1ed6c7123f Finish wiring --format into build-using-dockerfile
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
2017-05-30 17:29:31 +00:00
Nalin Dahyabhai
2048c74819 Cleanup: use FileInfo's own IsDir() method
Use os.FileInfo's IsDir() method instead of Mode().IsDir().

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #120
Approved by: rhatdan
2017-05-24 19:48:09 +00:00
Nalin Dahyabhai
05a7c97f20 Test that setting configurations values works
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
2017-05-24 18:20:11 +00:00
Nalin Dahyabhai
9049b6108c Test writing while selecting metadata formats
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
2017-05-24 18:20:11 +00:00
Nalin Dahyabhai
4b6ba974cc Make the output image format selectable
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
2017-05-24 18:20:11 +00:00
Nalin Dahyabhai
7a42d3c6d3 Learn to commit images in multiple formats
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
2017-05-24 18:20:11 +00:00
Nalin Dahyabhai
88bf2ebdcf Also import configurations from V2S1 images
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
2017-05-24 18:20:11 +00:00
Nalin Dahyabhai
b7ccc2397b Import and namespace more types
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
2017-05-24 18:20:10 +00:00
Nalin Dahyabhai
bdb7aff926 Makefile: add source deps for the CLI tool
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
2017-05-23 17:32:55 +00:00
Nalin Dahyabhai
b92279faa4 Increase the timeout for metalinter from 2m to 4m
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
2017-05-23 17:06:37 +00:00
Nalin Dahyabhai
7a5342be8d Add more detail to errors returned from Commit()
Add some context to errors returned from the Commit() method.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #115
Approved by: rhatdan
2017-05-23 15:53:11 +00:00
Dan Walsh
45398cd196 Code cleanup
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
2017-05-23 15:47:15 +00:00
Nalin Dahyabhai
57e6a500d6 Make sure maps in config blobs are always created
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
2017-05-23 15:40:48 +00:00
Nalin Dahyabhai
0109d21679 Initialize the builder's annotations from OCI data
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
2017-05-23 15:33:39 +00:00
TomSweeneyRedHat
91a7fac35b Touchup README.md with new commands and golang version
Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Closes: #113
Approved by: nalind
2017-05-22 19:21:37 +00:00
Nalin Dahyabhai
9bcd86d87b Fix a copy/paste error in a man page
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #111
Approved by: nalind
2017-05-19 20:34:57 +00:00
Nalin Dahyabhai
3065ea3d16 Add a "tag" command
Add a "tag" command, for adding names to locally-stored images.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #110
Approved by: rhatdan
2017-05-19 19:59:47 +00:00
Nalin Dahyabhai
76395efa52 Add an initial "inspect" command
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
2017-05-19 11:29:12 +00:00
Nalin Dahyabhai
9865ea3660 Add ImportBuilderFromImage()
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
2017-05-19 11:29:12 +00:00
Nalin Dahyabhai
6f4bd94b95 Update reference comments for docker types origins
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
2017-05-18 18:28:44 +00:00
Nalin Dahyabhai
f32f6662d9 Improve configuration preservation in imagebuildah
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
2017-05-18 18:28:44 +00:00
Nalin Dahyabhai
828df7b054 imagebuildah: Bail out earlier on bad target parse
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
2017-05-18 18:28:44 +00:00
Nalin Dahyabhai
fc880bcc86 Maintain multiple working container configs
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
2017-05-18 18:28:44 +00:00
Nalin Dahyabhai
58e56e3efc Import container.{Config,HealthCheck},nat.PortSet
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
2017-05-18 18:28:44 +00:00
Dan Walsh
95c2a2d99c Vendor in containers/storage and containers/image
Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #103
Approved by: nalind
2017-05-17 21:19:24 +00:00
TomSweeneyRedHat
59c440aee8 Few install touchups to README.md
Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Touchup README.md, add skopeo pkg

Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Closes: #101
Approved by: nalind
2017-05-12 21:59:36 +00:00
Nalin Dahyabhai
12e582ee1a Report pull/commit progress by default
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
2017-05-10 12:53:25 +00:00
Nalin Dahyabhai
6d03588e83 Don't bother setting redundant image names
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
2017-05-09 20:13:04 +00:00
Nalin Dahyabhai
4d155b93b4 imagebuildah: add AdditionalTags
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
2017-05-08 18:05:31 +00:00
TomSweeneyRedHat
e06a697040 Update README.md with a few install changes
Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Closes: #93
Approved by: rhatdan
2017-05-08 17:58:58 +00:00
Nalin Dahyabhai
60b9159485 Add a "go vet" validation step
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #91
Approved by: rhatdan
2017-05-08 17:50:38 +00:00
Dan Walsh
126b578d8e Contribute buildah.spec
Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #70
Approved by: rhatdan
2017-05-08 17:44:23 +00:00
Nalin Dahyabhai
a930251d21 Bump github.com/mattn/go-shellwords
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
f4e6ca7233 Bump github.com/containers/image
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
d2e102d910 Bump github.com/docker/distribution
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
6c84328107 Bump github.com/containers/storage
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
06b927513b Bump golang.org/x/sys
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Nalin Dahyabhai
d0719eef96 Bump golang.org/x/text
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #87
Approved by: nalind
2017-04-27 18:21:13 +00:00
Daniel J Walsh
4c66c03b3d Remove --mount from buildah-from
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
2017-04-24 21:45:07 +00:00
Nalin Dahyabhai
04ce6f39c4 imagebuildah: Reexport some things
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
2017-04-24 14:33:43 +00:00
Nalin Dahyabhai
e63b5d4586 imagebuildah: Prepare() accepts a source image now
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
2017-04-24 14:28:00 +00:00
Dan Walsh
c038712e2a Add table of buildah commands to readme.md
Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Closes: #81
Approved by: rhatdan
2017-04-24 12:56:26 +00:00
Nalin Dahyabhai
406a8b9057 Updated vendored deps
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
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
e0008f810f Bump golang.org/x/text
Update the version of golang.org/x/text that we vendor.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
5c00086866 Bump opencontainers/runtime-spec and runtime-tools
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
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
a24d24e929 Bump golang.org/x/crypto
Update the version of golang.org/x/crypto that we vendor.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00
Nalin Dahyabhai
d94b22845c Bump golang.org/x/net
Update the version of golang.org/x/net that we vendor.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #79
Approved by: nalind
2017-04-20 15:38:25 +00:00