Commit Graph

692 Commits

Author SHA1 Message Date
Vincent Demeester 69432c48db
Merge pull request #840 from dekkagaijin/master
GetAll -> Get to retrieve credentials from credential helpers
2018-02-16 15:38:53 +01:00
Arash Deshmeh 0a914da708 add tests to plugin create/remove/enable/disable commands. Part of work on #37
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-02-15 06:20:26 -05:00
Vincent Demeester 570ee9cb54
Share the compose loading code between swarm and k8s stack deploy
To ensure we are loading the composefile the same wether we are pointing
to swarm or kubernetes, we need to share the loading code between both.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-14 14:07:48 +01:00
Daniel Nephin b127b8d927 Replace go-bindata with esc
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-12 14:23:19 -05:00
Ivan Markin 57c51c8af3 Fix compilation of defaultCredentialStore() on unsupported platforms
Signed-off-by: Ivan Markin <sw@nogoegst.net>
2018-02-10 15:30:32 +00:00
Jake Sanders e1b607a351 defaultIndexserver -> defaultIndexServer
Signed-off-by: Jake Sanders <jsand@google.com>
2018-02-09 13:48:01 -08:00
Sungwon Han 34504d0a1e Clarify description of volume prune command
volume prune command removes only local volumes
not used by at least one container.

Signed-off-by: Sungwon Han <sungwon.han@navercorp.com>
2018-02-08 15:33:07 +09:00
Sebastiaan van Stijn b5df4f69db
Merge pull request #863 from WTFKr0/tls-env-var
Add DOCKER_TLS environment variable for --tls option
2018-02-06 10:24:38 -08:00
Sebastiaan van Stijn 25e969c854
Merge pull request #569 from vdemeester/compose-multiple-version-mergo
Add support for multiple composefile when deploying
2018-02-06 00:41:43 -08:00
WTFKr0 42fa3ef7d8 Add DOCKER_TLS environment variable
Signed-off-by: WTFKr0 <thomas.kovatchitch@gmail.com>
2018-02-06 09:27:05 +01:00
Jake Sanders 1d0a37c460 Use Get rather than GetAll to retrieve credentials from credential helpers.
Signed-off-by: Jake Sanders <jsand@google.com>
2018-02-05 20:31:46 -08:00
Sebastiaan van Stijn 9de1b162fa
Merge pull request #838 from vdemeester/fix-label-file-behavior
Fix `--label-file` weird behavior
2018-01-29 17:32:21 -08:00
Vincent Demeester 1872bd802c
Add support for multiple composefile when deploying
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-01-29 17:27:25 -08:00
Vincent Demeester 2b17f4c8a8
Fix `--label-file` weird behavior
`--label-file` has the exact same behavior as `--env-file`, meaning any
placeholder (i.e. a simple key, no `=` sign, no value), it will get the
value from the environment variable.

For `--label-file` it should just add an empty label.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-01-29 11:08:54 -08:00
Daniel Nephin a46fa0759d
Merge pull request #804 from thaJeztah/more-annotations
Annotate "stack" commands to be "swarm" and "kubernetes"
2018-01-26 15:12:09 -05:00
Silvin Lubecki 14fcadffb1 Using Flags instead of PersistentFlags, as Kubernetes flags seem not to be defined in the "persistent space".
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-01-24 09:17:08 -08:00
Ethan Haynes e76d8c9eae added check for empty source in bind mount
Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>

fixed error by removing punctuation

Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>

removed period

Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>

backtick string to escape double quotes in error messages

Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>

