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

619 commits

Author SHA1 Message Date
David Calavera
a7e23cab8d Merge pull request from dmcgowan/notary-offline
Support content trust offline
2015-09-21 21:11:36 -07:00
Evan Hazlett
0c71c19239 Merge pull request from duglin/FixRenameError
Fix 'rename' error msg and error checking
2015-09-21 15:51:02 -04:00
Zhang Kun
7cf343d106 add docker server version to /info
Signed-off-by: Zhang Kun <zkazure@gmail.com>
2015-09-21 21:15:32 +08:00
Sally O'Malley
e41753678d docker restarts running OR stopped containers, docs edit rm "running"
Signed-off-by: Sally O'Malley <somalley@redhat.com>
2015-09-20 09:16:27 -04:00
Doug Davis
848792c42e Fix 'rename' error msg and error checking
`docker rename foo ''` would result in:
```
usage: docker rename OLD_NAME NEW_NAME
```
which is the old engine's way of return errors - yes that's in the
daemon code.  So I fixed that error msg to just be normal.

While doing that I noticed that using an empty string for the
source container name failed but didn't print any error message at all.
This is because we would generate a URL like: ../containers//rename/..
which would cause a 301 redirect to ../containers/rename/..
however the CLI code doesn't actually deal with 301's - it just ignores
them and returns back to the CLI code/caller.

Rather than changing the CLI to deal with 3xx error codes, which would
probably be a good thing to do in a follow-on PR, for this immediate
issue I just added a cli-side check for empty strings for both old and
new names. This way we catch it even before we hit the daemon.

API callers will get a 404, assuming they follow the 301, for the
case of the src being empty, and the new error msg when the destination
is empty - so we should be good now.

Add tests for both cases too.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-18 11:12:22 -07:00
Hu Keping
da67833e63 Reset data of stats in docker cli when container stopped
When use `docker stats` to minitor a running container and then stop it,
there are some fields need to be reset to zero. Otherwise it will keep
displaying the data it received last time.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-18 15:24:13 +08:00
Antonio Murdaca
ffaee8fe78 Merge pull request from mountkin/fix-hijack
error should be checked earlier in the hijack function
2015-09-17 09:38:48 +02:00
Shijiang Wei
f2d978ccf9 error should be checked earlier in the hijack function
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-09-16 20:28:07 +08:00
Madhav Puri
54240f8da9 Support for passing build-time variables in build context
- The build-time variables are passed as environment-context for command(s)
run as part of the RUN primitve. These variables are not persisted in environment of
intermediate and final images when passed as context for RUN. The build environment
is prepended to the intermediate continer's command string for aiding cache lookups.
It also helps with build traceability. But this also makes the feature less secure from
point of view of passing build time secrets.

- The build-time variables also get used to expand the symbols used in certain
Dockerfile primitves like ADD, COPY, USER etc, without an explicit prior definiton using a
ENV primitive. These variables get persisted in the intermediate and final images
whenever they are expanded.

- The build-time variables are only expanded or passed to the RUN primtive if they
are defined in Dockerfile using the ARG primitive or belong to list of built-in variables.
HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy, FTP_PROXY and NO_PROXY are built-in
variables that needn't be explicitly defined in Dockerfile to use this feature.

Signed-off-by: Madhav Puri <madhav.puri@gmail.com>
2015-09-16 03:31:15 -07:00
Hu Keping
d3379946ec Refactor the statistics of network in docker stats
For now docker stats will sum the rxbytes, txbytes, etc. of all
the interfaces.

It is OK for the output of CLI `docker stats` but not good for
the API response, especially when the container is in sereval
subnets.

