Commit Graph

87 Commits

Author SHA1 Message Date
4489cc6ffc Merge pull request #30962 from TheHipbot/30431-implement-format-for-history-with-docs
30431 implement format for history with docs
Upstream-commit: a3ab46361ee91dc99790e84369b4865572bd9f8c
Component: engine
2017-04-16 10:34:41 -07:00
a89a2c21c5 builder: add an option for specifying build target
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 33e07f41adc0ec96edad5f22bc2cfaec0d26ea58
Component: engine
2017-04-10 16:21:43 -07:00
15fc803536 Merge pull request #31236 from tonistiigi/docker-stdin
build: accept -f - to read Dockerfile from stdin
Upstream-commit: 778e32a2fadcf1ccb1819ad6534af5c477585300
Component: engine
2017-04-10 20:14:54 +02:00
4adfcf1302 Upadte archive.ReplaceFileTarWrapper() to not expect a sorted archive
Improve test coverage of ReplaceFileTarWrapper()

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 8cd6c30a489f7a0210526b0f94469c525ba8e0ee
Component: engine
2017-04-06 13:36:34 -04:00
83d9648a45 Add label filter for docker system prune
This fix tries to address the issue raised in 29999 where it was not
possible to mask these items (like important non-removable stuff)
from `docker system prune`.

This fix adds `label` and `label!` field for `--filter` in `system prune`,
so that it is possible to selectively prune items like:
```
$ docker container prune --filter label=foo

$ docker container prune --filter label!=bar
```

Additional unit tests and integration tests have been added.

This fix fixes 29999.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 702524732427ce028277f99f215e1fab297e6001
Component: engine
2017-04-06 09:11:25 -07:00
3712bab8c4 Factor out adding dockerfile from stdin.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 56bf6de9f7f0d8e35a5170faf0c35ad07c89d04c
Component: engine
2017-04-05 19:42:31 -04:00
06ea8bf159 build: accept -f - to read Dockerfile from stdin
Heavily based on implementation by David Sheets

Signed-off-by: David Sheets <sheets@alum.mit.edu>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 3f6dc81e10b8b813fffaa9b4167a60c5a507fa38
Component: engine
2017-04-05 19:42:31 -04:00
5f5b8fe9f6 Manually reorganize import paths to segregate stdlib and 3rd-party packages
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: febbe3879695c46d243ce806713038e0c1582806
Component: engine
2017-03-27 18:21:59 -07:00
7cc7eec39f Replace fmt.Errorf() with errors.Errorf() in the cli
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7b7ea8ab810190018346cb7d84c161bb94f7ca60
Component: engine
2017-03-24 16:58:07 -04:00
b53e61fcff Return proper exit code on builder panic
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 385f1174ff6905243c51d97d641d815a520229ff
Component: engine
2017-03-21 19:09:23 -07:00
77bcd83cef Implements --format option for docker history command by creating a formatter
Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>

Adds to history documentation for --format

Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>

Adds MarshalJSON to historyContext for {{json .}} format

Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>

Adds back the --human option to history command

Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>

Cleans up formatter around --human option for history, Adds integration test for --format option of history

Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>

Adds test for history formatter checking full table results, Runs go fmt on touched files

Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>

Fixes lint errors in formatter/history

Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>

Runs go fmt on cli/command/formatter/history.go

Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>

sRemoves integration test for --format option of history

Merges Created and CreatedSince in docker history formatter, Updates docs and tests
Upstream-commit: 6bc1f345af77fcf8f1f34b66ae51c314cc63401e
Component: engine
2017-03-11 13:54:16 -06:00
6079289459 Merge pull request #30047 from duglin/distError
Add the mediaType to the error
Upstream-commit: e10f9db26d7db8396d6f70419ecd1aa081190069
Component: engine
2017-03-10 16:44:49 -08:00
ba46ce307c Use opts.MemBytes for flags.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: afcaeedbd4249009811ba1c11767173c23ae0814
Component: engine
2017-03-07 10:32:49 -05:00
aa4b36806a Some things just need to be line wrapped.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2e9f9d2c347186a29fc558e1c95d5246fad66c2a
Component: engine
2017-03-06 16:01:57 -05:00
e5361f1d31 Add the mediaType to the error
Without this fix the error the client might see is:
	target is unknown
