Commit Graph

49 Commits

Author SHA1 Message Date
Derek McGowan 476adcfd20 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>
2016-12-19 10:55:00 -08:00
Aaron Lehmann 639f97daea 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>
2016-12-14 10:49:32 -08:00
yuexiao-wang dd2b83e297 Update the option 'network' for docker build
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-12-13 18:18:53 +08:00
Tõnis Tiigi 4b7ad6c23e Merge pull request #29104 from duglin/Issue29084
Fix processing of unset build-args during build
2016-12-07 17:18:55 -08:00
Doug Davis f1801ba475 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>
2016-12-07 07:41:55 -08:00
Aaron Lehmann a5a246dbbc 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>
2016-12-06 15:53:21 -08:00
Yong Tang dd39897fca 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>
2016-12-02 20:08:49 -08:00
Jake Sanders c84b90291c Add registry-specific credential helper support
Signed-off-by: Jake Sanders <jsand@google.com>
2016-12-01 10:29:00 -08:00
Vincent Demeester dd8712c634 Merge pull request #28354 from ripcurld00d/tag_creation
Change the docker-tag usage text to be clearer
2016-11-18 13:02:40 +01:00
Boaz Shuster cc36bf62ef Change the docker-tag usage text to be clearer
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2016-11-18 10:34:02 +02:00
Victor Vieux 55908f8a82 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-17 10:54:10 -08:00
John Howard 5723c85b1d Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-14 17:41:52 -08:00
Vincent Demeester 3c61af0f76 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>
2016-11-11 15:34:01 +01:00
Derek McGowan 43bcd982cd 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)
2016-11-10 17:34:12 -08:00
Victor Vieux 4ae7176ffb 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>
2016-11-08 04:55:27 -08:00
WangPing 713c7cd81e 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>
2016-11-08 08:37:44 +08:00
Victor Vieux eb522dac24 always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-11-03 17:31:12 -07:00
Michael Crosby 09caa1ae97 Merge pull request #22641 from cpuguy83/build_finalization
Adds ability to flatten image after build
2016-11-01 14:30:18 -07:00
Brian Goff b90c048804 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>
2016-11-01 13:41:59 -04:00
Boaz Shuster fdbf29e1fa 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>
2016-10-31 15:30:55 +02:00
sandyskies 3c9dff2f75 add --network option for docker build
Signed-off-by: sandyskies <chenmingjie0828@163.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-25 10:25:36 -07:00
yuexiao-wang 24d0191a3a Fix typs from go to Go
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-10-18 19:40:16 +08:00
cyli 43d7c0ed9a 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>
2016-10-14 17:53:34 -07:00
allencloud 871b692833 better prune and system df
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-11 00:42:21 +08:00
yuexiao-wang 80bc917226 Add the OPTIONS and Fix the links for contain prune
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2016-10-11 00:13:33 +08:00
John Howard e307da732a Windows: Support credential specs
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-06 09:32:22 -07:00
Alexander Morozov 8691f7c542 Merge pull request #25837 from reaperhulk/support-compressing-build-context
Add support for compressing build context during image build
2016-10-05 12:57:46 -07:00
Arnaud Porterie 71ffe11776 Merge pull request #26108 from mlaventure/data-mngt
New Data Management commands
2016-10-01 03:17:18 +00:00
Paul Kehrer e25646bbc0 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>
2016-09-30 17:46:08 -05:00
Daniel Nephin d6b5a807d7 Use ListOpt for labels.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-29 17:59:52 -04:00
Kenfe-Mickael Laventure 6f8bb41ecb Add subcommand prune to the container, volume, image and system commands
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-29 07:42:53 -07:00
Tõnis Tiigi fe4cc3fd77 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>
2016-09-23 11:30:06 -07:00
Vincent Demeester cecd4904f3 Merge pull request #26516 from yongtang/26453-build-bad-syntax
Check bad syntax on dockerfile before building.
2016-09-23 12:24:20 +02:00
Daniel Nephin 1f0f7ecb5a 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>
2016-09-19 13:28:15 -04:00
Daniel Nephin 68b7f55a45 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>
2016-09-19 13:28:15 -04:00
Daniel Nephin accc5d5bd4 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>
2016-09-19 13:28:02 -04:00
Yong Tang 824707ea49 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>
2016-09-13 21:43:10 -07:00
Daniel Nephin 2f8c4333fe Fix testcases that expect trailing whitespace
and broken integration tests based of nil pointers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-13 17:58:12 -04:00
Daniel Nephin db0952ad22 Refactor formatter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-13 17:58:12 -04:00
Daniel Nephin d9cb421d69 Use opts.FilterOpt for filter flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-13 16:20:10 -04:00
Brian Goff d23d33781a Merge pull request #26103 from sakeven/fix-validate-build-arg
validate build-arg
2016-09-12 09:15:58 -04:00
Antonio Murdaca aabe9468aa Merge pull request #26456 from dnephin/move_cli_command_registry
Remove registry/auth helper methods from the DockerCLI object
2016-09-12 15:11:04 +02:00
sakeven f39b39cccb validate build-arg
Signed-off-by: sakeven <jc5930@sina.cn>
2016-09-12 18:02:21 +08:00
Vincent Demeester 2dc3e0341b Merge pull request #26303 from yongtang/26300-docker-images-3-fractional-digits
Restrict size to 2 fractional digits for `docker images`
2016-09-10 11:32:45 +02:00
Daniel Nephin a26ba0e702 Remove remaining registry methods from DockerCLI.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-09 15:50:01 -04:00
Daniel Nephin ed55f00674 Remove RetrieveAuthConfigs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-09 15:50:01 -04:00
Daniel Nephin 0cf85349f3 Move image trust related cli methods into the image package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-09 10:50:16 -04:00
Yong Tang c68bb57959 Restrict size to 2 fractional digits for `docker images`
This fix tries to address the issue raised in 26300. Previously
`docker images` will use `HumanSize()` to display the size which
has a fixed precision of 4 (thus 3 fractional digits). This
could be problematic in certain languages (e.g. , German, see
26300) as `.` may be interpreted as thousands-separator in number.

This fix use `CustomSize()` instead and limit the precision to 3
(thus 2 fractional digits).

This fix has been tested manually.

This fix fixes 26300.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-08 18:26:50 -07:00
Daniel Nephin 3bd1eb4b76 Move api/client -> cli/command
Using
  gomvpkg
     -from github.com/docker/docker/api/client
     -to github.com/docker/docker/cli/command
     -vcs_mv_cmd 'git mv {{.Src}} {{.Dst}}'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-09-08 15:46:29 -04:00