Commit Graph

58 Commits

Author SHA1 Message Date
7a6a7e6b80 Merge pull request #29226 from yongtang/28535-prune-until-follow-up
Add `--filter until=<timestamp>` for `docker container/image prune`
Upstream-commit: 39c5af4a85
Component: cli
2017-01-09 17:58:01 +01:00
ec2f9bcbe4 *: use opencontainers/go-digest package
The `digest` data type, used throughout docker for image verification
and identity, has been broken out into `opencontainers/go-digest`. This
PR updates the dependencies and moves uses over to the new type.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 5d67ac20cb
Component: cli
2017-01-06 18:48:41 -08:00
c902dd671a Add --filter until=<timestamp> for docker container/image prune
This fix is a follow up for comment
https://github.com/docker/docker/pull/28535#issuecomment-263215225

This fix provides `--filter until=<timestamp>` for `docker container/image prune`.

This fix adds `--filter until=<timestamp>` to `docker container/image prune`
so that it is possible to specify a timestamp and prune those containers/images
that are earlier than the timestamp.

Related docs has been updated

Several integration tests have been added to cover changes.

This fix fixes #28497.

This fix is related to #28535.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e2416af013
Component: cli
2017-01-04 14:16:42 -08:00
1f9f54deef Merge pull request #29683 from vdemeester/runconfig-clean
Clean some stuff from runconfig that are cli only…
Upstream-commit: 2e880dd199
Component: cli
2016-12-29 17:42:08 +01:00
e004e7c7e4 Merge pull request #29668 from dmcgowan/plugins-dct
Support Docker Content Trust for plugins
Upstream-commit: 2a66659625
Component: cli
2016-12-28 10:43:32 -05:00
abab494a4f Support for docker content trust for plugins
Add integration test for docker content trust

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: fcaa89f296
Component: cli
2016-12-27 12:51:00 -08:00
337c5bb793 Move builder cli helper functions to own pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: c41bfce39a
Component: cli
2016-12-26 18:53:22 -08:00
0d7462bd1f Define PushResult in api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: bcc61e1300
Component: cli
2016-12-26 18:53:22 -08:00
f912773c28 Clean some stuff from runconfig that are cli only…
… or could be in `opts` package. Having `runconfig/opts` and `opts`
doesn't really make sense and make it difficult to know where to put
some code.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6726879382
Component: cli
2016-12-24 13:16:00 +01:00
ed51ff0e2b Abstract distribution interfaces from image specific types
Move configurations into a single file.
Abstract download manager in pull config.
Add supports for schema2 only and schema2 type checking.
Add interface for providing push layers.
Abstract image store to generically handle configurations.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 476adcfd20
Component: cli
2016-12-19 10:55:00 -08:00
fe8fcf4846 cli: Split out GetNotaryRepository and associated functions
Split these into cli/trust so that other commands can make use of them.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 639f97daea
Component: cli
2016-12-14 10:49:32 -08:00
e51409f512 Update the option 'network' for docker build
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: dd2b83e297
Component: cli
2016-12-13 18:18:53 +08:00
27fca83e87 Merge pull request #29104 from duglin/Issue29084
Fix processing of unset build-args during build
Upstream-commit: 4b7ad6c23e
Component: cli
2016-12-07 17:18:55 -08:00
94a2133e92 Fix processing of unset build-args during build
This reverts 26103.  26103 was trying to make it so that if someone did:
  docker build --build-arg FOO .
and FOO wasn't set as an env var then it would pick-up FOO from the
Dockerfile's ARG cmd.  However, it went too far and removed the ability
to specify a build arg w/o any value. Meaning it required the --build-arg
param to always be in the form "name=value", and not just "name".

This PR does the right fix - it allows just "name" and it'll grab the value
from the env vars if set. If "name" isn't set in the env then it still needs
to send "name" to the server so that a warning can be printed about an
unused --build-arg. And this is why buildArgs in the options is now a
*string instead of just a string - 'nil' == mentioned but no value.