which wasn't helpful to me when I saw this today. With this fix I
now see:
	MediaType is unknown: 'text/html'
which helped me track down the issue to the registry I was talking to.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: c127d9614f5b30bd73861877f8540a63e7d869e9
Component: engine
2017-02-28 11:36:32 -08:00
7dba33b4e7 Add --add-host for docker build
Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
Upstream-commit: 7a962e4577628c357f96153eca07e527813fb42b
Component: engine
2017-02-20 17:32:28 -05:00
29e3dcbbb0 why there are so many mistakes in our repo (up to /cmd)
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: f8a40477960976f12dbbb72e5b133b5b0f05f9b3
Component: engine
2017-02-17 00:32:48 +08:00
2260389fe6 Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 3a1279393faf78632bf169619d407e584da84b66
Component: engine
2017-02-07 11:08:37 -08:00
ba31fcddc2 Merge pull request #29692 from yongtang/29492-daemon-shm-size
Add daemon option `--default-shm-size`
Upstream-commit: 354bd4aaddc3072dbe9ead45b22a1eaccda6a506
Component: engine
2017-02-01 16:56:10 +01:00
46d59f3006 Merge pull request #30411 from thaJeztah/fix-build-from-local-github-directories
do not ignore local build-contexts starting with "github.com"
Upstream-commit: 048fc98c09fb85b827f3caf69c460e9ad6aa095a
Component: engine
2017-01-31 12:45:11 -08:00
c74a5fc7cf Merge pull request #30186 from thaJeztah/add-version-annotation-to-flags
Add version annotation to various flags added in 1.13
Upstream-commit: a08da82a28848b4857e86b9a493143e9ac3fcee6
Component: engine
2017-01-30 12:33:36 -08:00
f890132120 Update opts.MemBytes to disable default, and move docker run/create/build to use opts.MemBytes
This fix made several updates:
1. Update opts.MemBytes so that default value will not show up.
   The reason is that in case a default value is decided by daemon,
   instead of client, we actually want to not show default value.
2. Move `docker run/create/build` to use opts.MemBytes for `--shm-size`
   This is to bring consistency between daemon and docker run
3. docs updates.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: d1982862cacb74fb28f8103d0774960fd59a5373
Component: engine
2017-01-27 12:17:06 -08:00
0dedd22a73 Merge pull request #30043 from dmcgowan/distribution-reference-update-1
Distribution reference update
Upstream-commit: e9c0de0de65182915d1cd205f06f5c903c20a29f
Component: engine
2017-01-24 20:38:20 -08:00
20217e017d do not ignore local build-contexts starting with "github.com"
Docker special-cases build-contexts starting with `github.com`, and
treats them as remote URLs.

Because of this special treatment, local build contexts in a directory
named "github.com" are ignored by `docker build`.

This patch changes the way the build-context is detected and first
checks if a local path with the given name exists before considering
it to be a remote URL.

Before this change;

    $ mkdir -p github.com/foo/bar && echo -e "FROM scratch\nLABEL iam=local" > github.com/foo/bar/Dockerfile

    $ docker build -t dont-ignore-me github.com/foo/bar
    Username for 'https://github.com':

After this change;

    $ mkdir -p github.com/foo/bar && echo -e "FROM scratch\nLABEL iam=local" > github.com/foo/bar/Dockerfile

    $ docker build -t dont-ignore-me github.com/foo/bar
    Sending build context to Docker daemon 2.048 kB
    Step 1/2 : FROM scratch
     --->
    Step 2/2 : LABEL iam local
     ---> Using cache
     ---> ae2c603fe970
    Successfully built ae2c603fe970

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 37a1a84d913a64cec7bc05d44a7e4c5c3445a8ae
Component: engine
2017-01-24 17:44:44 +01:00
ffebf75329 fix flag descriptions for content-trust
Commit ed13c3abfb242905ec012e8255dc6f26dcf122f6 added flags
for Docker Content Trust. Depending on the `verify` boolean,
the message is "Skip image verification", or "Skip image signing".
"Signing" is intended for `docker push` / `docker plugin push`.

