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

573 commits

Author SHA1 Message Date
David Calavera
3d3db0d4af Fail fail when the ps format template is invalid.
Fixes error continuing execution when the parsing fails.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-08-05 13:22:24 -07:00
Arnaud Porterie
7374852be9 Merge pull request from aaronlehmann/int64
Fix uses of "int" where "int64" should be used instead
2015-08-04 19:16:13 -07:00
Derek McGowan
6ce76cd9ed Updated to use latest version of notary
Update UX to use aliases for root, snapshot, and target key

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-31 17:32:35 -07:00
Aaron Lehmann
1f61084d83 Fix uses of "int" where "int64" should be used instead
Some structures use int for sizes and UNIX timestamps. On some
platforms, int is 32 bits, so this can lead to the year 2038 issues and
overflows when dealing with large containers or layers.

Consistently use int64 to store sizes and UNIX timestamps in
api/types/types.go. Update related to code accordingly (i.e.
strconv.FormatInt instead of strconv.Itoa).

Use int64 in progressreader package to avoid integer overflow when
dealing with large quantities. Update related code accordingly.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-31 16:31:40 -07:00
David Calavera
8f2dca5386 Merge pull request from aaronlehmann/graph-cleanup
Documentation improvements and code cleanups for graph package
2015-07-31 15:11:34 -07:00
Zhang Wei
6a4ac63aaa Docker stats: display Block IO stats
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-07-31 21:26:32 +08:00
Tibor Vass
3face3c521 Use default no-op uuid.Loggerf for client cli
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-30 21:19:51 -04:00
Aaron Lehmann
d4836cd7ec Documentation improvements and code cleanups for graph package
Expand the godoc documentation for the graph package.

Centralize DefaultTag in the graphs/tag package instead of defining it
twice.

Remove some unnecessary "config" structs that are only used to pass
a few parameters to a function.

Simplify the GetParentsSize function - there's no reason for it to take
an accumulator argument.

Unexport some functions that aren't needed outside the package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-30 14:27:10 -07:00
Alexander Morozov
8505183252 Merge pull request from ottok/master
Multiple fixes to 'docker stats' output
2015-07-30 14:02:35 -07:00
Josh Hawn
75f6929b44 Fix docker cp Behavior With Symlinks
[pkg/archive] Update archive/copy path handling

  - Remove unused TarOptions.Name field.
  - Add new TarOptions.RebaseNames field.
  - Update some of the logic around path dir/base splitting.
  - Update some of the logic behind archive entry name rebasing.

[api/types] Add LinkTarget field to PathStat

[daemon] Fix stat, archive, extract of symlinks

  These operations *should* resolve symlinks that are in the path but if the
  resource itself is a symlink then it *should not* be resolved. This patch
  puts this logic into a common function `resolvePath` which resolves symlinks
  of the path's dir in scope of the container rootfs but does not resolve the
  final element of the path. Now archive, extract, and stat operations will
  return symlinks if the path is indeed a symlink.

[api/client] Update cp path hanling

[docs/reference/api] Update description of stat

  Add the linkTarget field to the header of the archive endpoint.
  Remove path field.

[integration-cli] Fix/Add cp symlink test cases

  Copying a symlink should do just that: copy the symlink NOT
  copy the target of the symlink. Also, the resulting file from
  the copy should have the name of the symlink NOT the name of
  the target file.

  Copying to a symlink should copy to the symlink target and not
  modify the symlink itself.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-30 12:14:28 -07:00
Otto Kekäläinen
b619220ce1 Multiple fixes to 'docker stats' output:
* Add space between values in docker stats output for easier parsing

  Old output could not be parsed easily because there were columns
  that did not have any separator. Also values that are together
  without any space is difficult to read even for humans.

* Update unit.HumanSize comment to match what the does actually does

Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
2015-07-30 10:14:57 +03:00
Arnaud Porterie
d94aeb2876 Merge pull request from jlhawn/build_tag_resolved_digests
[api/client] Tag resolved digest from Dockerfile
2015-07-29 16:52:14 -07:00
Tibor Vass
7841d6ab9a Set uuid.Loggerf to nop on client and to logrus.Warnf on daemon
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-29 17:49:59 -04:00
root
929f2c2f40 api/client fix golint errors/warnings
Addresses 

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-07-29 17:20:54 +00:00
Tibor Vass
9d3ad6d892 Merge pull request from LK4D4/unsafe_random
Use non-crypto version of random to generate ids.
2015-07-29 11:47:38 -04:00
Alexander Morozov
6bca8ec3c9 Replace GenerateRandomID with GenerateNonCryptoID
This allow us to avoid entropy usage in non-crypto critical places.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-28 22:31:01 -07:00
Josh Hawn
bb2e6c72d2 [api/client] Tag resolved digest from Dockerfile
Builds where the base images have been resolved to trusted digest
references will now be tagged with the original tag reference from
the Dockerfile on a successful build.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-28 17:54:48 -07:00
Josh Hawn
af06d289e4 [api/client] update check Dockerfile in Context
Actually determine the relative path of the Dockerfile to the context
directory. Error out if the relative path starts with "../".

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-27 16:11:36 -07:00
Michael Crosby
bdc55be9b4 Merge pull request from jlhawn/fix_build_context_is_symlink
[api/client] Fix build when context dir is symlink
2015-07-27 15:11:36 -07:00
Vincent Demeester
5170a2c096 Lint fixes on runconfig
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-27 21:23:15 +02:00
Josh Hawn
01d570ad30 [api/client] Fix build when context dir is symlink
Symbolic links in the context directory path are now evaluated.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-27 12:01:13 -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
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 

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-24 11:55:07 -07:00
Jessie Frazelle
7674f21686 Merge pull request 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
David Calavera
1c6fe58efc Merge pull request from cpuguy83/refactor_logdrvier_reader
Refactor log driver reader
2015-07-22 11:54:35 -07:00
David Calavera
40b922418c Merge pull request from estesp/docker-ps-format
Carry : 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
Jessie Frazelle
ff011ededb Merge pull request 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 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 

Signed-off-by: Dave Tucker <dt@docker.com>
2015-07-22 00:47:41 +01:00
David Calavera
36106a20ca Merge pull request from duglin/Issue14621
Remove panic in nat package on invalid hostport
2015-07-21 15:48:51 -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
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 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 

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 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