Closes #29084

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: f1801ba475
Component: cli
2016-12-07 07:41:55 -08:00
e380819b38 registry: Remove reference.go
This removes some very old vestigial code that really should have been
removed during the content addressability transition. It implements
something called "reference" but it behaves differently from the actual
reference package. This was only used by client-side content trust code,
and is relatively easy to extricate.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: a5a246dbbc
Component: cli
2016-12-06 15:53:21 -08:00
b4cfb614da Convert DanglingOnly to Filters for docker image prune
This fix convert DanglingOnly in ImagesPruneConfig to Filters,
so that it is possible to maintain API compatibility in the future.

Several integration tests have been added to cover changes.

This fix is related to 28497.

A follow up to this PR will be done once this PR is merged.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: dd39897fca
Component: cli
2016-12-02 20:08:49 -08:00
e70cf0acf0 Add registry-specific credential helper support
Signed-off-by: Jake Sanders <jsand@google.com>
Upstream-commit: c84b90291c
Component: cli
2016-12-01 10:29:00 -08:00
6c5a8a992c Merge pull request #28354 from ripcurld00d/tag_creation
Change the docker-tag usage text to be clearer
Upstream-commit: dd8712c634
Component: cli
2016-11-18 13:02:40 +01:00
bdac023521 Change the docker-tag usage text to be clearer
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: cc36bf62ef
Component: cli
2016-11-18 10:34:02 +02:00
7487e32054 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 55908f8a82
Component: cli
2016-11-17 10:54:10 -08:00
0112a67d6b Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 5723c85b1d
Component: cli
2016-11-14 17:41:52 -08:00
d6a4ee3c7d Add reference filter and deprecated filter param…
… for `docker images`.

This deprecates the `filter` param for the `/images` endpoint and make a
new filter called `reference` to replace it. It does change the CLI
side (still possible to do `docker images busybox:musl`) but changes the
cli code to use the filter instead (so that `docker images --filter
busybox:musl` and `docker images busybox:musl` act the same).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3c61af0f76
Component: cli
2016-11-11 15:34:01 +01:00
bfaa4fa163 Update for distribution vendor
Handle updates to reference package.
Updates for refactoring of challenge manager.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 43bcd982cd
Component: cli
2016-11-10 17:34:12 -08:00
307edac963 always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>

update cobra and use Tags

Signed-off-by: Victor Vieux <vieux@docker.com>

allow client to talk to an older server

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 4ae7176ffb
Component: cli
2016-11-08 04:55:27 -08:00
8408e69f91 modify to improve code readability
Signed-off-by: WangPing <present.wp@icloud.com>

align

Signed-off-by: WangPing <present.wp@icloud.com>

align

Signed-off-by: WangPing <present.wp@icloud.com>
Upstream-commit: 713c7cd81e
Component: cli
2016-11-08 08:37:44 +08:00
25608ce8d4 always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: eb522dac24
Component: cli
2016-11-03 17:31:12 -07:00
951b0a97af Merge pull request #22641 from cpuguy83/build_finalization
Adds ability to flatten image after build
Upstream-commit: 09caa1ae97
Component: cli
2016-11-01 14:30:18 -07:00
fad42b5770 Adds ability to squash image after build
Allow built images to be squash to scratch.
Squashing does not destroy any images or layers, and preserves the
build cache.

Introduce a new CLI argument --squash to docker build
Introduce a new param to the build API endpoint `squash`

Once the build is complete, docker creates a new image loading the diffs
from each layer into a single new layer and references all the parent's
layers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b90c048804
Component: cli
2016-11-01 13:41:59 -04:00
f73b440c5c Validate docker-load receives a tar file
To load an image from a tar file, you can specify
the tar file in the -i/--input option:
docker load -i image_1.tar

or using stdin:

docker load < image_1.tar
cat image_1.tat | docker load

If the image file isn't given the `docker load`
command gets stuck.

To avoid that, the load makes sure the CLI input is
not a terminal or the `--input` option was set.
If not then an error message is shown.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: fdbf29e1fa
Component: cli
2016-10-31 15:30:55 +02:00
8446b1acdf add --network option for docker build
Signed-off-by: sandyskies <chenmingjie0828@163.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 3c9dff2f75
Component: cli
2016-10-25 10:25:36 -07:00
655c82e562 Fix typs from go to Go
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 24d0191a3a
Component: cli
2016-10-18 19:40:16 +08:00
1ce580f929 Fix API incompatibilities between notary v0.3.0 and v0.4.2:
- some function signatures have changed - use the new ones
- re-generate the notary delegation key certs, since notary doesn't allow SHA1
- fix some error message mapping because now if a root rotation fails to validate trusted operations will fail