During the migration to Cobra, this boolean got flipped for
`docker push` (9640e3a4514f96a890310757a09fd77a3c70e931),
causing `docker push` to show the incorrect flag description.

This patch changes the flags to use the correct description
for `docker push`, and `docker plugin push`.

To prevent this confusion in future, the boolean argument
is removed, and a `AddTrustSigningFlags()` function is added.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bb3c0b246617aecb8ecf9120f07efcf45b94ae09
Component: engine
2017-01-23 14:52:36 +01:00
027b11b8c3 Remove use of forked reference package for cli
Use resolving to repo info as the split point between the
legitimate reference package and forked reference package.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 0421f5173dbdcb4e4eade5267f274302bb6ab97c
Component: engine
2017-01-19 16:04:50 -08:00
be728731d1 Add version annotation to various flags added in 1.13
Pull request https://github.com/docker/docker/pull/27745 added support for the
client to talk to older versions of the daemon. Various flags were added to
docker 1.13 that are not compatible with older daemons.

This PR adds annotations to those flags, so that they are automatically hidden
if the daemon is older than docker 1.13 (API 1.25).

Not all new flags affect the API (some are client-side only). The following
PR's added new flags to docker 1.13 that affect the API;

- https://github.com/docker/docker/pull/23430 added `--cpu-rt-period`and `--cpu-rt-runtime`
- https://github.com/docker/docker/pull/27800 / https://github.com/docker/docker/pull/25317 added `--group` / `--group-add` / `--group-rm`
- https://github.com/docker/docker/pull/27702 added `--network` to `docker build`
- https://github.com/docker/docker/pull/25962 added `--attachable` to `docker network create`
- https://github.com/docker/docker/pull/27998 added `--compose-file` to `docker stack deploy`
- https://github.com/docker/docker/pull/22566 added `--stop-timeout` to `docker run` and `docker create`
- https://github.com/docker/docker/pull/26061 added `--init` to `docker run` and `docker create`
- https://github.com/docker/docker/pull/26941 added `--init-path` to `docker run` and `docker create`
- https://github.com/docker/docker/pull/27958 added `--cpus` on `docker run` / `docker create`
- https://github.com/docker/docker/pull/27567 added `--dns`, `--dns-opt`, and `--dns-search` to `docker service create`
- https://github.com/docker/docker/pull/27596 added `--force` to `docker service update`
- https://github.com/docker/docker/pull/27857 added `--hostname` to `docker service create`
- https://github.com/docker/docker/pull/28031 added `--hosts`, `--host-add` / `--host-rm` to `docker service create` and `docker service update`
- https://github.com/docker/docker/pull/28076 added `--tty` on `docker service create` / `docker service update`
- https://github.com/docker/docker/pull/26421 added `--update-max-failure-ratio`, `--update-monitor` and `--rollback` on `docker service update`
- https://github.com/docker/docker/pull/27369 added `--health-cmd`, `--health-interval`, `--health-retries`, `--health-timeout` and `--no-healthcheck` options to `docker service create` and `docker service update`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bbbddeebba5fb8856dc977eada90c22f1f20c394
Component: engine
2017-01-16 18:21:20 +01:00
fed9eaa59d Merge pull request #29856 from Microsoft/jjh/warntoout
Windows to Linux build warning to stdout
Upstream-commit: 7d24cc7710f49f1f3caadf15d9eddb7e3b7a5f0d
Component: engine
2017-01-14 16:37:31 -05:00
701de0a381 Merge pull request #29226 from yongtang/28535-prune-until-follow-up
Add `--filter until=<timestamp>` for `docker container/image prune`
Upstream-commit: f1fdbeca2a39c7189b1ca8db4e4543fe77ff1150
Component: engine
2017-01-09 17:58:01 +01:00
775c5633ef *: 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: 7a855799175b6b984886ef1cfa337d6df1d4c668
Component: engine
2017-01-06 18:48:41 -08:00
0c3b3bfadc 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: 58738cdee327f5de481dcf7d3d377374cbb5f13a
Component: engine
2017-01-04 14:16:42 -08:00
6019fc383c Windows to Linux build warning to stdout
Signed-off-by: John Howard <jhoward@microsoft.com>