It's better to leave these origianl data to user.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-15 15:40:34 +08:00
David Calavera
7ce270d4ea Merge pull request from vdemeester/api-client-ps-coverage
Add more unit tests on api/client/ps package
2015-09-14 14:02:49 -07:00
Derek McGowan
5e11cd43aa Ignore ping errors in notary repository setup
Notary is capable of acting in offline mode, making use of cache TUF data.
When ping is not successful, notary should still be attempted without error.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-09-14 11:08:25 -07:00
Nalin Dahyabhai
e611a189cb Add log reading to the journald log driver
If a logdriver doesn't register a callback function to validate log
options, it won't be usable.  Fix the journald driver by adding a dummy
validator.

Teach the client and the daemon's "logs" logic that the server can also
supply "logs" data via the "journald" driver.  Update documentation and
tests that depend on error messages.

Add support for reading log data from the systemd journal to the
journald log driver.  The internal logic uses a goroutine to scan the
journal for matching entries after any specified cutoff time, formats
the messages from those entries as JSONLog messages, and stuffs the
results down a pipe whose reading end we hand back to the caller.

If we are missing any of the 'linux', 'cgo', or 'journald' build tags,
however, we don't implement a reader, so the 'logs' endpoint will still
return an error.

Make the necessary changes to the build setup to ensure that support for
reading container logs from the systemd journal is built.

Rename the Jmap member of the journald logdriver's struct to "vars" to
make it non-public, and to make it easier to tell that it's just there
to hold additional variable values that we want journald to record along
with log data that we're sending to it.

In the client, don't assume that we know which logdrivers the server
implements, and remove the check that looks at the server.  It's
redundant because the server already knows, and the check also makes
using older clients with newer servers (which may have new logdrivers in
them) unnecessarily hard.

When we try to "logs" and have to report that the container's logdriver
doesn't support reading, send the error message through the
might-be-a-multiplexer so that clients which are expecting multiplexed
data will be able to properly display the error, instead of tripping
over the data and printing a less helpful "Unrecognized input header"
error.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> (github: nalind)
2015-09-11 16:50:03 -04:00
Hu Keping
22be1e443f Refactor CLI docker save
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-11 15:31:55 +08:00
David Calavera
a796ac5318 Merge pull request from kunalkushwaha/add-network-cli-help
"docker network" missing from docker --help
2015-09-09 13:36:43 -07:00
Hu Keping
e9602f3561 Use TrimSpace to instead of Trim
String.Trim(string, " ") can only get ride of the blank, but actully we need
to remove all leading and trailing white space include "\t" for example.

Prior to this patch, one can login with "[Tab][Tab]username", and it will
not be consider as the same with "username".

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-09 19:37:33 +08:00
Doug Davis
87255b6721 Add --help to "docker volume inspect --help" output
Closes 

While in there, modified the testing infrastructure for the help text
so that we can get commands with nested commands - like "volume".

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-08 14:24:00 -07:00
Harald Albers
00eaa7e1f5 Fix usage for docker volume inspect and docker volume rm
For both commands, volume is _not_ optional. Several volumes may
be specified.
Both commands now use the same name (VOLUME) for the command argument.

Signed-off-by: Harald Albers <github@albersweb.de>
2015-09-08 09:14:57 -07:00
Brian Goff
5f5d73d515 Merge pull request from HuKeping/fixstats
Fix connection block when using docker stats API
2015-09-08 10:01:11 -04:00
David Calavera
719886d435 Make RegistryConfig a typed value in the api.
Remove possible circular dependency that prevented us from using a real
type.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-07 19:29:33 -04:00
Vincent Demeester
6baf65d1a6 Complete unit tests on api/client/ps package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-06 22:05:57 +02:00
Hu Keping
d9bf8163ad Fix connection block when using docker stats API
For now CLI `docker stats` will not block even if the container was
not running is because there is a 2s timeout setting when waiting for
the response.

I think why we hang there waiting for the container to run is because we
want to get the stats of container immediately when it starts running.
But it will block when use the API directly, for example
- curl
- Google Chrome plugin, Postman
- Firefox plugin, RESTClient

