Граф коммитов

1010 Коммитов

Автор SHA1 Сообщение Дата
David Calavera c451d597f2 Merge pull request #15028 from vbatts/typo
api/client/build: typo in error
2015-07-27 10:13:05 -07:00
David Calavera e89aec0dfb Merge pull request #15010 from runcom/14947-fix-inspect-time-RFC3339Nano
Format times in inspect command with a template as RFC3339Nano
2015-07-27 10:08:21 -07:00
Vincent Batts 0e697ebe6e api/client/build: typo in error
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-07-27 11:01:26 -04:00
Stephen Rust c358a4cd35 Check for nil before using HostConfig to adjustCpuShares
Fix #14915. Add unit test for #14915.
Thanks @runcom for the test case: when the client calls 1.18 api
version w/o hostconfig it results in a nil pointer dereference.

Signed-off-by: Stephen Rust <srust@blockbridge.com>
2015-07-26 20:33:04 -04:00
Antonio Murdaca c9207bc0aa Format times in inspect command with a template as RFC3339Nano
In 1.6.2 we were decoding inspect API response into interface{}.
time.Time fields were JSON encoded as RFC3339Nano in the response
and when decoded into interface{} they were just strings so the inspect
template treated them as just strings.
From 1.7 we are decoding into types.ContainerJSON and when the template
gets executed it now gets a time.Time and it's formatted as
2015-07-22 05:02:38.091530369 +0000 UTC.
This patch brings back the old behavior by typing time.Time fields
as string so they gets formatted as they were encoded in JSON -- RCF3339Nano

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-26 15:25:08 +02:00
Derek McGowan 259cadb0b1 Rename to flags and environment variables to content trust
Update help line to allow 90 characters instead of 80

The trust flag pushes out the help description column wider, requiring more room to display help messages.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-24 16:31:18 -07:00
Josh Hawn 578b1521df Add notary integration to `docker build`
The Dockerfile is rewritten with images references on FROM
instructions resolved to trusted digests. The rewritten Dockerfile
is swapped with the original one during context upload.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-24 14:08:20 -07:00
Josh Hawn 3021b7a4a0 Refactor api/client/build.go
Separated preparation of context and Dockerfile for
the various different methods of specifying them.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-24 14:08:20 -07:00
Derek McGowan ed13c3abfb Use notary library for trusted image fetch and signing
Add a trusted flag to force the cli to resolve a tag into a digest via the notary trust library and pull by digest.
On push the flag the trust flag will indicate the digest and size of a manifest should be signed and push to a notary server.
If a tag is given, the cli will resolve the tag into a digest and pull by digest.
After pulling, if a tag is given the cli makes a request to tag the image.

Use certificate directory for notary requests

Read certificates using same logic used by daemon for registry requests.

Catch JSON syntax errors from Notary client

When an uncaught error occurs in Notary it may show up in Docker as a JSON syntax error, causing a confusing error message to the user.
Provide a generic error when a JSON syntax error occurs.

Catch expiration errors and wrap in additional context.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-24 14:08:20 -07:00
Aaron Lehmann 4fcb9ac40c Improve documentation and golint compliance of registry package
* Add godoc documentation where it was missing

* Change identifier names that don't match Go style, such as INDEX_NAME

* Rename RegistryInfo to PingResult, which more accurately describes
  what this structure is for. It also has the benefit of making the name
  not stutter if used outside the package.

