Commit Graph
1302 Commits
Author SHA1 Message Date
John Howard 91335091e8 Windows: Add volume support
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: af6e545164
Component: cli
2017-05-15 11:57:15 +02:00
Lei Jitang 1cce121885 Make default tls host work
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 74d0203af0
Component: cli
2017-05-15 11:57:15 +02:00
Doug Davis 26685a1f17 Remove used param on ParseHost
The first param on opts.ParseHost() wasn't being used for anything.

Once we get rid of that param we can then also clean-up some code
that calls ParseHost() because the param that was passed in wasn't
being used for anything else.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 1398bd9861
Component: cli
2017-05-15 11:57:15 +02:00
Sven Dowideit 700e7bbf64 Default the tcp port to 2376 if tls is on, and 2375 if not
Refactor so that the Host flag validation doesn't destroy the user's input,
and then post process the flags when we know the TLS options

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: 6ad0875074
Component: cli
2017-05-15 11:57:15 +02:00
Vincent Demeester f8687bd8be Revert environment regexp from 13694
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: aca36e11f2
Component: cli
2017-05-15 11:57:15 +02:00
Ma Shimiao e95263172c opts/opts.go: fix typo
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 863be38db7
Component: cli
2017-05-15 11:57:15 +02:00
Sven Dowideit 54bf4f9b92 Change ParseTCPAddr to use tcp://127.0.0.0:2375 format as default consistently
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: 2d2863ebd5
Component: cli
2017-05-15 11:57:15 +02:00
Vincent Demeester fd09cd3139 Finish linting opts and trust package.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 59ffb24c8f
Component: cli
2017-05-15 11:57:15 +02:00
Sevki Hasirci e746cef309 golint: trust
contributes to #14756

Signed-off-by: Sevki Hasirci <s@sevki.org>
Upstream-commit: 1c5cd03b1b
Component: cli
2017-05-15 11:57:15 +02:00
Sevki Hasirci 78282ac5a8 Opts lint issues, ip and ulimit
Signed-off-by: Sevki Hasirci <s@sevki.org>
Upstream-commit: 409920de5c
Component: cli
2017-05-15 11:57:15 +02:00
Brian Goff 476d2d284b Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f2934dbacf
Component: cli
2017-05-15 11:57:14 +02:00
Qiang Huang 82951125a6 Add mode check for device
This fixes two problems:
1. docker run --device /dev/sda:rw ubuntu bash doesn't work
2. --device /dev/zero:/dev/noro:ro doesn't show clear error message,
but fail when writing to cgroup file.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 22e1ac4966
Component: cli
2017-05-15 11:57:14 +02:00
Qiang Huang 4077014853 Change return value for ValidateMountMode
1. rename it from ValidateMountMode to ValidMountMode
Because it's a function simply check mount mode is valid or not.
2. remove the rw check return value
It's not supposed to be combined into this function, and we already
have a function for that check.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 6a31056ff6
Component: cli
2017-05-15 11:57:14 +02:00
Matt Robenolt a270c8bf74 opts/envfile: trim all leading whitespace in a line
Signed-off-by: Matt Robenolt <matt@ydekproductions.com>
Upstream-commit: 869e08a12b
Component: cli
2017-05-15 11:57:14 +02:00
Qiang Huang b765600600 Change all docker -d to docker daemon
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 091f800069
Component: cli
2017-05-15 11:57:14 +02:00
Antonio Murdaca 90369e329a Remove unused functions
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 351ac873e0
Component: cli
2017-05-15 11:57:14 +02:00
Shishir Mahajan 5b6cb6cb28 Add and modify tests for legacy and new daemon invokations
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f3841a1d27
Component: cli
2017-05-15 11:57:14 +02:00
Tibor Vass 092610c5eb cli: new daemon command and new cli package
This patch creates a new cli package that allows to combine both client
and daemon commands (there is only one daemon command: docker daemon).

The `-d` and `--daemon` top-level flags are deprecated and a special
message is added to prompt the user to use `docker daemon`.

Providing top-level daemon-specific flags for client commands result
in an error message prompting the user to use `docker daemon`.

This patch does not break any old but correct usages.

This also makes `-d` and `--daemon` flags, as well as the `daemon`
command illegal in client-only binaries.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f55d8241cf
Component: cli
2017-05-15 11:57:14 +02:00
Vincent Demeester 265a65f776 Add test coverage to opts and refactor
- Refactor opts.ValidatePath and add an opts.ValidateDevice
  ValidePath will now accept : containerPath:mode, hostPath:containerPath:mode
  and hostPath:containerPath.
  ValidateDevice will have the same behavior as current.