This patch keeps the feature that getting info immediately when container
starts running and in the meantime, it will not block when using the API
directrly.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-06 17:21:41 +08:00
Kunal Kushwaha
44da5c3de2 "docker network" missing from docker --help
Fixed issues related to network subcommand tests
- "network" in exempted list of short help check
- Condition for exact test modified to meet experimental commands
- Sorting of commands done in flags_experimental

Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
2015-09-04 15:34:17 +09:00
angt
01059cba78 Fix typo
Signed-off-by: Adrien Gallouët <agallouet@gmail.com>
2015-09-02 10:43:49 +02:00
John Howard
49c1b51ae2 Windows: Fix absolute checks
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-01 08:41:37 -07:00
Brian Goff
38da43184d Fix docker volume invalid so it displays usage
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-27 09:46:05 -04:00
Brian Goff
b3b7eb2723 Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-26 13:37:52 -04:00
Cholerae Hu
d30990d7b1 api/client/restart.go:Fix a typo in comment
Signed-off-by: Yingqian Hu <choleraehyq@gmail.com>
2015-08-26 18:59:56 +08:00
Taylor Jones
936b2c6afe adding message option to the import subcommand
Signed-off-by: Taylor Jones <monitorjbl@gmail.com>
2015-08-25 02:55:04 +00:00
Lei Jitang
211449a1ca Fix docker stats show blkio when there are multiple block devices.
Signed-off-by: Lei Jiang <leijitang@huawei.com>
2015-08-20 11:46:21 +08:00
Doug Davis
29ced5d0c4 Merge pull request from calavera/ps_format_q
Fix ignore `-q` flag in `docker ps` when there is a default format.
2015-08-17 15:44:28 -07:00
David Calavera
436fca704f Merge pull request from Microsoft/10662-uncpathonbuild
Windows: Allow UNC paths on build
2015-08-17 13:34:27 -07:00
John Howard
df7ab6f3db Windows: Allow UNC paths on build
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-08-17 11:03:54 -07:00
David Calavera
df46bfdd4d Fix ignore -q flag in docker ps when there is a default format.
Docker ps default format should not take precedence over cli flags.
This happens effectively for other flags except `-q`.
We need to let the cli to set the format as table to print the
expected output with `-q`.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-08-17 10:48:04 -07:00
Vincent Demeester
4fb88d2e11 Fix : make docker images repository:tag work
Make command like "docker images ubuntu:14.04" work and filter out the
image with the given tag.

Closes .

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-08-13 08:50:09 +02:00
Qiang Huang
81cc8ebc93 Change all docker -d to docker daemon
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-08-10 20:48:08 +08:00
Brian Goff
cc73fc03e8 Merge pull request from maaquib/15418-ps-image-id-too-wide
Truncating image id is docker ps to a length of 12
2015-08-08 07:48:16 -04:00
Lei Jitang
dc2a7ab750 Typo: remove unconsistent period in docker info
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-08 13:06:59 +08:00
Hu Keping
c536cec5ea Remove useless if-else
It is better to use simple form without else.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-08-08 20:02:44 +08:00
Mohammed Aaqib Ansari
1a2ccf59ee Truncating image id to 12 in docker ps
Signed-off-by: Mohammed Aaqib Ansari <maaquib@gmail.com>
2015-08-07 20:53:48 -04:00
David Calavera
0262d40ba7 Merge pull request from cpuguy83/better_error_on_client_connect
Better/more specific error messages on connect
2015-08-07 13:00:44 -07:00
David Calavera
0a0e9701f7 Merge pull request from WeiZhang555/golint-api-types
fix golint warnings/errors on package api/types/
2015-08-07 10:51:27 -07:00
David Calavera
70cae97ee2 Merge pull request from devx/refactor-clientRequestAttemptLogin
Cleanup: Factor cmdAttempt out of cli.clientRequestAttemptLogin
2015-08-07 10:47:18 -07:00
Zhang Wei
3d6617ffe7 fix golint warnings/errors on package api/types/
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-08-07 09:43:43 +08:00
Brian Goff
9994a35b5d Better/more specific error messages on connect
Closes 

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-06 16:41:37 -04:00
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