1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

66 commits

Author SHA1 Message Date
Victor Vieux
47a7f770f4 add support for base path in docker cli -H
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-07-08 15:42:40 -07:00
Jessie Frazelle
4185809659 Merge pull request from Microsoft/10662-infowarnings
Windows: Remove meaningless warnings on docker info
2015-07-13 14:30:57 -07:00
Jessie Frazelle
ff8cef3326 Merge pull request from tg123/master
prompt a cli login if receive 401 from registry v2 auth server
2015-07-10 15:33:42 -07:00
John Howard
615681f517 Windows: Remove meaningless warnings on docker info
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-10 10:06:20 -07:00
Ma Shimiao
91a496055c api/client: close the returned io.ReadCloser
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-07-08 10:06:25 +08:00
Phil Estes
d175ef6773 Add better client error for client certificate failure (missing or denied)
This adds a more meaningful error on the client side so the "bad
certificate" error coming from the TLS dial code has some context for
the user.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-06-26 16:23:05 -07:00
John Howard
126529c6d0 Windows: Security warning based on server OS
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-26 10:33:45 -07:00
Damien Nozay
e9ac7d24a7 Update utils.go
make error message when running commands while daemon is down more user-friendly.

```
docker@54.175.201.239 ~: sudo service docker stop
docker stop/waiting
docker@54.175.201.239 ~: docker images
Get http:///var/run/docker.sock/v1.19/images/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
```

Signed-off-by: Damien Nozay <damien.nozay@gmail.com>
2015-06-25 10:15:52 -07:00
Antonio Murdaca
910322a893 Error out if client API version is too old
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-18 11:03:07 +02:00
tgic
fe7b3658bd prompt a cli login if receive 401 from registry v2 auth server
Signed-off-by: tgic <farmer1992@gmail.com>
2015-06-17 19:28:13 +08:00
Arnaud Porterie
cd36b15ccb Merge pull request from jlhawn/cli_call_headers
api/client: have cli.call() return headers
2015-06-13 09:14:40 -07:00
Arnaud Porterie
422fa7f0a6 Merge pull request from Microsoft/adduseragent
Add GOOS in User-Agent
2015-06-12 17:19:51 -07:00
Josh Hawn
0cdc3b7539 api/client: have cli.call() return headers
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-06-10 16:20:13 -07:00
John Howard
84aec1e8e6 Typo fix in api\client\utils.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-10 15:24:53 -07:00
John Howard
543cf79ffb Add GOOS in User-Agent
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-04 13:37:41 -07:00
Antonio Murdaca
d9639409fd Provide a struct to configure cli streaming
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-01 20:23:44 +02:00
Antonio Murdaca
531f4122bd Remove engine mechanism
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-30 01:35:16 +02:00
Doug Davis
bb9da6ba92 Move CLI config processing out from under registry dir
No logic changes should be in here, just moving things around.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-23 10:18:38 -07:00
Antonio Murdaca
4b9fe9c298 Remove job from container_inspect
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 00:58:13 +02:00
Peggy Li
58065d0dd9 Fix golint errors in docker/api/client
Signed-off-by: Peggy Li <peggyli.224@gmail.com>
2015-04-22 00:14:23 -07:00
Doug Davis
18c9b6c645 Add .docker/config.json and support for HTTP Headers
This PR does the following:
- migrated ~/.dockerfg to ~/.docker/config.json. The data is migrated
  but the old file remains in case its needed
- moves the auth json in that fie into an "auth" property so we can add new
  top-level properties w/o messing with the auth stuff
- adds support for an HttpHeaders property in ~/.docker/config.json
  which adds these http headers to all msgs from the cli

In a follow-on PR I'll move the config file process out from under
"registry" since it not specific to that any more. I didn't do it here
because I wanted the diff to be smaller so people can make sure I didn't
break/miss any auth code during my edits.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-20 13:05:24 -07:00
Ahmet Alp Balkan
6e44246fed Swap width/height in GetWinsize and monitorTtySize
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-06 14:31:42 -07:00
Tibor Vass
ddbc68f564 Merge pull request from ahmetalpbalkan/win-cli/monitorttysize
windows: monitorTtySize correctly by polling
2015-03-31 11:14:04 -04:00
Ahmet Alp Balkan
ebbceea8a7 windows: monitorTtySize correctly by polling
This change makes `monitorTtySize` work correctly on windows by polling
into win32 API to get terminal size (because there's no SIGWINCH on
windows) and send it to the engine over Remove API properly.

Average getttysize syscall takes around 30-40 ms on an average windows
machine as far as I can tell, therefore in a `for` loop, checking every
250ms if size has changed or not.