Updates #14756

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-24 11:55:07 -07:00
Jessie Frazelle 7674f21686 Merge pull request #13771 from tiborvass/daemon-cli
New `docker daemon` command
2015-07-23 19:30:39 -07:00
Tibor Vass 96ce3a194a 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>
2015-07-23 19:44:46 -04:00
Tianon Gravi f57fc03e3b Fix "docker ps" with no containers regression
The header row was not being printed when "docker ps" was invoked without containers thanks to the new format support, and we instead received a single blank line.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-07-23 13:23:24 -07:00
Lei 877dbbbde8 Add ulimit to docker build.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-23 10:26:06 +08:00
Alexander Morozov 3ee7297b7e Merge pull request #14869 from calavera/remove_duplicated_cp_handlers_init
Remove duplicated code parsing parameters for the archiving handlers.
2015-07-22 13:25:34 -07:00
David Calavera 1612ff9726 Remove duplicated code parsing parameters for the archiving handlers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-22 12:39:46 -07:00
David Calavera 1c6fe58efc Merge pull request #14442 from cpuguy83/refactor_logdrvier_reader
Refactor log driver reader
2015-07-22 11:54:35 -07:00
David Calavera 40b922418c Merge pull request #14699 from estesp/docker-ps-format
Carry #10255: Docker ps format
2015-07-22 10:58:34 -07:00
Phil Estes 542b58d8f7 ps --format: Add config.js doc, fix gofmt, add integration tests
Re-add the docs from @calavera's PR to the moved cli cmd reference docs.
Fix gofmt and vet issues from carried commits
Add integration test for using format with --no-trunc and multi-names
Fix custom_test map order dependency on expected value check
Add docs to reference/commandline/ps.md
Remove "-F" flag option from original carried PR content

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-07-22 12:51:16 -04:00
Alexander Morozov a751c0a52f Merge pull request #14790 from hqhq/hq_golint_build
Fix golint warnings for builder
2015-07-22 08:17:04 -07:00
Antonio Murdaca 1a5d6a94c9 Fix wrong Content-Type returned by /images/search API
/images/search was replying with Content-Type text/plain instead
of application/json.
Fix #14846

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-22 11:07:41 +02:00
Sebastiaan van Stijn 50d2597e49 Merge pull request #13711 from calavera/version_volumes_inspect
Expose new mount points structs in inspect.
2015-07-22 09:02:00 +02:00
Qiang Huang 8c4a282a57 Fix golint warnings for builder
Addresses: #14756

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-22 13:29:03 +08:00
Jessie Frazelle ff011ededb Merge pull request #14804 from dave-tucker/golint_nat
golint: Fix issues in pkg/nat
2015-07-21 20:38:40 -07:00
Brian Goff c0391bf554 Split reader interface from logger interface
Implement new reader interface on jsonfile.
Moves jsonlog decoding from daemon to jsonfile logger.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-07-21 20:47:31 -04:00
Arnaud Porterie c986f85f73 Merge pull request #13171 from jlhawn/archive_copy
docker cp to and from containers
2015-07-21 16:59:44 -07:00
Dave Tucker 15d01d6e6c golint: Fix issues in pkg/nat
Updates #14756

Signed-off-by: Dave Tucker <dt@docker.com>
2015-07-22 00:47:41 +01:00
David Calavera 36106a20ca Merge pull request #14682 from duglin/Issue14621
Remove panic in nat package on invalid hostport
2015-07-21 15:48:51 -07:00
David Calavera 1c3cb2d31e Expose new mount points structs in inspect.
Keep old hashes around for old api version calls.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-21 15:33:05 -07:00
Josh Hawn 93c3e6c91e api/client: New and Improved `docker cp` behavior
Supports copying things INTO a container from a local file or from a tar
archive read from stdin.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-21 15:19:52 -07:00
Josh Hawn db9cc91a9e api/server: StatPath, ArchivePath, ExtractToDir
Adds http handlers for new API endpoints:

GET ContainersArchivePath
  Return a Tar Archive of the contents at the specified location in a
  container. Deprecates POST ContainersCopy. Use a HEAD request to stat
  the resource.

PUT ContainersExtractToDir
  Extract the Tar Archive from the request body to the directory at the
  specified location inside a container.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-21 15:19:52 -07:00