Signed-off-by: cyli <cyli@twistedmatrix.com>
Upstream-commit: 43d7c0ed9a
Component: cli
2016-10-14 17:53:34 -07:00
b9c5442c91 better prune and system df
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 871b692833
Component: cli
2016-10-11 00:42:21 +08:00
7f7622756e Add the OPTIONS and Fix the links for contain prune
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 80bc917226
Component: cli
2016-10-11 00:13:33 +08:00
9d0867981a Windows: Support credential specs
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e307da732a
Component: cli
2016-10-06 09:32:22 -07:00
69602c283c Merge pull request #25837 from reaperhulk/support-compressing-build-context
Add support for compressing build context during image build
Upstream-commit: 8691f7c542
Component: cli
2016-10-05 12:57:46 -07:00
55fc58e15f Merge pull request #26108 from mlaventure/data-mngt
New Data Management commands
Upstream-commit: 71ffe11776
Component: cli
2016-10-01 03:17:18 +00:00
ad88944cf1 Add support for compressing build context during image build
When sending a build context to a remote server it may be
(significantly) advantageous to compress the build context. This commit
adds support for gz compression when constructing a build context
using a command like "docker build --compress ."

Signed-off-by: Paul Kehrer <paul.l.kehrer@gmail.com>
Upstream-commit: e25646bbc0
Component: cli
2016-09-30 17:46:08 -05:00
8d6b5149c7 Use ListOpt for labels.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d6b5a807d7
Component: cli
2016-09-29 17:59:52 -04:00
c80b266f91 Add subcommand prune to the container, volume, image and system commands
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 6f8bb41ecb
Component: cli
2016-09-29 07:42:53 -07:00
09eec7183c Implement build cache based on history array
Based on work by KJ Tsanaktsidis

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: KJ Tsanaktsidis <kjtsanaktsidis@gmail.com>
Upstream-commit: fe4cc3fd77
Component: cli
2016-09-23 11:30:06 -07:00
bd30751e22 Merge pull request #26516 from yongtang/26453-build-bad-syntax
Check bad syntax on dockerfile before building.
Upstream-commit: cecd4904f3
Component: cli
2016-09-23 12:24:20 +02:00
a765266b0a Only hide commands if the env variable is set.
Better formatting for usage template.
Group commands in usage to management/operation commands.
Remove the word Docker from the description of management commands.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 1f0f7ecb5a
Component: cli
2016-09-19 13:28:15 -04:00
93bceb1528 Move the search command to the registry package.
And move it back to the top-level command.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 68b7f55a45
Component: cli
2016-09-19 13:28:15 -04:00
5ae46f25cb Move canonical image and container commands into a command group
Hide some top level commands
Add docker container and image inspect commands.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: accc5d5bd4
Component: cli
2016-09-19 13:28:02 -04:00
473fb49310 Check bad syntax on dockerfile before building.
This fix tries to address the issue raised in 26453 where bad syntax
on dockerfile is not checked before building, thus user has to wait
before seeing error in dockerfile.

This fix fixes the issue by evaluating all the instructions and check
syntax before dockerfile is invoked actually.

All existing tests pass.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 824707ea49
Component: cli
2016-09-13 21:43:10 -07:00
a43858a79d Fix testcases that expect trailing whitespace
and broken integration tests based of nil pointers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2f8c4333fe
Component: cli
2016-09-13 17:58:12 -04:00
91cf73d819 Refactor formatter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: db0952ad22
Component: cli
2016-09-13 17:58:12 -04:00
d9c3f096cf Use opts.FilterOpt for filter flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d9cb421d69
Component: cli
2016-09-13 16:20:10 -04:00
ee44344b08 Merge pull request #26103 from sakeven/fix-validate-build-arg
validate build-arg
Upstream-commit: d23d33781a
Component: cli
2016-09-12 09:15:58 -04:00