When building a Dockerfile from a Windows client on a Linux daemon, a
"security warning" is printed
on stderr. Having this warning printed on stderr makes it difficult to
distinguish a failed build from one that's succeeding, and the only way to
suppress the warning is through the -q option, which also suppresses every
output. This change prints the warning on stdout, instead of stderr, to
resolve this situation.
Upstream-commit: d45c652e8393416d5a00eaa8864223b786c4182e
Component: engine
2017-01-03 14:07:50 -08:00
ce3330c6eb Merge pull request #29683 from vdemeester/runconfig-clean
Clean some stuff from runconfig that are cli only…
Upstream-commit: 1dd941077653bc93ee4141c4d2bac90534678e3f
Component: engine
2016-12-29 17:42:08 +01:00
98526f223f Merge pull request #29668 from dmcgowan/plugins-dct
Support Docker Content Trust for plugins
Upstream-commit: a412c1b7a03e24ba733809924c680f395fad2655
Component: engine
2016-12-28 10:43:32 -05:00
17e3d2d6b6 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: 14e8bba4f5d39e7a540bee44c133a1e73db48f84
Component: engine
2016-12-27 12:51:00 -08:00
8fc615e678 Move builder cli helper functions to own pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: feaf5902f650f2326e1c41e82dfe28962f1ba46e
Component: engine
2016-12-26 18:53:22 -08:00
1c2e3ffc9c Define PushResult in api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 13222160e84a01db2174c0dbf3000761a756fd72
Component: engine
2016-12-26 18:53:22 -08:00
0de1da63ca 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: c424be21b7aa732681ed019b5e547a99fdc2afa5
Component: engine
2016-12-24 13:16:00 +01:00
c162add86f 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: 3c7676a057a4c0103895f793e407dc6736df139a
Component: engine
2016-12-19 10:55:00 -08:00
87aafbf002 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: 4b8c79f25ee00ca5dfe22271c166938009bda976
Component: engine
2016-12-14 10:49:32 -08:00
d619a55e45 Update the option 'network' for docker build
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: cd317282c9b7d4dc68dce8df1d2f84e7a5654e72
Component: engine
2016-12-13 18:18:53 +08:00
b5155284d2 Merge pull request #29104 from duglin/Issue29084
Fix processing of unset build-args during build
Upstream-commit: dca76ed50a02659ba7ca4e209356f138ff14dc3e
Component: engine
2016-12-07 17:18:55 -08:00
ce009b27d8 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: cdb8ea90b04683adb25c8ccd71b6eaedc44b51e2
Component: engine
2016-12-07 07:41:55 -08:00
7eef41ce9c 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: d91ed88365317cd86555e2f54bffa30ec6590dfe
Component: engine
2016-12-06 15:53:21 -08:00
35037b78fd 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: a6be56b54e871c4e7a6e72881770a64676c27c3c
Component: engine
2016-12-02 20:08:49 -08:00
2e1e2b9b86 Add registry-specific credential helper support
Signed-off-by: Jake Sanders <jsand@google.com>
Upstream-commit: 07c4b4124b46be30ea3ac7d114c44c4f911ca182
Component: engine
2016-12-01 10:29:00 -08:00
c61cce0a3d Merge pull request #28354 from ripcurld00d/tag_creation
Change the docker-tag usage text to be clearer
Upstream-commit: 6c447f552c84cfd1c2840f1f1d3061485aa69d10
Component: engine
2016-11-18 13:02:40 +01:00
af870551d0 Change the docker-tag usage text to be clearer
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 039aca05c2eae8a06dc16ff97110539feb44d13b
Component: engine
2016-11-18 10:34:02 +02:00
2e39dde1e5 refactor help func in CLI
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: bf95472105e5dad55314cfff599abea5b81b134a
Component: engine
2016-11-17 10:54:10 -08:00
593e5eb2d5 Windows: Use sequential file access
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7c29f5beed19b55ac8f14880752d4825ba23eccf
Component: engine
2016-11-14 17:41:52 -08:00