simplified test for bind no source error message

Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>
2018-01-22 18:33:58 -06:00
Sebastiaan van Stijn 93c36eb228
Annotate "stack" commands to be "swarm" and "kubernetes"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-22 15:44:47 -08:00
Vincent Demeester fbb9de2cfc
Merge pull request #780 from thaJeztah/fix-network-add
Fix --network-add adding duplicate networks
2018-01-22 14:45:58 -08:00
Sebastiaan van Stijn 44a1168ae5
Merge pull request #696 from mlaventure/attach-use-containerwait
attach: Use ContainerWait instead of Inspect
2018-01-20 23:55:16 +01:00
Vincent Demeester 2d29732f40
Mark docker-manifest command as experimental (cli)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-01-18 13:19:33 -08:00
Vincent Demeester 11dfa23a5d
Merge pull request #138 from clnperez/manifest-cmd
Add manifest command
2018-01-18 22:15:49 +01:00
Daniel Nephin fab4762941
Merge pull request #581 from thaJeztah/better-port-range-printing
Improve presentation of published port ranges
2018-01-16 17:16:45 -05:00
Sebastiaan van Stijn 14c62f655a
Merge pull request #808 from ethan-haynes/698-tmpfs-mode-compose
added support for tmpfs-mode in compose file
2018-01-16 20:59:17 +01:00
Daniel Nephin 1620538c49
Merge pull request #755 from kolyshkin/wait
Show container wait error
2018-01-16 14:40:36 -05:00
Kir Kolyshkin 85ddaee5af container.waitExitOrRemoved(): add a test case
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-01-16 10:16:28 -08:00
Ethan Haynes cd69d082ea added support for tmpfs-mode in compose file
Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>
2018-01-16 10:52:26 -06:00
Ethan Haynes b15362ce32 adding tmpfs field to the compose 3.6v file spec and updating binary
Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>
2018-01-16 10:50:40 -06:00
Ethan Haynes 2b8cc52409 adding config_schema_v3.6.json and updating binary
Signed-off-by: Ethan Haynes <ethanhaynes@alumni.harvard.edu>
2018-01-16 10:44:08 -06:00
Akim Demaille f83aa7b705 Remove: add missing eol when --force is passed
Signed-off-by: Akim Demaille <akim.demaille@docker.com>
2018-01-16 09:29:53 +01:00
Sebastiaan van Stijn d845b4d36a
golint: remove redundant ifs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-13 13:16:34 +01:00
Sebastiaan van Stijn a812995f98
Remove aliases for orchestrator
Prefer "strict" values for orchestrator, as it's
easier to add aliases (if we think it's needed) than
to remove them later.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-11 21:16:37 +01:00
Sebastiaan van Stijn e6ebaf55dd
Fix --network-add adding duplicate networks
When adding a network using `docker service update --network-add`,
the new network was added by _name_.

Existing entries in a service spec are listed by network ID, which
resulted in the CLI not detecting duplicate entries for the same
network.

This patch changes the behavior to always use the network-ID,
so that duplicate entries are correctly caught.

Before this change;

    $ docker network create -d overlay foo
    $ docker service create --name=test --network=foo nginx:alpine
    $ docker service update --network-add foo test
    $ docker service inspect --format '{{ json .Spec.TaskTemplate.Networks}}' test
    [
      {
        "Target": "9ot0ieagg5xv1gxd85m7y33eq"
      },
      {
        "Target": "9ot0ieagg5xv1gxd85m7y33eq"
      }
    ]

After this change:

    $ docker network create -d overlay foo
    $ docker service create --name=test --network=foo nginx:alpine
    $ docker service update --network-add foo test
    service is already attached to network foo

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-09 20:42:09 +01:00
Christy Perez db6d87216d manifest tests
create, annotate, & push

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2018-01-08 11:12:57 -06:00
Christy Perez 02719bdbb5 add manifest command
Enable inspection (aka "shallow pull") of images' manifest info, and
also the creation of manifest lists (aka "fat manifests").

The workflow for creating a manifest list will be:

`docker manifest create new-list-ref-name image-ref [image-ref...]`
`docker manifest annotate new-list-ref-name image-ref --os linux --arch
arm`
`docker manifest push new-list-ref-name`

The annotate step is optional. Most architectures are fine by default.

There is also a `manifest inspect` command to allow for a "shallow pull"
of an image's manifest: `docker manifest inspect
manifest-or-manifest_list`.

To be more in line with the existing external manifest tool, there is
also a `-v` option for inspect that will show information depending on
what the reference maps to (list or single manifest).

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-01-08 10:43:56 -06:00
Michael Friis 99e3b4cd93 use 'config' over 'configuration file'
Signed-off-by: Michael Friis <friism@gmail.com>
2018-01-05 13:19:53 -08:00
Vincent Demeester e708c900f8
Merge pull request #721 from silvin-lubecki/kube
Add kubernetes support to docker/cli
2018-01-03 17:20:43 +01:00
Silvin Lubecki 18c44e0829 Check and return error while creating kubernetes secret and config maps.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-01-03 15:46:19 +01:00
Silvin Lubecki f1b116179f Fix PR comments
- More strict on orchestrator flag
- Make orchestrator flag more explicit as experimental
- Add experimentalCLI annotation on kubernetes flags
- Better kubeconfig error message
- Prefix service name with stackname in ps and services stack subcommands
- Fix yaml documentation
- Fix code coverage ignoring generated code

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-01-03 10:23:32 +01:00
Silvin Lubecki ad409767bf Activate kubernetes only when experimental cli is enabled
* Refactor tests on version and kubernetes switch
* Fix rebase errors
* Refactor for gocyclo linter

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2017-12-28 14:40:10 +01:00
Vincent Demeester 5d375b348a Set a global orchestrator flag
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-28 14:40:10 +01:00
Sebastiaan van Stijn 70a29b492d
Add "pid" to unsupported options list
Services do not support custom "pid"-modes (e.g. `--pid=host`), but this
option was ignored silently when deploying a stack.

This patch adds `pid` to the list of unsupported options so that a warning
is printed;

With this patch applied:

    $ docker stack deploy -c docker-compose.yml foobar
    Ignoring unsupported options: pid

    Creating network foobar_default
    Creating service foobar_test

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-27 12:45:42 +01:00
Vincent Demeester 1a2244e384 Error out on orchestrator command that don't support k8s yet
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:46:59 +01:00
Silvin Lubecki ba5d0d8ff5 Move e2e test on version command to unit tests
* Refactor a little version command

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2017-12-26 11:46:59 +01:00
Vincent Demeester f5073f81d2 Update warning
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:45:56 +01:00
Vincent Demeester b5170bde03 Take @nass review into account
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:45:56 +01:00
Vincent Demeester dedd0db51a Refactor stack command
- Define command and subcommands only once
- Use annotations for k8s or swarm specific flags or subcommands

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:45:56 +01:00
Vincent Demeester 0508c09494 Move cli/command/orchestrator to cli/command
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:25:22 +01:00
Vincent Demeester f960d2d5f3 Move /cli/command/stack/kubernetes/api to /kubernetes
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:22:32 +01:00
Vincent Demeester 8417e49792 Add support for kubernetes in docker cli
- Add support for kubernetes for docker stack command
- Update to go 1.9
- Add kubernetes to vendors
- Print orchestrator in docker version command

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2017-12-26 11:22:32 +01:00
Vincent Demeester 84fe1a1b5b
Add support for experimental Cli configuration
Allow to mark some commands and flags experimental on cli (i.e. not
depending to the state of the daemon). This will allow more flexibility
on experimentation with the cli.

Marking `docker trust` as cli experimental as it is documented so.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-22 14:48:47 +01:00
Paweł Szczekutowicz a30dd1b6f3 Return errors from client in stack deploy configs
Signed-off-by: Paweł Szczekutowicz <pszczekutowicz@gmail.com>
2017-12-18 21:34:04 +01:00
Kir Kolyshkin 8471742a8a Show container wait error
If container wait has failed, show an error from the engine
and return an appropriate exit code.

This requires engine changes from https://github.com/moby/moby/pull/34999

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-12-15 14:15:30 -08:00
Daniel Nephin 9da2602f38 Fix external networks
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-12-11 11:29:49 -05:00
Brian Goff 7138d6e301 Sort component details in template
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-12-07 02:04:10 +01:00
Tibor Vass 5f4c5f8bb6 Add platform and its components to docker version output
The Server section of version output is now composed of an Engine
component and potentially more, based on what the /version endpoint
returns.

Signed-off-by: Tibor Vass <tibor@docker.com>
2017-12-07 02:04:10 +01:00
Joffrey F 88bbaca294 Add missing additionalProperties marker on mount definitions
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-12-06 12:37:38 -08:00
Joffrey F e49f14cf36 Add shm_size property to build configuration in Compose schema
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-12-06 12:34:12 -08:00
Sebastiaan van Stijn 86653f4d57
Merge pull request #732 from ndeloof/8917
closes #8917 introduce `—workdir` option for docker exec
2017-12-06 10:51:33 -08:00
Nicolas De Loof 8dc88ea7b5
Annotate worker option for 1.35 API
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-12-06 17:24:01 +01:00
Nicolas De Loof 591a1273fd
introduce `—workdir` option for docker exec
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-12-06 17:24:01 +01:00
Daniel Nephin d0b8aa7701 Support network.name in the compose schema.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-12-06 10:05:24 -05:00
Vincent Demeester 5ed399e588
Add unit tests on config/secret indempotence in stack deploy
Related PR : https://github.com/docker/cli/pull/509

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-11-30 09:45:32 +01:00
Sebastiaan van Stijn d921d5cc39
Merge pull request #694 from riyazdf/trust-inspect
docker trust inspect
2017-11-29 11:33:53 -08:00
Riyaz Faizullabhoy a9428285f0 Use default inspect formatting, remove omitempty, update docs
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-11-29 10:52:35 -08:00
Riyaz Faizullabhoy 1eb87cc096 support multiple arguments to trust inspect
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-11-29 10:52:34 -08:00
Riyaz Faizullabhoy cd38d39d0d add docker trust inspect command for JSON viewing
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-11-29 10:52:34 -08:00
Renaud Gaubert 1ff73f867d Added support of Generic resources in compose file
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
2017-11-28 21:52:09 +01:00
Renaud Gaubert 20a6ff32ee Added support for generic resource update
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
2017-11-28 18:03:10 +01:00
Renaud Gaubert 51c7cd91cf Added Generic Resource tests
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
2017-11-28 18:03:10 +01:00
Renaud Gaubert 7ddd5f3434 Updated GenericResource CLI
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
2017-11-28 18:03:10 +01:00
Ilya Sotkov ec47003ecb Remove duplication for secrets / configs, combine 3.5 loader tests, remove extraneous error call, regenerate schema correctly
Signed-off-by: Ilya Sotkov <ilya@sotkov.com>
2017-11-22 13:41:16 +02:00
Ilya Sotkov 1f10b31017 Add tests for secret.name in compose files.
Signed-off-by: Ilya Sotkov <ilya@sotkov.com>
2017-11-22 13:18:05 +02:00
Ilya Sotkov 4f7f3d2f61 Add secret.name and config.name in compose.
Signed-off-by: Ilya Sotkov <ilya@sotkov.com>
2017-11-22 13:18:05 +02:00
Kenfe-Mickael Laventure 66661761d5
attach: Use ContainerWait instead of Inspect
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-11-17 18:12:46 -08:00
Simon Ferquel 47cf2ea683 Add isolation mode on service update/create and compose files
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2017-11-17 15:31:13 +01:00
Simon Ferquel 787e30d57a Preparing for compose schema v3.5
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2017-11-17 15:30:32 +01:00
Sebastiaan van Stijn 801ddee343
Merge pull request #671 from dnephin/remove-secret-config-duplication
Remove secret/config duplication in cli/compose
2017-11-15 19:29:39 +01:00
Sebastiaan van Stijn 026c6db6f6
Merge pull request #74 from jamiehannaford/until-logging
Add new CLI option for --until
2017-11-14 18:49:46 +01:00
Jamie Hannaford 0450a2f437 Add docs
Signed-off-by: Jamie Hannaford <jamie@limetree.org>
2017-11-14 18:04:10 +01:00
Jamie Hannaford 9c9303e113 add test for logs
Signed-off-by: Jamie Hannaford <jamie@limetree.org>
2017-11-13 10:57:44 +01:00
Daniel Nephin f1cc679618 Add unit tests for some convert/service
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-11-10 16:28:39 -05:00
Daniel Nephin a68c940f1a Remove duplication in compose/convert
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-11-10 15:56:11 -05:00
Daniel Nephin 7bd26ed690 Remove duplication in loader
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-11-10 15:56:11 -05:00
Kyle Spiers a570e9b355 sign test: fix imports
Signed-off-by: Kyle Spiers <kyle@spiers.me>
2017-11-10 11:34:04 -08:00
Jamie Hannaford 6f309316e2 Add new CLI option for --until
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
2017-11-10 12:38:08 +01:00
Sebastiaan van Stijn 5735fff6fc
Bump moby to f4d4f5863156b82ef146b6ff1e845f8dcf019f12
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-11-08 17:50:58 +01:00
Daniel Nephin ee0615dc97
Merge pull request #575 from eiais/local-flag
trust sign: add --local flag
2017-11-07 14:15:53 -05:00
Sebastiaan van Stijn 025f51ca93
Merge pull request #670 from dnephin/cleanup-compose-volume-name
Only warn on volume.external.name for version 3.4
2017-11-07 14:29:22 +01:00
Sebastiaan van Stijn 042575aac9
Merge pull request #474 from jhowardmsft/jjh/apis-for-platform
LCOW: CLI changes to add platform flag - pull, run, create and build
2017-11-07 14:26:31 +01:00
Vincent Demeester 21d88629df
Merge pull request #657 from dnephin/add-test-for-container-cp
Adding unit tests for container cp
2017-11-07 14:22:22 +01:00
Daniel Nephin aea9544db5 Only warn on volume.external.name for version 3.4
Also remove use of volume.external.name

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-11-06 17:04:36 -05:00
John Howard d8b782560e LCOW: Add `--platform=` CLI flag to pull/create/run/build
Signed-off-by: John Howard <jhoward@microsoft.com>

This is the CLI updates for the document discussed in https://github.com/moby/moby/issues/34617
to support Linux Containers on Windows. It adds --platform= as CLI flags to the four
commands listed above. Import still to be completed (needs daemon changes).
2017-10-31 09:50:43 -07:00
Vincent Demeester a0140b4ddb
Merge pull request #658 from arehman199/fix-a-number-of-typos
fix a number of minor typos
2017-10-31 15:07:51 +01:00
Abdur Rehman c3fe9d85ef fix a number of minor typos
Fix 19 typos, grammatical errors and duplicated words.

These fixes have minimal impact on the code as these are either in the
doc files or in comments inside the code files.

Signed-off-by: Abdur Rehman <abdur_rehman@mentor.com>
2017-10-31 15:21:51 +05:00
Vincent Demeester 6e04da39b8
Merge pull request #654 from dnephin/pr-fix-image-rm
Fix behaviour of `rmi -f` with unexpected errors
2017-10-31 10:38:38 +01:00
Kyle Spiers f5a50650d6 trust sign: add --local flag
Signed-off-by: Kyle Spiers <kyle@spiers.me>
2017-10-30 16:06:03 -07:00
Daniel Nephin b7b62ca26a Adding unit tests for cp
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-30 18:33:28 -04:00
Sebastiaan van Stijn 96b8d15bdd
Merge pull request #651 from thaJeztah/fix-extra-host-sorting
Preserve sort-order of extra hosts, and allow duplicate entries
2017-10-30 20:38:10 +01:00
Brian Goff 7ca234fe24
Merge pull request #652 from thaJeztah/move-notary
Move notary to its new location
2017-10-30 14:05:59 -04:00
Daniel Nephin 65398de1a6
Merge pull request #655 from eiais/extraQuote
Remove extra quotes from docker trust sign
2017-10-30 13:53:18 -04:00
Daniel Nephin a79e742bfc
Merge pull request #648 from thaJeztah/fix-host-add-description
Fix flag description for --host-add
2017-10-30 13:52:29 -04:00
Kyle Spiers 291fdcfdbe Remove extra quotes from docker trust sign
Signed-off-by: Kyle Spiers <kyle@spiers.me>
2017-10-30 10:31:21 -07:00
Daniel Nephin b900676523 Use t.Run() for tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-30 13:00:03 -04:00
Arash Deshmeh 125302cfa6 docker rm -f exits with 1 if the image was not removed
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-10-30 12:50:19 -04:00
Sebastiaan van Stijn 6cd58063fa
Move notary to its new location
The https://github.com/docker/notary repository has moved to
https://github.com/theupdateframework/notary

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-30 17:21:41 +01:00
Sebastiaan van Stijn 0c4fa699eb
Merge pull request #566 from riyazdf/docker-trust-2
docker trust: interact with signers and keys
2017-10-30 17:03:58 +01:00
Riyaz Faizullabhoy e189a21a25 review feedback: updating for windows, error paths
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:55:59 +01:00
Riyaz Faizullabhoy 079471ebeb update to stderr instead of stdout, update tests
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:55:59 +01:00
Riyaz Faizullabhoy b4ef2ddb8b revendor notary for updated import/export packages, update with rebase
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:55:59 +01:00
Riyaz Faizullabhoy 2d8cc3cd80 refactoring and adding tests for EC key types
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:55:59 +01:00
Riyaz Faizullabhoy 532d223db4 trust: move signer and key commands down one level
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:53:54 +01:00
Kyle Spiers 4e797eaa04 docs: add docs for new trust subcommands
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:53:54 +01:00
Riyaz Faizullabhoy 604bc3f22d trust: key-load and key-generate code
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:53:53 +01:00
Ashwini Oruganti dde9f614a7 trust: add signer-add and signer-remove command
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:53:53 +01:00
Sebastiaan van Stijn dbdf8f6468
Preserve sort-order of extra hosts, and allow duplicate entries
Extra hosts (`extra_hosts` in compose-file, or `--hosts` in services) adds
custom host/ip mappings to the container's `/etc/hosts`.

The current implementation used a `map[string]string{}` as intermediate
storage, and sorted the results alphabetically when converting to a service-spec.

As a result, duplicate hosts were removed, and order of host/ip mappings was not
preserved (in case the compose-file used a list instead of a map).

According to the **host.conf(5)** man page (http://man7.org/linux/man-pages/man5/host.conf.5.html)

    multi  Valid values are on and off.  If set to on, the resolver
      library will return all valid addresses for a host that
      appears in the /etc/hosts file, instead of only the first.
      This is off by default, as it may cause a substantial
      performance loss at sites with large hosts files.

Multiple entries for a host are allowed, and even required for some situations,
for example, to add mappings for IPv4 and IPv6 addreses for a host, as illustrated
by the example hosts file in the **hosts(5)** man page (http://man7.org/linux/man-pages/man5/hosts.5.html):

    # The following lines are desirable for IPv4 capable hosts
    127.0.0.1       localhost

    # 127.0.1.1 is often used for the FQDN of the machine
    127.0.1.1       thishost.mydomain.org  thishost
    192.168.1.10    foo.mydomain.org       foo
    192.168.1.13    bar.mydomain.org       bar
    146.82.138.7    master.debian.org      master
    209.237.226.90  www.opensource.org

    # The following lines are desirable for IPv6 capable hosts
    ::1             localhost ip6-localhost ip6-loopback
    ff02::1         ip6-allnodes
    ff02::2         ip6-allrouters

This patch changes the intermediate storage format to use a `[]string`, and only
sorts entries if the input format in the compose file is a mapping. If the input
format is a list, the original sort-order is preserved.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-30 01:48:09 +01:00
Sebastiaan van Stijn 79b19cba16
Fix flag description for --host-add
The `--host-add` flag adds a new `host:ip` mapping. Even though
adding an entry is idempotent (adding the same mapping multiple
times does not update the service's definition), it does not
_update_  an existing mapping with a new IP-address (multiple
IP-addresses can be defined for a host).

This patch removes the "or update" part from the flag's
description.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-28 16:47:53 +02:00
Daniel Nephin 54e1378e04 Merge pull request #636 from dnephin/fix-trust-output-stream
Fix stdout and errors in image/trust
2017-10-27 11:31:01 -04:00
Sebastiaan van Stijn e4940cb8d2 Merge pull request #621 from charrywanganthony/displaystringutils
Refactor stringutils and fix docker search output form
2017-10-27 11:08:36 +02:00
Sebastiaan van Stijn 6aedafd195 Merge pull request #645 from dnephin/use-upstream-spf13-cobra
Hide help flag from help output
2017-10-27 11:00:07 +02:00
Chao Wang 926b20fcb5 Refactor stringutils and fix docker search output form when the description has CJK character
Signed-off-by: Chao Wang <wangchao.fnst@cn.fujitsu.com>
2017-10-27 11:15:10 +08:00
Daniel Nephin c0d004f7cf Update gometalinter
and enable the new WarnUnmatchedDirective to warn if a nolint is unnecessary.
remove some unnecessary nolint

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-26 12:21:02 -04:00
Daniel Nephin b68c3d007f Merge pull request #601 from dnephin/compose-cast-after-interpolate
[Compose] Cast values to expected type after interpolating values
2017-10-26 12:20:04 -04:00
Daniel Nephin f50345a26c Hide help flag from help output.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-26 12:17:50 -04:00
Daniel Nephin 8e600e10f7 Fix UseLine
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-25 18:22:04 -04:00
Daniel Nephin 4205416c9b Update code for upstream cobra
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-25 14:49:26 -04:00
Riyaz Faizullabhoy 5ab3ae7aba trust: define new commands and helpers
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-24 11:23:35 +02:00
Daniel Nephin 8f86a25029 Fix stdout and errors in image/trust
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-23 13:54:55 -04:00
Sebastiaan van Stijn 1401d5daf2 Merge pull request #620 from dnephin/add-nakedret-linter
Add nakedret linter
2017-10-13 14:54:00 +02:00
Daniel Nephin dbd96badb6 Add nakedret linter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-12 11:48:51 -04:00
Sebastiaan van Stijn e56a58e4ed
Updates for updated moby version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-12 01:02:10 +02:00
Daniel Nephin e548861481 Refactor runPull to remove second GetImageReferencesAndAuth
Fix unit tests to catch the regression.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-10 16:32:27 -04:00
Riyaz Faizullabhoy 067fff8b03 trust: update references when pulling
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-10 11:19:02 -07:00
Daniel Nephin af8f563922 Fix load order
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-05 12:03:29 -04:00
Daniel Nephin 18ddec447a Cast interpolated values
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-04 17:36:47 -04:00
Daniel Nephin 0aa7ca943c Update interface of Interpolate
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-04 17:36:43 -04:00
Brian Goff 1367fc1114 Merge pull request #593 from thaJeztah/add-create-output
Add output for "secrets" and "configs" on stack deploy
2017-10-03 11:06:04 -04:00
Sebastiaan van Stijn a5113f4368
Add output for "secrets" and "configs" on stack deploy
When deploying a stack from a compose file, the output did not show
that a secret or config was created. This patch adds messages for these.

Create a configuration file and compose file:

    $ cat > config.yml <<EOF
    hello: world
    EOF

    $ cat > secret.txt <<EOF
    p@ssw0rd
    EOF

    $ cat > docker-compose.yml <<EOF
    version: "3.3"
    services:
       test:
         image: nginx:alpine
         configs:
         - source: myconfig
           target: /my-config.yml
         secrets:
         - source: mysecret
           target: /my-secret.txt
    configs:
      myconfig:
        file: ./config.yml
    secrets:
      mysecret:
        file: ./secret.txt
    EOF

Before this patch is applied:

    $ docker stack deploy -c docker-compose.yml example
    Creating network example_default
    Creating service example_test

After this patch is applied:

    $ docker stack deploy -c docker-compose.yml example
    Creating network example_default
    Creating secret example_mysecret
    Creating config example_myconfig
    Creating service example_test

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-03 15:13:10 +02:00
Sebastiaan van Stijn 532a3942d6
Remove use of deprecated IsErr...NotFound checks
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-03 12:01:24 +02:00
Vincent Demeester 448d56a491 Merge pull request #560 from dnephin/fix-bind-mount-named-pipe-compose
Support parsing of named pipes for compose volumes
2017-10-03 09:29:13 +02:00
Sebastiaan van Stijn e98e95e7bc
Improve presentation of published port ranges
Port mappings in `docker service ls` are quite verbose, and occupy a lot of
space when ranges of ports are published.

This patch improves the output by reconstructing ranges of ports.

Given the following service;

    $ docker service create \
      -p 60-61:60-61 \
      -p 62:61 \
      -p 80:80 \
      -p 81:80 \
      -p 90-95:90-95 \
      -p 90-92:90-92/udp \
      -p 93-96:93-96/udp \
      --name foo \
      nginx:alpine

Before this patch is applied:

    $ docker service ls
    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    u1kwguv841qg        foo                 replicated          1/1                 nginx:alpine        *:60->60/tcp,*:61->61/tcp,*:62->61/tcp,*:80->80/tcp,*:81->80/tcp,*:90->90/tcp,*:91->91/tcp,*:92->92/tcp,*:93->93/tcp,*:94->94/tcp,*:95->95/tcp,*:90->90/udp,*:91->91/udp,*:92->92/udp,*:93->93/udp,*:94->94/udp,*:95->95/udp,*:96->96/udp

After this patch is applied:

    $ docker service ls
    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    u1kwguv841qg        foo                 replicated          1/1                 nginx:alpine        *:60-62->60-61/tcp,*:80-81->80/tcp,*:90-95->90-95/tcp,*:90-96->90-96/udp

Additional enhancements can still be made, and marked as TODO in this change;

- combine non-consecutive ports mapped to a single port (`80->80`, `81->80`,
  `84->80`, `86->80`, `87->80`); to be printed as `*:80-81,84,86-87->80`.
- combine `tcp` and `udp` mappings if their port-mapping is the same;
  print `*:80-81->80-81/tcp+udp` instead of `*:80-81->80-81/tcp, *:80-81->80-81/udp`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-02 12:54:20 +02:00
Sebastiaan van Stijn c5f267d95c
Do not truncate ID on docker service ps --quiet
Running `docker service ps --quiet` should print the
full, non-truncated ID, even if the `--no-trunc` option
is not set.

This patch disables truncation if the `--quiet` flag
is set.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-30 22:23:37 +02:00
Stephen J Day e78772af4d
cli/command/container: ensure channel is allocated
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-29 18:12:03 -07:00
Sebastiaan van Stijn 0082310aa5
Fixes for updated dependencies
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-29 17:45:31 +02:00
Sebastiaan van Stijn e63417a9c0
Add --no-trunc option to docker container stats
This patch adds a `--no-trunc` option to `docker container stats`;

With this patch applied, the default output is:

    CONTAINER ID        NAME                                    CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    b95a83497c91        awesome_brattain                        0.28%               5.629MiB / 1.952GiB   0.28%               916B / 0B           147kB / 0B          9
    67b2525d8ad1        foobar                                  0.00%               1.727MiB / 1.952GiB   0.09%               2.48kB / 0B         4.11MB / 0B         2
    e5c383697914        test-1951.1.kay7x1lh1twk9c0oig50sd5tr   0.00%               196KiB / 1.952GiB     0.01%               71.2kB / 0B         770kB / 0B          1
    4bda148efbc0        random.1.vnc8on831idyr42slu578u3cr      0.00%               1.672MiB / 1.952GiB   0.08%               110kB / 0B          578kB / 0B          2
    84e3deaa45b2        registry                                0.01%               3.402MiB / 1.952GiB   0.17%               127kB / 378B        233kB / 0B          10
    2ed915778ceb        foo.1.lsmxrefn5yp9c9ijz1hzgdq4u         0.00%               1.727MiB / 1.952GiB   0.09%               166kB / 7.76kB      614kB / 0B          2

Addin the `--no-trunc` option, changes the output to:

    CONTAINER ID                                                       NAME                                    CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    b95a83497c9161c9b444e3d70e1a9dfba0c1840d41720e146a95a08ebf938afc   awesome_brattain                        0.25%               5.75MiB / 1.952GiB    0.29%               648B / 0B           147kB / 0B          10
    67b2525d8ad10bb236a49960e93c09993b0baabeef12c2d46cd5f4fbb6f4808c   foobar                                  0.00%               1.727MiB / 1.952GiB   0.09%               2.35kB / 0B         4.11MB / 0B         2
    e5c383697914b98b10cbbc9d0bd324b7b927099ac584f031057b8208d2fba9b1   test-1951.1.kay7x1lh1twk9c0oig50sd5tr   0.00%               196KiB / 1.952GiB     0.01%               71.1kB / 0B         770kB / 0B          1
    4bda148efbc006b0063373c3678083159af89f8cc83a6a28def14cb0dd171f70   random.1.vnc8on831idyr42slu578u3cr      0.00%               1.672MiB / 1.952GiB   0.08%               110kB / 0B          578kB / 0B          2
    84e3deaa45b2fc363e06167df9b90ab59f88d4f101e3f9b8df03a62a8f6783e1   registry                                0.00%               3.387MiB / 1.952GiB   0.17%               127kB / 378B        233kB / 0B          10
    2ed915778cebddf9ec69263a75cfdcf00962a5198d94d42cda75d5cd45bb82f2   foo.1.lsmxrefn5yp9c9ijz1hzgdq4u         0.00%               1.727MiB / 1.952GiB   0.09%               166kB / 7.76kB      614kB / 0B          2

Which is the same as the default before this patch was applied.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-27 18:59:25 +02:00
Sebastiaan van Stijn 0a78472211
Update default output format for stats to include ID and Name
The `docker container stats` output has a column (`CONTAINER`), that shows either
the container _id_ or container _name_, depending on the arguments given.

For example, running `docker container stats foobar` shows:

    CONTAINER           CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    foobar              0.00%               1.938MiB / 1.952GiB   0.10%               782B / 0B           4.11MB / 0B         2

Whereas `docker container stats 67b2525d8ad1` (`67b2525d8ad1` being the ID for
container `foobar`) shows:

    CONTAINER           CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    67b2525d8ad1        0.00%               1.938MiB / 1.952GiB   0.10%               916B / 0B           4.11MB / 0B         2

This behavior is confusing.

This patch updates the default output format for `docker stats` to use separate
columns for container ID and container Name (similar to `docker container ls`).

With this patch applied, both commands show the same output:

    $ docker container stats foobar
    CONTAINER ID                                                       NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    67b2525d8ad10bb236a49960e93c09993b0baabeef12c2d46cd5f4fbb6f4808c   foobar              0.00%               1.938MiB / 1.952GiB   0.10%               1.25kB / 0B         4.11MB / 0B         2

    $ docker container stats 67b2525d8ad1
    CONTAINER ID                                                       NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
    67b2525d8ad10bb236a49960e93c09993b0baabeef12c2d46cd5f4fbb6f4808c   foobar              0.00%               1.938MiB / 1.952GiB   0.10%               1.31kB / 0B         4.11MB / 0B         2

Users that want to use the old format can configure a custom format in the
cli configuration file (`~/.docker/config.json`);

on Linux:

    {
      "statsFormat" : "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}\t{{.PIDs}}"
    }

on Windows:

    {
      "statsFormat" : "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}"
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-27 18:05:51 +02:00
Vincent Demeester feb4d79935 Merge pull request #562 from dnephin/update-gometalinter
Update gometalinter
2017-09-27 09:42:37 +02:00
Riyaz Faizullabhoy 9ad0e8f223 trust: remove extraneous OPTIONS from commands that do not use it
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-26 16:15:45 -07:00
Daniel Nephin 4203b49431 Refactor image commands to make use of the new trust struct for trusted pull
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-26 15:15:42 -04:00
Daniel Nephin d956386b2d Update gometalinter
The update includes bug fixes in gometalinter and updates to linters, which
discovered more linter problems.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-26 12:33:35 -04:00
Sebastiaan van Stijn 0856c20e04 Merge pull request #551 from dnephin/set-local-constant
Use a local constant
2017-09-26 17:42:50 +02:00
Daniel Nephin 9f73b8c718 Support parsing of named pipes for compose volumes.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-26 11:24:23 -04:00
Sebastiaan van Stijn be8dab26a3 Merge pull request #451 from tych0/use-pass-backend
Use pass backend
2017-09-26 16:40:32 +02:00
Riyaz Faizullabhoy e07f345267 mark command as experimental in docs and cli
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:39:46 -07:00
Riyaz Faizullabhoy c6db0cd7a1 trust: rename inspect to view, add repo name to signer table header
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:39:46 -07:00
Riyaz Faizullabhoy 46a879e3b9 tests: use alice/bob/claire conventional names for signers
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:39:46 -07:00
Riyaz Faizullabhoy 4e95fcd72c trust: update remove to error on empty references for consistency
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:39:46 -07:00
Riyaz Faizullabhoy 67cf09cbe1 tests: move trust test to proper package
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:39:46 -07:00
Riyaz Faizullabhoy 4e89dc800a trust: update reference type and use golden output
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:39:44 -07:00
Riyaz Faizullabhoy 6fca400f1e tests: address review feedback
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:38:41 -07:00
Riyaz Faizullabhoy f667bd7559 trust: use mock CLI for testing offline
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:38:40 -07:00
Riyaz Faizullabhoy e5c35ab9d1 cli: introduce NotaryClient getter
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:38:38 -07:00
Riyaz Faizullabhoy 7c5b836ca5 trust: add Repository client interface
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:34:54 -07:00
Riyaz Faizullabhoy 45c102a03d trust: address review feedback, refactor to align with existing cli/command semantics
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:34:53 -07:00
Riyaz Faizullabhoy 609f8b4b81 trust revoke: add docker trust revoke command
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:34:53 -07:00
Riyaz Faizullabhoy fab6bb6798 trust sign: add docker trust sign command
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:34:53 -07:00
Riyaz Faizullabhoy ec6bc9460f trust inspect: add docker trust inspect command with formatting print
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:34:52 -07:00
Riyaz Faizullabhoy 5846e6e5d5 trust: update existing code for new vendoring, refactor for docker trust code sharing
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-09-25 09:34:52 -07:00
allencloud 26f06c5bcb sort secrets and configs in cli
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
2017-09-25 13:18:13 +08:00
Daniel Nephin 32612058cb Use a local constant
This constant is going to be removed from jsonlog package.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-22 17:59:46 -04:00
Daniel Nephin e828efa4ab Set APIVersion on the client, even when Ping fails
Refactor to support testing
Also add tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-22 10:08:19 -04:00
Tycho Andersen 713e87e780 prefer `pass` backend if it is available
Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-09-20 11:15:49 -06:00
Tycho Andersen 4cf1849418 defaultCredentialStore: make this a function
In the next patch, we'll use this to implement some logic about which
password backend to use.

Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-09-20 11:14:27 -06:00
Vincent Demeester 0da9f14821
Fix loader error with different build syntax
`build: .` was not working anymore. Fixing this by adding a new
tranform function for BuildConfig.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-09-20 14:02:33 +02:00
Vincent Demeester f34655ecf8
Tidying up compose/loader test a bit
- Use `require` instead of `assert` when the assumption is "breaking" for the code
following. For example when asserting an error is not nil and then doing
`err.Error` on it ; if `err` is nil, the test will panic instead of fail.
- Use `assert.Len` when possible. The error message is better.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-09-19 16:48:52 +02:00
Sebastiaan van Stijn 3edf97e5a9 Merge pull request #366 from twistlock/plugable_secrets_backend
Plugable secrets backend
2017-09-18 19:25:15 +02:00
Vincent Demeester a09a2c6d15 Merge pull request #509 from xificurC/fix-secrets-and-configs-idempotence
sort secrets and configs to ensure idempotence
2017-09-15 15:43:59 +02:00
Daniel Nephin 7b77ab5c60 Merge pull request #513 from shouze/reset-id-pair-during-build-to-avoid-cache-busting
Reset uid/gid to 0 in build context to fix cache busting issues on ADD/COPY
2017-09-13 15:19:26 -04:00
Vincent Demeester 2eb31e6b60 Merge pull request #481 from cdrage/add-build-to-service-config
Add 'build' to types.go
2017-09-13 18:20:42 +02:00
Charlie Drage 9bdb0763b9 Add 'build' to types.go
This adds 'build' to types.go in order for projects that use docker/cli
to parse Docker Compose files to correctly retrieve `build` keys

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
2017-09-13 10:47:17 -04:00
Sebastiaan van Stijn 0c27355f7b
Use non-detached mode as default for service commands
Commit 330a0035334871d92207b583c1c36d52a244753f added a `--detach=false` option
to various service-related commands, with the intent to make this the default in
a future version (17.09).

This patch changes the default to use "interactive" (non-detached), allowing
users to override this by setting the `--detach` option.

To prevent problems when connecting to older daemon versions (17.05 and below,
see commit db60f25561), the detach option is
ignored for those versions, and detach is always true.

Before this change, a warning was printed to announce the upcoming default:

    $ docker service create nginx:alpine
    saxiyn3pe559d753730zr0xer
    Since --detach=false was not specified, tasks will be created in the background.
    In a future release, --detach=false will become the default.

After this change, no warning is printed, but `--detach` is disabled;

    $ docker service create nginx:alpine
    y9jujwzozi0hwgj5yaadzliq6
    overall progress: 1 out of 1 tasks
    1/1: running   [==================================================>]
    verify: Service converged

Setting the `--detach` flag makes the cli use the pre-17.06 behavior:

    $ docker service create --detach nginx:alpine
    280hjnzy0wzje5o56gr22a46n

Running against a 17.03 daemon, without specifying the `--detach` flag;

    $ docker service create nginx:alpine
    kqheg7ogj0kszoa34g4p73i8q

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-13 12:27:55 +02:00
Sébastien HOUZÉ 7e407610d4
Reset idPair during build to avoid cache busting
Signed-off-by: Sébastien HOUZÉ <cto@verylastroom.com>
2017-09-13 02:04:03 +02:00
Sebastiaan van Stijn 6f1b510843
Refactor/cleanup of docker info
Some mild refactoring of the docker info command;

- Use `fmt.Fprinln()` instead of `fmt.Fprintf()` where possible
- Rename `fprintfIfNotEmpty()` to `fprintlnNonEmpty()`, and removed
  return variables, because they were not used. `fprintlnNonEmpty()`
  now uses fmt.Fprintln()` instead of `fmt.Fprintf()`, because
  formatting was not used.
- Use `fprintlnNonEmpty()` to get rid of some `if` statements
- Extract printing Swarm-related information to a `printSwarmInfo()` function
- Change `Http Proxy` and `Https Proxy` to `HTTP Proxy` / `HTTPS Proxy`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-11 15:13:06 +02:00
Victor Vieux aae519d0f6 Merge pull request #510 from dnephin/add-parse-log-details
Use a local copy of ParseLogDetails
2017-09-08 11:38:24 -07:00
pnagy 27e8bdf32b sort secrets and configs to ensure idempotence
`docker stack deploy` keeps restarting services it doesn't need to (no changes)
because the entries' order gets randomized at some previous (de)serialization.
Maybe it would be worth looking into this at a higher level and ensure
all (de)serialization happens in an ordered collection.

This quick fix sorts secrets and configs (in place, mutably) which ensures the
same order for each run.

Based on
https://github.com/moby/moby/pull/30506

Fixes
https://github.com/moby/moby/issues/34746

Signed-off-by: Peter Nagy <xificurC@gmail.com>
2017-09-08 16:09:48 +02:00
Daniel Nephin 51587de1c4 Use golden files for tests that expect end-of-line whitespace
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-07 17:50:44 -04:00
Daniel Nephin a747389bf4 Use a local copy of ParseLogDetails
It's being removed from client/

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-07 12:50:25 -04:00
Liron Levin 0ee9e05d8f Plugable secret backend
This commit extends SwarmKit secret management with pluggable secret
backends support.
Following previous commits:
1. docker/swarmkit@eebac27434
2. docker/docker@08f7cf0526
Added driver parameter to `docker secret` command.

Specifically:

1. `docker secret create [secret_name] --driver [driver_name]`
2.  Displaying the driver in
```
    $ docker secret ls
    $ docker secret inspect [secret_name]
    $ docker secret inspect [secret_name] -pretty
```

Signed-off-by: Liron Levin <liron@twistlock.com>
2017-09-07 11:10:44 +03:00
Daniel Nephin 5c5cdd0e36 Merge pull request #424 from simonferquel/update-vendoring
updated vendoring
2017-09-05 15:06:09 -04:00
Daniel Nephin ec99774a85 Merge pull request #406 from ksouf/issue_37_network_list_test
adding network list test
2017-09-05 11:24:32 -04:00
Simon Ferquel a0113c3a44 updated vendoring
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2017-09-01 19:41:06 -04:00
French Ben bb8f49773c Move output of stack rm to stdout
Signed-off-by: French Ben <frenchben@docker.com>

Update for the test to capture the proper removal

Signed-off-by: French Ben <frenchben@docker.com>

Satisfy lint length limit

Signed-off-by: French Ben <frenchben@docker.com>

Updated e2e test

Signed-off-by: French Ben <frenchben@docker.com>
2017-09-01 14:25:20 -07:00
Daniel Nephin d817967647 Merge pull request #489 from dnephin/fix-container-run
Fix crash in container run after pulling an image
2017-08-31 18:11:26 -04:00
Daniel Nephin 5a9bf7f359 Merge pull request #484 from ripcurld0/ps_exit_1
When nothing found in stack exit with exit code 1
2017-08-31 17:13:00 -04:00
Daniel Nephin a0d8d80250 Fix crash in containe run after pulling an image.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-31 17:08:02 -04:00
Boaz Shuster 79f9af2475 When nothing found in stack exit with exit code 1
To keep on a consistent behaviour such as in docker-service-ps
if docker-stack-ps didn't find a given stack, the command line
should exit with exit code 1.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-08-30 23:25:36 +03:00
Daniel Nephin e636a5388c Merge pull request #475 from AliyunContainerService/start_period
Support start_period for healthcheck in Docker Compose
2017-08-30 14:11:43 -04:00
Victor Vieux 8ea02f6f08 Merge pull request #477 from dnephin/some-tests-for-container-command
A few tests for container command
2017-08-30 09:38:38 -07:00
Li Yi e02fcfd34e Change the type of interval, timeout and start_period of healthcheck from string to * time.Duration
Signed-off-by: Li Yi <denverdino@gmail.com>
2017-08-30 23:39:12 +08:00
Daniel Nephin e7f90b6b38 Reduce complexity in cli/command/container
Add tests for exec and cleanup existing tests.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-29 19:25:50 -04:00
Daniel Nephin bdc8cf364e Add ulimits to unsupported compose fields.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-29 17:05:16 -04:00
Daniel Nephin dae1b7112c Remove test for code not in this repo.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-29 13:19:28 -04:00
khaled souf 15d92a9e03 adding network list test
Signed-off-by: khaled souf <khaled.souf@gmail.com>
2017-08-29 16:30:37 +02:00
Li Yi 0abdad615f Support start_period for healthcheck in Docker Compose
Signed-off-by: Li Yi <denverdino@gmail.com>
2017-08-29 11:19:29 +08:00
Daniel Nephin d318c4112b Reduce complexity of two formatters
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-28 12:49:07 -04:00
Vincent Demeester 7e52344cd2 Merge pull request #471 from cyli/surface-autolock
Include whether the managers in the swarm are autolocked as part of `docker info`
2017-08-28 17:46:09 +02:00
Ying Li 3428b78e96 Include whether the managers in the swarm are autolocked as part of `docker info`.
Signed-off-by: Ying Li <ying.li@docker.com>
2017-08-25 16:33:46 -07:00
Daniel Nephin d83752cdf2 Merge pull request #452 from dnephin/compose-allow-x-fields
Allow extension fields in the v3.4 version of the compose format
2017-08-25 12:37:47 -04:00
Vincent Demeester 8ebc03a71f Merge pull request #367 from kolyshkin/ipcmode
Introduce/document new IPC modes
2017-08-25 09:48:00 +02:00
Tibor Vass 6c3d93bbb6 Merge pull request #445 from dnephin/add-end-to-end-suite
Add end to end suite
2017-08-23 16:16:09 -07:00
Daniel Nephin 05308fcec7 Merge pull request #440 from ripcurld0/search_format
Add --format to docker-search
2017-08-22 19:10:53 -04:00
Victor Vieux 5e1d0289f4 Merge pull request #456 from dnephin/add-tests-for-client
Add unit tests for initializing the client
2017-08-22 16:08:36 -07:00
Boaz Shuster 88cc47ad5c Add --format to docker-search
Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-08-23 01:37:54 +03:00
Daniel Nephin 79ecfa876b Merge pull request #463 from dnephin/remove-pkg-testutil
Remove docker/docker/pkg/testutil
2017-08-22 13:53:03 -04:00
Marco Mariani 3a0b967c05 support --compose-file - as stdin
Signed-off-by: Marco Mariani <marco.mariani@alterway.fr>
2017-08-22 17:55:59 +02:00
Daniel Nephin 2a1857e899 Allow extension fields in the v3.4 version of the compose format.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-22 10:42:49 -04:00
Vincent Demeester 317b735573 Merge pull request #439 from ripcurld0/fix_image_ls_digest
Show images digests when "{{.Digest}}" is in format
2017-08-22 16:17:43 +02:00
Daniel Nephin 846a31aa50 Use new internal testutil.ErrorContains()
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-22 10:14:25 -04:00
Daniel Nephin b3f843afe2 Move internal/test package out of cli.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-22 10:14:25 -04:00
Boaz Shuster 83112f6343 Show images digests when "{{.Digest}}" is in format
This patch fixes the following bug:

Running "docker image ls --digests" will add images digests
to the image table. However, when using "format" to display
images digests all of them are "<none>".

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-08-22 16:55:10 +03:00
Vincent Demeester 8da1daeefa Merge pull request #386 from thaJeztah/fix-image-resolve-detection
Fix image resolve detection
2017-08-22 15:05:39 +02:00
Christophe Vidal 037029414d Dropped hyphen in bind mount where appropriate
Signed-off-by: Christophe Vidal <kriss@krizalys.com>
2017-08-19 21:14:48 +07:00
Sebastiaan van Stijn 3c7ede6a68 Merge pull request #205 from redpanda/rollback
Add 'docker service rollback' subcommand
2017-08-19 15:56:14 +02:00
Daniel Nephin 930f97dd09 Add unit tests for initializing the client.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-18 12:49:23 -04:00
Joffrey F 1667073908 Update schemas to prevent invalid properties in deploy.resources
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-08-17 15:58:51 -07:00
Jimmy Leger 11d471d660 Add 'docker service rollback' subcommand
Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Implement runRollback to not use runUpdate

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Add version tag and add flag quiet to suppress progress output

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Removed flags from warnDetachDefault

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Used command.Cli interface

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Add detach flag on rollback command

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Create a fakeClient for service commands

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Added unit test for rollback command

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Used command.Cli interface instead of *command.DockerCli in service commands

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Revert "Removed flags from warnDetachDefault"

This reverts commit 3e4f601c8a82cc2599a755dc693409bbc47917fc.

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Fixed test.NewFakeCli instanciation

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Removed unused receiver

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Replaced cli by dockerCli

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Revert "Removed unused receiver"

This reverts commit 604ef7c13df3d019949ca81d992db501114dafce.

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>

Fixed last typo

Signed-off-by: Jimmy Leger <jimmy.leger@gmail.com>
2017-08-16 22:18:36 +02:00
Daniel Nephin 15837afa77 Replace pkg/testutil/tempfile with gotestyourself/fs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 505a0fe45f Update volume command tests to use the new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 3d68aa8416 Update swarm command tests to use the new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 1dd742eac8 Update stack and task command tests to new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 4c62d7288f Update service and secret command tests to new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:28 -04:00
Daniel Nephin 0e2bf7420a Update node command tests to the new golden
Also remove some superfluous tests that are now covered by a strict golden.Assert

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:23:15 -04:00
Daniel Nephin 75f7bfedf8 Update image command tests to use the new golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:20:36 -04:00
Daniel Nephin f9007ad7db Update config and checkpoint commands to use gotestyourself/golden
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 14:19:00 -04:00
Daniel Nephin b5cb5ee446 Add first e2e test
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-16 10:46:40 -04:00
Sebastiaan van Stijn 04659b8802 Merge pull request #430 from dnephin/add-build-target-to-compose
Add network and target to build in v3.4
2017-08-15 19:20:49 +02:00
Daniel Nephin 3b8cf20a0c Merge pull request #436 from thaJeztah/improve-singular-plural-message
Singularize / pluralize "argument(s)" in error message
2017-08-14 11:06:25 -04:00
Sebastiaan van Stijn 898f1e2997 Merge pull request #438 from ripcurld0/history_fix
Print timestamp when --human=true
2017-08-14 16:02:04 +02:00
Vincent Demeester aaf6939679 Merge pull request #390 from thaJeztah/add-test-for-github-special-case
Add test for github.com special handling
2017-08-14 10:24:13 +02:00
Boaz Shuster 5e7f0f67a8 Print timestamp when --human=true
* Setting "--human=true" changes "CreatedSince" format

* "CreatedAt" now displays the creation timestamp as
  specified in the documents

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-08-12 23:12:47 +03:00
Sebastiaan van Stijn b9a7f35e02
Singularize / pluralize "argument(s)" in error message
The validation functions to test for the number of passed arguments did not
pluralize `argument(s)`, and used `argument(s)` in all cases.

This patch adds a simple `pluralize()` helper to improve this.

Before this change, `argument(s)` was used in all cases:

    $ docker container ls foobar
    "docker container ls" accepts no argument(s).

    $ docker network create one two
    "docker network create" requires exactly 1 argument(s).

    $ docker network connect
    "docker network connect" requires exactly 2 argument(s).

    $ docker volume create one two
    "docker volume create" requires at most 1 argument(s).

After this change, `argument(s)` is properly singularized or plurarized:

    $ docker container ls foobar
    "docker container ls" accepts no arguments.

    $ docker network create one two
    "docker network create" requires exactly 1 argument.

    $ docker network connect
    "docker network connect" requires exactly 2 arguments.

    $ docker volume create one two
    "docker volume create" requires at most 1 argument.

Test cases were updated accordingly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-12 18:25:38 +02:00
Daniel Nephin eef256943b Add network and target to build in v3.4
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 10:50:32 -04:00
Daniel Nephin f3c325f390 Merge pull request #427 from vdemeester/import-templates-from-docker-pkg
Import templates from docker pkg
2017-08-08 11:55:58 -04:00
Vincent Demeester a6800f95fa
Import `docker/docker/pkg/templates` to cli
This package will be deprecated/removed from `docker/docker/pkg` and
is mainly used for the cli format options. Let's import it and
maintain here.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-08-08 17:26:24 +02:00
Kir Kolyshkin 9285db6752 Introduce/document new IPC modes
This builds (and depends) on https://github.com/moby/moby/pull/34087

Version 2:
 - remove --ipc argument validation (it is now done by daemon)
 - add/document 'none' value
 - docs/reference/run.md: add a table with better modes description
 - dockerd(8) typesetting fixes

Version 3:
 - remove ipc mode tests from cli/command/container/opts_test.go

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-08-05 17:49:53 -07:00
Sebastiaan van Stijn d0bea64185
Preserve resolved image-digest if QueryRegistry == false
When re-deploying a stack without re-resolving the image digest,
the service's ContainerSpec was updated with the image-reference
as specified in the stack/compose file.

As a result, the image-digest that was resolved in a previous
deploy was overwritten, causing the service to be re-deployed.

This patch preserves the previously resolve image-digest
by copying it from the current service spec.

A unit test is also added to verify that the image information
in the service spec is not updated if QueryRegistry is disabled.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-03 18:49:07 +02:00
Sebastiaan van Stijn f007d623a8
Add test for github.com special handling
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-03 17:53:42 +02:00
Josh Hawn 2831a04cba Enable TCP Keep-Alive in Docker client
Some network environments may have NATs, proxies, or gateways which
kill idle connections. There are many Docker API operations which may
be idle for long periods of time (such as ContainerWait and ContainerAttach)
and may result in unexpected connection closures or hangs if TCP keepalives
are not used.

This patch updates the default HTTP transport used by the Docker client
package to enable TCP Keep-Alive with a keep-alive interval of 30 seconds.
It also sets a connect timeout of 30 seconds.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2017-08-02 14:35:03 -07:00
Sebastiaan van Stijn 1cd402b192 Merge pull request #360 from akalipetis/compose-update-order
Add support for update order in compose deployments
2017-08-01 22:24:48 +02:00
Sebastiaan van Stijn ceb18a841a
Fix presentation of published "random" host ports
Ports that were picked from the ephemeral port range
were presented as `*:0->80/tcp`.

This patch changes the presentation to use the
actually assigned port, instead of the port specified
in `Endpoint.Spec` (which is always empty/zero (`0`))

Before this change;

    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    5d44i665qj66        with-random-port    replicated          1/1                 nginx:alpine        *:0->80/tcp

After this change;

    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    5d44i665qj66        with-random-port    replicated          1/1                 nginx:alpine        *:30000->80/tcp

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-01 19:21:17 +02:00