Josh Hawn c32dde5baa daemon: container ArchivePath and ExtractToDir
The following methods will deprecate the Copy method and introduce
two new, well-behaved methods for creating a tar archive of a resource
in a container and for extracting a tar archive into a directory in a
container.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-21 11:20:10 -07:00
David Calavera 37209190c7 Docker ps custom formatting.
Docker-DCO-1.1-Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-20 22:46:55 -04:00
Jeff Mickey de0e883331 docker ps: add fields for ordering and column selection
* api/client/ps.go: Refactor CmdPs to use a fields list of
  characters to determine which columns to print on `docker ps`
  invocation.

This adds an ability for the docker command to print the columns of
output in arbitrary order.

Signed-off-by: Jeff Mickey <j@codemac.net>

Docker-DCO-1.1-Signed-off-by: Jeff Mickey <j@codemac.net>
2015-07-20 22:45:21 -04:00
Morgan Bauer dea49b7474
golint for cliconfig
- fully capitalize HTTP in HTTPHeaders
 - comment for CONFIGFILE
 - camelcase and privatize oldConfigfile, defaultIndexserver
 - remove unused var errConfigFileMissing
 - comments for methods and functions throughout
 - external references to renamed variables changed

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-07-20 16:48:58 -07:00
Sebastiaan van Stijn 415f744d0c Merge pull request #11485 from wlan0/rollover_log
Add rollover log driver, and --log-driver-opts flag
2015-07-17 22:41:26 +02:00
Doug Davis 12b6083c8f Remove panic in nat package on invalid hostport
Closes #14621

This one grew to be much more than I expected so here's the story... :-)
- when a bad port string (e.g. xxx80) is passed into container.create()
  via the API it wasn't being checked until we tried to start the container.
- While starting the container we trid to parse 'xxx80' in nat.Int()
  and would panic on the strconv.ParseUint().  We should (almost) never panic.
- In trying to remove the panic I decided to make it so that we, instead,
  checked the string during the NewPort() constructor.  This means that
  I had to change all casts from 'string' to 'Port' to use NewPort() instead.
  Which is a good thing anyway, people shouldn't assume they know the
  internal format of types like that, in general.
- This meant I had to go and add error checks on all calls to NewPort().
  To avoid changing the testcases too much I create newPortNoError() **JUST**
  for the testcase uses where we know the port string is ok.
- After all of that I then went back and added a check during container.create()
  to check the port string so we'll report the error as soon as we get the
  data.
- If, somehow, the bad string does get into the metadata we will generate
  an error during container.start() but I can't test for that because
  the container.create() catches it now.  But I did add a testcase for that.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-17 13:02:54 -07:00
Derek McGowan 19515a7ad8 Update graph to use vendored distribution client for the v2 codepath
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-16 13:13:47 -04:00
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
Patrick Hemmer 41588a5766 add --format flag to `docker version`
Signed-off-by: Patrick Hemmer <patrick.hemmer@gmail.com>
2015-07-13 19:10:56 -04:00
Jessie Frazelle 4185809659 Merge pull request #14518 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 #13986 from tg123/master
prompt a cli login if receive 401 from registry v2 auth server
2015-07-10 15:33:42 -07:00
Phil Estes b7e8169274 Merge pull request #13554 from Microsoft/10662-winexec
Windows: The real Windows exec driver is here.
2015-07-10 17:13:10 -04:00
John Howard 9ae9d4c87a Windows: Exec driver
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-10 13:36:56 -07:00
Doug Davis daced1d303 Add support for DOCKER_CONFIG/--config to specific config file dir
Carry #11675

Aside from what #11675 says, to me a key usecase for this is to support
more than one Docker cli running at the same time but each may have its
own set of config files.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-10 12:51:34 -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 9a4cbb358d api/client: unify format of args check
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-07-08 17:29:47 +08: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
Jessie Frazelle 2cd417df73 Merge pull request #14388 from runcom/14316-fix-events-filters
Fix combined image events filters
2015-07-07 18:08:56 -07:00
Doug Davis 26a35dd09b Merge pull request #14344 from Mashimiao/add-json-check-for-execcreate
api/server: Add missing json check
2015-07-05 19:04:12 -04:00