- Refactor opts.ValidateEnv, opts.ParseEnvFile
  Environment variables will now be validated with the following
  definition :
  > Environment variables set by the user must have a name consisting
  > solely of alphabetics, numerics, and underscores - the first of
  > which must not be numeric.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 7b9ceadc4d
Component: cli
2017-05-15 11:57:14 +02:00
Matthieu Hauglustaine 2249f7363a Add unit tests for ParseEnvFile.
Add unit tests of the ParseEnvFile function. Test for:
* good file
* empty file
* non existent file
* badly formatted file

Signed-off-by: Matthieu Hauglustaine <matt.hauglustaine@gmail.com>
Upstream-commit: f49f44a3a3
Component: cli
2017-05-15 11:57:14 +02:00
Matthieu Hauglustaine cdb5492521 Return bufio error if set in ParseEnvFile
Return an error value if bufio failed to properly read a token.
Avoids running a container with partial environment.

Fixes: #14266

Signed-off-by: Matthieu Hauglustaine <matt.hauglustaine@gmail.com>
Upstream-commit: 0ede41afbd
Component: cli
2017-05-15 11:57:14 +02:00
Eric-Olivier Lamey e5cf261e6a Display empty string instead of <nil> when IP opt is nil.
Fixes #13878.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
Upstream-commit: 0c721e1ad5
Component: cli
2017-05-15 11:57:13 +02:00
Doug Davis 82d0cb3f4b Minor doc edit to add clarity around the --volume path format
Also add a comment to the ValidatePath func so devs/reviewers
know exactly what its looking for.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: d1be0bd11e
Component: cli
2017-05-15 11:57:13 +02:00
Doug Davis 74a2061e32 Remove duplicate call to net.ParseIP
and a little cleanup

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 292e38a144
Component: cli
2017-05-15 11:57:13 +02:00
Antonio Murdaca 290c7f1a1b Add syslog-address log-opt
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 51c5706326
Component: cli
2017-05-15 11:57:13 +02:00
Antonio Murdaca 077a92771f Allow links to be specified with only the name if this matches the alias
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: e8e6124050
Component: cli
2017-05-15 11:57:13 +02:00
wlan0 6470449577 Add log opts flag to pass in logging options
Signed-off-by: wlan0 <sidharthamn@gmail.com>
Upstream-commit: d0c32b1efa
Component: cli
2017-05-15 11:57:13 +02:00
jhowardmsft 87a8e0557c Windows: Change default listener to HTTP
Signed-off-by: jhowardmsft <jhoward@microsoft.com>
Upstream-commit: 7da142413e
Component: cli
2017-05-15 11:57:13 +02:00
Antonio Murdaca 9f1e435e6a Remove job from container_inspect
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 64a9942188
Component: cli
2017-05-15 11:57:13 +02:00
George MacRorie 5792f08680 Cleanup redundant else statements find via golint #11602
Signed-off-by: George MacRorie <gmacr31@gmail.com>
Upstream-commit: cd08d97a64
Component: cli
2017-05-15 11:57:13 +02:00
Tomáš Hrčka 6c88b9b6c8 Restrict domain name to 255 characters
Signed-off-by: Tomáš Hrčka <thrcka@redhat.com>

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)
Upstream-commit: 01245d2619
Component: cli
2017-05-15 11:57:13 +02:00
Lei Jitang ccc7b1dd83 Add validate the input mac address on docker run command
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 8972795de7
Component: cli
2017-05-15 11:57:13 +02:00
Brian Goff 2c7c95805c Allow setting ulimits for containers
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 473eb9a2c5
Component: cli
2017-05-15 11:57:13 +02:00
Phil Estes 8471c91d34 Add more helpful error message for -add-host
Fixes: #10655

As noted in the issue, bad format was being returned even if the format
was appropriate, but the IP was invalid.  This adds a better error
message for when the IP address fails validation.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 196bc32878
Component: cli
2017-05-15 11:57:13 +02:00
Phil Estes 42e0391260 Allow IPv6 addresses in ExtraHosts option settings
Since the separator for extra host settings (for /etc/hosts in a
container) is a ":", the code that handles extra hosts needed to only
split on the first ":" to preserve IPv6 addresses which are passed via
the command line settings as well as stored in the JSON container
config.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: d656c63b21
Component: cli
2017-05-15 11:57:13 +02:00
Doug Davis 542cb79ba6 Docker run -e FOO should erase FOO if FOO isn't set in client env
See #10141 for more info, but the main point of this is to make sure
that if you do "docker run -e FOO ..." that FOO from the current env
is passed into the container.  This means that if there's a value, its
set.  But it also means that if FOO isn't set then it should be unset in
the container too - even if it has to remove it from the env.  So,
   unset HOSTNAME
   docker run -e HOSTNAME busybox env
should _NOT_ show HOSTNAME in the list at all