I'm not sure if there's a better way to do it on windows, if so,
somebody please send a link 'cause I could not find.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-26 16:08:05 -07:00
Antonio Murdaca
6f4d847046 Replace aliased imports of logrus, fixes
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-26 23:22:04 +01:00
Don Kjer
6b2eeaf896 Fix for issue 9922: private registry search with auth returns 401
Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-03-26 18:59:16 +00:00
Alexander Morozov
b9d19fdaef Merge pull request from peggyl/golint-api-client
Fix golint errors for casing in api/client package
2015-03-26 09:28:33 -07:00
Peggy Li
a465e26bb0 Fix golint errors for casing in api/client package
Signed-off-by: Peggy Li <peggyli.224@gmail.com>
2015-03-25 19:54:29 -07:00
bobby abbott
0cd6c05d81 Fixes hacks from progressreader refactor
related to 

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-03-25 18:21:02 -07:00
Srini Brahmaroutu
6871b9b16a Removing -X flag option and autogenerated code to create Dockerversion.go functionality
Addresses 

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-02-20 05:40:12 +00:00
Jessica Frazelle
cd5902fc7b Fix range for go 1.3
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-12 11:49:52 -08:00
Jean-Paul Calderone
f29ee87051 Use the official mime type that exists instead of an imaginary one that does not.
Signed-off-by: Jean-Paul Calderone <exarkun@twistedmatrix.com>

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@linux.com> (github: jfrazelle)
2015-01-09 20:24:54 -08:00
Tianon Gravi
6292354dc3 Fix silly little syntax mistake
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-01-09 15:03:11 -07:00
Tianon Gravi
b20363c4c0 Add "gofmt" from Go 1.3.3
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-01-09 09:54:58 -07:00
Don Kjer
33b931e718 Adding workaround to suppress gofmt issues with api/client/utils.go
Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-01-08 21:16:43 +00:00
Don Kjer
568f86eb18 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 

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>
2015-01-08 20:14:58 +00:00
Doug Davis
90928eb114 Add support for docker exec to return cmd exitStatus
Note - only support the non-detached mode of exec right now.
Another PR will add -d support.

Closes 

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-25 17:49:25 -08:00
Jessica Frazelle
7fe8d0aeeb Fix steam where it should be stream.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-11-18 10:49:01 -08:00
Ahmet Alp Balkan
91a86670aa Extract client signals to pkg/signal
SIGCHLD and SIGWINCH used in api/client (cli code) are not
available on Windows. Extracting into separate files with build
tags.

Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
2014-11-14 18:20:53 -08:00
Tibor Vass
b79211f4ae Merge pull request from duglin/Issue5184
Add a better error message when we get an unknown http issue
2014-11-04 20:07:41 -05:00
Doug Davis
6fdaa66652 Add a better error message when we get an unknown http issue
Closes 

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-04 16:46:41 -08:00
Alexandr Morozov
7c62cee51e Use logrus everywhere for logging
Fixed 

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-24 15:03:06 -07:00
Vincent Batts
da42ae536c client: even cleaner use of Transport
First off, sorry for the noise. This is a cleaner step of 

Found more of a root cause of the open file handles.
After more testing I found that the open file descriptors will still
occur for TCP:// connections to the daemon, causing client and/or daemon
to fail.

The issue was instantiating a new http.Transport on _ever_ client
request. So each instance held the prior connection alive, but was only
ever used once.

By moving it out to the initilization of DockerCli, we can now have
reuse of idled connections. Simplifies the garbage overhead of the
client too, though that's not usually a deal.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-10-12 22:32:55 -04:00
unclejack
7fa7c42ce2 Merge pull request from vbatts/vbatts-too_many_open_files
cleaner handling of client socket access
2014-10-11 11:16:23 +03:00
Vincent Batts
fb7ceeb170 cleaner handling of client socket access
In the go stdlib net/http Transport, the used connections are cached
when idled. This behaviour is intended for TCP connections and does not
behave correctly for unix sockets. Despite the
DefaultMaxIdleConnsPerHost being 2, the idled connections are held open
during a session. For large sessions like `docker rm $(docker ps -a -q)`
of thousands of containers, it will cause the client _and_ the server to
open too many fails and have failures.

Having keep alives not used for only unix sockets is a work around for
this stdlib issue.

Also this includes disabling compression when communicating over the
local unix socket too.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-10-10 19:58:49 -04:00
Jessica Frazelle
b66ac6a809 Revert "Fix line delimited JSON response"
This reverts commit d2f75a3040.

Conflicts:
	integration-cli/docker_api_events_test.go

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-10-09 13:46:21 -07:00
Jessica Frazelle
4c6b7cd1b5 Revert "Change content-type for json stream to application/x-json-stream."
This reverts commit 10ab2089ce.

Conflicts:
	api/client/utils.go
	docs/sources/reference/api/docker_remote_api.md

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-10-09 13:17:47 -07:00
Tonis Tiigi
e457b21db3 Fix Host header on stream commands
Fixes 

Setting Host on URL only works if the Request does not
already have its Host property set.

Note that the API version was also swallowed.

Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
2014-10-06 17:04:27 +03:00
Vojtech Vitek (V-Teq)
d742c57f53 DockerCli: Check IsTerminal() for both STDIN and STDOUT
`docker events > /tmp/out` should not print control
characters to non-terminal STDOUT.

This addresses commit 26b4a4920a
without creating regression described in issue .

Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-25 20:58:24 +02:00
Jessica Frazelle
10ab2089ce Change content-type for json stream to application/x-json-stream.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-09-22 10:29:56 -07:00