Closes #10141

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 67735d2a16
Component: cli
2017-05-15 11:57:13 +02:00
Don Kjer 5e44a300bb Deprecating ResolveRepositoryName
Passing RepositoryInfo to ResolveAuthConfig, pullRepository, and pushRepository

Moving --registry-mirror configuration to registry config

Created resolve_repository job

Repo names with 'index.docker.io' or 'docker.io' are now synonymous with omitting an index name.

Adding test for RepositoryInfo

Adding tests for opts.StringSetOpts and registry.ValidateMirror

Fixing search term use of repoInfo

Adding integration tests for registry mirror configuration

Normalizing LookupImage image name to match LocalName parsing rules

Normalizing repository LocalName to avoid multiple references to an official image

Removing errorOut use in tests

Removing TODO comment

gofmt changes

golint comments cleanup.  renaming RegistryOptions => registry.Options, and RegistryServiceConfig => registry.ServiceConfig

Splitting out builtins.Registry and registry.NewService calls

Stray whitespace cleanup

Moving integration tests for Mirrors and InsecureRegistries into TestNewIndexInfo unit test

Factoring out ValidateRepositoryName from NewRepositoryInfo

Removing unused IndexServerURL

Allowing json marshaling of ServiceConfig.  Exposing ServiceConfig in /info

Switching to CamelCase for json marshaling

PR cleanup; removing 'Is' prefix from boolean members.  Removing unneeded json tags.

Removing non-cleanup related fix for 'localhost:[port]' in splitReposName

Merge fixes for gh9735

Fixing integration test

Reapplying #9754

Adding comment on config.IndexConfigs use from isSecureIndex

Remove unused error return value from isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>

Adding back comment in isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>
Upstream-commit: 4440f5aa3f
Component: cli
2017-05-15 11:57:12 +02:00
Victor Vieux e362dac28b add daemon labels
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 1eda63e7e4
Component: cli
2017-05-15 11:57:12 +02:00
Ahmet Alp Balkan 265a45229c Fix input volume path check on Windows
used path package instead of path/filepath so that --volumes and
--device parameters to always validate paths as unix paths instead of
OS-dependent path convention

Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
Upstream-commit: bcae148da2
Component: cli
2017-05-15 11:57:12 +02:00
Tim Hockin c7523b18f9 Allow extra lines in /etc/hosts
This adds a --add-host host:ip flag which appends lines to /etc/hosts.  This is needed in places where you want the container to get a different name resolution than it would through DNS.  This was submitted before as #5525, closed, and now I am re-opening.  It has come up 2 or 3 times in the last couple days.

Signed-off-by: Tim Hockin <thockin@google.com>
Upstream-commit: 4731b1ebc8
Component: cli
2017-05-15 11:57:12 +02:00
Phil Estes 0a5e19808a Refactor all pre-compiled regexp to package level vars
Addresses #8057

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 8b27eee0f0
Component: cli
2017-05-15 11:57:12 +02:00
Tim Smith c5c0e2caa5 Add daemon flag to specify public registry mirrors
Adds support for a --registry-mirror=scheme://<host>[:port]
daemon flag. The flag may be present multiple times. If
provided, mirrors are prepended to the list of endpoints used
for image pull. Note that only mirrors of the public
index.docker.io registry are supported, and image/tag resolution
is still performed via the official index.

Docker-DCO-1.1-Signed-off-by: Tim Smith <timbot@google.com> (github: timbot)
Upstream-commit: cc0954586a
Component: cli
2017-05-15 11:57:12 +02:00
Solomon Hykes 9b463e6bc8 Fix inconsistency in IP address parsing errors
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 561b98067f
Component: cli
2017-05-15 11:57:12 +02:00
Solomon Hykes 43a7a9eb65 opts.IPVal returns an error on incorrect input
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 1edb726c0b
Component: cli
2017-05-15 11:57:12 +02:00
Solomon Hykes d71edae8a3 Helpers to parse lists, IPs, hosts, dns searches from the command line
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: a6487884e5
Component: cli
2017-05-15 11:57:12 +02:00
Solomon Hykes fb885c354e opts.IpOpt: a helper to parse IP addressed from the command line
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: f34ca0a354
Component: cli
2017-05-15 11:57:12 +02:00
Tibor Vass f324acb085 Make --attach case-insensitive
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: 67a518b70c
Component: cli
2017-05-15 11:57:12 +02:00
Erik Hollensbe 81ffb1c91a Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 29adea2e42
Component: cli
2017-05-15 11:57:12 +02:00
Victor Vieux acf41deb77 update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 1ed63a0f85
Component: cli
2017-05-15 11:57:12 +02:00
Victor Vieux cd7bb080ab update for consistency
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 84c187fe0c
Component: cli
2017-05-15 11:57:12 +02:00