Compare commits

...

1417 Commits

Author SHA1 Message Date
Jessica Frazelle
f4bf5c7026 bump version for v1.8.3
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-10-11 20:37:29 -07:00
Jessica Frazelle
1321794dc1 change flag name to better follow the other flags that start with disable;
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-10-07 10:50:50 -07:00
Richard Scothern
668a1758bd Prevent push and pull to v1 registries by filtering the available endpoints.
Add a daemon flag to control this behaviour.  Add a warning message when pulling
an image from a v1 registry.  The default order of pull is slightly altered
with this changset.

Previously it was:
https v2, https v1, http v2, http v1

now it is:
https v2, http v2, https v1, http v1

Prevent login to v1 registries by explicitly setting the version before ping to
prevent fallback to v1.

Add unit tests for v2 only mode.  Create a mock server that can register
handlers for various endpoints.  Assert no v1 endpoints are hit with legacy
registries disabled for the following commands:  pull, push, build, run and
login.  Assert the opposite when legacy registries are not disabled.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-10-06 18:26:17 -07:00
Richard Scothern
6321ac9182 Command line, manpage and deprecation documentation
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-10-06 18:26:16 -07:00
Aaron Lehmann
40164ebcc1 Remove trust package
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-10-06 18:26:15 -07:00
Aaron Lehmann
56d463690f Unmarshal signed payload when pulling by digest
Add a unit test for validateManifest which ensures extra data can't be
injected by adding data to the JSON object outside the payload area.

This also removes validation of legacy signatures at pull time. This
starts the path of deprecating legacy signatures, whose presence in the
very JSON document they attempt to sign is problematic.  These
signatures were only checked for official images, and since they only
caused a weakly-worded message to be printed, removing the verification
should not cause impact.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-10-06 18:26:09 -07:00
Tonis Tiigi
9098628b29 Calculate hash based image IDs on pull
Generate a hash chain involving the image configuration, layer digests,
and parent image hashes. Use the digests to compute IDs for each image
in a manifest, instead of using the remotely specified IDs.

To avoid breaking users' caches, check for images already in the graph
under old IDs, and avoid repulling an image if the version on disk under
the legacy ID ends up with the same digest that was computed from the
manifest for that image.

When a calculated ID already exists in the graph but can't be verified,
continue trying SHA256(digest) until a suitable ID is found.

"save" and "load" are not changed to use a similar scheme. "load" will
preserve the IDs present in the tar file.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-10-06 18:25:17 -07:00
David Calavera
0a8c2e3717 Bump to version 1.8.2.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-10 14:43:43 -04:00
Tianon Gravi
57e9c4f7e5 Swap "ubuntu-debootstrap" for just "ubuntu"
See https://github.com/docker-library/official-images/pull/982#issuecomment-133207587.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-09-10 14:43:43 -04:00
Jessica Frazelle
3e8da36017 use apt-ftparchive and reprepro to enable apt-pinning;
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
(cherry picked from commit 12a71c8954)
2015-09-03 05:20:58 -04:00
David Calavera
1cce9a26a3 Bump libnetwork version to bc565c2d295067c1a43674a23a473ec6336d7fd4
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-02 17:24:37 -04:00
Tonis Tiigi
d7f8b4d43e Fix goroutine leak on pull
Close the pipeWriter even if there was no error.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-09-01 09:31:43 -04:00
Derek McGowan
6f7bbc3171 Fix sanitize URL bug on layer upload
Update the distribution version to include sanitize URL fix

Fixes #15875

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-08-31 03:37:50 -04:00
Harald Albers
947087fb24 Update bash completion for docker run
Also fixed sort order of options using `sort -d`

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 644c158837)
2015-08-28 05:03:01 -04:00
Harald Albers
ffe7e48ed6 Add options for the json-file logging driver to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 5c1ad6f90c)
2015-08-28 05:02:55 -04:00
Harald Albers
eeecd1cf59 Add storage options to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e4d8a8e1ca)

Conflicts:
	contrib/completion/bash/docker
2015-08-28 05:02:45 -04:00
Harald Albers
3f411db15b Add missing storage drivers to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
2015-08-28 04:59:30 -04:00
Harald Albers
789197f33d Remove -h flag from completion and daemon reference
All docker subcommands support `-h` as an alias for `--help`
unless they have `-h` aliased to something else like `docker run`,
which uses `-h` for `--hostname`.

`-h` is not included in the help messages of the commands, though.

It ist visible in
* reference: only in `docker daemon` reference,
  see output of `grep -Rse --help=false docs`
* man pages: only in `docker` man page
  see output of `grep -RF '**-h**' man`

For consistency reasons, this commit removes `-h` as an alias for
`--help` from the reference page, man page and the bash completion.

Signed-off-by: Harald Albers <github@albersweb.de>
2015-08-28 04:59:09 -04:00
Harald Albers
0c71d09921 Add docker ps --format to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
2015-08-28 04:57:54 -04:00
Tonis Tiigi
cc8320cb58 Fix pull on client disconnect
Fixes #15589

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-28 04:26:22 -04:00
Arnaud Porterie
c22b292719 Update vendoring
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-08-26 04:45:56 -04:00
Tonis Tiigi
14d2083f14 Remove nil contexts
Causes daemon panic because loggers can’t be found.

Fixes #15724

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 0c08913d52)
2015-08-25 12:25:38 -04:00
Tonis Tiigi
ea56c5e1ce Update volumes userguide
Fixes #15644

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-25 12:25:37 -04:00
Harald Albers
341ff018a2 Fix bash completion for log driver options
This option was incorrectly ported to the new `daemon` subcommand
structure.

Beside the obvious effect that completion of `docker daemon --log-opt`
did not work, this also caused completion of `docker` and `docker xxx`
to fail on macs with

> bash: words: bad array subscript

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 18381faee6)

Conflicts:
	contrib/completion/bash/docker
2015-08-25 12:25:37 -04:00
Shijiang Wei
e07819293a a quick fix to #15626
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-08-25 12:25:37 -04:00
Marius Sturm
6ec8d40ae7 Initialize LogConfig in daemon mode
Signed-off-by: Marius Sturm <marius@graylog.com>
(cherry picked from commit e904cbec03)

Conflicts:
	docker/daemon.go
2015-08-25 12:25:37 -04:00
Jana Radhakrishnan
16d64608f3 Vendoring in vishvananda/netlink
Updating netlink package to 4b5dce31de6d42af5bb9811c6d265472199e0fec
to fix certain wierd netlink issues seen.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit 7948b755c7)

Conflicts:
	hack/vendor.sh
2015-08-25 12:25:37 -04:00
David Calavera
00a27b6872 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-25 04:32:20 -04:00
Vincent Batts
fc12b9ddce vendor: update tar-split to v0.9.6
Fixes rare edge case of handling GNU LongLink and LongName entries.
Perf improvements. /dev/null writes were taking CPU time during docker
push. Thanks @LK4D4
Various cleanup too.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-08-25 04:32:07 -04:00
Jessie Frazelle
b66e5ef208 Merge pull request #15544 from icecrime/bump_1.8.1
Bump 1.8.1
2015-08-12 20:19:06 -07:00
Arnaud Porterie
d12ea79c9d Update VERSION and CHANGELOG.md
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-08-12 18:54:41 -07:00
Arnaud Porterie
a9aaa66780 Update regression test
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-08-12 18:52:01 -07:00
Arnaud Porterie
e19060dcea Revert #14884
This reverts commit 810d3b2642.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-08-12 18:51:57 -07:00
David Calavera
b0e0dbb33b Merge pull request #15091 from calavera/bump_v1.8.0
Bump v1.8.0
2015-08-11 13:16:04 -05:00
David Calavera
0d03096b65 Bump version to 1.8.0
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-08-11 11:35:27 -05:00
Jessica Frazelle
55e9551aaa minor cosmetic change to client output on pull
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
(cherry picked from commit 8bd6322760)
2015-08-11 11:35:27 -05:00
Mary Anthony
c65afe6ba8 Updating new vm and with migrate
Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit e5c160e1d6)
2015-08-11 11:35:27 -05:00
Mary Anthony
5745aaed22 Initial work
Removing references to regsitry 1.0, pointing to distribution
Updating links and title
Adding in comments

Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit d550d729e1)
2015-08-11 11:35:27 -05:00
Diogo Monica
b6f0f93c94 Docker content trust documentation
- started from Diogo's work
- updated after discussions with team
- Updating with new key names
- fixing weight
- adding in sandbox
- adding in gliffy for images
- backing out to old names for now
- Copy edit pass
- Entering comments from the content trust team
- Update name of branch and image name
- Removing the last diogo reference
- Updating with Seb's comments

Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit 753bf40f15)
2015-08-11 11:35:26 -05:00
Youcef YEKHLEF
33b16fef43 Add fedora 22 install docs warning about systemd-network
With systemd in version 219 IP forwarding should be forced in the interface configuration file.

Signed-off-by: yyekhlef <yyekhlef@gmail.com>
(cherry picked from commit 35aebdc803)
2015-08-10 12:11:42 -05:00
Youcef YEKHLEF
9705c349c5 Add fedora 22 install docs warning about systemd-network
Following @cles commit #6bd15a68c for Arch

Signed-off-by: yyekhlef <yyekhlef@gmail.com>
(cherry picked from commit f224a9f3d6)
2015-08-10 12:11:42 -05:00
Ankush Agarwal
3de34af5d1 Remove note from docker version 1.3 on Env variables
Fixes #14734

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
(cherry picked from commit 89ec5399af)
2015-08-10 12:11:42 -05:00
Ankush Agarwal
b3f3abfc94 Make official install instructions use curl instead of wget
YOU GO CURL

Fixes #14650

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
(cherry picked from commit c76fef1791)
2015-08-10 12:10:42 -05:00
Mary Anthony
783baec49c Fixes #15349 too many apis
Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit 1d5f479e01)
2015-08-10 12:10:42 -05:00
Vincent Bernat
c1d9e7c6fb doc: add a notice about memory accounting overhead
The documentation for Debian and Ubuntu explains how to enable memory
and swap accounting but doesn't explain why it is disabled in the first
place. The problem with those subsystems is that they incurs a
performance hit even when not used at all. Add this explanation.

The provided figure are quite vague. The memory overhead is easily
verifiable. It is for example cited in [RedHat documentation][]. For the
performance hit, maybe the performance is better now, but a few years
ago, it was said to be [between 6 and 15%][].

The goal is that people don't just enable memory accounting if they
don't have a use for it.

[RedHat documentation]: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-memory.html
[between 6 and 15%]: https://lwn.net/Articles/517562/

Signed-off-by: Vincent Bernat <vincent@bernat.im>
(cherry picked from commit 56b33e9f27)
2015-08-10 12:10:42 -05:00
Derek McGowan
83f6dbe30a Skip notary tests which update system clock
Currently some notary tests change the system clock to check for expiration.
Skip these tests until the code can be refactored to not rely on updating the system clock.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit bf3c1e6a3a)
2015-08-07 10:08:37 -07:00
Jessica Frazelle
a97b89b585 remove docker-unconfined profile we were not using it and it breaks apparmor on wheezy
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
(cherry picked from commit e542238f2a)
2015-08-06 20:08:25 -07:00
Tibor Vass
29ea36a880 registry: Do not push to mirrors
This patch splits LookupEndpoints into LookupPullEndpoints and
LookupPushEndpoints so that mirrors added with --registry-mirror are
skipped in the list returned by LookupPushEndpoints.

Fixes https://github.com/docker/distribution/issues/823

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit b899977ee2)
2015-08-06 19:55:06 -07:00
Alessandro Boch
ed672d1609 Vendoring libnetwork bd3eecc96f3c05a4acef1bedcf74397bc6850d22
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit e35a5ae463)
2015-08-06 19:55:05 -07:00
Jessica Frazelle
5916664220 revert apparmor changes back to how it was in 1.7.1, but keep tests
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
(cherry picked from commit ed248207d7)
2015-08-06 19:55:05 -07:00
Lei
da4b336233 Remove redundant ip_forward check
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 6a0050d0f0)
2015-08-06 09:55:02 -07:00
Josh Hawn
74df05ccaa [graph] Use a pipe for downloads to write progress
The process of pulling an image spawns a new goroutine for each layer in the
image manifest. If any of these downloads fail we would stop everything and
return the error, even though other goroutines would still be running and
writing output through a progress reader which is attached to an http response
writer. Since the request handler had already returned from the first error,
the http server panics when one of these download goroutines makes a write to
the response writer buffer.

This patch prevents this crash in the daemon http server by waiting for all of
the download goroutines to complete, even if one of them fails. Only then does
it return, terminating the request handler.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

(cherry picked from commit d80c4244d3)
2015-08-06 09:14:16 -07:00
Dimitri John Ledkov
2c875215b1 systemd: set service type to notify.
Currently the service type is 'simple', the default, meaning that
docker.service is considered to be started straight after
spawning. This is incorrect as there is significant amount of time
between spawning and docker ready to accept connections on the passed
sockets. Docker does implement systemd socket activate and
notification protocol, and send the ready signal to systemd, once it
is ready. However for systemd to take those notifications into
account, the service file type should be set to notify.

Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
(cherry picked from commit d3e5179c29)
2015-08-06 08:39:11 -07:00
Mary Anthony
be40a48c12 - Remove references to sudo in basics.md; see sudo instructions top of file
- Removing references to Boot2Docker replacing with Docker Machine
- Removing sudo warnings in instances where appropriate (no sudo in file)
- Updating with comments

Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit cc375a1e48)
2015-08-06 08:39:10 -07:00
Filipe Oliveira
85f7f7cfc7 Adding support to forked distributions in installer script.
Signed-off-by: Filipe Oliveira <contato@fmoliveira.com.br>
(cherry picked from commit f618de1543)
2015-08-06 08:35:41 -07:00
David Calavera
e15f6fca3f 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>
(cherry picked from commit 3d3db0d4af)
2015-08-05 16:21:30 -07:00
Vincent Demeester
d3bbaa70cd Update some contributions documentations
- Add a golint entry to coding-style.md

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit b304920021)
2015-08-05 10:54:39 -07:00
Harald Albers
cc6f6cb2e2 Add --config to bash completion
The custom configuration will also be used in docker invocations made
by the completion script itself, just like `-H`.

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit b898111d3a)
2015-08-05 09:52:08 -07:00
Jessica Frazelle
c967dd289f update systemd article to reference dropin file
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
(cherry picked from commit 35e7a7c3e2)
2015-08-04 14:11:36 -07:00
Sally O'Malley
7895ec25ea make man/docker.1.md consistent with docker --help
"Options:" listed when you run "docker --help" and "docker daemon
--help" do not match the options listed in "man/docker.1.md".  This PR
makes 'docker --help', 'docker daemon --help' and 'man docker' consistent.
Also 2 typo fixes.

Signed-off-by: Sally O'Malley <somalley@redhat.com>
(cherry picked from commit f3bea61c80)
2015-08-04 09:35:25 -07:00
Charles Chan
5b06c94701 Fix #15212: Add "Labels" key to output of /containers/json
Applied retroactively from API v1.18 - v1.21.

Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
(cherry picked from commit b245bcd458)
2015-08-04 09:35:25 -07:00
Eric Windisch
5851e2da60 Remove container AA profile from packaging
Signed-off-by: Eric Windisch <eric@windisch.us>
(cherry picked from commit 0f4e5f7149)
2015-08-03 17:49:58 -07:00
Eric Windisch
9eff33735a Fix the proc integration test & include missing AA profile
Integration tests were failing due to proc filter behavior
changes with new apparmor policies.

Also include the missing docker-unconfined policy resolving
potential startup errors. This policy is complain-only so
it should behave identically to the standard unconfined policy,
but will not apply system path-based policies within containers.

Signed-off-by: Eric Windisch <eric@windisch.us>
(cherry picked from commit 5832715052)
2015-08-03 17:49:58 -07:00
Alessandro Boch
fc7697b050 Fix preallocated bridge networks
- Because of a bug, all the statically preallocated
  bridge networks have /24 as network mask.

Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit dab0447ae0)
2015-08-03 17:21:31 -07:00
David Calavera
1bf8954d0d Remove key file when migration fails.
Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit 07c45e499d)
2015-08-03 16:22:34 -07:00
Michael Crosby
dfd9f5989a Add LXC built in support deprecation notice
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 06f6c0c7e5)
2015-08-03 16:22:34 -07:00
Josh Hawn
d9581e861d [graph] Enforce manifest/layer digest verification
We noticed a regression since the 1.7.1 patch after some refactoring. This
patch corrects the behavior and adds integration tests for modified manifest
and rootfs layer blobs.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

(cherry picked from commit de52a3bcaa)
2015-08-03 16:22:33 -07:00
Stephen Rust
c383ceaf37 Docs: Add Blockbridge volume plugin
Signed-off-by: Stephen Rust <srust@blockbridge.com>
(cherry picked from commit 8b15b7958a)
2015-08-03 11:29:25 -07:00
Harald Albers
948912f692 Filter completions of docker inspect by --type
Completion now filters the images and containers by given
`--type`.

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 69cde5a302)
2015-08-03 11:29:25 -07:00
jrabbit
d19b1b927b Actually link to the information
Signed-off-by: jrabbit <jackjrabbit@gmail.com>
(cherry picked from commit d2cd142ce1)
2015-08-03 09:44:11 -07:00
Tibor Vass
53f5905379 Add missing LICENSE files for docker/notary
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 084af30f39)
2015-08-03 09:43:19 -07:00
Tibor Vass
60cbf4da6c Vendor docker/distribution to 7dc8d4a26b689bd4892f2f2322dbce0b7119d686
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 0cce1fb37f)
2015-08-03 09:43:19 -07:00
evalle
183628388c Fix wrong path to YaST's 'Routing' menu for openSUSE Tumbleweed
Signed-off-by: evalle <shmarnev@gmail.com>
(cherry picked from commit 5f1593c7b8)
2015-08-03 09:37:35 -07:00
Charles Chan
fbd2267e7d Update docker_remote_api.md
Minor fixes:
* v1.19: GET /containers/(id)/logs - add missing '/'
* v1.18: Break up POST /containers/create and POST /containers/(id)/start into separate lines.

Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
(cherry picked from commit 084d464081)
2015-08-03 09:37:35 -07:00
Derek McGowan
a16ab243e5 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)
(cherry picked from commit 6ce76cd9ed)
2015-08-03 09:37:35 -07:00
Derek McGowan
b3c3c4cddc Vendor latest notary
Use updated notary to pick up updates from security review

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit d594c6fcd8)
2015-08-03 09:37:34 -07:00
Qiang Huang
0fe5aad984 Remove unused variable
Introduced by #15209 unintentionally.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
(cherry picked from commit f5557f4f43)
2015-08-03 09:37:34 -07:00
Brian Goff
0f5e2fd479 Ensure reader position is at the end after tailing
After tailing a file, if the number of lines requested is > the number
of lines in the file, this would cause a json unmarshalling error to
occur when we later try to go follow the file.
So brute force set it to the end if any tailing occurred.

There is potential that there could be some missing log messages if logs
are being written very quickly, however I was not able to make this
happen even with `while true; do echo hello; done`, so this is probably
acceptable.

While testing this I also found a panic in LogWatcher.Close can be
called twice due to a race. Fix channel close to only close when there
has been no signal to the channel.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit c57faa91e2)
2015-08-03 09:37:34 -07:00
David Calavera
2f7145b1c5 Remove read index that causes dead lock.
Let the iterator to lock the index when it needs it.

Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit 5ed84009b3)
2015-07-31 14:56:17 -07:00
Harald Albers
81efe1f32e Fix completion of commands after a global option with arg
Without this fix, `docker -l info ` would not complete the commands.

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit aab82c5c22)
2015-07-31 12:20:42 -07:00
Harald Albers
5ba75ac343 Add completion of global options to docker daemon
It's a bit confusing: the "global options" are valid as "global options"
for all client commands (i.e. all but daemon).
Example: `docker --log-level info run`

For `docker daemon`, these "global options" are only valid as "command
options".
Example: `docker daemon --log-level info`

As command completion cannot tell which command the user is going to
type next, completion for the daemon command has to allow illegal
syntaxes like
`docker --log-level info daemon --log-level info`

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit e0dad9a153)
2015-07-31 12:20:42 -07:00
Alessandro Boch
290987fcb4 Add test code to cover issue #14859
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit 4964ab0821)
2015-07-31 08:59:42 -07:00
Alessandro Boch
98855c863d Vendoring libnetwork 31139cdb513aea5ad1ed08b60d4350a68b4c96db
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit 91274625ba)
2015-07-31 08:59:42 -07:00
Jessica Frazelle
b1f394a247 fix regression
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
(cherry picked from commit b0af811272)
2015-07-30 17:21:22 -07:00
Avi Miller
a819a60a94 Fix for #14924. Seperates lsb_dist detection from dist_version detection
so that the latter can be distro specific.

Signed-off-by: Avi Miller <avi.miller@oracle.com>
(cherry picked from commit 5c6446f335)
2015-07-30 17:21:21 -07:00
Tibor Vass
33cdc7f2c4 registry: allow fallback on unknown errors
This patch fixes a bug where a user specifies a v1 mirror for
--registry-mirror and pull an image from the Hub.

It used to not fallback because of an unexpected error returned when
trying to JSON marshal nginx output.

We now ensure that any unexpected error falls back to the next endpoint
in the list.

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit a21ba12f4e)
2015-07-30 17:21:21 -07:00
Jay Kamat
117860577c Fix a couple broken links
Signed-off-by: Jay Kamat <github@jgkamat.33mail.com>
(cherry picked from commit 4ca0aad855)
2015-07-30 17:21:21 -07:00
Dan Walsh
b0ac5df367 Labels on network content need to be shared if shared network namespace
If I run two containers with the same network they share the same /etc/resolv.conf.
The current code changes the labels of the /etc/resolv.conf currently to the
private label which causes it to be unusable in the first container.

This patch changes the labels to a shared label if more then one container
will use the content.

Docker-DCO-1.1-Signed-off-by: Dan Walsh dwalsh@redhat.com (github: rhatdan)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)

(cherry picked from commit 90b8cebda6)
2015-07-30 17:21:21 -07:00
Josh Hawn
c109095a58 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)

(cherry picked from commit 75f6929b44)
2015-07-30 17:21:20 -07:00
Stephen Rust
d394113dfe 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>
(cherry picked from commit c358a4cd35)
2015-07-30 17:21:20 -07:00
Michael Crosby
2af7f63173 Don't mount /proc as ro
This caused a regression with LSM labeling.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit bfc51cf660)
2015-07-30 17:21:20 -07:00
Eric Windisch
f156fb7be5 Only explicitly deny ptrace for container-originated procs
The 'deny ptrace' statement was supposed to only ignore
ptrace failures in the AUDIT log. However, ptrace was implicitly
allowed from unconfined processes (such as the docker daemon and
its integration tests) due to the abstractions/base include.

This rule narrows the definition such that it will only ignore
the failures originating inside of the container and will not
cause denials when the daemon or its tests ptrace inside processes.

Introduces positive and negative tests for ptrace /w apparmor.

Signed-off-by: Eric Windisch <eric@windisch.us>
(cherry picked from commit f5c388b35a)
2015-07-30 12:54:14 -07:00
Tibor Vass
559043b953 tlsconfig: better format for error message in tlsconfig
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit c7a04fda2a)
2015-07-30 12:54:14 -07:00
Harald Albers
ba8abcb3dd Add docker daemon to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 8cc8ee9254)
2015-07-30 12:54:14 -07:00
David Calavera
ebf396c6e8 Log each release step.
Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit 776600fabb)
2015-07-30 09:07:15 -07:00
Josh Hawn
47d52fb872 [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)

(cherry picked from commit bb2e6c72d2)
2015-07-29 16:53:10 -07:00
Vincent Batts
d167338876 graphdriver/*: expect uncompressed tar for ApplyDiff
The `ApplyDiff` function takes a tar archive stream that is
automagically decompressed later. This was causing a double
decompression, and when the layer was empty, that causes an early EOF.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
(cherry picked from commit 273f50c741)
2015-07-29 16:48:42 -07:00
Vincent Batts
e6844381f0 archive, chrootarchive: split out decompression
In `ApplyLayer` and `Untar`, the stream is magically decompressed. Since
this is not able to be toggled, rather than break this ./pkg/ API, add
an `ApplyUncompressedLayer` and `UntarUncompressed` that does not
magically decompress the layer stream.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
(cherry picked from commit 56bf275e32)
2015-07-29 16:48:41 -07:00
Derek McGowan
589922adf0 Fix login and search TLS configuration
Currently login and search do not load per registry certificates.
This is a regression caused by the last refactor since this was recently fixed.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit e863a07b89)
2015-07-29 16:45:16 -07:00
David Calavera
689c4e6075 Keep backwards compatibility in kill api.
Return an error when the container is stopped only in api versions
equal or greater than 1.20 (docker 1.8).

Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit 621e3d8587)
2015-07-29 16:44:21 -07:00
David Calavera
43da1adedb Use *int64 for MemorySwappiness.
So we marshal/unmarshal its value properly when it's empty.

Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit 4e25d2982b)
2015-07-29 16:44:21 -07:00
Antonio Murdaca
686fe02020 Fix install script to handle debian 8.1 apt repo string
Fix #14911

Signed-off-by: Antonio Murdaca <runcom@linux.com>
(cherry picked from commit 98f15cae89)
2015-07-29 10:46:26 -07:00
Eric Windisch
1d02be1c7a Mark engine AA policy as complain-only
The engine policy will now only complain
as a temporary measure to ensure we do not
cause breakages while users exercise this
policy.

This is NOT the policy for containers, but
for the newly-introduced policy for the
daemon itself.

Signed-off-by: Eric Windisch <eric@windisch.us>
(cherry picked from commit 6c887be769)
2015-07-29 09:54:16 -07:00
Eric Windisch
edb60b950a AA: Eliminate 'file' permission
Implements the policies for the remaining binaries
called by the Docker engine and eliminates the
giant whitelisted 'all files' permission in favor
of granular whitelisting and child-specific policies.

It should be possible now to remove the 'file' permission,
but for the sake of keeping Docker unbroken, we'll try
to gradually tighten the policy.

Signed-off-by: Eric Windisch <eric@windisch.us>
(cherry picked from commit 8b2fcddcd2)
2015-07-29 09:54:16 -07:00
Eric Windisch
e0e852ee6f Restore AppArmor profile generation
Will attempt to load profiles automatically. If loading fails
but the profiles are already loaded, execution will continue.

A hard failure will only occur if Docker cannot load
the profiles *and* they have not already been loaded via
some other means.

Also introduces documentation for AppArmor.

Signed-off-by: Eric Windisch <eric@windisch.us>
(cherry picked from commit 3edc88f76d)
2015-07-29 09:54:16 -07:00
Jessica Frazelle
b537508f8c only write distributions file if dne
Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit 2eee192366)
2015-07-28 17:48:56 -07:00
Avi Miller
37e886eb7b Fix typo.
Signed-off-by: Avi Miller <avi.miller@oracle.com>
(cherry picked from commit 59e48b3468)
2015-07-28 09:39:55 -07:00
Avi Miller
50f65742ef Switch to using only the RPM command to determine the distro version.
Signed-off-by: Avi Miller <avi.miller@oracle.com>
(cherry picked from commit a43199f143)
2015-07-28 09:39:50 -07:00
Alexander Morozov
56d859d052 Use math.MaxInt32 instead of math.MaxUint32
I think it was original intention, because even half of a comment was about
MaxInt32.

Fix #15038

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit eb45602d2f)
2015-07-28 09:35:56 -07:00
Josh Hawn
546a704c63 [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)

(cherry picked from commit 01d570ad30)
2015-07-28 09:35:38 -07:00
Aaron Lehmann
fa85dc0030 Update vendored distribution repo to new version
This version includes a fix that avoids checking against specific HTTP
status codes. The previous behavior violated the registry API spec.

Fixes #14975

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 091dbc1034)
2015-07-28 09:35:26 -07:00
Antonio Murdaca
36b6e5884d 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>
(cherry picked from commit c9207bc0aa)
2015-07-28 09:35:14 -07:00
Jessica Frazelle
90991ddb9b fix deb packaging systemd files
Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit a2ea8f2ad8)
2015-07-28 09:34:48 -07:00
Tibor Vass
afb831d35e Merge pull request #14979 from runcom/fix-flacky-TestRunNonRootUserResolvName
Fix TestRunNonRootUserResolvName flackiness
2015-07-24 21:50:44 -04:00
Arnaud Porterie
5bdd4d0ec4 Merge pull request #14966 from mrjana/vendor18
Vendoring libnetwork
2015-07-24 17:58:23 -07:00
Antonio Murdaca
30d4c70d28 Fix TestRunNonRootUserResolvName flackiness
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-25 02:45:17 +02:00
Arnaud Porterie
4f5b677fd9 Merge pull request #14546 from dmcgowan/trusted-notary-integration
Notary integration
2015-07-24 17:44:14 -07:00
Arnaud Porterie
542685d856 Merge pull request #14976 from calavera/revert_unconfined_aa_policy
Revert "Introduce a dedicated unconfined AA policy"
2015-07-24 17:31:28 -07:00
Jana Radhakrishnan
2ad81da856 Vendoring libnetwork
Vendoring libnetwork commit f1c5671f1ee2133055144e566cd8b3a0ae4f0433

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-07-24 17:11:47 -07:00
Arnaud Porterie
78906612a2 Merge pull request #14935 from stevvooe/registry-moratorium
Impose moratorium on remote registry access
2015-07-24 16:45:05 -07:00
Jessie Frazelle
935810bd20 Merge pull request #14977 from jfrazelle/fix-lxc
fix lxc
2015-07-24 16:43:46 -07:00
David Calavera
94ab0d312f Revert "Introduce a dedicated unconfined AA policy"
This reverts commit 87376c3add.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-24 16:35:51 -07: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
Diogo Monica
3e90b12d42 Added tests for expired snapshots and timestamps
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-24 16:31:18 -07:00
Nathan McCauley
268fa5af47 Add tests simulating an evil server
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-24 16:31:18 -07:00
Derek McGowan
871d2b96ed Add build integration cli tests
Clean up tests to remove duplicate code

Add tests which run pull and create in an isolated configuration directory.
Add build test for untrusted tag

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-24 16:31:12 -07:00
Jessica Frazelle
0a5b8c40c0 ignore certain tests on lxc driver
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-24 16:10:59 -07:00
Jessie Frazelle
5ab4b60e11 Merge pull request #14969 from tianon/utopic-eol
Remove Ubuntu 14.10 (Utopic Unicorn) from build-deb targets
2015-07-24 15:48:34 -07:00
Jessica Frazelle
a38b544ef0 fix memory swappiness lxc
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-24 15:46:51 -07:00
Zhang Kun
0547b5fb2a #14474 skip DockerSuite.TestRunCapAddCHOWN on lxc
Signed-off-by: Zhang Kun <zkazure@gmail.com>
2015-07-24 15:16:07 -07:00
Sebastiaan van Stijn
86c7ea4863 Merge pull request #14637 from metalivedev/patch-1
Document that load supports compressed tarballs.
2015-07-24 23:38:43 +02:00
Sebastiaan van Stijn
d951ef128f Merge pull request #14522 from carlossg/patch-1
Clarify filters option in list containers doc
2015-07-24 23:13:32 +02:00
Diogo Monica
eeb6d0a71b Add test for incorrect nonroot passphrase
Fix failing tests for create, push, and pull

Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-24 14:08:20 -07:00
Nathan McCauley
1406cb35fd Add trust tests for Docker create, run, push, and pull
Created date util function

Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-24 14:08:20 -07:00
Diogo Monica
356b07c896 Add more integration tests for trusted push and pull
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-24 14:08:20 -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
58a1de9b59 Add integration cli trust tests
Added notary server to docker base image.
Created trust suite which runs trust server for running trusted commands.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
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
Doug Davis
2084eee02c Merge pull request #14967 from Microsoft/10662-fixpaniconwindowsdaemon
Windows: Fixes panic on daemon binary
2015-07-24 16:48:37 -04:00
moxiegirl
2b847df8c2 Merge pull request #14939 from rtrauntvein/docs-autobuild
Fix broken link in automated build doc
2015-07-24 13:48:14 -07:00
Tibor Vass
84e917b876 Merge pull request #14835 from aaronlehmann/registry-lint-cleanup
Improve documentation and golint compliance of registry package
2015-07-24 16:23:23 -04:00
Tianon Gravi
a83e4e4a34 Remove Ubuntu 14.10 (Utopic Unicorn) from build-deb targets
As of July 23, 2015, it is officially EOL (https://lists.ubuntu.com/archives/ubuntu-announce/2015-July/000198.html) and will receive no further updates.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-07-24 13:21:01 -07:00
John Howard
b405e89d5c Windows: Fixes panic on daemon binary
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-24 12:30:49 -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
Alexander Morozov
44e327b29e Merge pull request #14964 from tiborvass/fix-reexec
reexec: Use in-memory binary /proc/self/exe on linux instead of os.Args[0]
2015-07-24 11:51:56 -07:00
Tibor Vass
5aee8807a6 reexec: Use in-memory binary on linux instead of os.Args[0]
This keeps reexec working properly even if the on-disk binary was replaced.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-24 14:15:50 -04:00
Jessie Frazelle
e1dea0c485 Merge pull request #14920 from jfrazelle/release-script-updates-for-new-repo
warn the script is depreciated
2015-07-24 11:09:35 -07:00
Jessica Frazelle
ff271f5190 warn the script is depreciated
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-24 10:34:41 -07:00
David Calavera
3a07e7d115 Merge pull request #14958 from LK4D4/fix_valid
Fix option validation for log-drivers without it
2015-07-24 09:57:36 -07:00
Tianon Gravi
4eee075f22 Merge pull request #14865 from calavera/update_init_scripts
Update init scripts to use `docker daemon`.
2015-07-24 09:47:03 -07:00
Alexander Morozov
d68c55bc72 Fix option validation for log-drivers without it
There is no option validation for "journald" log-driver, so it makes no
sense to fail in that case.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-24 09:00:53 -07:00
Sebastiaan van Stijn
f32295eda6 Merge pull request #14877 from calavera/deprecate_docker_d
Add -d to the deprecated feature list for 1.8.
2015-07-24 17:44:23 +02:00
Tibor Vass
9c0bb22571 Merge pull request #14925 from calavera/fix_volume_symlink_test
Remove reference to old Volumes field in inspect struct.
2015-07-24 10:41:00 -04:00
Carlos Sanchez
1fb29e6c3c Clarify filters option in list containers and list images docs
Based on the list containers with filters options it would seem that filtering containers with label `test=docker-java` could be done with `{"test":["docker-java"]}` which doesn't work

The options that work are `{"label":["test"]}` and `{"label":["test=docker-java"]}`

As seen in https://github.com/docker-java/docker-java/pull/262

Signed-off-by: Carlos Sanchez <carlos@apache.org>
2015-07-24 11:57:18 +02:00
Derek McGowan
f5a4a8da15 Vendor notary
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-24 01:31:50 -07:00
Nathan McCauley
48250832a3 Add cmdline docs for signing and verification flows
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-24 01:31:50 -07:00
Sebastiaan van Stijn
58bab11ee2 Merge pull request #14700 from charleswhchan/patch-2
Add benefit to using automated build.
2015-07-24 08:22:59 +02:00
Ryan Trauntvein
8e66e627d7 Fix broken link in automated build doc
Signed-off-by: Ryan Trauntvein <rtrauntvein@novacoast.com>
2015-07-23 23:12:06 -07:00
Charles Chan
c9ff01ffc7 * Add benefit to using automated build.
* Wording based on suggestions by @thaJeztah, @moxiegirl in PR #14700.

Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
2015-07-23 21:01:23 -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
Stephen J Day
24f7d0afc9 Impose moratorium on remote registry access
A moratorium has been added to the road map to add a moratorium on adding
remote registry access to commands that don't already do so.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-07-23 19:09:20 -07:00
moxiegirl
163acd07e2 Merge pull request #14696 from rtrauntvein/patch-1
Fix link to examples documentation
2015-07-23 18:25:31 -07:00
Jessie Frazelle
d5e085572d Merge pull request #14926 from dmcgowan/prune-tar-split
Fix pruning in vendor script
2015-07-23 17:43:17 -07:00
Tibor Vass
e246f1e4ee Update docs to use the new docker daemon command
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-23 20:31:43 -04:00
Shishir Mahajan
e7fc632147 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>
2015-07-23 20:31:43 -04:00
Ryan Trauntvein
4f62dec548 Add index.md to examples docs
Signed-off-by: Ryan Trauntvein <rtrauntvein@novacoast.com>
2015-07-23 17:24:44 -07:00
David Calavera
cd9dd55233 Merge pull request #14919 from tianon/empty-ps-headers
Fix "docker ps" with no containers regression
2015-07-23 16:52:43 -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
moxiegirl
490e78a642 Merge pull request #14557 from maaquib/14418-dangling-link-in-runmd
Fixing dangling link in docs/reference/commandline/run.md
2015-07-23 16:29:17 -07:00
moxiegirl
ae027c0864 Merge pull request #14589 from paetling/ae-update_net_docs
add to docs that ports do not get exposed when using --net
2015-07-23 16:22:21 -07:00
Derek McGowan
82685367d8 Keep license files
Currently the vendor script removes directories which do not have imported go packages, however this also ends up removing license files which may be other directories.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-23 16:12:21 -07:00
David Calavera
bb43bdf6c5 Remove reference to old Volumes field in inspect struct.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-23 16:10:31 -07:00
Derek McGowan
a8546df89d Fix pruning on tar split
Currently the vendor script prunes files which are currently checked in.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-23 15:21:32 -07:00
Alexander Morozov
c6f4c192fe Merge pull request #14545 from Djelibeybi/oraclelinux6-rpm
Updated docker-engine.spec to build on Oracle Linux 6.
2015-07-23 13:29:48 -07: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
Stephen Day
4af94efcf0 Merge pull request #14831 from duglin/VendorDist
Vendor latest distributions so we can use the new errcode stuff
2015-07-23 13:17:55 -07:00
Alexander Morozov
f28877257b Merge pull request #14034 from hqhq/hq_checkconfig_xattr
Some check_config enhancement
2015-07-23 13:01:59 -07:00
Vincent Batts
1e40915e9d Merge pull request #14854 from rhvgoyal/unmount-base
docker: Unmount -init layer root before taking a snapshot
2015-07-23 15:17:07 -04:00
moxiegirl
4e035031b0 Merge pull request #14900 from duglin/AddFilterToDoc
Add filter to /images/json docs
2015-07-23 11:57:12 -07:00
Phil Estes
9dcd0cc1ee Merge pull request #14887 from Microsoft/10662-stupidtypo
Windows: Stupid copy/paste error
2015-07-23 14:49:17 -04:00
Doug Davis
b874ef8f43 Do Docker edits so we can use the new distribution code
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-23 10:24:46 -07:00
Doug Davis
8b69552b50 Vendor latest distributions so we can use the new errcode stuff
ping @stevvooe @RichardScothern

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-23 10:24:46 -07:00
Tianon Gravi
8c28363993 Merge pull request #13933 from ypid/mkimage-no-compression
Do not compress rootfs archive in mkimage.sh.
2015-07-23 10:22:07 -07:00
David Calavera
ac9fc03c74 Merge pull request #14855 from ewindisch/apparmor-unconfined
Introduce a dedicated unconfined AA policy
2015-07-23 10:21:51 -07:00
Jessie Frazelle
e5d8fb9658 Merge pull request #14903 from jfrazelle/fix-experimental-rpm-debs
pass DOCKER_EXPERIMENTAL into build images
2015-07-23 10:05:00 -07:00
David Calavera
2cf9fec111 Merge pull request #14901 from albers/completion-log-opt-fixes
Fixes to bash completion for log driver options
2015-07-23 10:03:29 -07:00
Jessica Frazelle
76d6751600 pass DOCKER_EXPERIMENTAL into build images
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-23 09:42:22 -07:00
Sebastiaan van Stijn
9e438ffb61 Merge pull request #14891 from jgeiger/fix_typo_in_builder_docs_for_dockerignore
Fix typo in builder.mb .dockerignore example
2015-07-23 18:26:16 +02:00
Sebastiaan van Stijn
d44e334a6e Merge pull request #14893 from Evalle/14653-fix-sles-issue
Fixing SLES12 issue
2015-07-23 18:22:38 +02:00
Arnaud Porterie
c9937c3a80 Merge pull request #14905 from jfrazelle/fix-fedora-install
fix fedora release
2015-07-23 09:17:48 -07:00
Jessica Frazelle
8192a9ac6c fix fedora release
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-23 09:16:35 -07:00
Phil Estes
c2346f6406 Merge pull request #14898 from runcom/sockRequestRaw-close-body
Ensure body is closed after error is checked
2015-07-23 10:11:44 -04:00
Antonio Murdaca
18faf6f94e Ensure body is closed after error is checked
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-23 14:34:38 +02:00
Doug Davis
a20bf5e61c Add filter to /images/json docs
Closes #14894

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-23 05:29:09 -07:00
Harald Albers
de40f3997a Complete all known driver options if no log driver was specified
Without this fix, `docker --log-opt ` would not complete anything
because the completions were driver specific.

Signed-off-by: Harald Albers <github@albersweb.de>
2015-07-23 14:19:13 +02:00
Harald Albers
6de8dd1a6e Fix problem with = in completion of docker global options
Without this fix, `docker --log-driver fluentd --log-opt fluentd-tag=b`
would complete `b` to `build`.
Completion of the commands has to be nailed to __docker_pos_first_nonflag

Signed-off-by: Harald Albers <github@albersweb.de>
2015-07-23 13:52:06 +02:00
evalle
94119c58a1 Fixing SLES12 issue
Signed-off-by: evalle <shmarnev@gmail.com>
2015-07-23 08:59:23 +02:00
jgeiger
9086c16f42 Fix typo in builder.mb .dockerignore example
Signed-off-by: jgeiger <jgeiger@gmail.com>
2015-07-22 23:54:46 -06:00
Phil Estes
d593130fda Merge pull request #14880 from Microsoft/10662-paniconremotetest
Stop SIGSEGV on test dial not reachable
2015-07-22 23:21:12 -04:00
Phil Estes
c5053d4700 Merge pull request #14886 from duglin/FixDepDoc
Fix typo in deprecation doc
2015-07-22 23:15:09 -04:00
Phil Estes
7e4db0a370 Merge pull request #12850 from coolljt0725/add_ulimi_to_build
Add ulimit to docker build
2015-07-22 23:11:47 -04:00
John Howard
cef5cb2dcb Windows: Stupid copy/paste error
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-22 19:30:47 -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
Doug Davis
ea3dcee913 Fix typos in deprecation doc
thanks @tiborvass

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-22 18:45:12 -07:00
John Howard
09b86c46b8 Stop SIGSEGV on test dial not reachable
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-22 18:44:04 -07:00
Stephen Day
48d057f8a9 Merge pull request #14884 from aaronlehmann/redundant-image-checks
Avoid redundant HEAD requests for identical layers on push
2015-07-22 18:28:39 -07:00
Aaron Lehmann
810d3b2642 Avoid redundant HEAD requests for identical layers on push
pushV2Tag already deduplicates layers, but the scope of this
deduplication is only for a particular tag. If we are pushing all tags
in a repository, we may check layers several times. Fix this by moving
the layersSeen map from the pushV2Tag function to the v2Pusher struct.

In addition to avoiding some useless round-trips, this makes the "docker
push" output less confusing. It formerly could contain many repeated
lines like:

    124e2127157f: Image already exists
    124e2127157f: Image already exists
    ...

Add test coverage based on the "docker push" output: a hash should not
appear multiple times when pushing multiple tags.

Fixes #14873

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-22 17:54:20 -07:00
Jessie Frazelle
5fdc102396 Merge pull request #14878 from icecrime/14756_golint_on_ci
Enable validate-lint as part of CI
2015-07-22 16:32:29 -07:00
Tibor Vass
a3857cc379 Merge pull request #14580 from rohitkadam19/patch-1
Update docker_remote_api_v1.17.md
2015-07-22 19:22:37 -04:00
Jessie Frazelle
f218192754 Merge pull request #14638 from jfrazelle/new-repo-install-script
update install script/docs for new apt and yum repos
2015-07-22 15:25:27 -07:00
Arnaud Porterie
bc8b8e03b4 Enable validate-lint as part of CI
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-07-22 15:23:34 -07:00
Alexander Morozov
3198e76b77 Merge pull request #14862 from vdemeester/validate-lint-all-files
Update validate-lint to lint all go files
2015-07-22 15:18:02 -07:00
Jessica Frazelle
451d3f5950 update install script for new repos
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-22 15:08:19 -07:00
Jessica Frazelle
877d740d48 update docs for new install script
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-22 15:08:14 -07:00
David Calavera
9a1728a427 Add -d to the deprecated feature list for 1.8.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-22 15:05:23 -07:00
Sebastiaan van Stijn
a628155a72 Merge pull request #13900 from duglin/Deprecate
Define Docker's deprecation policy
2015-07-22 23:23:37 +02:00
Vincent Demeester
fa34f07ec0 Update validate-lint to lint all go files
By default, using go with package will only validate the go file for the
current platform (or at last misses file_windows.go for example). This
tries to fix that.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-22 23:21:18 +02:00
David Calavera
f82ebe5932 Merge pull request #14839 from jfrazelle/better-io-error
better i/o timeout error on pull
2015-07-22 14:10:50 -07:00
Doug Davis
27b828c9e4 Define Docker's deprecation policy
Announce the cmd line options that are targetted for removal

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-22 14:09:49 -07:00
Sebastiaan van Stijn
4160d1af7d Merge pull request #14528 from estesp/add-readme-links
Add links and correct locations in project/README.md
2015-07-22 23:05:32 +02:00
Jessie Frazelle
a7d8450312 Merge pull request #14864 from ewindisch/apparmor-engine-policy
Add AppArmor policy for the docker binary
2015-07-22 13:56:33 -07:00
Jessie Frazelle
80fec1dbaf Merge pull request #14872 from jfrazelle/fix-debs-apparmour
update deb dockerfiles
2015-07-22 13:35:24 -07:00
Phil Estes
9055eb0ce4 Add links and correct locations in project/README.md
After removing the duplicate ROADMAP in a separate PR, a few other
issues were noted in README.md which are fixed here:
- the directory is project, not hack
- make.sh is no longer in the current dir since hack/ is not project/
  anymore
- MAINTAINERS is no longer here as a markdown file, but is a TOML file
  in the root of the project
- links were added to all files to make it easier to follow from here
  to the appropriate location

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-07-22 16:31:12 -04: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
Brian Goff
d106a2ea2a Merge pull request #14613 from stefanberger/nohidevols2
Do not hide user provided network mounts [v2]
2015-07-22 16:24:22 -04:00
Sebastiaan van Stijn
d3ba2457d9 Merge pull request #14769 from clintonskitson/add_plugindocs_rexray
updated plugin docs to include REX-Ray
2015-07-22 22:12:41 +02:00
Sebastiaan van Stijn
933d9f2e0d Merge pull request #14799 from coolljt0725/docs_fix_devicemapper_default_basesize
Docs: update the devicemapper default basesize from 10G to 100G
2015-07-22 22:07:38 +02:00
Jessica Frazelle
1fff0a5cc5 actually update deb dockerfiles
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-22 13:06:04 -07:00
David Calavera
53fb4d6fb6 Merge pull request #14871 from jfrazelle/change-leeroy-uri
move leeroy under docker
2015-07-22 13:03:22 -07:00
Jessica Frazelle
9bc502ecde move leeroy under docker
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-22 12:57:13 -07:00
David Calavera
1639288b0a Merge pull request #14067 from vbatts/vbatts-tar-split
graph: layer tar disassembly and reassembly
2015-07-22 12:53:26 -07:00
Alexander Morozov
c328e0c827 Merge pull request #14628 from estesp/update-docker-py
Update docker-py commit to current master (~1.3.1 release)
2015-07-22 12:41:41 -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
Brian Goff
19ba7f9e23 Merge pull request #14753 from flavio/zfs-initialization-errors
ZFS driver: raise better errors during init
2015-07-22 14:27:46 -04:00
David Calavera
346ce4f8d2 Update init scripts to use docker daemon.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-22 11:24:38 -07:00
Eric Windisch
39dae54a3f Add AppArmor policy for the engine
Wraps the engine itself with an AppArmor policy.

This restricts what may be done by applications
we call out to, such as 'xz'.

Significantly, this policy also restricts the policies
to which a container may be spawned into. By default,
users will be able to transition to an unconfined
policy or any policy prefaced with 'docker-'.

Local operators may add new local policies prefaced
with 'docker-' without needing to modify this policy.
Operators choosing to disable privileged containers
will need to modify this policy to remove access
to change_policy to unconfined.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-22 14:20:50 -04: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
Stefan Berger
6bd389b9db Do not hide user provided network mounts [v2]
Prevent the docker daemon from mounting the created network files over
those provided by the user via -v command line option. This would otherwise
hide the one provide by the user.
The benefit of this is that a user can provide these network files using the
-v command line option and place them in a size-limited filesystem.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2015-07-22 13:44:21 -04:00
Phil Estes
65fb04228e Update docker-py to current master (~docker-py 1.3.1)
The docker-py commit used in the standard `Dockerfile` is from Feb. 2015
and is out of date with the current API level and has fixes for things
like the new docker cli config location and registry v2 changes/API
responses as well.

Also pass "NOT_ON_HOST=true" to docker-py test suite so that tests
relying on direct HOST interaction (versus running in a container) are
skipped.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-07-22 13:17:59 -04:00
David Calavera
fe68ac806b Merge pull request #14858 from icecrime/14756_update_linted_packages
Update linted package list
2015-07-22 10:11:51 -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
moxiegirl
7d8859a4f5 Merge pull request #14217 from ankushagarwal/ubuntu-15.04
Add support for 15.04, add systemd note for 15.04
2015-07-22 08:56:02 -07:00
Arnaud Porterie
b7184f8574 Update linted package list
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-07-22 08:46:42 -07:00
Vincent Batts
22347fdb63 graph: isolate the (dis)assembly logic
with the current duplication of code in the grap.go split-up, this puts
all assembly/disassembly logic into isolated functions

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-07-22 11:36:15 -04:00
Vincent Batts
5a00326d29 graph: use tar archive entries for TarLayer
if there is a tar-data.json.gz present for an image layer, then use it
to create the tar archive, instead of the traditional graphdriver Diff.

Signed-off-by: Vincent Batts <vbatts@redhat.com>

Conflicts:
	graph/graph.go
2015-07-22 11:36:15 -04:00
Vincent Batts
ba1f76cbfa graph: variablize file names
and add a comment.. :-)

Signed-off-by: Vincent Batts <vbatts@redhat.com>

Conflicts:
	graph/graph.go
2015-07-22 11:36:15 -04:00
Vincent Batts
5d9f06599c graph: preserve tar archive entries
Preserve the entries from the tar archive for layers added to the graph.

With these entries and relative filesystem path, the tar archives can be
reassembled later.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-07-22 11:36:15 -04:00
Vincent Batts
7fb061832a vendor: adding tar-split dependency for graph
tar-split is a facility to disassemble and reassemble tar archives

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-07-22 11:36:10 -04:00
Eric Windisch
87376c3add Introduce a dedicated unconfined AA policy
By using the 'unconfined' policy for privileged
containers, we have inherited the host's apparmor
policies, which really make no sense in the
context of the container's filesystem.

For instance, policies written against
the paths of binaries such as '/usr/sbin/tcpdump'
can be easily circumvented by moving the binary
within the container filesystem.

Fixes GH#5490

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-22 11:28:32 -04:00
Tibor Vass
875fffdff8 Merge pull request #14851 from bfirsh/golint-integration-cli
Golint integration-cli
2015-07-22 11:28:19 -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
Vivek Goyal
fe26669205 docker: Unmount -init layer root before taking a snapshot
When we are creating a container, first we call into graph driver to take
snapshot of image and create root for container-init. Then we write some
files to it and call into graph driver again to create container root
from container-init as base.

Once we have written files to container-init root, we don't unmount it
before taking a snapshot of it. Looks like with XFS it leaves it in such
a state that when we mount the container root, it goes into log recovery
path.

Jul 22 10:24:54 vm2-f22 kernel: XFS (dm-6): Mounting V4 Filesystem
Jul 22 10:24:54 vm2-f22 kernel: XFS (dm-6): Starting recovery (logdev: internal)
Jul 22 10:24:54 vm2-f22 kernel: XFS (dm-6): Ending recovery (logdev: internal)

This should not be required. So let us unmount container-init before use
it  as a base for container root and then XFS does not go into this
internal recovery path.

Somebody had raised this issue for ext4 sometime back and proposed the same
change. I had shot it down at that point of time. I think now time has
come for this change.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-07-22 10:32:53 -04:00
Brian Goff
f0d0a52d80 Merge pull request #14817 from runcom/golint-pkg-mount
pkg: mount: golint
2015-07-22 09:23:26 -04:00
Doug Davis
a10cb08bbb Merge pull request #14802 from rhatdan/error
If a user hits this error it would be helpful to know tagstore name.
2015-07-22 06:17:38 -07:00
Doug Davis
5328cc346f Merge pull request #14850 from runcom/14846-fix-get-images-search-content-type
Fix wrong Content-Type returned by /images/search API
2015-07-22 06:16:16 -07:00
Ben Firshman
6b3c928140 Fix golint warnings for integration-cli
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-07-22 14:03:50 +01:00
Dan Walsh
4815fdc334 Merge branch 'master' of github.com:docker/docker into error
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-07-22 08:06:19 -04: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
Antonio Murdaca
0f5c9d301b pkg: mount: golint
Fix the following warnings:

pkg/mount/mountinfo.go:5:6: type name will be used as mount.MountInfo by other packages, and that stutters; consider calling this Info
pkg/mount/mountinfo.go:7:2: struct field Id should be ID

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-22 10:26:10 +02:00
Sebastiaan van Stijn
757c4f0d5c Merge pull request #14821 from stevvooe/coding-style-guidelines
Adding Go coding style guidelines
2015-07-22 09:08:43 +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
Alexander Morozov
30b951ff08 Merge pull request #14842 from hqhq/hq_remove_rootuid
Remove unused parameter in NewTtyConsole
2015-07-21 21:37:21 -07: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
Jessie Frazelle
06162fed8b Merge pull request #14822 from runcom/host-config-links-on-start
Allow starting a container with an existing hostConfig which contains links
2015-07-21 20:06:26 -07:00
Jessie Frazelle
052b23e290 Merge pull request #14770 from albers/completion-log-opt
Bash completion for log drivers and their options
2015-07-21 19:58:12 -07:00
Jessie Frazelle
b6c5f6d075 Merge pull request #14794 from HuKeping/ci
CI: use dockerCmd in integration-cli when possible
2015-07-21 19:57:33 -07:00
Hu Keping
012b67c3ea CI: use dockerCmd in integration-cli when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-07-22 17:55:41 +08:00
Jessie Frazelle
162ae444af Merge pull request #14677 from vincentbernat/fix/zsh-completion-update-4
zsh: update zsh completion for docker command
2015-07-21 19:56:03 -07:00
Jessie Frazelle
5dda570d50 Merge pull request #14688 from Microsoft/10662-hookupmac
Windows: Hook up user supplied MAC
2015-07-21 19:55:21 -07:00
Jessie Frazelle
7a06e85270 Merge pull request #14812 from LK4D4/fix_cgroup_parent_tests
Fix cgroup parent tests
2015-07-21 19:53:48 -07:00
Jessie Frazelle
dda1d66ac7 Merge pull request #14808 from cpuguy83/bump_md2man
Bump go-md2man to 1.0.3
2015-07-21 19:53:26 -07:00
Qiang Huang
af3059855c Remove unused parameter in NewTtyConsole
It's introduced in
68ba5f0b69 (Execdriver implementation on new libcontainer API)

But I don't see reson why we need it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-22 10:32:31 +08:00
Jessica Frazelle
ca3dae523b better i/o timeout error on pull
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-21 19:08:15 -07:00
Clinton Kitson
ca552a953e added REX-Ray as volume plugin to plugin docs
Signed-off-by: Clinton Kitson <clintonskitson@gmail.com>
2015-07-21 21:00:27 -05:00
Brian Goff
d3b3ebc3a4 remove dead code after decoupling from jsonlog
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-07-21 20:47:35 -04: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
Tibor Vass
879f440a99 Merge pull request #14833 from icecrime/14756_update_lint_script
Update validate-lint script
2015-07-21 19:28:19 -04:00
Tibor Vass
42533e323c Merge pull request #14829 from RichardScothern/registry-tls
Configure TLS for private v2 registry mirrors.
2015-07-21 19:23:39 -04: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
Antonio Murdaca
d52b2b98ba Merge pull request #14830 from Microsoft/10662-removebadcomment
Windows: Remove erroneous comment only (no code change)
2015-07-22 00:39:58 +02: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
e54b1e081a docs: Updated for docker cp and its API changes
Documented changes to API to enable new `docker cp` behavior.

Added documentation on `docker cp` usage and behavior.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-21 15:30:20 -07:00
Richard Scothern
6b36a488e7 Remove v1 registry mirror configuration from LookupEndpoints.
V1 mirrors do not mirror the index and those endpoints should
only be indexes.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-07-21 15:21:41 -07:00
Richard Scothern
cb57b25689 Configure TLS for private registry mirrors.
If a registry mirror is using TLS, ensure that certs for it
are picked up from /etc/docker/certs.d

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-07-21 15:21:25 -07:00
Josh Hawn
418135e7ea integration-cli: New docker cp integration tests
Adds several integration tests for `docker cp` behavior with over a dozen
tests for each of:

  container -> local
  local -> 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
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
Arnaud Porterie
7f02cc420a Update validate-lint script
Add a set of newly linted packages, and fix the script.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-07-21 15:02:46 -07:00
Tibor Vass
0d17cba922 Merge pull request #14820 from aaronlehmann/registry-dead-code
Remove dead code in registry package
2015-07-21 17:45:49 -04:00
John Howard
bd30d27636 Windows: Remove erroneous comment
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-21 14:25:08 -07:00
Stephen J Day
d57ea8da25 Adding Go coding style guidelines
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-07-21 13:47:02 -07:00
Arnaud Porterie
c88ce893a5 Merge pull request #14805 from dave-tucker/golint_namesgen
golint: Lint pkg/namesgenerator
2015-07-21 13:45:31 -07:00
Antonio Murdaca
65121e5fce Allow starting a container with an existing hostConfig which contains links
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-21 22:10:00 +02:00
Aaron Lehmann
9e76e184e4 Remove unused types in registry package
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-21 11:53:57 -07:00
Aaron Lehmann
962dc622d9 Remove dead code in registry package
The only uses of RequestAuthorization and its associated functions were
removed in 19515a7ad8 ("Update graph to
use vendored distribution client for the v2 codepath")

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-21 11:45:53 -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
Josh Hawn
a74799b701 pkg/archive: new utilities for copying resources
Adds TarResource and CopyTo functions to be used for creating
archives for use with the new `docker cp` behavior.

Adds multiple test cases for the CopyFrom and CopyTo
functions in the pkg/archive package.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-21 11:03:25 -07:00
David Calavera
3ee15acaad Merge pull request #14659 from calavera/promote_volumes_experimental_to_master
Promote volume drivers from experimental to master.
2015-07-21 10:39:17 -07:00
Antonio Murdaca
d796bb9151 Merge pull request #14815 from LK4D4/remove_tty_terminal
Remove unused TtyTerminal interface
2015-07-21 19:36:43 +02:00
Arnaud Porterie
943bf44686 Merge pull request #13617 from Microsoft/10662-sql
Windows: Statically linkable SQLite3
2015-07-21 10:12:40 -07:00
Alexander Morozov
6ae377ffa0 Remove unused TtyTerminal interface
It was used only by integration tests, which now gone.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-21 09:56:28 -07:00
Alexander Morozov
e4f1cf787c Merge pull request #14780 from icecrime/14756_add_golint
Add golint to the development toolbox
2015-07-21 09:50:58 -07:00
John Howard
10bcaca914 Windows: Statically linkable SQLite3
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-21 09:33:46 -07:00
David Calavera
c4d45b6a29 Promote volume drivers from experimental to master.
Remove volume stubs and use the experimental path as the only path.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-21 09:32:44 -07:00
Antonio Murdaca
06b922c63f Merge pull request #14801 from HuKeping/golint
golint: use golint to check package util
2015-07-21 18:09:39 +02:00
Hu Keping
17ce34116a golint: use golint to check package util
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-07-22 05:34:13 +08:00
Arnaud Porterie
6cce8d1838 Add golint to the development toolbox
Add golint to the Dockerfile, and a `validate-lint` task to the
Makefile. Currently, the linter will process a harcoded list of packages
that will expand as we fix more warnings. Eventually, the linter should
process all subpackages of the repo (excluding vendored code).

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-07-21 09:00:36 -07:00
Alexander Morozov
844fc5f77c Fix cgroup parent tests
After merging mounting cgroups in container this tests doing wrong
checks. Cgroup paths could be prepended by other cgroups from host.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-21 08:59:17 -07:00
Brian Goff
6c95040e3b Merge pull request #14765 from runcom/fix-dockerCmd-refactor
Refactor missed dockerCmd changes
2015-07-21 11:53:28 -04:00
Alexander Morozov
380959dd68 Merge pull request #14609 from ewindisch/apparmor-policy
Move AppArmor policy to contrib & deb packaging
2015-07-21 08:48:02 -07:00
Antonio Murdaca
9818d8fa22 Merge pull request #14796 from WeiZhang555/golint-network
golint on daemon/network package
2015-07-21 17:37:40 +02:00
Dave Tucker
c5667bc569 golint: Lint pkg/namesgenerator
Also addded a couple more tests

Updates #14756

Signed-off-by: Dave Tucker <dt@docker.com>
2015-07-21 16:33:34 +01:00
Eric Windisch
80d99236c1 Move AppArmor policy to contrib & deb packaging
The automatic installation of AppArmor policies prevents the
management of custom, site-specific apparmor policies for the
default container profile. Furthermore, this change will allow
a future policy for the engine itself to be written without demanding
the engine be able to arbitrarily create and manage AppArmor policies.

- Add deb package suggests for apparmor.
- Ubuntu postinst use aa-status & fix policy path
- Add the policies to the debian packages.
- Add apparmor tests for writing proc files
Additional restrictions against modifying files in proc
are enforced by AppArmor. Ensure that AppArmor is preventing
access to these files, not simply Docker's configuration of proc.
- Remove /proc/k?mem from AA policy
The path to mem and kmem are in /dev, not /proc
and cannot be restricted successfully through AppArmor.
The device cgroup will need to be sufficient here.
- Load contrib/apparmor during integration tests
Note that this is somewhat dirty because we
cannot restore the host to its original configuration.
However, it should be noted that prior to this patch
series, the Docker daemon itself was loading apparmor
policy from within the tests, so this is no dirtier or
uglier than the status-quo.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-21 11:05:53 -04:00
Zhang Wei
7be8336fb5 golint on daemon/network package
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-07-21 22:49:49 +08:00
moxiegirl
1ca737875d Merge pull request #14725 from charleswhchan/issue-14433
Issue #14433
2015-07-21 07:48:54 -07:00
Brian Goff
dd7d4d1101 Bump go-md2man to 1.0.3
Fixes an issue with curly braces being escaped when they should not be.
This was particularly an issue in places where `--format '{{ ...  }}'`
is used in the man docs.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-07-21 10:42:02 -04:00
Arnaud Porterie
a7d61882c0 Merge pull request #14778 from thaJeztah/remove-rhel6-rpm-from-generate
Remove reference to CENTOS6 from generate script
2015-07-21 07:27:29 -07:00
Sebastiaan van Stijn
739f7b1da6 Merge pull request #14731 from Evalle/14729-Fix-ubuntu-doc-issue
Fixing ubuntu doc issue
2015-07-21 15:51:11 +02:00
Brian Goff
5a29f0ac88 Merge pull request #14798 from coolljt0725/minor_fix_TestLogsStderrInStdout
Minor fix of TestLogsStderrInStdout
2015-07-21 09:33:34 -04:00
Dan Walsh
96a4469835 If a user hits this error it would be helpful to know tagstore name.
There are several bug reports on this error happening, and error is
not helpful unless you read the code.  Google brings up removing
the repositories.btrfs file.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-07-21 09:26:27 -04:00
Lei
36cc6a985b Docs: update the devicemapper default basesize from 10G to 100G
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-21 20:46:31 +08:00
Lei
2e7daffd7b Minor fix of TestLogsStderrInStdout
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-21 20:37:14 +08:00
Sebastiaan van Stijn
1e9394103c Merge pull request #14727 from vdemeester/opts-docs-updates
Update documentation according to opts updates (#13694)
2015-07-21 14:19:29 +02:00
Vincent Demeester
dc8b765930 Update documentation according to opts updates
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-21 14:08:19 +02:00
Sebastiaan van Stijn
197c9010bc Merge pull request #14766 from runcom/remove-ref-from-libcontainer
Remove reference to docker/libcontainer
2015-07-21 12:49:36 +02:00
Sebastiaan van Stijn
f0473eaf01 Merge pull request #14744 from gesellix/add-gradle-docker-remote-api-plugin
Add gradle docker remote api plugin
2015-07-21 08:34:08 +02:00
Harald Albers
d5aeb3398b Second level completions for --log-opt
Advanced completion for some log driver options:
gelf-address, syslog-address, syslog-facility.

Signed-off-by: Harald Albers <github@albersweb.de>
2015-07-21 08:25:14 +02:00
Sven Dowideit
2eda00c861 Merge pull request #14757 from rhatdan/man
Fix man pages
2015-07-21 16:08:02 +10:00
Brian Goff
d241d2f36c vendor fsnotify
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-07-20 22:47:03 -04: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
Tibor Vass
efd56bbe6f Merge pull request #14779 from duglin/BetterErrMsg14774
Add better output for TestLinksEtcHostsContentMatch to help debug #14774
2015-07-20 20:40:06 -04:00
Doug Davis
4d0990a753 Merge pull request #14762 from LK4D4/lint_reexec
Add docstring to reexec.Command
2015-07-20 20:37:27 -04:00
Antonio Murdaca
4c0fb85729 Merge pull request #14776 from MHBauer/cliconfig-lint
golint fixes for cliconfig
2015-07-21 02:22:09 +02:00
Doug Davis
09a3b57f94 Merge pull request #14775 from runcom/move-nat-tests
move nat tests from container's unit test to nat's ones
2015-07-20 20:06:34 -04:00
Alexander Morozov
9738b9319b Add docstring to reexec.Command
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-20 17:00:18 -07: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
Doug Davis
6751a49d14 Add better output for TestLinksEtcHostsContentMatch to help debug #14774
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-20 16:46:51 -07:00
Sebastiaan van Stijn
18ca5d7c0e Remove reference to CENTOS6 from generate script
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2015-07-21 01:21:33 +02:00
Antonio Murdaca
37d737fc2c Merge pull request #14691 from Microsoft/10662-start
Windows: hostconfig on start
2015-07-21 00:52:19 +02:00
Antonio Murdaca
f2aff58483 move nat tests from container's unit test to nat's ones
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-21 00:29:24 +02:00
Arnaud Porterie
cc7fe0d2d9 Merge pull request #14771 from Microsoft/10662-image2image
Fixing Image struct to no longer use Graph.
2015-07-20 15:25:06 -07:00
Sebastiaan van Stijn
8b7923620a Merge pull request #14768 from fredlf/style-guide-edits
Small edits and clean up
2015-07-21 00:23:56 +02:00
John Howard
9001ea26e7 Fixing Image struct to no longer use Graph.
Signed-off-by:  John Howard <jhoward@microsoft.com>
2015-07-20 13:59:53 -07:00
David Calavera
bd8386c127 Merge pull request #14764 from sevki/14756-lint
golint fix TLs->TLS in docker/
2015-07-20 13:19:42 -07:00
Harald Albers
38acec94c4 Completion: Add support for '=' in arguments to __docker_pos_first_nonflag
This solves several problems that arise from the special treatment of
"=" in Bash.
The fix was required as some log drivers have options in a key=value
form. It also addresses the --option=value and the negated boolean syntax
(--boolean=false).

Note that this is not a general fix for these problems, it is limited to
the __docker_pos_first_nonflag function.

Signed-off-by: Harald Albers <github@albersweb.de>
2015-07-20 21:22:56 +02:00
Fred Lifton
6609cfb5e7 Small edits and clean up
Signed-off-by: Fred Lifton <fred.lifton@docker.com>

Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)
2015-07-20 11:59:48 -07:00
Antonio Murdaca
bd328da555 Refactor missed dockerCmd changes
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-20 20:55:57 +02:00
Antonio Murdaca
691e3a3e70 Remove reference to docker/libcontainer
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-20 20:30:22 +02:00
Harald Albers
faa8b658e7 Driver-specific completions for --log-opt
Signed-off-by: Harald Albers <github@albersweb.de>
2015-07-20 20:24:01 +02:00
Sevki Hasirci
ce3156f1eb fix mixed typo TlS -> TLS
Signed-off-by: Sevki Hasirci <s@sevki.org>
2015-07-20 21:14:45 +03:00
Harald Albers
e09d0febe6 Add missing log drivers to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
2015-07-20 20:13:59 +02:00
Sevki Hasirci
16ea3cf3a3 golint fix TLs->TLS in docker/
Signed-off-by: Sevki Hasirci <s@sevki.org>
2015-07-20 20:50:03 +03:00
David Calavera
46cbfcb168 Merge pull request #14746 from jfrazelle/remove-rhel-centos-6-rpm
remove centos/rhel 6 from rpm builder
2015-07-20 10:44:18 -07:00
David Calavera
fc2f90fc63 Merge pull request #14741 from HuKeping/ci-refactor
CI: use dockercmd when possible
2015-07-20 09:49:40 -07:00
Hu Keping
27ac154d05 CI: use dockercmd when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-07-21 04:40:15 +08:00
David Calavera
ee7af0d2cb Merge pull request #14671 from hqhq/hq_use_dockerCmd
Use dockerCmd when possible
2015-07-20 09:44:42 -07:00
Dan Walsh
732141442a Fix man pages
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-07-20 11:47:59 -04:00
Tibor Vass
77bbee3d00 Merge pull request #14716 from LK4D4/update_libcontainer
Update libcontainer to v0.0.2
2015-07-20 11:33:19 -04:00
Antonio Murdaca
c6a3517246 Merge pull request #14724 from coolljt0725/14603-dockerCmd-integration-cli-3
Refactor: use dockerCmd when possible in integraiton-cli tests
2015-07-20 16:00:38 +02:00
Flavio Castelli
f95b3a6b6a ZFS driver: raise better errors during init
The ZFS driver should raise proper errors when the ZFS utility is
missing or when there's no zfs partition active on the system. Raising the
proper errors make possible to silently ignore the ZFS storage
driver when no default storage driver is specified.

Previous to this commit it was no longer possible to start the
docker daemon in that way:

  docker -d --storage-opt dm.loopdatasize=2GB

The above command resulted in an exit error because the ZFS driver
tried to use the storage options.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2015-07-20 15:24:48 +02:00
Vincent Bernat
3a1596f0f5 zsh: update zsh completion for docker command
zsh completion is updated with the content of
felixr/docker-zsh-completion.

 - felixr/docker-zsh-completion@a93e1cb7bd Fix completion of repositories with tags
 - felixr/docker-zsh-completion@590ea70596 Respect provided `--host` flag when invoking docker
 - felixr/docker-zsh-completion@6c557babaa Several cosmetic improvements
 - felixr/docker-zsh-completion@5b63cc591a Update completion for `inspect`
 - felixr/docker-zsh-completion@b7d8f2f7cc Order completions alphabetically
 - felixr/docker-zsh-completion@63f6a06224 Factor completion for `build`, `create` and `run`
 - felixr/docker-zsh-completion@ade49ee47f Enforce positional arguments being last
 - felixr/docker-zsh-completion@850b6b6d95 Update completion for build/commit/export/exec/history/import
 - felixr/docker-zsh-completion@01bfd8c075 Remove completion for `insert` and duplicate of `import`
 - felixr/docker-zsh-completion@c64a1d730a Update completion for `stats` to add `--no-stream` flag
 - felixr/docker-zsh-completion@5e81d78b52 Update completion for `log` to add `--since` flag
 - felixr/docker-zsh-completion@b3c146a1a2 Update completion for `run` to add `--group-add` flag
 - felixr/docker-zsh-completion@8d4f196ad8 Don't trigger expensive completion function for flags
 - felixr/docker-zsh-completion@bd5aaa124d Add completion for `--help` everywhere
 - felixr/docker-zsh-completion@3a67a0e8c4 Return appropriate status code on completion
 - felixr/docker-zsh-completion@4dfcb450ea Add Steve as a regular contributor.
 - felixr/docker-zsh-completion@996a1c6def Add completion for top-level flags
 - felixr/docker-zsh-completion@b6df75905f Ensure short/long option are not allowed twice
 - felixr/docker-zsh-completion@75b6a500a0 Complete repositories with tags only on repository match
 - felixr/docker-zsh-completion@5e6292135f Factorize completion of images/repositories/tags
 - felixr/docker-zsh-completion@1c504eb677 Handle repositories with ":"
 - felixr/docker-zsh-completion@0a05bf818b Update completion for `pause' and `unpause'
 - felixr/docker-zsh-completion@b3a63253e2 Containers name can include Swarm host

In summary:

 - Swarm support
 - Handling repositories with ":"
 - Rework how completion of images/repositories/tags work:
    - felixr/docker-zsh-completion@5e6292135f
    - felixr/docker-zsh-completion@75b6a500a0
    - felixr/docker-zsh-completion@a93e1cb7bd

The remaining changes are here to sync changes done in Docker repository
(mostly from PR #14074 and #14555, by @sdurrheimer). With some minor changes:

 - boolean flags don't complete their arguments (true/false)
 - reuse of `--host` argument is done with `$opt_arg` to avoid parsing
   error
 - build/create/run common options are factorized out
 - `--help` flag is handled differently
 - `pause` and `unpause` accepts several containers as far as I know, so
   the change is reverted
 - some more, but difficult to notice (more completion for some flags I think)

Some labels are reverted, mostly because I did the merge by copy/pasting
new options instead of modifying existing options.

This commit is partial. The way the `--help` option is handled triggered
a major change due to the way things are quoted. Those changes were
partially and programmaticaly reverted in this commit only to minimize
the changes to review. The next commit will restore the full changes.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
2015-07-20 14:25:48 +02:00
Sebastiaan van Stijn
46d7762f26 Merge pull request #14614 from hqhq/hq_simplify_swappiness
Simplify swappiness check
2015-07-20 13:51:39 +02:00
Qiang Huang
6f8ddec1d0 Simplify swappiness check
As suggested in https://github.com/docker/docker/pull/14004/files#r34022527

The concern there is we can't differentiate whether user explicitly
asked for an invalid value of -1 or he did not specify anything.

I don't think this would be a problem, because:
 - like all other default values like zero, we can't differentiate
   user specify it or not, most of which, zeros are also invalid, so
   default is default, we show these default values in help info,
   so users would know if they set value as default, it'll be like
   they set nothing.
 - we can't do this kind of string check in REST api request, so
   it'll make the behave different from docker command and RESTapi.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-20 16:10:10 +08:00
Qiang Huang
668e2369cc dockerCmd when possible
Addresses: #14603

integration-cli/docker_cli_daemon_experimental_test.go (hqhq)
integration-cli/docker_cli_daemon_test.go (hqhq)
integration-cli/docker_cli_diff_test.go (hqhq)
integration-cli/docker_cli_events_test.go (hqhq)
integration-cli/docker_cli_events_unix_test.go (hqhq)
integration-cli/docker_cli_exec_test.go (hqhq)
integration-cli/docker_cli_exec_unix_test.go (hqhq)
integration-cli/docker_cli_experimental_test.go (hqhq)
integration-cli/docker_cli_export_import_test.go (hqhq)
integration-cli/docker_cli_help_test.go (hqhq)
integration-cli/docker_cli_history_test.go (hqhq)
integration-cli/docker_cli_images_test.go (hqhq)
integration-cli/docker_cli_import_test.go (hqhq)
integration-cli/docker_cli_info_test.go (hqhq)
integration-cli/docker_cli_inspect_test.go (hqhq)
integration-cli/docker_cli_kill_test.go (hqhq)

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-20 14:55:40 +08:00
Lei
eef6eda7d2 Recfactor: Use dockerCmd when possible in integration-cli tests
Part of #14603
integration-cli/docker_cli_links_test.go (coolljt0725)
integration-cli/docker_cli_links_unix_test.go (coolljt0725)
integration-cli/docker_cli_logs_test.go (coolljt0725)
integration-cli/docker_cli_nat_test.go (coolljt0725)
integration-cli/docker_cli_network_test.go (coolljt0725)
integration-cli/docker_cli_stats_test.go (coolljt0725)
integration-cli/docker_cli_tag_test.go (coolljt0725)
integration-cli/docker_cli_top_test.go (coolljt0725)
integration-cli/docker_cli_version_test.go (coolljt0725)
integration-cli/docker_cli_wait_test.go (coolljt0725

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-20 14:44:22 +08:00
Sven Dowideit
008d57bf7f Merge pull request #14747 from moxiegirl/update-docs-dockerfile
Updating to use the new base
2015-07-20 12:00:02 +10:00
Ankush Agarwal
9847c0c8b0 Add support for 15.04, add systemd note for 15.04
Fixes #12002

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-07-19 18:33:55 -07:00
Mary Anthony
e0bceb7064 Updating to use the new base
Signed-off-by: Mary Anthony <mary@docker.com>
2015-07-19 15:39:43 -07:00
Jessica Frazelle
af5fb9b7d0 remove centos6 from rpm builder
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-19 14:30:48 -07:00
Arnaud Porterie
ccc78c9968 Merge pull request #14715 from icecrime/14365_remove_rhel6_from_docs
Update RHEL/Centos/Fedora installation docs
2015-07-19 13:00:50 -07:00
Tobias Gesellchen
a51684ff8f add gradle-docker-plugin, update docker-client url
Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
2015-07-19 21:28:11 +02:00
Tobias Gesellchen
38e7069668 remove unused row-even and row-odd css classes
Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
2015-07-19 21:27:12 +02:00
Charles Chan
08d5424c04 Issue #14433
Try to improve the cache behavior for `ADD` and `COPY` commands.

Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
2015-07-19 12:19:28 -07:00
moxiegirl
32764fe3b9 Merge pull request #14676 from duglin/Issue14675
Add missing 'Names' field to /containers/json API output
2015-07-19 06:53:25 -07:00
evalle
120c21c97c Fixing ubuntu doc issue
Signed-off-by: evalle <shmarnev@gmail.com>
2015-07-18 18:24:45 +02:00
Sebastiaan van Stijn
a89370039a Merge pull request #14667 from charleswhchan/patch-5
Trim excess from image. Based on the context, the email itself is sufficient.
2015-07-18 11:14:28 +02:00
Lei
c6cde91b7d Add dockerCmdWithStdoutStderr function
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-18 10:48:28 +08:00
Alexander Morozov
a0a0b8499e Merge pull request #14722 from duglin/FixInspectExecIDTest
Move inspect into the loop on InspectExecID test
2015-07-17 18:21:49 -07:00
Doug Davis
f06620ece3 Move inspect into the loop on InspectExecID test
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-17 17:30:24 -07:00
David Calavera
7f353a11e4 Merge pull request #13681 from tiborvass/carry-11784
Carry 11784: rmi dangling is unsafe when pulling
2015-07-17 16:17:18 -07:00
Alexander Morozov
f0f261a899 Update libcontainer to v0.0.2
This is fix for proper setup of nested containers cgroups.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-17 15:05:17 -07:00
Jessie Frazelle
465192cb28 Merge pull request #14706 from duglin/FixInspectTest
Fix InspectExecID test
2015-07-17 14:37:23 -07:00
Arnaud Porterie
340bd135dd Update RHEL/Centos/Fedora installation docs
Remove mentions of older systems.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-07-17 14:04:19 -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
Arnaud Porterie
a192105d3b Merge pull request #14413 from vbatts/vbatts-graph-cleanup
graph: comment clarification about shadowed `err`
2015-07-17 13:39:27 -07: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
Arnaud Porterie
98ed9a55f4 Merge pull request #14693 from LK4D4/update_libcontainer
Update libcontainer
2015-07-17 13:02:04 -07:00
David Calavera
25d9f38852 Merge pull request #13680 from jfrazelle/new-apt-yum-repos
WIP: new apt yum repos for release scripts
2015-07-17 12:29:21 -07:00
Sebastiaan van Stijn
a763637eae Merge pull request #13951 from calavera/plugins_path
Separate plugin sockets and specs.
2015-07-17 21:11:31 +02:00
Brian Goff
e939a30039 Merge pull request #14709 from rhvgoyal/base-size-100G
devicemapper: Change default basesize to 100G
2015-07-17 12:41:28 -04:00
Brian Goff
fb34537a99 Merge pull request #14685 from Microsoft/10662-revendorhcsshim
Windows: Revendor hcsshim@f674a70f1306dbe20b3a516bedd3285d85db60d9
2015-07-17 12:31:58 -04:00
Jessie Frazelle
97be366961 Merge pull request #14708 from icecrime/14445_remove_workflow_from_maintainers
Remove reviewing process from MAINTAINERS
2015-07-17 09:03:53 -07:00
Ma Shimiao
1b67c38f6f fix 8926: rmi dangling is unsafe when pulling
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-17 11:39:57 -04:00
David Calavera
ff05f9c285 Merge pull request #14445 from icecrime/reviewing_process_and_labels
Document and adjust reviewing process and labels
2015-07-17 08:25:41 -07:00
David Calavera
7b83b0e15c Merge pull request #14605 from brahmaroutu/gccgo_scheduler
Go Scheduler issue with sync.Mutex
2015-07-17 08:16:32 -07:00
Vivek Goyal
424d5e55a2 devicemapper: Change default basesize to 100G
Current default basesize is 10G. Change it to 100G. Reason being that for
some people 10G is turning out to be too small and we don't have capabilities
to grow it dyamically.

This is just overcommitting and no real space is allocated till container
actually writes data. And this is no different then fs based graphdrivers
where virtual size of a container root is unlimited.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-07-17 11:10:23 -04:00
Brian Goff
b900aaac46 Merge pull request #14701 from charleswhchan/patch-6
Add missing space
2015-07-17 10:42:48 -04:00
Vincent Batts
a40e337882 graph: clarify the need for named error
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-07-17 10:01:52 -04:00
Doug Davis
c5c98c31a1 Fix InspectExecID test
The check for the end of the loop was off by one which is why we saw
errors on the following inpsect() call instead of a timeout

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-17 06:46:37 -07:00
Charles Chan
ceca4109fa Add missing space
Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
2015-07-16 22:49:46 -07:00
Alexander Morozov
ac3f7c71b8 Merge pull request #14698 from duglin/AddErr
Add missing 'err' to Fatalf to help debug an issue
2015-07-16 21:42:42 -07:00
Doug Davis
97c5f64001 Add missing 'err' to Fatalf to help debug an issue
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-16 20:27:14 -07:00
root
9ca913d0f1 Go Scheduler issue with sync.Mutex using gccgo
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-07-17 01:33:58 +00:00
David Calavera
15cb7dfc9e Merge pull request #14578 from mountkin/fix-rmi-image-not-found
don't allow deleting the image of running containers
2015-07-16 18:02:51 -07:00
Alexander Morozov
c86189d554 Update libcontainer
Replaced github.com/docker/libcontainer with
github.com/opencontainers/runc/libcontaier.
Also I moved AppArmor profile generation to docker.

Main idea of this update is to fix mounting cgroups inside containers.
After updating docker on CI we can even remove dind.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-16 16:02:26 -07:00
Alexander Morozov
8801906ced Merge pull request #14620 from hqhq/hq_cgroup_ro_optional
Remove cgroup read-only flag when privileged
2015-07-16 16:00:02 -07:00
John Howard
39ad38ccf9 Windows: hostconfig on start
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-16 15:33:13 -07:00
David Calavera
5d3043649a Merge pull request #14690 from LK4D4/update_libnetwork
Update libnetwork
2015-07-16 15:13:24 -07:00
David Calavera
6c0795747b Separate plugin sockets and specs.
Check if there is a plugin socket first under `/run/docker/plugins/NAME.sock`.
If there is no socket for a plugin, check `/etc/docker/plugins/NAME.spec` and
`/usr/lib/docker/plugins/NAME.spec` for spec files.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-16 14:20:07 -07:00
Alexander Morozov
b84ceb3d0a Update github.com/docker/libnetwork to 2a5cb84758b5115d99d8f82c84845417c6c345a3
This update includes removal of libcontainer dependency.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-16 13:58:38 -07:00
John Howard
a207ce6ae4 Windows: Hook up user supplied MAC
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-16 13:20:14 -07:00
Stephen Day
212525f951 Merge pull request #14664 from calavera/fix_load_tag_with_digest
Check if a tag name to load is a valid digest.
2015-07-16 12:46:05 -07:00
John Howard
83ad0536c1 Windows: Vendor hcsshim@f674a70f1306dbe20b3a516bedd3285d85db60d9
Signed-off-by: John Howard <John.Howard@microsoft.com>
2015-07-16 12:07:20 -07:00
David Calavera
5365e6b463 Merge pull request #13375 from tiborvass/distribution-refactor
Vendor distribution client v2
2015-07-16 11:54:08 -07:00
David Calavera
1ec25653d8 Check if a tag name to load is a valid digest.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-16 10:53:56 -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
Tibor Vass
276c640be4 remove pkg/transport and use the one from distribution
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-16 13:13:46 -04:00
Tibor Vass
745820fec0 Vendor docker distribution registry client and dependencies
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-16 13:13:46 -04:00
Tibor Vass
48a01a317c Merge pull request #14679 from tiborvass/fix-docker-py-search-test
Fix issue where Search API endpoint would panic due to empty AuthConfig
2015-07-16 13:12:31 -04:00
Tibor Vass
b32c4cb459 Fix issue where Search API endpoint would panic due to empty AuthConfig
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-16 12:38:44 -04:00
Sebastiaan van Stijn
8c77e39627 Merge pull request #14571 from charleswhchan/patch-2
Documentation: Split apt-get example onto multiple lines
2015-07-16 18:32:56 +02:00
David Calavera
ac8299ae15 Merge pull request #14623 from HuKeping/refactor-dockercmd
Refactor : Use dockerCmd in integration-cli tests
2015-07-16 09:24:59 -07:00
Hu Keping
71868228c7 Refactor : Use dockerCmd in integration-cli tests
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-07-17 04:07:12 +08:00
Alexander Morozov
97515a35ca Merge pull request #14604 from Microsoft/10662-addbridge
Windows: Plumb through -b on daemon
2015-07-16 08:44:40 -07:00
Doug Davis
081991c01e Add missing 'Names' field to /containers/json API output
Closes #14675

Wasn't sure how far back I needed to go so I did just a few.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-16 08:23:55 -07:00
James Turnbull
b70428c4dd Merge pull request #14670 from chenchun/fix_fluentd_link
Fix fluentd link name
2015-07-16 10:44:54 -04:00
Charles Chan
c4d2b34d13 Split apt-get example onto multiple lines. Use extra spaces to align the code block.
Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
2015-07-16 06:42:07 -07:00
Robin Schneider
397de38ae6 Updated usage information because of removed short parameters.
Signed-off-by: Robin Schneider <ypid@riseup.net>
2015-07-16 10:44:58 +02:00
Chun Chen
ed23ecd305 Fix fluentd link name
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-07-16 14:23:56 +08:00
Shijiang Wei
ce6410cd4c don't allow deleting the image of running containers
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-07-16 13:14:48 +08:00
Charles Chan
f373bd97c3 Trim excess from image. Based on the context, the email itself is sufficient.
Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
2015-07-15 20:15:57 -07:00
David Calavera
cd642973fa Merge pull request #14661 from LK4D4/vet_warns
Fix some formatting calls
2015-07-15 16:41:18 -07:00
David Calavera
a81dcaef93 Merge pull request #13993 from Ramzec/index_iteration
graph: use truncindex consistently to iterate graph entries
2015-07-15 16:39:59 -07:00
Jessica Frazelle
c850e97c84 Add release-deb & release-rpm scripts.
These will create the apt & yum repos for the deb/rpms generated by build-deb
and build-rpm.

Adds sign-repo script which signs the repo metadata with a gpg key.

Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-15 15:54:00 -07:00
Arnaud Porterie
57c43960f8 Remove reviewing process from MAINTAINERS
The pull request reviewing process and labeling strategy is described as
part of a dedicated file in `project/REVIEWING.md`: remove the existing
description from the `MAINTAINERS` file.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-07-15 13:56:04 -07:00
Arnaud Porterie
6157937f67 Document reviewing process and labels
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-07-15 13:14:21 -07:00
Jessica Frazelle
4a5fd6c0f9 add tianon's suites.sh file
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-15 12:48:49 -07:00
Alexander Morozov
a5142f6ac3 Fix some formatting calls
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-15 12:25:50 -07:00
David Calavera
46aea60fb0 Merge pull request #14332 from ankushagarwal/failedLogin
Add 500 check for registry api call
2015-07-15 11:19:31 -07:00
Brian Goff
e98a881570 Merge pull request #14624 from vdemeester/14603-dockerCmd-integration-cli-1
Integration test refactors to use dockerCmd
2015-07-15 14:03:58 -04:00
Jessie Frazelle
386f11a63d Merge pull request #14555 from sdurrheimer/master
Zsh completion updates and improvements
2015-07-15 10:40:41 -07:00
Jessie Frazelle
308ecafad8 Merge pull request #14655 from duglin/CleanupBuild
Cleanup build tmp dir stuff
2015-07-15 09:42:24 -07:00
Jessie Frazelle
e46c7060cc Merge pull request #14643 from dmcgowan/fix-canonical-repo-info
Set canonical name correctly
2015-07-15 09:39:01 -07:00
David Calavera
e0728035fe Merge pull request #14636 from calavera/bump_changelog
Bump changelog from 1.7.1
2015-07-15 08:56:03 -07:00
Brian Goff
39e380b97a Merge pull request #14657 from anatolyborodin/typo_fix
Fix a typo: change "such Bash" to "such as Bash" in dockerfile_best-practices.md
2015-07-15 11:29:38 -04:00
Anatoly Borodin
5f9d1bc018 Fix a typo: change "such Bash" to "such as Bash"
Signed-off-by: Anatoly Borodin <anatoly.borodin@gmail.com>
2015-07-15 17:10:22 +02:00
Brian Goff
1df7a2f940 Merge pull request #14644 from charleswhchan/patch-4
Remove duplicated period in link
2015-07-15 10:34:01 -04:00
Doug Davis
13c08b898b Cleanup build tmp dir stuff
If there's an error while unpacking the build context then we weren't erasing
the tmp dir created to persist the context.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-15 06:23:19 -07:00
Sven Dowideit
a031b6476c Merge pull request #14574 from SvenDowideit/elastic-ip-webhooks
Trusted build servers moved to AWS and use an elastic IP
2015-07-15 12:20:50 +10:00
Sven Dowideit
174870e64f Trusted build servers moved to AWS and use an elastic IP
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-07-14 19:20:09 -07:00
Sven Dowideit
8e7f2fc2e7 Merge pull request #14584 from Jason-Green-Aver/patch-1
Add missing periods to elements in ROADMAP.md
2015-07-15 12:01:31 +10:00
moxiegirl
35746ef97f Merge pull request #14635 from jfrazelle/update-rpm-url
update urls for rpms
2015-07-14 18:04:17 -07:00
Charles Chan
3a23203255 Remove duplicated period in link
Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
2015-07-14 17:50:19 -07:00
Derek McGowan
7f48cd7dce Set canonical name correctly
Currently canonical name gets set to the local name and displayed in the errors.
Canonical name should be the unique and canonical name for an image.
Use docker.io as the canonical domain for images on the public registry.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-14 17:45:49 -07:00
Jessie Frazelle
8c7cd78650 Merge pull request #14639 from calavera/fix_read_write_check
Fix read-write check for volumes.
2015-07-14 16:36:01 -07:00
Andy Rothfusz
918229cbdf Document that load supports compressed tarballs.
As per
ecdbf86884/pkg/archive/archive.go (L96)

Signed-off-by: Andy Rothfusz <github@developersupport.net>
2015-07-14 15:51:06 -07:00
David Calavera
82a54001fd Fix read-write check for volumes.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-14 15:50:43 -07:00
Stephen Day
c7d4a4b2b4 Merge pull request #14521 from mattmoor/authenticated-search
Add the X-Docker-Token header to the /v1/search requests.
2015-07-14 15:43:28 -07:00
Jessica Frazelle
24bb36297c update urls for rpms
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-14 15:26:11 -07:00
David Calavera
b49cbe289f Bump version to 1.8.0-dev.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-14 15:24:48 -07:00
David Calavera
2932069dc7 Bump to version 1.7.1
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-14 15:23:55 -07:00
David Calavera
ecdbf86884 Merge pull request #13694 from vdemeester/opts-test-coverage
Tests, refactor and coverage on package opts
2015-07-14 15:09:48 -07:00
Jessie Frazelle
4e9280ffdb Merge pull request #14304 from vieux/http_proxy_support
add support for base path in docker cli -H
2015-07-14 13:21:51 -07:00
Vincent Demeester
5c295460da Use dockerCmd when possible (#14603)
- integration-cli/docker_cli_attach_test.go
- integration-cli/docker_cli_attach_unix_test.go
- integration-cli/docker_cli_build_test.go
- integration-cli/docker_cli_build_unix_test.go
- integration-cli/docker_cli_by_digest_test.go
- integration-cli/docker_cli_commit_test.go
- integration-cli/docker_cli_config_test.go
- integration-cli/docker_cli_cp_test.go
- integration-cli/docker_cli_create_test.go
- integration-cli/docker_cli_pause_test.go
- integration-cli/docker_cli_port_test.go
- integration-cli/docker_cli_port_unix_test.go
- integration-cli/docker_cli_proxy_test.go
- integration-cli/docker_cli_ps_test.go
- integration-cli/docker_cli_pull_test.go
- integration-cli/docker_cli_push_test.go

- docker_api_attach_test.go
- docker_api_containers_test.go
- docker_api_events_test.go
- docker_api_exec_resize_test.go
- docker_api_exec_test.go
- docker_api_images_test.go
- docker_api_info_test.go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-14 21:52:43 +02:00
Phil Estes
d2fe5bd12f Merge pull request #14618 from hqhq/hq_add_check_for_swappiness
Add hostConfig check for MemorySwappiness
2015-07-14 15:24:50 -04:00
Brian Goff
e5fa2a740d Merge pull request #14629 from LK4D4/pubsub_timer_off
pkg/pubsub: Don't use time.After if there is no timeout
2015-07-14 13:06:57 -04:00
Sebastiaan van Stijn
899f6f2a89 Merge pull request #14252 from sallyom/docs-use-lowercase
Modify man pages for image-naming
2015-07-14 18:34:36 +02:00
Alexander Morozov
bc6ad1608c Don't use time.After if there is no timeout
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-14 09:14:51 -07:00
Alexander Morozov
7080f5d1cf Add docstring to pubsub.Publisher
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-14 09:10:14 -07:00
Jessie Frazelle
cf09e435c8 Merge pull request #14608 from vincentbernat/fix/zsh-reviewers
zsh: remove Vincent Bernat from reviewers for ZSH completion
2015-07-14 07:08:06 -07:00
James Turnbull
aaf1426995 Merge pull request #14494 from HuKeping/update-docs
docs: update docs for API history
2015-07-14 08:16:00 -04:00
Hu Keping
29660f263e docs: update docs for API history
The response of hitory API includes more information now.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-07-14 19:54:24 +08:00
Steve Durrheimer
91a2d9cc7d Several cosmetic improvements in zsh completion
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2015-07-14 11:34:33 +02:00
Steve Durrheimer
12f67141f9 Zsh completion update for the following commits:
- Add fluentd logging driver to zsh completion #12876
- Add inspect --type flag to zsh completion #13187
- Respect -H option in zsh completion #13195
- Fix number of argument limit for pause and unpause in zsh completion

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2015-07-14 11:32:26 +02:00
Qiang Huang
a7f5e1c4c3 Remove cgroup read-only flag when privileged
Fixes: #14543

It needs libcontainer fix from:
https://github.com/opencontainers/runc/pull/91

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-14 15:00:41 +08:00
Vincent Demeester
4290bdefab Add dockerCmdWithError
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-14 08:35:06 +02:00
Sebastiaan van Stijn
daffcc044b Merge pull request #14458 from hqhq/hq_fix_docs_create
Docs: fix commandline doc create.md and run.md
2015-07-14 08:10:41 +02:00
Qiang Huang
19c7b65ea6 Add hostConfig check for MemorySwappiness
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-14 13:52:57 +08:00
Brian Goff
154820aca6 Merge pull request #14595 from LK4D4/pubsub_bench
Benchmark and race test for pkg/pubsub
2015-07-13 23:04:44 -04:00
Jason Green
59aa3b27ca Add missing periods to elements in ROADMAP.md
Signed-off-by: Jason Green <Jason.Green@AverInformatics.Com>
2015-07-13 23:01:34 -04:00
Qiang Huang
c3b77bbe8b Docs: fix commandline doc create.md and run.md
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-14 09:26:59 +08:00
Vincent Batts
5ca3e7c54c Merge pull request #14021 from rhvgoyal/detect-pool-loopback-devices
devicemapper: Check loop devices of existing pool
2015-07-13 21:15:23 -04:00
Jessie Frazelle
35b0223921 Merge pull request #10717 from mrunalp/feature/group_add
Adds support for specifying additional groups.
2015-07-13 17:08:05 -07:00
Jessie Frazelle
e221291a25 Merge pull request #14194 from phemmer/cli-version-format
add --format flag to `docker version`
2015-07-13 17:04:06 -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
Alexander Morozov
60b34cb957 Merge pull request #14599 from brahmaroutu/gccgo_timeduration
time duration should be nano seconds, gccgo treats it as zero
2015-07-13 16:44:45 -06:00
moxiegirl
73bd855dcc Merge pull request #14581 from vdemeester/14573-docs-docker-bestpractice-fix
Fixes TOC in dockerfile_best_practices.md
2015-07-13 15:14:56 -07:00
Arnaud Porterie
23d0676c07 Merge pull request #14607 from brahmaroutu/increase_timeout
increase timeout to run tests on slow platforms
2015-07-13 14:56:17 -07:00
Vincent Demeester
d03923732f Fixes TOC in dockerfile_best_practices.md
Decided to put the link in a reference word.

Closes #14573

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-13 23:46:04 +02:00
Jessie Frazelle
5e331ad41a Merge pull request #14343 from Pensu/14232-Add-Warning-To-Ubuntu-Script
14232 add warning to ubuntu script
2015-07-13 14:38:58 -07: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
363cc51e82 Merge pull request #14205 from YanFeng-Adam/patch
update testcase mount/sharedsubtree_linux_test.go
2015-07-13 14:28:30 -07:00
Vincent Bernat
5dbb217bcb zsh: remove Vincent Bernat from reviewers for ZSH completion
Signed-off-by: Vincent Bernat <vincent@bernat.im>
2015-07-13 23:15:16 +02:00
root
b98edced9e Increase timeout to run tests on slow platforms
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-07-13 21:13:17 +00:00
Robin Schneider
3f0fa1f643 Removed short parameters and use Bash features to make code shorter. Thanks to @tianon.
Signed-off-by: Robin Schneider <ypid@riseup.net>
2015-07-13 22:56:15 +02:00
Jessie Frazelle
15f9766691 Merge pull request #14567 from Microsoft/10662-fixbuilder
Windows: Fix builder
2015-07-13 13:50:52 -07:00
Alexander Morozov
c2b9fa8c9a Merge pull request #14516 from Microsoft/10662-mergeLXCconf
Windows: Tidy up daemon\utils*.go
2015-07-13 14:47:25 -06:00
Jessie Frazelle
655b1d2367 Merge pull request #14556 from Evalle/14497-fix-install-script
Fix issue with detection logic of Centos in install.sh
2015-07-13 13:47:08 -07:00
Alexander Morozov
1da3843149 Merge pull request #14601 from runcom/cleanup-deleteImages
Cleanup not needed calls to deleteImages
2015-07-13 14:04:20 -06:00
Sally O'Malley
05a86905a2 Modify man pages for image-naming
This PR adds recommendations in man pages to use only [a-z0-9-_.] when
naming and tagging images.  The purpose of this is to add consistency
and to make image naming caps rules seem less arbitrary.

This PR addresses confusion with:
1. BaseImage:Tagged (not allowed)
2. baseimage:Tagged (allowed)
3. baseimage/tagged:V1 (allowed)
4. baseimage/Tagged:V1 (not allowed)

Signed-off-by: Sally O'Malley <somalley@redhat.com>
2015-07-13 15:49:41 -04:00
Doug Davis
9158ddef89 Merge pull request #14596 from Microsoft/quieter-clean-exec-commands
Quieter debug logging for clean exec commands
2015-07-13 15:43:27 -04:00
John Howard
e0ec0cc115 Windows: Plumb through -b on daemon
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-13 12:41:48 -07:00
evalle
33039aa129 Fix issue with detection logic of Centos in install.sh
Signed-off-by: evalle <shmarnev@gmail.com>
2015-07-13 20:50:31 +02:00
Mrunal Patel
7fb456589b Fixup rebase.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-07-13 14:50:30 -04:00
Mrunal Patel
d77d0268eb Adds documentation for additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-07-13 14:47:28 -04:00
Mrunal Patel
0b7938e845 Adds test for additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-07-13 14:47:28 -04:00
Mrunal Patel
e0d96fb3ef Adds support for specifying additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-07-13 14:47:28 -04:00
Antonio Murdaca
d3566fa0b1 Cleanup not needed calls to deleteImages
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-13 20:30:53 +02:00
root
6c4e14b3e2 time duration should be nano seconds, gccgo treats it as zero
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-07-13 18:01:43 +00:00
Sebastiaan van Stijn
4ef67b79bc Merge pull request #14597 from albers/docs-typo-1
Fix typo in documentation
2015-07-13 19:56:54 +02:00
John Howard
b271593c34 Quieter debug logging for clean exec commands
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-13 10:36:36 -07:00
Alexander Morozov
0f466c36b9 Merge pull request #14500 from runcom/add-diff-emtpy-arg-test
Add diff command with emtpy string testcase
2015-07-13 11:30:31 -06:00
Harald Albers
41def26c1b Fix typo in documentation
Signed-off-by: Harald Albers <github@albersweb.de>
2015-07-13 19:17:33 +02:00
Jessie Frazelle
0badebe734 Merge pull request #14426 from albers/completion-events
Add some missing events to bash completion
2015-07-13 10:05:36 -07:00
Alexander Morozov
b39c330a18 Merge pull request #14587 from rhatdan/man
Man page fixes
2015-07-13 10:59:55 -06:00
Jessie Frazelle
a20994fd54 Merge pull request #14508 from jfrazelle/deb-rpm-make
add deb and rpm targets to makefile
2015-07-13 09:48:43 -07:00
Alexander Morozov
e13f9edfed Merge pull request #14583 from sagarhani/patch-1
Added entry for Sir M.Visvesvaraya
2015-07-13 10:47:08 -06:00
Arnaud Porterie
7ba54a4628 Merge pull request #14569 from vdemeester/pkg-fileutils-tests
Add missing tests and docs for pkg/fileutils
2015-07-13 09:29:30 -07:00
Alexander Morozov
8aa7ba731a Race test for pkg/pubsub package
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-13 09:05:47 -07:00
Arnaud Porterie
161f5b2790 Merge pull request #14554 from Ajeey/added-notable-indian-scientists
Added notable indian scientists to names-generator.go
2015-07-13 09:05:47 -07:00
Alexander Morozov
e5da4d62ef Benchmark for pkg/pubsub package
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-13 09:02:16 -07:00
Arnaud Porterie
eb174dbb1e Merge pull request #14553 from WPH95/fix-install
Fix failure on adding source list for ubuntu
2015-07-13 09:00:26 -07:00
Antonio Murdaca
1f963af697 Merge pull request #14586 from Tenk42/14362-Improve-sockRequestRaw-check
Improve sockRequest and sockRequestRaw check
2015-07-13 15:59:39 +02:00
Brian Goff
24c09006c9 Merge pull request #14588 from rhatdan/ro
We now support multiple roModes
2015-07-13 09:53:55 -04:00
paetling
ca4ff1ae36 add to docs that ports do not get exposed when using --net
Signed-off-by: paetling <paetling@gmail.com>
2015-07-13 09:46:39 -04:00
Phil Estes
441ae6c943 Merge pull request #14004 from ktraghavendra/13938_container_swappiness
Add the memory swappiness tuning option to docker.
2015-07-13 09:22:08 -04:00
Dan Walsh
b28d6eaa94 We now support multiple roModes
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-07-13 09:19:15 -04:00
Dan Walsh
3eea6f753a Robert P.J. Day found this problems in man pages
Example in docker search has an extranious -t
docker rmi has a typo

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-07-13 08:59:03 -04:00
Quentin Tayssier
fa6925aa9b Improve sockRequest and sockRequestRaw check
Signed-off-by: Quentin Tayssier <qtayssier@gmail.com>
2015-07-13 21:49:08 +09:00
Sagar Hani
45dbdabdc7 Added entry for Sir M.Visvesvaraya
Signed-off-by: Sagar Hani <sagarhani33@gmail.com>
2015-07-13 17:20:45 +05:30
Rohit Kadam
d51ae591e0 Update docker_remote_api_v1.17.md
HostConfig had misplaced comma(,) for Devices and SecurityOpt keys. Corrected comma position.

Signed-off-by: rohitkadam19 <rohit.d.kadam@gmail.com>
2015-07-13 15:51:27 +05:30
Arnaud Porterie
b0da494aa3 Merge pull request #14559 from Microsoft/10662-todo1
Windows: Move daemon check back centrally
2015-07-12 21:22:43 -07:00
Jessie Frazelle
b58565e9d6 Merge pull request #14568 from runcom/test-vet-fixes
Add minor vet fixes
2015-07-12 14:00:44 -07:00
Vincent Demeester
09adf87f23 Add missing tests and docs for pkg/fileutils
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-12 22:43:42 +02:00
Antonio Murdaca
26ce3f4c90 Add minor vet fixes
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-12 19:16:38 +02:00
John Howard
2ceb114607 Windows: Fix builder
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-12 09:06:18 -07:00
Vincent Demeester
dfc6c04fa3 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>
2015-07-12 10:33:30 +02:00
Raghavendra K T
921da495d2 Add the memory swappiness tuning option to docker.
Memory swappiness option takes 0-100, and helps to tune swappiness
behavior per container.
For example, When a lower value of swappiness is chosen
the container will see minimum major faults. When no value is
specified for memory-swappiness in docker UI, it is inherited from
parent cgroup. (generally 60 unless it is changed).

Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
2015-07-12 13:16:33 +05:30
John Howard
62a75fca68 Windows: Move daemon check back centrally
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-11 12:42:46 -07:00
Mohammed Aaqib Ansari
ee685dca0d Fixing dangling link in docs/reference/commandline/run.md
Signed-off-by: Mohammed Aaqib Ansari <maaquib@gmail.com>
2015-07-11 14:10:54 -04:00
Ajey Charantimath
c27b93ea26 Added notable indian scientists to names-generator.go
Signed-off-by: Ajey Charantimath <ajey.charantimath@gmail.com>
2015-07-11 20:11:22 +05:30
Penghan Wang
80e90499aa Fix failure on adding source list for ubuntu
For hybrid cloud, some ubuntu vm images doesn't have the directory
`/etc/apt/sources.list.d` which cause failure on creating
`/etc/apt/sources.list.d/docker.list`.

To fix this issue, create this directory first (if it doesn't exist).

Signed-off-by: Penghan Wang <ph.wang@daocloud.io>
2015-07-11 22:37:02 +08:00
Avi Miller
865d3a1488 Updated docker-engine.spec to build on Oracle Linux 6.
Signed-off-by: Avi Miller <avi.miller@oracle.com>
2015-07-11 09:53:00 +10:00
Jessie Frazelle
9264d38424 Merge pull request #14537 from stevvooe/allow-one-character-repository-names
Allow one character repository names
2015-07-10 15:41:53 -07:00
Jessie Frazelle
4aeb84612f Merge pull request #14371 from Microsoft/10662-graphdriver
Windows: Graph driver implementation
2015-07-10 15:35:00 -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
Jessie Frazelle
703248da20 Merge pull request #13669 from ewindisch/readonly-proc
Make /proc, /sys, & /dev readonly for readonly containers
2015-07-10 15:32:13 -07:00
Jessie Frazelle
892ac93ec9 Merge pull request #14501 from duglin/FixCommitDocs
Align 'docker commit' docs with the code
2015-07-10 15:21:29 -07:00
Jessie Frazelle
a828415286 Merge pull request #14533 from natebrennand/update-docker-config-docs
update reference to config file
2015-07-10 15:20:52 -07:00
John Howard
52f4d09ffb Windows: Graph driver implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-10 14:33:11 -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
Sebastiaan van Stijn
5bf98dd997 Merge pull request #12856 from duglin/ConfigLocation
Add support for DOCKER_CONFIG/--config to specify config file dir
2015-07-10 23:05:49 +02:00
John Howard
9ae9d4c87a Windows: Exec driver
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-10 13:36:56 -07:00
Stephen J Day
451789cf88 Allow one character repository name components
The docker/distribution dependency was updated in the previous commit to allow
repository name components to only consist of a single letter. The unit tests
have been updated to cement this change.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-07-10 14:06:15 -06:00
Stephen J Day
bfd5202c17 Update docker/distribution dependency
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-07-10 14:05:38 -06: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
Brian Goff
20ac0e6164 Merge pull request #14306 from Microsoft/validatepsfilter
Validate status= filter to docker ps
2015-07-10 15:43:01 -04:00
Nate Brennand
6827782bef update reference to config file
`docker login` in 1.7 produces a config file in `~/docker/config.json`
instead of a `~/.dockercfg`.

Signed-off-by: Nate Brennand <nate.brennand@clever.com>
2015-07-10 18:55:47 +00:00
moxiegirl
5bf335d0a2 Merge pull request #14450 from hqhq/hq_fix_oom_kill_disable_doc
Fix docs for oom-kill-disable
2015-07-10 11:15:02 -07:00
moxiegirl
471fbc9b99 Merge pull request #14478 from atilacamurca/patch-1
Update run.md
2015-07-10 11:13:51 -07:00
Michael Crosby
1dd2fda394 Merge pull request #13312 from hqhq/hq_enable_cgroupfs
Add cgroup bind mount by default
2015-07-10 10:45:05 -07:00
Michael Crosby
c4b85baf3d Merge pull request #14527 from duglin/MoreExecTests
More extensive testing of new GC of execs
2015-07-10 10:42:28 -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
Doug Davis
72b75cd4e7 More extensive testing of new GC of execs
This is a follow-on to PR #14520.

PR #14520 is the quick fix to get the testing working again.

This PR makes sure that the list of execs associated with  a container goes
from zero to one (as a new exec is run), then back to zero when the exec is
finished.  However, we should be able to query the exec while the container
is still around, and even though the exec isn't listed in the container's
inspect data.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-10 07:27:11 -07:00
Brian Goff
469e234ded Merge pull request #14520 from duglin/FixExecTest
Minor fix to the exec inspect test
2015-07-10 09:57:43 -04:00
Doug Davis
899c85b405 Minor fix to the exec inspect test
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-10 06:19:03 -07:00
Qiang Huang
f18fb5b3ef Add cgroup bind mount by default
Libcontainer already supported mount container's own cgroup into
container, with this patch, we can see container's own cgroup info
in container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-10 13:12:09 +08:00
Matt Moore
5a170484d1 Add the X-Docker-Token header to the /v1/search requests.
By adding this header AuthTransport will add Basic authentication to the request and allow 'docker search' results to include private images.

Signed-off-by: Matt Moore <mattmoor@google.com>
2015-07-09 20:56:23 -07:00
Brian Goff
6e64e0548f Merge pull request #14514 from hqhq/hq_fix_file_leak
Fix file leak in integration-cli
2015-07-09 21:52:59 -04:00
John Howard
3875be9830 Windows: Tidy up daemon\utils*.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-09 18:47:32 -07:00
Jessie Frazelle
4893ecc112 Merge pull request #14512 from Microsoft/10662-fixdockerinfo
Windows: Fix docker info not to SIGSEGV
2015-07-09 17:16:49 -07:00
John Howard
4348ad68f8 Windows: Fix docker info not to SIGSEGV
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-09 16:37:54 -07:00
Jessie Frazelle
56e8a99b61 Merge pull request #14480 from Microsoft/fix-windows-ci
Fix Windows CI fail due to GH13866
2015-07-09 16:37:41 -07:00
Michael Crosby
e64af7a70e Merge pull request #14505 from kostickm/12905-port-container-attach-tests
Port POST container attach tests
2015-07-09 16:27:03 -07:00
Arnaud Porterie
7df186dac7 Merge pull request #14509 from Microsoft/10662-remove-linux
Windows: Remove linux
2015-07-09 15:42:53 -07:00
Jessie Frazelle
382799a642 Merge pull request #14476 from crosbymichael/execid-growth-fix
Prevent uncontrolled exec config growth
2015-07-09 15:36:11 -07:00
John Howard
7d3bbe9d34 Windows: Remove linux
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-09 15:15:25 -07:00
Jessie Frazelle
a29af0cc42 Merge pull request #14507 from estesp/remove-old-roadmap
No need for the old project/ROADMAP.md
2015-07-09 15:11:26 -07:00
Phil Estes
548caddaf6 No need for the old project/ROADMAP.md
Now that we have ROADMAP.md in the root of the project, the outdated and
non-specific ROADMAP.md in project/ can be removed.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-07-09 18:05:09 -04:00
Michael Crosby
34ab8c4326 Use mark and sweep for exec command removal
This takes the final removal for exec commands in two steps.  The first
GC tick will mark the exec commands for removal and then the second tick
will remove the config from the daemon.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-07-09 14:51:10 -07:00
Jessica Frazelle
21a07a63c9 add deb and rpm targets to dockerfile
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-09 14:51:02 -07:00
Jessie Frazelle
c9e2a71509 Merge pull request #14484 from LK4D4/check_dockerinit_lxc
Check dockerinit only if lxc driver is used
2015-07-09 14:47:03 -07:00
Jessie Frazelle
0f9c458730 Merge pull request #14457 from Djelibeybi/oraclelinux-rpms
Add support for building docker-engine RPM on Oracle Linux 7.
2015-07-09 14:44:42 -07:00
Avi Miller
f18c4f23cc Change generate.sh so that the yum command for packages remains generic across distros.
Signed-off-by: Avi Miller <avi.miller@oracle.com>
2015-07-10 07:34:47 +10:00
Jessie Frazelle
dce90c0bdd Merge pull request #14502 from calavera/help_release_announce_text
Help the release captain to announce the released packages.
2015-07-09 14:27:24 -07:00
David Calavera
eae99e9da7 Help the release captain to announce the released packages.
Add a few links to the release output that the release captain can use to announce the release.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-09 14:19:05 -06:00
Doug Davis
0bf0e5a6ef Align 'docker commit' docs with the code
It was missing some variants and 'maintainer' isn't actually supported.
Also sorted the list of allowed cmds in the code just to make it easier
to diff with the docs.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-09 13:17:47 -07:00
Megan Kostick
a8715ea220 Port POST container attach tests
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-07-09 12:52:45 -07:00
John Howard
c1b524486c Fix Windows CI fail due to GH13866 and patch up tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-09 10:09:45 -07:00
Antonio Murdaca
9d84d4c2cc Add diff command with emtpy string testcase
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-09 18:46:38 +02:00
Phil Estes
37771c122b Merge pull request #14498 from calavera/fix_volume_from_references
Fix volumes-from mount references.
2015-07-09 12:34:27 -04:00
Alexander Morozov
5369b6cf29 Merge pull request #14348 from sunyuan3/TestPullImageWithAllTagFromCentralRegistry
Add TestPullImageWithAllTagFromCentralRegistry test case.
2015-07-09 09:56:53 -06:00
David Calavera
3d029c3bf3 Fix volumes-from mount references.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-09 09:01:57 -06:00
Qiang Huang
d28b0ba115 Fix file leak in integration-cli
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-09 18:52:18 +08:00
Doug Davis
0afd7bde02 Merge pull request #14381 from Mashimiao/cleanup-client-unused-code
api/client: unify format of args check
2015-07-09 06:42:57 -04:00
Sebastiaan van Stijn
f0e90606cd Merge pull request #13989 from squaremo/netplugin_docs
Mention network driver plugins and point to protocol docs
2015-07-09 09:27:05 +02:00
Sebastiaan van Stijn
ca3e4ccb80 Merge pull request #14241 from ZJU-SEL/fix-ulimit-usage
Fix ulimit usage of nproc
2015-07-09 08:23:26 +02:00
Harry Zhang
54ac3ad736 Clarify that nproc is not for per container
Fix ulimit nproc spec in daemon

Signed-off-by: Harry Zhang <harryzhang@zju.edu.cn>
2015-07-09 02:40:47 +00:00
Jessie Frazelle
cab02a5bbc Merge pull request #14456 from Djelibeybi/issue14042
Remove RPM specific dependencies
2015-07-08 17:17:55 -07:00
Victor Vieux
d2cde4fa66 update doc
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-07-08 15:42:41 -07: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
Jessie Frazelle
885e7f2a1e Merge pull request #14479 from LK4D4/fix_test_inspect
Remove prefix dots from inspects in tests
2015-07-08 15:10:51 -07:00
Phil Estes
2df65c32d7 Merge pull request #14402 from mrjana/mh
Vendoring libnetwork
2015-07-08 17:15:13 -04:00
Alexander Morozov
96bc377a8d Check dockerinit only if lxc driver is used
This allow you to run dynamically linked docker without compiling
dockerinit.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-08 14:12:51 -07:00
Michael Crosby
5f017bba48 Add GC loop to clean exec command refs on daemon
This adds an event loop for running a GC cleanup for exec command
references that are on the daemon.  These cannot be cleaned up
immediately because processes may need to get the exit status of the
exec command but it should not grow out of bounds.  The loop is set to a
default 5 minute interval to perform cleanup.

It should be safe to perform this cleanup because unless the clients are
remembering the exec id of the process they launched they can query for
the status and see that it has exited.  If they don't save the exec id
they will have to do an inspect on the container for all exec instances
and anything that is not live inside that container will not be returned
in the container inspect.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-07-08 13:47:59 -07:00
Alexander Morozov
67058e388b Remove prefix dots from inspects in tests
Dots prepended to key in inspectField function

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-08 12:41:05 -07:00
Brian Goff
42eb82ae92 Merge pull request #14477 from Microsoft/10662-runconfig-oopsie
Windows: Wrong build tag in runconfig
2015-07-08 15:34:05 -04:00
Átila Camurça Alves
7121a2ae46 Update run.md
Put a space after the `###` in the Example section. On the github parser the result file looks ok, but in the docker page (<https://docs.docker.com/reference/run/>) looks ugly.

Signed-off-by: Átila Camurça <camurca.home@gmail.com>
2015-07-08 16:09:40 -03:00
Sebastiaan van Stijn
2f566f747b Merge pull request #14459 from lexandro/add-dockery-to-client-libs
Adding dockery as client lib to the docs
2015-07-08 20:52:24 +02:00
John Howard
4cd9301692 Windows: Wrong build tag in runconfig
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-08 11:38:28 -07:00
Michael Crosby
04c9f86bdc Remove exec config from container after exit
This removes the exec config from the container after the command exits
so that dead exec commands are not displayed in the container inspect.
The commands are still kept on the daemon so that when you inspect the
exec command, not the container, you are still able to get it's exit
status.

This also changes the ProcessConfig to a pointer.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-07-08 10:55:42 -07:00
David Calavera
3833c990e7 Merge pull request #14471 from icecrime/14451_devmapper_startup_panic
Fix panic on devicemapper initialization
2015-07-08 11:18:00 -06:00
Arnaud Porterie
f089899023 Fix panic on devicemapper initialization
The ability to save and verify base device UUID (#13896) introduced a
situation where the initialization would panic when removing the device
returns EBUSY.

Functions `verifyBaseDeviceUUID` and `saveBaseDeviceUUID` now take the
lock on the `DeviceSet`, which solves the problem as `removeDevice`
assumes it owns the lock.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-07-08 09:10:20 -07:00
Yuan Sun
c9a4c1401f Add TestPullImageWithAllTagFromCentralRegistry test case.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-07-08 19:47:33 +08:00
Robert Stern
cd454fef5a Adding dockery as client lib to the docs
Signed-off-by: Robert Stern <lexandro2000@gmail.com>
2015-07-08 12:09:34 +02: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
Peeyush Gupta
7e4725cb66 Adding a warning to Ubuntu script
Signed-off-by: Peeyush Gupta <gpeeyush@linux.vnet.ibm.com>
2015-07-08 12:28:30 +05:30
Avi Miller
0117330ae7 Add support for building docker-engine RPM on Oracle Linux 7.
Signed-off-by: Avi Miller <avi.miller@oracle.com>
2015-07-08 16:12:19 +10:00
Avi Miller
e3b5889783 Remove specific dependencies and let RPM auto-generate the dependencies on libraries during build.
Signed-off-by: Avi Miller <avi.miller@oracle.com>
2015-07-08 15:30:42 +10:00
Alexander Morozov
f5ebcfe1dc Merge pull request #14429 from coolljt0725/fix_cp_created_container
Fix copy from a "created" container. Fixes #14420
2015-07-07 22:27:01 -06:00
David Calavera
159e830068 Merge pull request #14379 from Mashimiao/add-missing-stream-close
api/client: close the returned io.ReadCloser
2015-07-07 21:15:45 -06:00
Lei Jitang
289ee90b04 Fix copy from a "created" container. Fixes #14420
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-08 11:15:09 +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
Qiang Huang
c92fb4d517 Fix docs for oom-kill-disable
Addresses: #14440

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-08 09:51:10 +08:00
Jessie Frazelle
2fe51ecee7 Merge pull request #14100 from rhvgoyal/overlay-docker-inspect
overlay: Export metadata for container and image in docker-inspect
2015-07-07 18:11:27 -07:00
Jessie Frazelle
9c96304a86 Merge pull request #14315 from Pensu/14176-fix-run-table-rendering
Fixing the table rendering in reference/run.md
2015-07-07 18:09:53 -07: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
Jessie Frazelle
25151eb24e Merge pull request #14417 from crosbymichael/attach-stdin
Always attach STDIN if -i,--interactive is specified
2015-07-07 18:07:46 -07:00
Brian Goff
045ccc4326 Merge pull request #14432 from coolljt0725/umount_rootf_on_cp_fail
Always umount container rootfs and volumes on docker cp failed
2015-07-07 21:04:16 -04:00
Jessie Frazelle
81c30c3303 Merge pull request #14430 from zmarouf/master
fix(docs): Small typoes in the Supported installation page
2015-07-07 18:00:19 -07:00
Jessie Frazelle
16f8afb451 Merge pull request #14369 from maximkulkin/14123-dockerize-disk-with-non-en-locale
Fix dockerize-disk.sh working in non-en locale
2015-07-07 17:51:29 -07:00
Jessie Frazelle
e13b7862ab Merge pull request #14335 from konstruktoid/issue_14263
Mention experimental build
2015-07-07 17:49:37 -07:00
Michael Crosby
806b3fa145 Merge pull request #13835 from cpuguy83/gen-prc
generate plugin clients via template
2015-07-07 17:17:39 -07:00
Michael Crosby
a5283d2ff3 Merge pull request #13866 from brahmaroutu/runOOM_13766
RunOOM test should check to see if Oom Control is enabled
2015-07-07 16:21:46 -07:00
David Calavera
b2b367a6ad Merge pull request #14427 from Evalle/14404-add-Metatag
Adding Group Metatag
2015-07-07 16:43:20 -06:00
Arnaud Porterie
f7ea9114d6 Merge pull request #14415 from calavera/warning_on_no_dev_sync
Put dm.override_udev_sync_check back.
2015-07-07 14:35:49 -07:00
David Calavera
e27131519f Warn when udev_sync is not supported.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-07 15:10:24 -06:00
Arnaud Porterie
e3966c1031 Merge pull request #14380 from sunyuan3/TestRunCapAddCHOWN
add TestRunCapAddCHOWN test case
2015-07-07 12:36:14 -07:00
David Calavera
9af7afb9eb Revert "Fix implicit DeviceMapper selection"
This reverts commit 0a376291b2.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-07 12:27:19 -07:00
James Turnbull
a14b1f1e9d Merge pull request #14441 from embray/patch-1
Update windows.md
2015-07-07 15:14:37 -04:00
Roman Strashkin
cc955ae73c added ability to iterate over all indexes and use index.Iterate() instead of ReadDir() to walk over the graph
Signed-off-by: Roman Strashkin <roman.strashkin@gmail.com>
2015-07-07 22:13:28 +03:00
Michael Crosby
a8f8748f7a Merge pull request #14398 from ankushagarwal/gitignore-iml
Removing .idea from .gitignore
2015-07-07 12:10:54 -07:00
Michael Crosby
bfc5966d0b Merge pull request #14094 from rghv/master
Added entries of a few ancient Indian mathematicians who did cool things centuries ago.
2015-07-07 12:03:28 -07:00
Vivek Goyal
bebf534439 devicemapper: Check loop devices of existing pool
Often it happens that docker is not able to shutdown/remove the thin
pool it created because some device has leaked into some mount name
space. That means device is in use and that means pool can't be removed.

Docker will leave pool as it is and exit. Later when user starts the
docker, it finds pool is already there and docker uses it. But docker
does not know it is same pool which is using the loop devices. Now
docker thinks loop devices are not being used. That means it does not
display the data correctly in "docker info", giving user wrong information.

This patch tries to detect if loop devices as created by docker are
being used for pool and fills in the right details in "docker info".

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-07-07 14:13:29 -04:00
Arnaud Porterie
2ea4d90da4 Merge pull request #14422 from Microsoft/10662-dumpstacks
Windows: Win32 event for sigusr1 linux equivalence
2015-07-07 10:54:00 -07:00
Erik Bray
12c85f3671 Update windows.md
With apologies (it wasn't clear from the contributing guidelines how this project feels about PRs for one or two word doc fixes).

Signed-off-by: Erik M. Bray <erik.m.bray@gmail.com>
2015-07-07 13:51:17 -04:00
Michael Crosby
cd72c7f3bb Merge pull request #14421 from dmcgowan/fix-duplicate-layers
Fix duplicate layers in manifest
2015-07-07 10:50:45 -07:00
Brian Goff
10bbf62081 Merge pull request #14375 from coolljt0725/fix_test_events_default_empty
Fix test TestEventsDefaultEmpty. Fixes #14360
2015-07-07 10:37:40 -04:00
moxiegirl
833cdd28ed Merge pull request #14307 from kolyshkin/readme-fixes
README.md: fix cgroups/namespaces name and link
2015-07-07 06:09:20 -07:00
Antonio Murdaca
61418e39d5 Merge pull request #14428 from sunyuan3/TestPushBusyboxImage
Correct wrong comment of TestPushBusyboxImage.
2015-07-07 14:44:08 +02:00
Lei Jitang
13c36ce65e Always umount container rootfs and volumes on docker cp failed
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-07 20:27:45 +08:00
zmarouf
3bee3a2927 fix(docs): Small typoes in the Supported installation page
-> https://docs.docker.com/installation/

Signed-off-by: Zeid Marouf <zeid.marouf@gmail.com>
2015-07-07 11:09:12 +02:00
Yuan Sun
f244ed2531 Correct wrong comment of TestPushBusyboxImage.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-07-07 16:10:37 +08:00
Sebastiaan van Stijn
270d7e1af8 Merge pull request #14406 from duglin/tweakCmdlineHelp
Fix example in cmdline help text to have correct output
2015-07-07 09:26:13 +02:00
Sebastiaan van Stijn
244141a8aa Merge pull request #13987 from larsks/bug/7583
Update docker commit man page re: volumes
2015-07-07 09:16:54 +02:00
evalle
0db7c2a9a6 Adding Group Metatag
Signed-off-by: evalle <shmarnev@gmail.com>
2015-07-07 09:08:55 +02:00
Harald Albers
ea26b38784 Add some missing events to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
2015-07-07 09:04:15 +02:00
Sebastiaan van Stijn
81964ca555 Merge pull request #14275 from ankushagarwal/runtime-metrics-docs-stats
Add Docker stats to runtime metrics article
2015-07-07 08:21:31 +02:00
Sebastiaan van Stijn
a25ee91f1c Merge pull request #14095 from timwraight/master
Clarify .dockerignore example for Markdown files
2015-07-07 07:59:39 +02:00
Kir Kolyshkin
68efb27e99 daemon.md: fix placement of exec driver heading
Options for zfs storage driver were incorrectly placed
under 'exec driver options' header. Move the header to
the correct place.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-07-06 22:51:31 -07:00
Kir Kolyshkin
7e309aed4e README.md: fix cgroups/namespaces name and link
The features Docker relies on are called "cgroups" and "namespaces",
so fix the language accordingly.

Also for cgroups, provide a link to Linux kernel documentation that
is more relevant (and deep) than the Wikipedia article.

Cc: Ankush Agarwal <ankushagarwal11@gmail.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-07-06 22:45:56 -07:00
Jana Radhakrishnan
c6dc6bcbb8 Vendoring libnetwork
Vendoring libnetwork commit: 8fb0a8bc9e3166216ca3da2d0bb15332f6685745
    - Fixes breakage in k/v store handling logic in experimental
    - Adds back all the fixes that went in 1.7.1 to master
    - Change VXLAN port in overlay driver to IANA assigned port

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-07-06 20:53:03 -07:00
Lei Jitang
2802831218 Fix test TestEventsDefaultEmpty. Fixes #14360
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-07 11:27:00 +08:00
Doug Davis
58edd21c05 Merge pull request #14409 from vdemeester/fix-testRequires-network
Fix integration tests with testRequires(c, Network)
2015-07-06 23:08:34 -04:00
John Howard
f4b08c7f5e Windows: Win32 event for sigusr1 linux equivalence
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-06 18:58:53 -07:00
Doug Davis
aea0fd0115 Fix example in cmdline help text to have correct output
Showing "$$ exit 13" caught my eye and wasn't correct.
While in there I also made it so the following paragraph didn't go past 80 chars

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-06 17:51:09 -07:00
Derek McGowan
35081ea4b6 Fix duplicate layers in manifest
Currently the layer array is initialized with the first layer then the first layer is appened to the layer list. Adding the first layer twice causes the layer to appear twice in the manifest, making a duplicate push and pull attempt occur.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-06 17:31:06 -07:00
David Calavera
2905fe4806 Merge pull request #14414 from jfrazelle/fix-rpms
fix rpms
2015-07-06 17:12:38 -07:00
moxiegirl
6ffce0131c Merge pull request #14154 from chrismckinnel/master
Fix a broken link to .dockerignore
2015-07-06 15:48:25 -07:00
Ankush Agarwal
274c838ced Add Docker stats to runtime metrics article
Fixes #13170

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-07-06 15:40:26 -07:00
Michael Crosby
691b2851f7 Always attach STDIN if -i,--interactive is specified
There is no reason to error out or not do what the user expects when -i
is specified on the cli.  We should always attach to the stdin of the
container in this situation.

Closes #14390

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-07-06 15:24:23 -07:00
Sebastiaan van Stijn
4f69609ac2 Merge pull request #14411 from duglin/Issue14407
Add some missing events to the API docs
2015-07-06 23:29:56 +02:00
root
e7fb38410d RunOOM test should check to see if Oom Control is enabled
closes #13766
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-07-06 21:15:55 +00:00
Jessica Frazelle
76a853de6e fix rpms
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-06 14:14:26 -07:00
Vincent Demeester
6e4c6da819 Fix integration tests with testRequires(c, Network)
It seems http://hub.docker.com is not accessible anymore, so switching
to https://hub.docker.com for testRequires(c, Network).

Adds a Timeout check on the TestRequirement to *panic* if there is a
timeout (fail fast).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-06 22:08:35 +02:00
Doug Davis
4bb3c253e8 Add some missing events to the API docs
Closes #14407

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-06 11:39:37 -07:00
Vincent Batts
c7492126ef Merge pull request #14127 from vbatts/vbatts-dm-active-external
pkg/devicemapper: external device activation
2015-07-06 14:07:33 -04:00
Ankush Agarwal
b0f7a1c62c Removing .idea from .gitignore
The project cannot include every editor's
ignore files. Contributers can use a local
global gitignore : https://help.github.com/articles/ignoring-files

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-07-06 10:41:38 -07:00
Lars Kellogg-Stedman
a974789537 Update docker commit man page re: volumes
Update the man page for 'docker commit' to make explicit the fact that
'commit' does not save data in volumes.

Addresses comments in #7583

Signed-off-by: Lars Kellogg-Stedman <lars@redhat.com>
2015-07-06 10:16:21 -04: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
Sebastiaan van Stijn
7fde07ea16 Merge pull request #14394 from moxiegirl/carry-pr-13361
Carries and closes 13361
2015-07-05 11:30:17 +02:00
Mary Anthony
2c5e044b59 Carries and closes 13361
Signed-off-by: Mary Anthony <mary@docker.com>
2015-07-04 18:12:52 -07:00
moxiegirl
7aa554c444 Merge pull request #14392 from moxiegirl/fix-fedora-table
Table formatting was broken
2015-07-04 16:30:17 -07:00
Sebastiaan van Stijn
57286aad25 Merge pull request #14235 from mlarcher/mlarcher-patch-2
Add workaround in docs for git bash usage issue
2015-07-04 21:00:53 +02:00
James Turnbull
f240bb5e94 Merge pull request #14309 from Tenk42/14287-wheezy-link-broken-on-debian-page
Fixing Wheezy link on debian installation page
2015-07-04 14:57:00 -04:00
Mary Anthony
762214ccc8 Table formatting was broken
Signed-off-by: Mary Anthony <mary@docker.com>
2015-07-04 07:32:58 -07:00
Antonio Murdaca
36958ba49b Merge pull request #14374 from Mashimiao/clinent-load-tiny-typo-fix
client/load: tiny typo fix
2015-07-04 00:24:21 +02:00
Antonio Murdaca
19e6de2654 Fix combined image events filters
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-04 00:19:08 +02:00
Alexander Morozov
90bc5513a9 Merge pull request #14383 from runcom/runconfig-merge-cleanup
add break after key is found in for loop
2015-07-03 15:18:09 -07:00
Antonio Murdaca
a5be803458 Add break after key is found in for loop
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-03 20:37:34 +02:00
Sebastiaan van Stijn
bca32648f4 Merge pull request #14195 from ch3lo/master
update in Kitematic OS support
2015-07-03 18:05:27 +02:00
Marcelo Salazar
1b3bde47ef update in Kitematic OS support
Kitematic now support Windows

Signed-off-by: Marcelo Salazar R <chelosalazar@gmail.com>
2015-07-03 12:32:00 -03:00
Yuan Sun
230179c8dc add TestRunCapAddCHOWN test case
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-07-03 23:25:52 +08:00
Sebastiaan van Stijn
a89f4e36ab Merge pull request #14159 from tristan0x/patch-1
docker-hub Admin right gives access to build logs
2015-07-03 16:56:04 +02:00
Tristan Carel
515df52f19 Rewrite DockerHub group permissions documentation
On behalf of @moxiegirl
    https://gist.github.com/moxiegirl/1c34957b9edc0f6d528c#file-gistfile1-md

Signed-off-by: Tristan Carel <tristan.carel@gmail.com>
2015-07-03 16:29:30 +02:00
Doug Davis
0dedadd4d6 Merge pull request #14377 from coolljt0725/validate_restart_policy
Validate restart policy. Fixes #14351
2015-07-03 07:01:44 -05:00
Lei Jitang
f3faf59925 Validate restart policy. Fixes #14351
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-03 17:33:33 +08:00
mlarcher
33be2c5d2e Add workaround in docs for git bash usage issue
When using boot2docker through git bash, there is a nasty issue when trying to share a folder, due to how git bash parses the URIs. The issue is explained in [issue #12751](https://github.com/docker/docker/issues/12751) but needs more visibility in the docs.

Signed-off-by: Matthieu Larcher <github@ringabell.org>
2015-07-03 09:07:44 +02:00
Sebastiaan van Stijn
7b0666f568 Merge pull request #14378 from airandfingers/patch-2
Edit "Working with Containers" page for readability
2015-07-03 08:43:50 +02:00
ayoshitake
0ed7fd46b6 Edit "Working with Containers" page for readability
Signed-off-by: ayoshitake <airandfingers@gmail.com>
2015-07-02 23:10:36 -07:00
Ma Shimiao
801a7fed19 api/server: Add missing json check
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-07-03 08:52:32 +08:00
Ma Shimiao
87cfc2bc58 client/load: tiny typo fix
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-07-03 08:37:27 +08:00
James Turnbull
d7326bd787 Merge pull request #14190 from ankushagarwal/experimentalDownloadLink
Document the location of experimental binary
2015-07-02 20:14:15 -04:00
James Turnbull
7dc8e77cc7 Merge pull request #14295 from Lennie/patch-1
Fix for broken link
2015-07-02 19:24:57 -04:00
John Howard
7bf26d44b0 Validate status= filter to docker ps
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-02 16:12:42 -07:00
Maxim Kulkin
8630ad1530 Fix dockerize-disk.sh working in non-en locale
One part of script relies on messages that are
output by some system tool. In non-en locale
those messages get localized which breaks the
script.
This patch enforces en locale for that system
tool.

Signed-off-by: Maxim Kulkin <maxim.kulkin@gmail.com>
2015-07-02 16:08:12 -07:00
Sebastiaan van Stijn
a45576ab40 Merge pull request #14104 from mariusGundersen/patch-1
Spelling
2015-07-03 01:03:58 +02:00
Ankush Agarwal
01cfb70b0a Document the location of experimental binary
Some devs might want to download the binary directly,
especially for systems where the install script does not
work.

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-07-02 15:59:13 -07:00
David Calavera
5b2d14fbbf Merge pull request #14349 from hqhq/hq_error_for_todisk
Show error message when todisk failed
2015-07-02 15:56:56 -07:00
Jessie Frazelle
9356c76d9f Merge pull request #14064 from jfrazelle/no-cache-for-experimental
add no cache for experimental builds bc cloudfront
2015-07-02 17:24:29 -04:00
Jessica Frazelle
0cc664fae3 add no cache for experimental builds bc cloudfront
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-07-02 13:50:11 -07:00
Ankush Agarwal
88f02c2f33 Add 500 check for registry api call
Partially Addresses #14326

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-07-02 12:41:24 -07:00
Eric Windisch
5400d8873f Make /proc, /sys, /dev readonly for readonly containers
If a container is read-only, also set /proc, /sys,
& /dev to read-only. This should apply to both privileged and
unprivileged containers.

Note that when /dev is read-only, device files may still be
written to. This change will simply prevent the device paths
from being modified, or performing mknod of new devices within
the /dev path.

Tests are included for all cases. Also adds a test to ensure
that /dev/pts is always mounted read/write, even in the case of a
read-write rootfs. The kernel restricts writes here naturally and
bad things will happen if we mount it ro.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-02 19:08:00 +00:00
David Calavera
71f8ca30ce Merge pull request #14359 from cpuguy83/14354_events_send_resp_immediately
Send resp immediately on GET /events
2015-07-02 12:00:45 -07:00
Arnaud Porterie
f0ed68f852 Merge pull request #14292 from calavera/fix_driver_detection
Fix implicit DeviceMapper selection
2015-07-02 11:33:55 -07:00
Phil Estes
e3d488e280 Merge pull request #13851 from ewindisch/no-allow-rc4
Remove RC4 from the list of registry cipher suites
2015-07-02 13:11:40 -04:00
Alexander Morozov
36f6b7331e Merge pull request #14350 from moysesb/fixdoc
Fixed outdated comment.
2015-07-02 10:06:31 -07:00
David Calavera
0a376291b2 Fix implicit DeviceMapper selection
DeviceMapper must be explicitly selected because the Docker binary might not be linked to the right devmapper library.

With this change, Docker fails fast if the driver detection finds the devicemapper directory but the driver is not the default option.
The option `override_udev_sync_check` doesn't make sense anymore, since the user must be explicit to select devicemapper, so it's being removed.
Docker fails to use devicemapper only if Docker has been built statically unless the option was explicit.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-02 09:21:27 -07:00
Brian Goff
d0a299c027 Send resp immediately on GET /events
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-07-02 11:45:24 -04:00
Alexander Morozov
f58758ce36 Merge pull request #14355 from vdemeester/log-to-logrus
Replace latest log by logrus
2015-07-02 08:20:16 -07:00
Vincent Demeester
10e114fb95 Replace latest log by logrus
Related to #11618 and #11614

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-02 16:11:52 +02:00
Sebastiaan van Stijn
9300eb6684 Merge pull request #13825 from Mashimiao/unify-help-message
Unify docker commands' usage in man and help
2015-07-02 15:31:57 +02:00
wlan0
9b782d3af3 add support for maximum log size, and max number of log files
Signed-off-by: wlan0 <sidharthamn@gmail.com>
2015-07-02 06:26:06 -07:00
Sebastiaan van Stijn
ddc9bc6c56 Merge pull request #14341 from ankushagarwal/ubuntuUglyDocs
Fix missing newline
2015-07-02 15:17:27 +02:00
Moysés Borges
8b0e40bb38 Fixed outdated comment.
Synchronized the comment for httputils/mimetype.DetectContentType
with the actual code.

Signed-off-by: Moysés Borges <moysesb@gmail.com>
2015-07-02 08:17:11 -03:00
Qiang Huang
af7f81878f Show error message when todisk failed
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-02 18:24:35 +08:00
Ma Shimiao
f38232b475 Unify docker commands' usage in man and help
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-07-02 10:33:26 +08:00
Ankush Agarwal
942a0f994f Fix missing newline
Fixes #14340

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-07-01 18:16:22 -07:00
Sebastiaan van Stijn
98f988f62c Merge pull request #13187 from shishir-a412ed/docker_inspect_issue
Flag Addition: --type flag added for docker inspect command
2015-07-02 01:31:15 +02:00
Sebastiaan van Stijn
f51d77f86e Merge pull request #12548 from camallen/docker_host_docs
add note in docs about DOCKER_HOST env var overriding unix socket config
2015-07-02 01:27:47 +02:00
Alexander Morozov
75864dcb38 Merge pull request #14324 from aboch/ds
Stats API to retrieve nw stats from libnetwork
2015-07-01 15:19:46 -07:00
Alexander Morozov
9b9a4b2e59 Merge pull request #14329 from runcom/14318-fix-regression-cap-add-drop-as-single-string
Fix regression in parsing capabilities
2015-07-01 13:28:07 -07:00
Brian Goff
1751b40b04 Merge pull request #14333 from LK4D4/fix_tags
Fix windows tag in pkg/term
2015-07-01 16:27:57 -04:00
Thomas Sjögren
9b42de0e57 remove bashism
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2015-07-01 22:19:24 +02:00
Alexander Morozov
7b3492df0c Fix windows tag in pkg/term
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-01 13:16:16 -07:00
Thomas Sjögren
21ec389fe1 mention the daily experimental build
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2015-07-01 22:12:57 +02:00
Antonio Murdaca
10a3061c5f Fix regression in parsing capabilities list when a single string is given
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-01 21:28:02 +02:00
Alessandro Boch
8b40e44c39 Stats API to retrieve nw stats from libnetwork
- Container networking statistics are no longer
  retrievable from libcontainer after the introduction
  of libnetwork. This change adds the missing code
  for docker daemon to retireve the nw stats from
  Endpoint.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-07-01 11:15:16 -07:00
Alexander Morozov
358c022cac Merge pull request #14321 from MattHauglustaine/14266-return-envfile-parse-bufio-error
Return bufio error when parsing env file
2015-07-01 11:06:33 -07:00
Alexander Morozov
53b897ce9c Merge pull request #13744 from turtlebender/feature/whitelist-label-for-commit
Support LABEL as change for `docker commit`
2015-07-01 10:57:33 -07:00
Brian Goff
5fd0563505 Merge pull request #14322 from runcom/14320-fix-regression-attach-cont-notfound
Return not found before hijacking in attach/wsattach
2015-07-01 13:22:03 -04:00
Alexander Morozov
be5e1498c3 Merge pull request #14134 from vdemeester/runconfig-test-coverage
Refactor and add tests coverage on package runconfig
2015-07-01 10:15:26 -07:00
Antonio Murdaca
88d32a6109 Fix regression in containers attach/wsattach api, return not found before hijacking
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-01 18:16:17 +02:00
Shishir Mahajan
2cb74e6915 Flag Addition: --type flag added for docker inspect command
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-07-01 12:14:01 -04:00
David Calavera
1d7a62d776 Merge pull request #14314 from sunyuan3/TestRmiBlank
Add the expected error verification for TestRmiBlank.
2015-07-01 09:09:56 -07:00
David Calavera
d02540a44a Merge pull request #14305 from aboch/nwst
Import latest libnetwork
2015-07-01 09:07:40 -07:00
Matthieu Hauglustaine
0dadf11bec 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>
2015-07-01 17:43:03 +02:00
Matthieu Hauglustaine
e848494017 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>
2015-07-01 17:17:48 +02:00
Yuan Sun
2179dd00dd Add the expected error verification for TestRmiBlank.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-07-01 19:34:43 +08:00
Peeyush Gupta
636ec6383b Fixing the table rendering in reference/run.md
Signed-off-by: Peeyush Gupta <gpeeyush@linux.vnet.ibm.com>
2015-07-01 16:07:39 +05:30
Vincent Demeester
d4aec5f0a6 Refactor test and add coverage to runconfig
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-01 10:16:36 +02:00
Quentin Tayssier
82b444e3fa Fixing Wheezy link
Signed-off-by: Quentin Tayssier <qtayssier@gmail.com>
2015-07-01 13:01:00 +09:00
Alessandro Boch
126b1b2923 Import latest libnetwork
- To bring in interface which retrieves endpoint statistics

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-30 14:16:16 -07:00
David Calavera
bb2cd98b28 Merge pull request #14238 from rileytg/fix-graphdb-test-typo
fixed typo in graphdb_test failure message
2015-06-30 14:15:02 -07:00
Alexander Morozov
27af9a52a1 Merge pull request #14303 from cpuguy83/fix_nat_import
Nat was moved to pkg/nat
2015-06-30 13:56:11 -07:00
Brian Goff
d9af8551f8 Nat was moved to pkg/nat
Somehow this import was missed

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-30 16:48:17 -04:00
David Calavera
a2621ac6da Merge pull request #14294 from mavenugo/bnone
fixed incorrect assumption on --bridge=none treated as disable network
2015-06-30 13:40:52 -07:00
Alexander Morozov
caa4acc7b1 Merge pull request #14297 from pwaller/move-nat-pkg
Move /nat to /pkg/nat
2015-06-30 13:23:30 -07:00
Madhu Venugopal
c9328c6ccf fixed incorrect assumption on --bridge=none treated as disable network
libnetwork host, none and bridge driver initialization is incorrectly
disabled if the daemon flag --bridge=none. The expected behavior of
setting --bridge as none is to disable the bridge driver alone and let
all other modes to be operational.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-30 13:04:28 -07:00
Sebastiaan van Stijn
a453da2114 Merge pull request #13962 from unclejack/shrink_docs_images
docs: shrink some big images
2015-06-30 21:55:44 +02:00
Brian Goff
2de810df3f Merge pull request #14231 from ankushagarwal/checkValidPort
Validate hostConfig on daemon. Check for invalid port specifications
2015-06-30 15:54:24 -04:00
Arnaud Porterie
2d8dd6b93e Merge pull request #12846 from dave-tucker/network_integration
integration-cli: Add Tests for IPv6 and Fixed CIDR
2015-06-30 12:52:07 -07:00
Brian Goff
f13b40f6e7 Merge pull request #13524 from calavera/plugin_json_spec
Plugins JSON spec.
2015-06-30 15:44:48 -04:00
Ankush Agarwal
477201a295 Validate Port specifications on daemon side
Fixes #14230

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-06-30 12:14:49 -07:00
Alexander Morozov
bb364ff459 Merge pull request #14268 from unclejack/lower_allocations_execdriver
daemon: lower allocations
2015-06-30 12:12:06 -07:00
David Calavera
96417dd6c3 Merge pull request #14211 from icecrime/roadmap
Add ROADMAP.md
2015-06-30 11:40:45 -07:00
Lennie
d6da3736d7 Fix for broken link
The link pointed to experimental.md, but that didn't exist. It looks like README.md was intended. Probably experimental.md was renamed.

Signed-off-by: Leen Besselink <github@consolejunkie.net>
2015-06-30 20:10:12 +02:00
Arnaud Porterie
aa5fb884b4 Add ROADMAP.md
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-30 10:17:08 -07:00
Peter Waller
9c2374d196 Move /nat to /pkg/nat
By convention /pkg is safe to use from outside the docker tree, for example
if you're building a docker orchestrator.

/nat currently doesn't have any dependencies outside of /pkg, so it seems
reasonable to move it there.

This rename was performed with:

```
gomvpkg -vcs_mv_cmd="git mv {{.Src}} {{.Dst}}" \
	-from github.com/docker/docker/nat \
        -to   github.com/docker/docker/pkg/nat

```

Signed-off-by: Peter Waller <p@pwaller.net>
2015-06-30 17:43:17 +01:00
moxiegirl
90024b952c Merge pull request #14267 from ankushagarwal/memory-swap-docs
Typo in memory-swap flag
2015-06-30 05:48:47 -07:00
unclejack
c1477db04f daemon: lower allocations
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-06-30 01:45:31 +03:00
Alexander Morozov
20467faf13 Merge pull request #14269 from vdemeester/pkg-parsers-test-coverage
Add and refactor tests for pkg/parsers{,*}
2015-06-29 15:24:14 -07:00
David Calavera
18d5d3ba03 Merge pull request #14133 from Microsoft/10662-netmode
Windows: Refactor network modes
2015-06-29 15:02:42 -07:00
Alexander Morozov
475ae0889e Merge pull request #14218 from calavera/fix_exec_user
Default process user to container config user.
2015-06-29 14:31:45 -07:00
Vincent Demeester
b81472a6d8 Add test coverage to pkg/parsers
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-06-29 22:30:11 +02:00
John Howard
c5e6a4b307 Windows: Refactor network modes
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-29 13:13:55 -07:00
Ankush Agarwal
e7e48bcfdd Typo in memory-swap flag
Fixes #14253

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-06-29 13:12:08 -07:00
David Calavera
0faa4518ed Default process user to container config user.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-29 12:52:05 -07:00
James Turnbull
77396bd66a Merge pull request #14222 from erikdw/fix-casing-of-vmware-in-main-doc
Use proper casing for VMware in README
2015-06-29 15:16:01 -04:00
moxiegirl
4fd284bde0 Merge pull request #14244 from ankushagarwal/patch-1
Update README.md
2015-06-29 11:53:25 -07:00
Michael Bridgen
f05e503aec Mention network driver plugins and point to protocol docs
Signed-off-by: Michael Bridgen <mikeb@squaremobius.net>
Signed-off-by: Tom Denham <tom.denham@metaswitch.com>
2015-06-29 19:08:23 +01:00
Fred Lifton
0aea0e4072 Merge pull request #14261 from jeremyprice/basics-doc-typo-fix
fix(docs): removed extra quote character in heading
2015-06-29 11:05:54 -07:00
David Calavera
d543a01e17 Merge pull request #14061 from runcom/clean-builder-daemon-config
Add struct to configure Builder commit
2015-06-29 11:04:05 -07:00
David Calavera
333ac3a3eb Plugins JSON spec.
Allow full configuration of external plugins via a JSON document.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-29 10:32:18 -07:00
Alexander Morozov
cb2079e218 Merge pull request #14193 from stevvooe/concurrent-pull-fix
Attempt to protect on disk image store with mutex
2015-06-29 10:28:02 -07:00
moxiegirl
985fd1c6cc Merge pull request #14243 from moxiegirl/carry-pr-13323
Closes #13323 and carries
2015-06-29 08:33:34 -07:00
Jeremy Price
d612782023 fix(docs): removed extra quote character in heading
Signed-off-by: Jeremy Price <jprice.rhit@gmail.com>
2015-06-29 09:46:50 -05:00
Phil Estes
a386a00a3c Merge pull request #14147 from ericsage/patch-1
Fix Typo in experimental docs
2015-06-29 10:41:09 -04:00
Antonio Murdaca
e1afbbf247 Merge pull request #13876 from vdemeester/pkg-jsonlog-test-coverage
Add test coverage to pkg/jsonlog
2015-06-29 16:39:56 +02:00
Dave Tucker
2dfb7f3b7d integration-cli: Add Tests for IPv6 and Fixed CIDR
This patch adds tests for the `--ipv6` and `--fixed-cidr` daemon flags

Signed-off-by: Dave Tucker <dt@docker.com>
2015-06-29 14:45:00 +01:00
Mary Anthony
078b23a37d Closes #13323 and carries
Entering comments

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-29 06:18:41 -07:00
Eric Windisch
37846bff58 Remove RC4 from the list of registry cipher suites
The registry client's TLS configuration used the
default cipher list, including RC4. This change
copies the default cipher list from Golang 1.4 and
removes RC4 from that list. RC4 ciphers are considered
weak and vulnerable to a number of attacks.

Uses the tlsconfig package to define allowed ciphers.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-06-29 09:15:13 -04:00
Ankush Agarwal
9bbdaa9280 Update README.md
cgroups and namespaces links are broken. They point to blog.dotcloud.com which is dead. Updating the links to point to informative pages.

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-06-29 01:10:27 -07:00
Doug Davis
40a41ffdf0 Merge pull request #14198 from cpuguy83/14170_fix_entrypoint_as_string
Fix unmarshalling of Command and Entrypoint
2015-06-28 19:47:26 -06:00
Riley Guerin
c9175d681b fixed typo in graphdb_test failure message
Signed-off-by: Riley Guerin <rileytg.dev@gmail.com>
2015-06-28 16:54:05 -07:00
Yan Feng
2cca502c05 update testcase mount/sharedsubtree_linux_test.go
Signed-off-by: Yan Feng <yanfeng2@huawei.com>
2015-06-27 14:34:32 -04:00
Vincent Demeester
e7a9a0bed8 Add test coverage to pkg/jsonlog
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-06-27 10:13:47 +02:00
Erik Weathers
9030f53165 Use proper casing for VMware in README
Signed-off-by: Erik Weathers <erikdw@gmail.com>
2015-06-26 19:16:29 -07:00
Antonio Murdaca
7571e6d900 Merge pull request #13779 from estesp/tls-confusing-error
Add better client-side error for failed certificate verification
2015-06-27 02:08:04 +02: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
David Calavera
389b806945 Merge pull request #13740 from Microsoft/10662-securitywarning
Windows: Security warning based on server OS
2015-06-26 13:09:03 -07:00
David Calavera
2d15b35f7a Merge pull request #14120 from mdavranche/tempDir
tempDir (in the root dir), must be created after the root dir.
2015-06-26 11:46:55 -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
moxiegirl
31ae9d876a Merge pull request #14126 from laijs/fix-file-permission
docs: fix file's permissions
2015-06-26 10:08:06 -07:00
Alexander Morozov
f46ac8c51c Merge pull request #14162 from dnozay/patch-1
more friendly message for when docker daemon is not running.
2015-06-26 09:27:21 -07:00
Brian Goff
17d6f00ec2 Fix unmarshalling of Command and Entrypoint
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-26 09:00:57 -07:00
Alexander Morozov
b96f109344 Merge pull request #12876 from tagomoris/logger-driver-fluentd
Add new Logging driver "fluentd"
2015-06-26 08:41:10 -07:00
moxiegirl
b49c9850a6 Merge pull request #14200 from moxiegirl/create-install-index
Adding installation index
2015-06-26 02:14:44 -07:00
Mary Anthony
d5de3ed09e Adding installation index
Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-26 02:12:27 -07:00
Chris McKinnel
3c5b17cf7e Fix a broken anchor tag on the CLI builder page
Signed-off-by: Chris McKinnel <chrismckinnel@gmail.com>
2015-06-26 09:43:30 +01:00
Stephen J Day
7eac23cf8d Attempt to protect on disk image store with mutex
During `(*Graph).Register, there was no protection on adding new layers
concurrently. In some cases, this resulted in corruption of a layer by creating
the directory but not the underlying data. This manifested in several different
IO errors reported in the client.  This attempts to fix this by adding a mutex
by Image ID to protect the Register operation.

We do not completely understand the root cause of this corruption other than
the result is somehow tied to this particular function.  This fix has been
confirmed to address the issue through testing.

Unfortunately, this fix does not address existing corruption. The user will
have to remove and re-pull the corrupt layer to stop the error from happening
in the future. This change only ensures that the layer will not become corrupt.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-06-25 20:16:37 -07:00
Stephen Day
c7ece73fa4 Merge pull request #14046 from mattmoor/token-investigation
Unconditionally use AuthTransport.
2015-06-25 19:07:10 -07:00
TAGOMORI Satoshi
78f4a9dad4 Update English expressions by review comments
Signed-off-by: TAGOMORI Satoshi <tagomoris@gmail.com>
2015-06-26 11:04:26 +09:00
TAGOMORI Satoshi
361a582ba0 Add new logging driver: fluentd
Signed-off-by: TAGOMORI Satoshi <tagomoris@gmail.com>
2015-06-26 11:03:11 +09:00
Tibor Vass
dd408891ba Merge pull request #14139 from jlhawn/fix_build_with_auth
[api, builder] Fix build auth config
2015-06-25 17:39:36 -07:00
moxiegirl
2e078b24b8 Merge pull request #14187 from Microsoft/docs-version
Fix docs for #14047
2015-06-25 16:07:27 -07:00
Vivek Goyal
67473c6d06 overlay: Export metadata for container and image in docker-inspect
Export metadata for container and image in docker-inspect when overlay
graphdriver is in use. Right now it is done only for devicemapper graph
driver.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-06-25 17:33:20 -04:00
John Howard
857e0ba32e Fix docs for #14047
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-25 13:39:12 -07:00
moxiegirl
50a1d0f0ef Merge pull request #14142 from fl0yd/patch-1
Update plugins_volume.md
2015-06-25 13:17:02 -07:00
moxiegirl
be33d13f67 Merge pull request #14183 from ChanderG/master
Fix minor typo in CONTRIBUTING.md
2015-06-25 13:16:04 -07:00
moxiegirl
de9c5473f7 Merge pull request #14178 from csarrazi/patch-1
[Easy-Pick] [Documentation] Fix broken links for Fedora
2015-06-25 13:15:26 -07:00
moxiegirl
15d8e7bc6b Merge pull request #14161 from laijs/man_pages
man: convert `docker/docs/man` to `docker/man`
2015-06-25 13:12:46 -07:00
moxiegirl
8c8e8d624f Merge pull request #14156 from HuKeping/master
Docs: fix wrong example of API Exec
2015-06-25 13:09:36 -07:00
moxiegirl
7201127cfb Merge pull request #14189 from moxiegirl/carry-14079
Splitting out the cli command into parts.
2015-06-25 12:05:56 -07:00
Mary Anthony
561bfb268d Splitting out the cli command into parts.
Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-25 12:02:41 -07:00
Alexander Morozov
c281549610 Merge pull request #14030 from estesp/init-memory-swappiness
Initialize swappiness in libcontainer cgroups template
2015-06-25 11:36:54 -07:00
Phil Estes
e8b87cfce1 Merge pull request #13907 from chenchun/exitcode
Set exit code of old running container as 137
2015-06-25 10:57:48 -07:00
moxiegirl
81d6f60935 Merge pull request #14182 from moxiegirl/fix-logging
Breaking logging driver material out of run
2015-06-25 10:28:36 -07:00
Alexander Morozov
e0cfe36b8e Merge pull request #14163 from mrjana/cnm_integ
Fix endpoint leave failure for --net=host mode
2015-06-25 10:17:03 -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
Chun Chen
b0b2f979c7 Set exit code of old running container as 137
Signed-off-by: Chun Chen <chenchun.feed@gmail.com>
2015-06-25 22:30:09 +08:00
ChanderG
e594a2fb54 Fix minor typo in CONTRIBUTING.md
Signed-off-by: ChanderG <chandergovind@gmail.com>
2015-06-25 18:23:38 +05:30
Mary Anthony
31dd97f4ad Breaking logging driver material out of run
- creating index which is overview of configuring logs
- linking to individual journald/fluent material
- leaving behind table and link to index in run

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-25 05:00:49 -07:00
Charles Sarrazin
62213219dc Fix broken fedora documentation
The documentation is currently broken for the fedora page. This PR fixes missing the markup.

Signed-off-by: Charles Sarrazin <charles@sarraz.in>
2015-06-25 10:16:46 +02:00
moxiegirl
4ab8b88286 Merge pull request #13973 from calavera/fix_zfs_options_doc_location
Move zfs options doc to the storage section.
2015-06-24 15:52:13 -07:00
Jana Radhakrishnan
9bb69f9726 Fix endpoint leave failure for --net=host mode
When a container is started with `--net=host` with
a particular name and it is subsequently destroyed,
then all subsequent creations of the container with
the same name will fail. This is because in `--net=host`
the namespace is shared i.e the host namespace so
trying to destroy the host namespace by calling
`LeaveAll` will fail and the endpoint is left with
the dangling state. So the fix is, for this mode, do
not attempt to destroy the namespace but just cleanup
the endpoint state and return.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-24 12:33:52 -07:00
Hu Keping
221fa4c3d1 Docs: fix wrong example of API Exec
The last "," should not shown up, otherwise you will get the error
back as below:
- invalid character '}' looking for beginning of object key string.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-06-25 02:03:27 +08:00
Sebastiaan van Stijn
afd4d544cf Merge pull request #14119 from moxiegirl/fix-heading-blanks
Fix heading blanks
2015-06-24 08:35:42 -07:00
Lai Jiangshan
85e2957409 man: convert docker/docs/man to docker/man
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2015-06-24 23:31:12 +08:00
unclejack
0a9c580fad Merge pull request #14153 from feixueliantian1/typo
Fix Typo in stdcopy.go
2015-06-24 16:11:20 +03:00
yuchengxia
16be453e0f Fix Typo in stdcopy.go
Signed-off-by: Yu Chengxia <yuchengxia@huawei.com>
2015-06-24 15:00:14 +08:00
Eric Sage
4466d00534 Typo
Signed-off-by: Eric Sage <eric.david.sage@gmail.com>
2015-06-23 19:41:55 -07:00
fl0yd
0835b20ace Update plugins_volume.md
Signed-off-by: Mark Oates <fl0yd@me.com>
2015-06-23 15:30:36 -07:00
Josh Hawn
02c7bbefb8 [api, builder] Fix build auth config
With the 1.7 release, we introduced a change to how we store registry
credentials, but the build API endpoint did not expect a change in the format
of that file. This patch fixes this problem so that you can again pull private
images during `docker build`.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-06-23 12:58:17 -07:00
Alexander Morozov
4dd1d1bfa5 Merge pull request #13810 from d23/syslog-facility
Add syslog-facility option
2015-06-23 12:05:15 -07:00
Alexander Morozov
d5721f0385 Merge pull request #13833 from Microsoft/10662-dockerbuild
Windows: Start docker build working
2015-06-23 11:46:56 -07:00
David Calavera
aa4f495cae Merge pull request #13966 from mountkin/fix-stats-goroutine-leak
fix the goroutine leak in the stats API if the container is not running
2015-06-23 10:06:35 -07:00
Vincent Batts
5c93c265f6 Merge pull request #14047 from Microsoft/10662-versionadd
Add build time to version and tidy output
2015-06-23 09:57:31 -07:00
Lai Jiangshan
f23698bb14 docs: fix file's permissions
The README.md and the *.png should not have the executable
permissions, remove them.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2015-06-24 00:09:27 +08:00
Alexander Morozov
9b5875eb9d Merge pull request #14114 from HuKeping/master
Remove useless conversion
2015-06-23 08:10:34 -07:00
Hu Keping
250ce20fee Remove useless conversion
It is already type float.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-06-24 00:47:08 +08:00
root
41f69883d2 tempDir (in the root dir), must be created after the root dir.
Signed-off-by: mikael.davranche <mikael.davranche@corp.ovh.net>
2015-06-23 14:53:18 +02:00
Mary Anthony
960cbd2c8d Fixes #14117
Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-23 05:17:20 -07:00
Mary Anthony
e81861ea54 Closes #14055 for anchal
Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-23 05:14:53 -07:00
Dennis Docter
609e7b0a55 Add --log-opt to specify facility for syslog driver
Signed-off-by: Dennis Docter <dennis@d23.nl>
2015-06-23 14:04:25 +02:00
Shijiang Wei
1cbf5a54da fix the goroutine leak in the stats API if the container is not running
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-06-23 19:38:15 +08:00
Antonio Murdaca
cb6ca19b53 Merge pull request #14110 from webwurst/patch-2
Typo
2015-06-23 12:34:16 +02:00
Vincent Batts
8861d65e97 pkg/devicemapper: external device activation
Reported-by: Sheng Yang <shend.yang@rancher.com>
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-06-22 20:28:15 -04:00
moxiegirl
51264fa63c Merge pull request #14111 from bfirsh/update-compose-swarm-docs
Fix compose/swarm/network docs
2015-06-22 17:23:57 -07:00
Ben Firshman
fe1f210c42 Update documentation for compose/swarm/network
Thanks to @aanand for help debugging

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-06-22 16:45:22 -07:00
Tobias Bradtke
1797f03760 Typo
Signed-off-by: Tobias Bradtke <webwurst@gmail.com>
2015-06-23 00:52:16 +02:00
David Calavera
74be85500a Merge pull request #12812 from sharidas/8373-display-docker-ps-host
Display when a container is in --net=host in docker ps
2015-06-22 14:06:07 -07:00
John Howard
87eae0d659 Add branch and build time to version
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-22 13:00:27 -07:00
Ben Firshman
e02947b236 Add link to compose/swarm/network to readme
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-06-22 11:38:46 -07:00
Marius Gundersen
2e7399a52b spelling
Signed-off-by: Marius Gundersen <me@mariusgundersen.net>
2015-06-22 20:04:06 +02:00
Tim Wraight
182d2668a1 Clarify .dockerignore example for Markdown files
The current documentation correctly states that dockerignore pattern
searches are non-recursive. However, the example given for Markdown
files seems to contradict this by saying that `*.md` will exclude *all*
Markdown files. This commit clarifies the situation by explicitly
specifying that `*.md` will only exclude files in the root directory of
the project.

Signed-off-by: Tim Wraight <tim.wraight@tangentlabs.co.uk>
2015-06-22 17:53:05 +01:00
moxiegirl
a7116c5e2b Merge pull request #14101 from aanand/compose-swarm-networking-guide
Add experimental Compose/Swarm/multi-host networking guide
2015-06-22 09:47:33 -07:00
David Calavera
f39b9a0b0f Merge pull request #14071 from mavenugo/mhnet
Vendoring libnetwork 83743db8ceb2bdbfa0960d9a54ed2f98df4ea846
2015-06-22 08:35:18 -07:00
Aanand Prasad
a5f6407c5b Add experimental Compose/Swarm/multi-host networking guide
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-22 08:33:20 -07:00
VinayRaghavanKS
1a28fb7583 Added entries for aryabhata, bhaskara, brahmagupta, mahavira, panini and varahamihira - ancient Indian mathematicians
Signed-off-by: VinayRaghavanKS <raghavan.vinay@gmail.com>
2015-06-22 19:50:07 +05:30
Madhu Venugopal
739996c1d7 Adding container to secondary network to support port mapping
With publish-service and default-network support, a container could be
connected to a user-defined network that is backed by any driver/plugin.
But if the user uses port mapping or expose commands, the expectation
for that container is to behave like existing bridge network.
Thanks to the Libnetwork's CNM model, containers can be connected
to the bridge network as a secondary network in addition to the
user-specified network.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-22 04:15:57 -07:00
Madhu Venugopal
1e59169509 Reworked ReleaseNetwork to make use of libnetwork's new LeaveAll API
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-22 04:15:57 -07:00
Madhu Venugopal
53b0f686f7 Removed the default "bridge" in builder
Now that the default network mode is "default" and this mode is chosen
even if the mode is empty string, it is not correct to have builder
still pointing to "bridge" as default (though this is daemon default).

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-22 04:15:56 -07:00
Madhu Venugopal
508065a7ad Vendoring in libnetwork for native multihost networking
- brings in vxlan based native multihost networking
- added a daemon flag required by libkv for dist kv operations
- moved the daemon flags to experimental

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-22 04:15:41 -07:00
Sujith Haridasan
8a9ed09746 Display when a container is in --net=host in docker ps
Display */tcp, */udp when a container is in --net=host in docker ps

Signed-off-by: Sujith Haridasan <sujith.h@gmail.com>
2015-06-22 11:44:33 +05:30
moxiegirl
abb85f822d Merge pull request #14085 from moxiegirl/1.7-release-notes
Commenting out the release-notes for 1.6
2015-06-21 20:46:45 -07:00
Mary Anthony
efef353a29 Commenting out the release-notes for 1.6
Original text

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-21 20:41:43 -07:00
Alexander Morozov
c782be0e2a Merge pull request #14062 from runcom/cleanup-dead-code
Remove dead code
2015-06-21 16:01:19 -07:00
Arnaud Porterie
4548d3fb77 Merge pull request #14074 from sdurrheimer/master
Update the zsh completion
2015-06-21 15:43:09 -07:00
Brian Goff
7491f9a9c1 Merge pull request #12099 from moysesb/12078-binary_remote_context
Handle binary remote contexts when creating builder jobs.
2015-06-21 13:59:26 -07:00
Steve Durrheimer
b2cc6f1b47 Update the zsh completion
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2015-06-21 17:33:07 +02:00
Arnaud Porterie
fef0e84b2d Merge pull request #14051 from mavenugo/services
experimental services ui
2015-06-20 18:24:37 -07:00
Sebastiaan van Stijn
67f9bbcbd4 Merge pull request #11907 from gcuisinier/11094-allow-import-from-file2
fix #11094 - Allow 'docker import' to load from local files
2015-06-20 12:17:58 -07:00
Dave Tucker
4736b17315 Initial Services docs
Signed-off-by: Dave Tucker <dt@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-20 11:04:25 -07:00
Madhu Venugopal
1ac350a0ec Support for --publish-service flag in docker run
This commit makes use of the CNM model supported by LibNetwork and
provides an ability to let a container to publish a specified service.
Behind the scenes, if a service with the given name doesnt exist, it is
automatically created on appropriate network and attach the container.

Signed-off-by: Alessandro Boch <aboch@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-20 11:03:38 -07:00
Antonio Murdaca
927d13bc3c Remove dead code
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-20 19:14:15 +02:00
Jessie Frazelle
a93a5ee50a Merge pull request #14054 from konstruktoid/issue_14045
rpm name and location
2015-06-20 07:14:22 -07:00
Antonio Murdaca
7046651b87 Add struct to configure Builder commit instead of using one defined in daemon
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-20 12:53:47 +02:00
Robin Schneider
52e193bed7 Implemented as proposed by @tianon and @ypid. Restores the default behavior (using xz compression).
* `--compression=none` and `--no-compression` to disable compression.
* `--compression=auto` to use the default compression (enabled by default).
* `--compression=xz` to use xz compression (default compression).
* `--compression=gz` to use gzip compression.

Signed-off-by: Robin Schneider <ypid@riseup.net>
2015-06-20 12:14:49 +02:00
Gildas Cuisinier
3f64b76d4c work on #11094 allow import from local file
Signed-off-by: Gildas Cuisinier <gildas.cuisinier@gcuisinier.net>
2015-06-20 09:04:43 +02:00
Brian Goff
c3997daeb5 Merge pull request #14052 from Microsoft/10662-fixcgroupcheck
Windows: Fix cgroup regression
2015-06-19 21:17:39 -04:00
Alexander Morozov
e5ded9c378 Merge pull request #13997 from runcom/drop-old-client
Error out if client API version is too old
2015-06-19 17:05:39 -07:00
Thomas Sjögren
a0a010e2e3 rpm name and location
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2015-06-20 01:14:58 +02:00
John Howard
9d0ed1dea0 Windows: Fix cgroup regression
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-19 15:29:47 -07:00
David Calavera
7313a9ae9c Merge pull request #14044 from duglin/MakeDocs
Add back top-level "make docs"
2015-06-19 12:42:11 -07:00
Moysés Borges
d48bface59 Support downloading remote tarball contexts in builder jobs.
Signed-off-by: Moysés Borges <moysesb@gmail.com>
2015-06-19 16:35:00 -03:00
David Calavera
7ce20fad99 Merge pull request #13780 from LK4D4/use_checkv
Remove timer and use -check.v for tests formatting
2015-06-19 11:34:31 -07:00
David Calavera
de6d2603f9 Merge pull request #13848 from estesp/tls-server-client-cipher-cleanup
Split client and server cipher suite list in TLS defaults
2015-06-19 11:08:19 -07:00
Alexander Morozov
3ee67caf3b Merge pull request #14032 from lizf-os/fix-sysinfo-regression
Fix sysinfo regression
2015-06-19 11:00:13 -07:00
Matt Moore
c2315102ff Unconditionally add AuthTransport.
Today, endpoints implementing v2 cannot properly fallback to v1 because the underlying transport that deals with authentication (Basic / Token) doesn't get annotated.

This doesn't affect DockerHub because the DockerHub endpoint appears as 'https://index.docker.io/v1/' (in .dockercfg), and the 'v1' tricks this logic just long enough that the transport is always annotated for DockerHub accesses.

Signed-off-by: Matt Moore <mattmoor@google.com>
2015-06-19 10:12:52 -07:00
Doug Davis
2bc0d2bf51 Add back top-level "make docs"
Just to make life easier on devs so they don't need to 'cd' into
the docs dir just to test their docs edits.  This doesn't do anything
more than "cd docs && make docs" so that all of the smarts are still
in the docs's Makefile and not in docker's.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-06-19 09:42:39 -07:00
David Calavera
df73d5e0cd Merge pull request #14023 from mavenugo/net_ui
experimental network ui
2015-06-19 09:26:05 -07:00
Madhu Venugopal
742db1737c attaching services api and UI chain to docker parent
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-19 09:19:09 -07:00
Qiang Huang
fb85a99f58 Add some cgroup related config check
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-06-19 13:47:48 +08:00
Qiang Huang
0c4c830289 Add check config for ext3 file system
Some distros still use ext3 as default file system, we should check
these configs as well.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-06-19 13:45:07 +08:00
Zefan Li
4398693201 Fix sysinfo regression
The cleanup to sysinfo package introduced a regression.

If memory cgroup isn't supported and --memory is specified when
starting a container, we should return info instead of nil in
checkCgroupMem(), otherwise we'll access a nil pointer.

Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-06-19 09:44:23 +08:00
Alexander Morozov
b3254dab49 Merge pull request #14031 from tianon/update-frozen-images
Update frozen busybox and hello-world images
2015-06-18 18:15:45 -07:00
Tianon Gravi
4d171281bf Update frozen busybox and hello-world images
These have both been updated to no longer include the empty "scratch" layer, and `hello-world` has a fix for http->https.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-06-18 17:09:57 -07:00
Phil Estes
9e9d227677 Initialize swappiness in libcontainer cgroups template
By default, the cgroup setting in libcontainer's configs.Cgroup for
memory swappiness will default to 0, which is a valid choice for memory
swappiness, but that means by default every container's memory
swappiness will be set to zero instead of the default 60, which is
probably not what users are expecting.

When the swappiness UI PR comes into Docker, there will be docker run
controls to set this per container, but for now we want to make sure
*not* to change the default, as well as work around an older kernel
issue that refuses to allow it to be set when cgroup hiearchies are in
use.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-06-18 19:27:04 -04:00
Jessie Frazelle
1334a2fc39 Merge pull request #14028 from jfrazelle/fix-index-generation-experimental
fix s3_url for release script for experimental
2015-06-18 15:22:26 -07:00
Jessica Frazelle
0f0f5ecd57 fix s3_url for release script for experimental
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-18 14:54:40 -07:00
Alexander Morozov
4253a1f87e Remove timer and use -check.v for tests formatting
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-18 14:22:40 -07:00
Antonio Murdaca
d7544217dd Merge pull request #13978 from cpuguy83/cleanup_sysinfo
cleanup sysinfo package
2015-06-18 22:27:32 +02:00
David Calavera
b1143f4cb0 Merge pull request #13218 from brahmaroutu/decoder_issue_gccgo
Decoder does not work properly with nested pointers using gcc
2015-06-18 13:22:28 -07:00
James Turnbull
1487350b85 Merge pull request #14016 from vizv/patch-1
fix the url in article "Best practices for writing Dockerfiles"
2015-06-18 13:05:26 -07:00
Brian Goff
ebef527b39 Merge pull request #13976 from icecrime/12934_carry
LXC execdriver compatibility with recent LXC versions
2015-06-18 15:08:55 -04:00
Madhu Venugopal
cca990c67a Network UI / API docs
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-18 12:07:58 -07:00
Madhu Venugopal
da5a3e6dee register libnetwork API and UI with docker parent chain
This commit also brings in the ability to specify a default network and its
corresponding driver as daemon flags. This helps in existing clients to
make use of newer networking features provided by libnetwork.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-18 12:07:58 -07:00
Jessie Frazelle
8ea1b54065 Merge pull request #14019 from jfrazelle/bump-version
Bump version
2015-06-18 11:25:19 -07:00
Jessica Frazelle
53f5f5b7f4 bump version to 1.8.0-dev
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-18 10:47:53 -07:00
Jessica Frazelle
2e0e038fb2 Bump version to v1.7.0
Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit 0baf609845)
2015-06-18 10:47:25 -07:00
Wenxuan Zhao
3dd134ceca Fix the url in comparison of "COPY" and "RUN curl"
From context on next line,`tar -xJC` implies
the file is `big.tar.xz` instead of `big.tar.gz`.

Signed-off-by: Wenxuan Zhao <viz@linux.com>
2015-06-18 12:33:46 -04:00
Tibor Vass
fc793bf1a3 Merge pull request #13830 from clnperez/check-apparmor-file-first
Check for apparmor file before reading it
2015-06-18 08:18:01 -04: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
Campbell Allen
3cb9f7f6aa add note about DOCKER_HOST env var overriding unix socket config
when trying to use docker without sudo and the DOCKER_HOST env var is set docker tries to connect to the specified host instead of using the unix socket.

Signed-off-by: Campbell Allen <campbell.allen@gmail.com>
2015-06-18 06:51:21 +01:00
Jessie Frazelle
423e6dc333 Merge pull request #14002 from moxiegirl/hugo-test-fixes
Hugo final 1.7 Documentation PR -- please read carefully
2015-06-17 22:00:09 -07:00
Mary Anthony
328dbd0aa2 Fixing seds, deleting old stuff
Signed-off-by: Mary Anthony <mary@docker.com>

Upding sed, adding script to avoid redirects, remove mkdos

Signed-off-by: Mary Anthony <mary@docker.com>

Ignoring graphics with sed

Signed-off-by: Mary Anthony <mary@docker.com>

Fixing kitematic image

Signed-off-by: Mary Anthony <mary@docker.com>

Removing draft

Signed-off-by: Mary Anthony <mary@docker.com>

Fixing link

Signed-off-by: Mary Anthony <mary@docker.com>

removing from the menu

Signed-off-by: Mary Anthony <mary@docker.com>

Updatiing order of project material

Signed-off-by: Mary Anthony <mary@docker.com>

Removing from Regsitry v2 content per Olivier

Signed-off-by: Mary Anthony <mary@docker.com>

tweaking the touchup

Signed-off-by: Mary Anthony <mary@docker.com>

Removing include; only used four places; hugo global var replace

Signed-off-by: Mary Anthony <mary@docker.com>

Entering fixes from page-by-page

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-17 21:05:37 -07:00
Brian Goff
baa1664478 Merge pull request #13991 from LalatenduMohanty/adding_new_scientists
Proposing Chandrasekhar, Khorana, Saha for name-generator
2015-06-17 21:06:24 -04:00
Brian Goff
9b05aa6ee8 cleanup sysinfo package
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-17 20:41:14 -04:00
Sebastiaan van Stijn
206acbcf89 Merge pull request #13070 from shishir-a412ed/cleanup_cmd_tag
Use distribution's ValidateRepositoryName for remote name validation.
2015-06-17 23:26:27 +02:00
Derek McGowan
d86345b9f7 Merge pull request #13575 from mattmoor/consistent-push-fallback
Make v2 push have v1-fallback behavior consistent with pull.
2015-06-17 13:41:58 -07:00
Alexander Morozov
af845d42a5 Merge pull request #13988 from runcom/fix-old-code-path-removal
Remove missed code path for api < 1.12
2015-06-17 12:30:11 -07:00
Phil Estes
c107e9d790 Merge pull request #13870 from lindenlab/pull-single-tag
Only request a single repository tag when pulling a specific image:tag
2015-06-17 15:29:39 -04:00
Lalatendu Mohanty
3fa2ddc452 Proposing Chandrasekhar, Khorana, Saha for name-generator
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
2015-06-18 00:52:29 +05:30
Shishir Mahajan
b8301005ff Use distribution's ValidateRepositoryName for remote name validation.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-06-17 15:15:16 -04:00
David Calavera
85d3b75dfd Merge pull request #13896 from rhvgoyal/verify-base-uuid
devicemapper: Compare uuid of base device on startup
2015-06-17 11:30:04 -07:00
Michael Crosby
010470dd53 Merge pull request #13893 from mrunalp/update_libcontainer
Updates libcontainer to v2.2.1
2015-06-17 10:47:49 -07:00
John Howard
3c177dc877 Windows: Docker build starting to work
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-17 10:41:28 -07:00
Christy Perez
691ed6ef99 Check for apparmor file before reading it
I ran a single integration test and got an error that the file
/sys/module/apparmor/parameters/enabled doesn't exist. I don't have
apparmor installed. So, just check the file first to avoid a confusing
error.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2015-06-17 11:58:17 -05:00
moxiegirl
424bb26b6c Merge pull request #13827 from moxiegirl/rpm-rhel-centos-fedora
RPMs update to installation guides
2015-06-17 08:29:33 -07:00
Antonio Murdaca
b6a6c56915 Remove missed code path for api < 1.12
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-17 17:00:48 +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
Alexander Morozov
9ad87523c0 Merge pull request #13292 from coolljt0725/add_bridge_nf_to_docker_info
Add bridge-nf-call-iptables/bridge-nf-call-ipv6tables to docker info
2015-06-16 22:15:48 -07:00
Phil Estes
a27d8f9aa4 Merge pull request #13975 from stevvooe/move-setup-init-layer
Move graph.SetupInitLayer to daemon package where it is used
2015-06-16 22:37:51 -04:00
Lei Jitang
57d12a0e0a Add bridge-nf-call-iptables/bridge-nf-call-ipv6tables to docker info
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-06-17 09:19:11 +08:00
Vivek Goyal
c06b05b11e devicemapper: Compare uuid of base device on startup
It is easy for one to use docker for a while, shut it down and restart
docker with different set of storage options for device mapper driver
which will effectively change the thin pool. That means any of the
metadata stored in /var/lib/docker/devicemapper/metadata/ is not valid
for the new pool and user will run into various kind of issues like
container not found in the pool etc.

Users think that their images or containers are lost but it might just
be the case of configuration issue. People might use wrong metadata
with wrong pool.

To detect such situations, save UUID of base image and once docker
starts later, query and compare the UUID of base image with the
stored one. If they don't match, fail the initialization with the
error that UUID failed to match.

That way user will be forced to cleanup /var/lib/docker/ directory
and start docker again.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-06-16 21:12:27 -04:00
Stephen J Day
b7f887a9a2 Move graph.SetupInitLayer to daemon package where it is used
An inspection of the graph package showed this function to be way out of place.
It is only depended upon by the daemon code. The function prepares a top-level
readonly layer used to provide a consistent runtime environment for docker
images.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-06-16 16:50:56 -07:00
David Calavera
ba9db62e68 Merge pull request #13685 from yuchangchun1/tag_regx
add a more accurate error description for invalid tag name
2015-06-16 16:33:17 -07:00
Mary Anthony
f9ab04ad13 First pass of updates
Working docs
Update after check
update to centos 7 after second test
Updating with hopefully correct urls
Adding thaJetzah's comments
Updating with the new images
Updating after a visual check

Signed-off-by: Mary Anthony <mary@docker.com>

Updating with comments

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-16 16:29:11 -07:00
David Calavera
b6531d4ec3 Merge pull request #13961 from unclejack/linting_changes
linting changes
2015-06-16 15:55:18 -07:00
Arnaud Porterie
cb979edec0 Fix typo in lxc_template.go
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-16 15:19:43 -07:00
Alex Samorukov
6089e679a2 Make LXC exec driver compatible with recent LXC where lxc.autodev is enabled by default
Update LXC to 1.1.2

Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
2015-06-16 15:19:00 -07:00
unclejack
2f6e4fdb29 linting changes
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-06-17 01:16:57 +03:00
Vincent Batts
e69df2589c Merge pull request #13198 from rhvgoyal/extend-docker-inspect
docker-inspect: Extend docker inspect to export image metadata related to graph driver
2015-06-16 15:03:14 -05:00
Tom Howe
6e2662b3ba just adding label to whitelist for commit command (Fixes #13738)
Signed-off-by: Tom Howe <turtlebender@gmail.com>
2015-06-16 13:59:16 -05:00
David Calavera
b1f984a29f Merge pull request #13970 from cpuguy83/13964_fix_tlsverify_env
Fix DOCKER_TLS_VERIFY being ignored
2015-06-16 10:24:41 -07:00
David Calavera
b674ae0639 Move zfs options doc to the storage section.
Zfs options belong to the storage section, but they were added under the exec driver section.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-16 10:12:00 -07:00
Jessie Frazelle
c80256a31d Merge pull request #13915 from tianon/validate-pkg
Add new "validate-pkg" bundlescript
2015-06-16 10:09:11 -07:00
Tibor Vass
952d030be2 Merge pull request #13955 from jfrazelle/update-install-script-w-experimental-gpg
add gpg fingerprint for experimental
2015-06-16 12:44:40 -04:00
Alexander Morozov
2420ef8cf1 Merge pull request #13972 from tiborvass/update-go-net
Update vendored go.net to use golang.org/x/net canonical path
2015-06-16 09:37:07 -07:00
Tibor Vass
de6e6d4b28 Merge pull request #13965 from cpuguy83/fix_windows_vfs_import
Fix circular import for windows vfs graphdriver
2015-06-16 12:32:24 -04:00
Brian Goff
5a6a33f7ac Fix DOCKER_TLS_VERIFY being ignored
DOCEKR_TLS_VERIFY was being ignored because we were just checking if the
`-tlsverify` flag was set, not the actual value, which is defaulted to
the value of `os.Getenv("DOCKER_TLS_VERIFY") != ""`

The problem that this specifically fixes is where the client has set the
`DOCKER_TLS_VERIFY` env var but is connecting to a daemon that is not
verifed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-16 12:04:00 -04:00
Tibor Vass
d820e00aac Update vendored go.net to use golang.org/x/net canonical path
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-06-16 11:40:04 -04:00
Brian Goff
49834e8d59 Fix circular import for windows vfs graphdriver
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-16 09:08:10 -04:00
moxiegirl
57aa0248af Merge pull request #13960 from yous/fix-static-file-links
Remove `sources/` under `docs` directory
2015-06-16 05:54:23 -07:00
unclejack
b68d0c6612 docs: shrink some big images
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-06-16 13:57:42 +03:00
ChaYoung You
3f4eeca68f Remove sources/ under docs directory
See #13936.

Signed-off-by: ChaYoung You <yousbe@gmail.com>
2015-06-16 19:15:48 +09:00
Don Kjer
b349a74c71 Only pulling single repository tag on pull for a specific tag. extending TestGetRemoteTags unit test
Splitting out GetRemoteTag from GetRemoteTags.  Adding registry.ErrRepoNotFound error

Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-06-16 07:10:09 +00:00
Jessica Frazelle
957622d452 add gpg fingerprint for experimental
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-15 18:49:22 -07:00
Brian Goff
9dffd032f4 Merge pull request #13950 from Microsoft/10662-vfsforreal
Windows - Really fix VFS this time
2015-06-15 21:41:12 -04:00
Jessie Frazelle
b81f2ee5f2 Merge pull request #13953 from crosbymichael/network-mtu
Get Mtu from default route
2015-06-15 17:13:44 -07:00
Michael Crosby
ff4e58ff56 Get Mtu from default route
If no Mtu value is provided to the docker daemon, get the mtu from the
default route's interface.  If there is no default route, default to a
mtu of 1500.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-15 16:33:02 -07:00
David Calavera
f48fadd05c Merge pull request #13941 from unclejack/fix_umask
docker/daemon: set umask to the default on startup
2015-06-15 16:19:38 -07:00
Jessie Frazelle
4d23f459ad Merge pull request #13947 from mavenugo/vin
Picking up missed out vendor files via hack/vendor.sh
2015-06-15 16:16:02 -07:00
Jessie Frazelle
748814a97a Merge pull request #13935 from asbjornenge/tm_syntax_updates
TM syntax updates
2015-06-15 16:12:22 -07:00
Mrunal Patel
6d022bda3b Updates libcontainer to v2.2.1
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-06-15 18:18:38 -04:00
John Howard
59cfc08982 Windows - Really fix VFS this time
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-15 15:09:48 -07:00
Antonio Murdaca
835f1c9116 Merge pull request #13547 from coolljt0725/fix_unpause_not_running_container
Correct the message of pause and unpause a non-running container
2015-06-15 23:56:32 +02:00
Josh Hawn
86d6a5b11f Merge pull request #13869 from jlhawn/multi_line_help_usage
api/client: Allow for multi-line usage help
2015-06-15 14:50:17 -07:00
Arnaud Porterie
b3b04fd85a Merge pull request #13945 from dmcgowan/distribution-store-digest-on-pull
Store layer digests on pull
2015-06-15 14:37:30 -07:00
moxiegirl
d409b05970 Merge pull request #13936 from moxiegirl/test-tooling
Updated retooling for Hugo to go out with 1.7
2015-06-15 13:57:12 -07:00
Mary Anthony
f93fee5f48 retooling for hugo
Tweaking for Hugo
Updating the Dockerfile with new sed; fix broken link on Kitematic
Fixing image pull for Dockerfile
Removing docs targets

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-15 13:19:38 -07:00
Madhu Venugopal
dcc4a14ba3 Picking up missed out vendor files via hack/vendor.sh
while wokring on another PR, I noticed that hack/vendor.sh was picking
up unrelated files. Maybe a previous update to the hack/vendor.sh failed
to run the script and push the vendor changes ?

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-15 11:38:06 -07:00
Michael Crosby
3f11e05db2 Merge pull request #13942 from calavera/fix_unshare_mount_regression
Fix regression bind mounting shared.
2015-06-15 11:25:35 -07:00
Derek McGowan
a98ea87e46 Store layer digests on pull
Currently digests are not stored on pull, causing a simple re-tag or re-push to send up all layers. Storing the digests on pull will allow subsequent pushes to the same repository to not push up content.
This does not address pushing content to a new repository. When content is pushed to a new repository, the digest will be recalculated. Since only one digest is currently stored, it may cause a new content push to the original repository.

Fixes #13883

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-06-15 11:08:21 -07:00
Vivek Goyal
407a626be6 docker-inspect: Extend docker inspect to export image/container metadata related to graph driver
Export image/container metadata stored in graph driver. Right now 3 fields
DeviceId, DeviceSize and DeviceName are being exported from devicemapper.
Other graph drivers can export fields as they see fit.

This data can be used to mount the thin device outside of docker and tools
can look into image/container and do some kind of inspection.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-06-15 14:05:10 -04:00
David Calavera
d8592eaff8 Revert "contrib/init: unshare mount namespace for inits"
This reverts commit b6569b6b82.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-15 10:35:17 -07:00
Alexander Morozov
1157fcc4a4 Merge pull request #13926 from Microsoft/10662-createfixup
Windows: Fixup compile in daemon_windows.go
2015-06-15 10:17:24 -07:00
Sebastiaan van Stijn
637023a5f8 Merge pull request #13502 from coolljt0725/conflict_port_and_netmode
Add --net=container with --publish --expose --publish-all error out
2015-06-15 16:25:59 +02:00
unclejack
6578ad90c3 docker/daemon: set umask to the default on startup
This sets up the umask so that it's the same on all systems.

Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-06-15 16:47:20 +03:00
Asbjørn Enge
dfec4a48c7 Various cleanups added to asbjornenge/Docker.tmbundle (by the TM maintainer) and support for the LABEL instruction
Docker-DCO-1.1-Signed-off-by: Asbjorn Enge <asbjorn@hanafjedle.net> (github: asbjornenge)
2015-06-15 00:04:05 +02:00
Asbjørn Enge
ac8cbf4952 Updated TextMate install instruction - this bundle is not included in TM 😄 :rocket
Docker-DCO-1.1-Signed-off-by: Asbjorn Enge <asbjorn@hanafjedle.net> (github: asbjornenge)
2015-06-15 00:02:10 +02:00
Robin Schneider
0030df868a Do not compress rootfs archive in mkimage.sh.
* This wastes CPU time for compressing and decompressing.

Signed-off-by: Robin Schneider <ypid@riseup.net>
2015-06-14 20:51:11 +02:00
moxiegirl
ee40f29712 Merge pull request #13927 from moxiegirl/carry-13250
Carry of PR #13520
2015-06-13 10:29:56 -07:00
Tibor Vass
f27c9bc6e7 Merge pull request #13895 from calavera/fix_get_env_split
Correct getEnv split.
2015-06-13 12:43:45 -04:00
Mary Anthony
cd44018856 Carry of PR #13520
Removinig files

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-13 09:27:30 -07:00
Arnaud Porterie
cd36b15ccb Merge pull request #13860 from jlhawn/cli_call_headers
api/client: have cli.call() return headers
2015-06-13 09:14:40 -07:00
John Howard
c7975f12d6 Windows: Fixup compile in daemon_windows.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-13 09:10:54 -07:00
Arnaud Porterie
261af00282 Merge pull request #13682 from mavenugo/ln_vin
Vendoring in libnetwork to 3be488927db8d719568917203deddd630a194564
2015-06-13 09:00:33 -07:00
Doug Davis
f1ea3e5c74 Merge pull request #13504 from coolljt0725/refactor_verifyhostconfig
Refactor verifyHostConfig: change to verifyConfigs and add verify config
2015-06-12 19:59:45 -07:00
Lei Jitang
b37832e353 Add verify config to verifyContainerSettings
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-06-13 09:31:19 +08:00
Arnaud Porterie
422fa7f0a6 Merge pull request #13749 from Microsoft/adduseragent
Add GOOS in User-Agent
2015-06-12 17:19:51 -07:00
Michael Crosby
39bf57e085 Merge pull request #13344 from hqhq/hq_fix_arm64_test
Fix unit-test build error on ARM64
2015-06-12 17:11:18 -07:00
Arnaud Porterie
6a7a7570bb Merge pull request #12833 from burke/faster-changes
Optimize archive.ChangesDirs on Linux
2015-06-12 17:05:34 -07:00
Madhu Venugopal
083300168f Vendoring in libnetwork to 3be488927db8d719568917203deddd630a194564
This PR brings the vendored libnetwork code to
3be488927db8d719568917203deddd630a194564, which pulls in quite a few
fixes to support kvstore, windows daemon compilation fixes,
multi-network support for Bridge driver, etc...

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-12 16:10:40 -07:00
Jessie Frazelle
cd71c5ed43 Merge pull request #13836 from amylindburg/master
Update plugins.md
2015-06-12 15:40:20 -07:00
Amy Lindburg
0a529b6e7a Update plugins.md
Fixed broken link.

Signed-off-by: Amy Lindburg <amy.lindburg@docker.com>

Update plugins.md

Some other broken links!

Signed-off-by: Amy Lindburg <amy.lindburg@docker.com>

Update plugin_api.md

FIxing broken links.

Signed-off-by: Amy Lindburg <amy.lindburg@docker.com>

Update plugins_volume.md

Fixing more links.

Signed-off-by: Amy Lindburg <amy.lindburg@docker.com>
2015-06-12 15:38:15 -07:00
David Calavera
421b9b6859 Merge pull request #13916 from Microsoft/10662-compileserver
Windows: Patch up compile after adjustCpuShares
2015-06-12 13:48:22 -07:00
John Howard
d2c5fcc8d5 Windows: Patch up compile after adjustCpuShares
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-12 13:00:59 -07:00
Tianon Gravi
9465272c28 Add new "validate-pkg" bundlescript
This helps ensure that `github.com/docker/docker/pkg/...` is actually safe to use in isolation (ie, doesn't import anything from `github.com/docker/docker` except other things from `pkg` or vendored dependencies).

Adding `github.com/docker/docker/utils` to the imports of `pkg/version/version.go`:

```
---> Making bundle: validate-pkg (in bundles/1.7.0-dev/validate-pkg)
These files import internal code: (either directly or indirectly)
 - pkg/version/version.go imports github.com/docker/docker/autogen/dockerversion
 - pkg/version/version.go imports github.com/docker/docker/utils
```

And then removing it again:

```
---> Making bundle: validate-pkg (in bundles/1.7.0-dev/validate-pkg)
Congratulations! "./pkg/..." is safely isolated from internal code.
```

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-06-12 12:28:23 -07:00
Antonio Murdaca
5bddafe169 Merge pull request #13912 from icecrime/13902_improve_test
Replace "sleep" by "top" in test implementation
2015-06-12 20:24:31 +02:00
David Calavera
e7533d7f81 Merge pull request #13494 from Microsoft/10662-vfsdriveroption
Windows: Allow VFS
2015-06-12 11:12:32 -07:00
Antonio Murdaca
27e2837c6c Merge pull request #13911 from cpuguy83/13910_fix_stats_nostream_resp
Fixes content-type/length for stats stream=false
2015-06-12 19:53:18 +02:00
Arnaud Porterie
e5b7f61f09 Replace "sleep" by "top" in test implementation
Eliminate any chance of race condition by replacing a call to sleep by a
call to top, and rely on test cleanup logic to have it exit cleanly.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-12 10:45:42 -07:00
Arnaud Porterie
2351557607 Merge pull request #13902 from ibuildthecloud/api-fixes
Set omitempty for IP and PublicPort to conform w/ API 1.18
2015-06-12 10:42:07 -07:00
Brian Goff
855a056af7 Fixes content-type/length for stats stream=false
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-12 13:06:06 -04:00
Darren Shepherd
09de92b891 Set omitempty for IP and PublicPort to conform w/ API 1.18
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-06-12 09:49:53 -07:00
John Howard
e89f837bc6 Windows: Allow VFS
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-12 09:21:17 -07:00
Arnaud Porterie
5a02d0727b Merge pull request #13899 from mavenugo/hp
Vendoring in libnetwork to fix #13873.
2015-06-12 07:27:07 -07:00
Brian Goff
c98eafe564 Merge pull request #13906 from chenchun/closed_chan
Fix send on closed channel bug
2015-06-12 09:37:53 -04:00
Brian Goff
e70d680d72 Merge pull request #13903 from dqminh/fix-cli-exec-output
TestExecStopNotHanging: log output as string
2015-06-12 09:23:45 -04:00
Madhu Venugopal
f3d1826350 Vendoring in libnetwork to fix #13873.
Libnetwork sha# e578e95aa101441481411ff1d620f343895f24fe

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-12 04:58:37 -07:00
Chun Chen
a408790de8 Fix send on closed channel bug
Signed-off-by: Chun Chen <chenchun.feed@gmail.com>
2015-06-12 15:42:34 +08:00
Daniel, Dao Quang Minh
d898372568 TestExecStopNotHanging: log output as string
When cmd failed, log its ouput as string instead of byte array to prevent test
log like: [49 53 ....] exit status 1

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
2015-06-11 22:53:55 -04:00
Arnaud Porterie
00b8fec75f Merge pull request #13773 from dmcgowan/refactor-1-image-graph-separation
refactor: separate graph from image
2015-06-11 17:44:37 -07:00
David Calavera
85f895ce68 Correct getEnv split.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-11 14:40:46 -07:00
Arnaud Porterie
71ead0ef5c Merge pull request #13722 from samuelkarp/CpuShareRemoteAPI
Adjust disallowed CpuShares in /containers/create
2015-06-11 14:20:50 -07:00
Jessie Frazelle
0de7065897 Merge pull request #13801 from bexelbie/bex_manpage_indention
Updates man page generation to use go-md2man v1.0.2
2015-06-11 14:12:17 -07:00
Jessie Frazelle
98391f0a39 Merge pull request #13890 from moxiegirl/vieux-fix
Updating with fix for first line and the vieux/amy comment on website
2015-06-11 13:22:03 -07:00
Mary Anthony
566466e714 Updating with fix for first line and the vieux/amy comment on website
Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-11 12:48:01 -07:00
Jessie Frazelle
cada9b54b5 Merge pull request #13865 from Mic92/zfs-selinux
zfs: correctly apply selinux context
2015-06-11 12:42:06 -07:00
Phil Estes
9b43f5a3a1 Split client and server cipher suite list in TLS defaults
Per @ewindisch, removing the CBC ciphers from the client preferred TLS
cipher suites.  This will allow a future version of the server to also
remove the CBC ciphers from the accepted list.

This changes the server default to client + additional CBC cipher list,
and client default to the non-CBC ciphers.

Also, cipher order preference is modified so that best and highest-bit count
ciphers are most preferred.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-06-11 14:00:31 -04:00
Jessie Frazelle
e3821feb13 Merge pull request #13783 from tianon/vendor-pruning
Add intelligent vendor pruning (via "go list")
2015-06-11 10:32:53 -07:00
Tianon Gravi
b0d748325f Update "vendor/"
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-06-11 09:59:12 -07:00
Tianon Gravi
9e4ee3dea5 Add intelligent vendor pruning (via "go list")
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-06-11 09:59:12 -07:00
Tianon Gravi
f61d595b55 Adjust "Dockerfile" to build tools we need in isolated mktemp GOPATHs
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-06-11 09:59:12 -07:00
Srini Brahmaroutu
eb97de7dee Decoder does not work properly with nested pointers using gcc
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-06-11 16:45:54 +00:00
Doug Davis
b27f960504 Merge pull request #13879 from eolamey/13878-nil-ip-opt-as-empty-string
Display empty string instead of <nil> when IP opt is nil.
2015-06-11 09:30:52 -07:00
moxiegirl
9001c4bc48 Merge pull request #13839 from eolamey/13838-fix-docs-url
Fix docs URL not using https.
2015-06-11 08:59:35 -07:00
Brian Goff
4fc6449944 Merge pull request #13861 from mrjana/cnm_integ
Vendoring libnetwork to fix stale arp cache issue
2015-06-11 09:12:34 -04:00
Eric-Olivier Lamey
9ad89281ae Display empty string instead of <nil> when IP opt is nil.
Fixes #13878.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
2015-06-11 11:14:28 +00:00
Vincent Batts
ef171afdbb Merge pull request #13590 from mountkin/fix-archive-tests
Add the parent directory to changes set if new files are generated
2015-06-11 05:12:45 -04:00
Jörg Thalheim
19c31a703f zfs: correctly apply selinux context
fixes #13858

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-06-11 11:11:37 +02:00
Brian (bex) Exelbierd
5d51118c7c Update man page Dockerfile to use go-md2man v1.0.1 and go-lang 1.4
The main Dockerfile to was updated - this update brings the
sub-directory specific file inline with it.

Fixes #12866

Signed-off-by: Brian Exelbierd <bex@pobox.com>
2015-06-11 08:36:21 +02:00
Antonio Murdaca
2b27fe17a1 Merge pull request #13862 from Microsoft/10662-fixelementsrestored
Show actual number of elements restored
2015-06-11 07:13:19 +02:00
Eric-Olivier Lamey
212dfb45de Fix docs URL not using https.
Fixes #13838.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
2015-06-11 04:50:50 +00:00
Jana Radhakrishnan
386ab25137 Vendoring libnetwork to fix stale arp cache issue
Vendoring in libnetwork 90638ec9cf7fa7b7f5d0e96b0854f136d66bff92

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-10 19:29:10 -07:00
Arnaud Porterie
883d661b69 Merge pull request #13867 from calavera/fix_daemon_cleanup_order
Cleanup driver and graph db after stopping containers.
2015-06-10 17:05:41 -07:00
David Calavera
ad9080a87c Merge pull request #13868 from jfrazelle/update-gitignore-man
update gitignore for new manpages
2015-06-10 16:55:15 -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
Josh Hawn
4cb0c93f92 api/client: Allow for multi-line usage help
Subcommands can provide multiple usage synopses.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-06-10 16:14:45 -07:00
David Calavera
0964a664e8 Cleanup driver and graph db after stopping containers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-10 16:11:50 -07:00
Jessica Frazelle
f88e620359 update gitignore for new manpages
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-10 16:11:15 -07:00
Doug Davis
466efebf0e Merge pull request #13863 from Microsoft/typoclientutils
Typo fix in api\client\utils.go
2015-06-10 15:57:37 -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
141cd2a1f2 Show actual number of elements restored
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-10 15:18:51 -07:00
David Calavera
b6049b5c49 Merge pull request #13804 from moxiegirl/proposal-man-pages
PROPOSAL: Moving man pages out of docs
2015-06-10 15:04:19 -07:00
Arnaud Porterie
9da65ed84f Merge pull request #13854 from crosbymichael/revert-shared-root
Revert shared container rootfs
2015-06-10 14:12:14 -07:00
Mary Anthony
eacae64bd8 Moving man pages out of docs
Adding in other areas per comments
Updating with comments; equalizing generating man page info
Updating with duglin's comments
Doug is right here again;fixing.

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-10 13:43:35 -07:00
Tibor Vass
add64dc297 Merge pull request #13832 from mapk0y/fix-error-msg
fix typo.
2015-06-10 16:38:07 -04:00
Brian Goff
05644ccea9 Merge pull request #13272 from Microsoft/10662-daemonrefactorv2
Windows: Refactor daemon
2015-06-10 16:28:56 -04:00
David Calavera
17324c91e3 Merge pull request #13015 from mariussturm/master
Add logging driver for GELF via UDP
2015-06-10 12:45:12 -07:00
John Howard
8fb0ca2c35 Windows: Refactor daemon
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-10 12:42:43 -07:00
Jessie Frazelle
65d0670d65 Merge pull request #13853 from jfrazelle/fix-hack-make
ugh typo in hack scripts fix, introduced by 2b4facdf
2015-06-10 11:53:47 -07:00
Michael Crosby
c9d71317be Revert shared container rootfs
This is breaking various setups where the host's rootfs is mount shared
correctly and breaks live migration with bind mounts.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-10 11:29:27 -07:00
Marius Sturm
96d06e106f add UDP GELF logging-driver
allows to send container logs to Graylog or Logstash.

Signed-off-by: Marius Sturm <marius@graylog.com>
2015-06-10 20:21:50 +02:00
Jessica Frazelle
c5f49886fa ugh typo in hack scripts fix, introduced by 2b4facdf
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-10 11:00:59 -07:00
Jessie Frazelle
12149e8293 Merge pull request #13754 from cpuguy83/13753_fix_events_64
Default events since to current time
2015-06-10 10:34:13 -07:00
Brian Goff
74c12aa429 Default events since to current time
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-10 12:37:40 -04:00
Brian Goff
88e4dff9a9 use go-generate to build volume/driver/proxy.go
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-10 11:42:15 -04:00
James Turnbull
5821f13b8c Merge pull request #13844 from ponsfrilus/master
Typo psuedo - pseudo
2015-06-10 11:41:44 -04:00
Brian Goff
4c81c9dddc generate plugin clients via template
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-10 11:41:40 -04:00
Doug Davis
46af724e81 Merge pull request #12371 from rhatdan/kill
docker kill should return error if container is not running.
2015-06-10 08:32:57 -07:00
Tibor Vass
de90aef411 Merge pull request #12813 from Microsoft/10662-nolinuxgraph
Windows: Don't build Linux graph drivers
2015-06-10 10:01:50 -04:00
Shijiang Wei
e2c6a8be7c Add the parent directory to changes set if new files are generated
The "TestChangesWithChanges" case randomlly fails on my development
VM with the following errors:
```
--- FAIL: TestChangesWithChanges (0.00s)
        changes_test.go:201: no change for expected change C /dir1/subfolder != A /dir1/subfolder/newFile
```

If I apply the following patch to changes_test.go, the test passes.

```diff
diff --git a/pkg/archive/changes_test.go b/pkg/archive/changes_test.go
index 290b2dd..ba1aca0 100644
--- a/pkg/archive/changes_test.go
+++ b/pkg/archive/changes_test.go
@@ -156,6 +156,7 @@ func TestChangesWithChanges(t *testing.T) {
        }
        defer os.RemoveAll(layer)
        createSampleDir(t, layer)
+       time.Sleep(5 * time.Millisecond)
        os.MkdirAll(path.Join(layer, "dir1/subfolder"), 0740)

        // Let's modify modtime for dir1 to be sure it's the same for the two layer (to not having false positive)
```

It seems that if a file is created immediately after the directory is created,
the `archive.Changes` function could't recognize that the parent directory of
the new file is modified.

Perhaps the problem may reproduce on machines with low time precision?
I had successfully reproduced the failure on my development VM as well as
a VM on DigitalOcean.

Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-06-10 20:29:29 +08:00
Nicolas Borboën
e12839fa5a Typo psuedo - pseudo
Signed-off-by: ponsfrilus <ponsfrilus@gmail.com>
2015-06-10 13:27:55 +02:00
Arnaud Porterie
55bdb51659 Merge pull request #13699 from calavera/volume_backwards
Allow to downgrade local volumes from > 1.7 to 1.6.
2015-06-09 19:51:06 -07:00
David Calavera
bd9814f0db Allow to downgrade local volumes from > 1.7 to 1.6.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-09 18:04:59 -07:00
Michael Crosby
4750e1f77e Merge pull request #13784 from mrjana/cnm_integ
libnetwork: Add garbage collection trigger
2015-06-09 17:24:30 -07:00
Arnaud Porterie
c3b962d327 Merge pull request #13831 from LK4D4/update_libcontainer
Update libcontainer to v2.1.1
2015-06-09 17:12:20 -07:00
Arnaud Porterie
13baeb3b70 Merge pull request #13815 from tiborvass/do-not-send-basic-auth-on-302
Do not set auth headers for registry v1 if 302
2015-06-09 15:34:53 -07:00
Jessie Frazelle
ceee2595b6 Merge pull request #12583 from Mic92/hack/explicit-bundles
Hack/explicit bundles
2015-06-09 14:34:52 -07:00
mapk0y
416e855e9b fix typo.
Signed-off-by: mapk0y <mapk0y@gmail.com>
2015-06-10 06:26:07 +09:00
Alexander Morozov
38acd31e8a Update libcontainer to v2.1.1
It includes fix for mounting / as volume on SELinux.
docker/libcontainer#619

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-09 13:54:57 -07:00
Alexander Morozov
5e86b818ed Merge pull request #13828 from calavera/plugin_fixes
Fix volume plugin serialization.
2015-06-09 13:30:55 -07:00
David Calavera
18ddc2728d Merge pull request #13805 from aboch/czo
Add integ test for unpublished ports in ps o/p
2015-06-09 11:30:06 -07:00
Alexander Morozov
06aef2b5c2 Merge pull request #13819 from Mashimiao/optimize-logic-of-get-container
daemon: cleanup getting container logic
2015-06-09 10:42:24 -07:00
David Calavera
30448166de Fix volume plugin serialization.
Unmarshal errors into strings.
Fix `omit` typos.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-09 10:39:46 -07:00
Alessandro Boch
7b9ae696d8 Add integ test for unpublished ports in ps o/p
- This is a test to assert the fix #13734

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-09 09:40:19 -07:00
Sebastiaan van Stijn
90259fed2e Merge pull request #12031 from jlhawn/build_cache_ignore_mtime
Make build cache ignore mtime
2015-06-09 18:26:07 +02:00
James Turnbull
3b01dac44d Merge pull request #13814 from duglin/DocTweak
Fix COPY/ADD quoted/json form
2015-06-09 04:56:35 -04:00
Ma Shimiao
73bc885b23 daemon: cleanup getting container logic
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-06-09 14:47:07 +08:00
Jörg Thalheim
2b4facdf2e hack: explicit bundles for integration-cli prequisites
no longer load hide critical code such as in .integration-daemon-{start,stop},
if this step failed, it will had logged the corresponding module before:

---> Making bundle: .integration-daemon-start (in bundles/1.7.0-dev/daemon-start)

which is nicer to debug.

This will make it also easier to execute a single tests in an interactive shell.

$ make shell
docker> . hack/make.sh binary .integration-daemon-start .integration-daemon-setup
docker> docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED STATUS              PORTS               NAMES
docker> go test github.com/docker/docker/integration-cli

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-06-09 07:22:26 +02:00
Alexander Morozov
7f6aa3b783 Merge pull request #13816 from xiekeyang/remove
Registry: remove unwanted return variable name
2015-06-08 20:38:30 -07:00
xiekeyang
a31be25121 Registry: remove unwanted return variable name
Signed-off-by: xiekeyang <xiekeyang@huawei.com>
2015-06-09 10:58:33 +08:00
Jessie Frazelle
5e0e71bbe0 Merge pull request #13714 from flavio/add-suse-support-to-docker-installer
Added openSUSE and SUSE Linux Enterprise support to install.sh
2015-06-08 17:20:33 -07:00
Tibor Vass
123a0582b2 Do not set auth headers if 302
This patch ensures no auth headers are set for v1 registries if there
was a 302 redirect.

This also ensures v2 does not use authTransport.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-06-08 19:59:39 -04:00
Doug Davis
f4a3e8bef0 Fix COPY/ADD quoted/json form
Minor tweak to the quoted/json form and made man page look like the Dockerfile
docs.  W/o the `,` people may think there should be a space delimited list.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-06-08 16:40:20 -07:00
Jessie Frazelle
a2ab067b3c Merge pull request #13022 from Microsoft/10662-addrsrc
Windows: Add resources for manifest and icon
2015-06-08 15:16:10 -07:00
Jessie Frazelle
75f63499a0 Merge pull request #12992 from aidanhs/aphs-easy-debug-build
Allow passing DOCKER_DEBUG= to `make`
2015-06-08 15:15:49 -07:00
John Howard
9a9dc5ba96 Windows: Don't build Linux graph drivers
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-08 15:09:33 -07:00
David Calavera
4ad05ed985 Merge pull request #13808 from Microsoft/10662-volumefixcompile
Windows: Fix PR13278 compile break
2015-06-08 15:02:47 -07:00
Tianon Gravi
969cb545ae Merge pull request #13546 from hqhq/hq_checkconfig_rescount
Don't check RESOURCE_COUNTERS in new kernel
2015-06-08 14:43:17 -07:00
Tianon Gravi
c69d3b749d Merge pull request #13790 from jfrazelle/update-authors-mailmap
update authors and mailmap
2015-06-08 14:24:32 -07:00
Josh Hawn
cd7e2a6b2b [docs] Update builder docs on last-modified times
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-06-08 13:55:02 -07:00
Josh Hawn
0e10507a1c [builder] Make build cache ignore mtime
Build cache uses pgk/tarsum to get a digest of content which is
ADD'd or COPY'd during a build. The builder has always used v0 of
the tarsum algorithm which includes mtimes however since the whole
file is hashed anyway, the mtime doesn't really provide any extra
information about whether the file has changed and many version
control tools like Git strip mtime from files when they are cloned.

This patch updates the build subsystem to use v1 of Tarsum which
explicitly ignores mtime when calculating a digest. Now ADD and
COPY will result in a cache hit if only the mtime and not the file
contents have changed.

NOTE: Tarsum is NOT a meant to be a cryptographically secure hash
function. It is a best-effort approach to determining if two sets of
filesystem content are different.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-06-08 13:54:47 -07:00
John Howard
71eadd4176 Windows: Fix PR13278 compile break
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-08 13:47:09 -07:00
Michael Crosby
b099eb796a Merge pull request #13800 from eolamey/13799-fix-docs-url-in-systemd-service-file
Fix docs URL in systemd service file.
2015-06-08 09:36:36 -07:00
Sebastiaan van Stijn
875eafb00b Merge pull request #13713 from draghuram/manport
Fix examples in "docker port" man page.
2015-06-08 17:08:37 +02:00
Raghuram Devarakonda
bf6492e689 Fix examples in "docker port" man page.
Closes #13667.

Signed-off-by: Raghuram Devarakonda <draghuram@gmail.com>
2015-06-08 10:40:24 -04:00
James Turnbull
c622ca6d4b Merge pull request #13797 from eolamey/13796-tiny-systemd-docs-improvements
Tiny improvements to systemd docs.
2015-06-08 08:57:13 -04:00
Eric-Olivier Lamey
68bfd9e3ae Tiny improvements to systemd docs.
Show how to use `systemctl show` and recommend against modifying
system unit files in `/usr` and `/lib`.

Fixes #13796.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
2015-06-08 12:05:34 +00:00
Eric-Olivier Lamey
dbf5e36fd6 Fix docs URL in systemd service file.
Fixes #13799.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
2015-06-08 10:21:43 +00:00
Alexander Morozov
a63c7c7be6 Merge pull request #13582 from coolljt0725/remove_useless_code
Cleanup: remove some useless code
2015-06-07 23:01:39 -07:00
Jana Radhakrishnan
c68e7f96f9 libnetwork: Add garbage collection trigger
When the daemon is going down trigger immediate
garbage collection of libnetwork resources deleted
like namespace path since there will be no way to
remove them when the daemon restarts.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-07 21:33:51 -07:00
Lei Jitang
67552fb22d Cleanup: remove some useless code and change verifyHostConfig to verifyContainerSetting
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-06-08 09:06:58 +08:00
Doug Davis
5d22afc54e Merge pull request #13795 from michael-k/daemonFolder
[integration-cli] Made doc consistent with code
2015-06-07 16:57:54 -04:00
Michael Käufl
54ac3d9c76 Made doc consistent with code
The name of the folder was shortened in a1ea562

Signed-off-by: Michael Käufl <docker@c.michael-kaeufl.de>
2015-06-07 22:32:29 +02:00
Doug Davis
07b22fcf50 Merge pull request #13787 from runcom/check-nil-Config
Avoid nil pointer dereference while creating a container with an empty Config
2015-06-07 12:28:41 -04:00
James Turnbull
3c37a307bc Merge pull request #13791 from eolamey/minor-docs-fixes
Fix a typo and a minor formatting issue in the docs.
2015-06-07 09:25:15 -04:00
Eric-Olivier Lamey
173d0918a8 Fix a typo and a minor formatting issue in the docs.
Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
2015-06-07 12:49:03 +00:00
Jessica Frazelle
ae68dfe31b update authors and mailmap
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-06 21:42:14 -07:00
Alexander Morozov
3d10540bc3 Merge pull request #13757 from eolamey/13755-we-would-like-default-gateway-back-please
Restore --default-gateway{,-v6} daemon options.
2015-06-06 16:02:59 -07:00
Antonio Murdaca
4ce817796e Avoid nil pointer dereference while creating a container with an empty Config
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-06 20:07:32 +02:00
James Turnbull
3c132ff62d Merge pull request #13764 from bcexelbi/bexelbie_man_typo
Fixing typo in Dockerfile manpage
2015-06-06 08:50:27 -04:00
moxiegirl
ffd74e74b1 Merge pull request #13776 from duglin/MinorVolDocEdit
Minor doc edit to add clarity around the --volume path format
2015-06-05 18:41:37 -07:00
Derek McGowan
c0b4421819 Update graph to use digest type
Update get and set functions to use digests.
Update push code to use the digest type instead of string

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-06-05 18:07:41 -07:00
Derek McGowan
bb50a4159b Update graph walkhistory to pass by value
Remove unused graph history function

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-06-05 18:06:09 -07:00
Derek McGowan
2b58b677a5 Separate graph from image
Move graph related functions in image to graph package.
Consolidating graph functionality is the first step in refactoring graph into an image store model.
Subsequent refactors will involve breaking up graph into multiple types with a strongly defined interface.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-06-05 18:06:09 -07:00
Jessie Frazelle
f20863929b Merge pull request #13778 from LK4D4/rename_file
Rename test file to have _test postfix
2015-06-05 15:43:55 -07:00
Doug Davis
3fcf53db92 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>
2015-06-05 15:11:42 -07:00
Alexander Morozov
ff9877ccc4 Rename test file to have _test postfix
Without this go test was unable to find line number of error in that
file.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-05 13:49:58 -07:00
moxiegirl
7c64ed5c8c Merge pull request #12573 from clnperez/doc-article-baseimage
Update doc with usage of the scratch image
2015-06-05 13:36:33 -07:00
Jessie Frazelle
af29aff53c Merge pull request #13772 from icecrime/13770_image_labels_to_containers
Container don't inherit from image labels
2015-06-05 13:25:34 -07:00
Christy Perez
77bd53adfe Update doc with usage of the scratch image
The scratch image used to be a regular image, but as of
commit 8936789919 it is a
special case, and cannot be used with 'docker pull.'

Update this doc to reflect the new behavior and clear up
confusion surrounding this image.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2015-06-05 14:47:03 -05:00
Arnaud Porterie
79621c7728 Container don't inherit from image labels
Labels are metadata that apply to a particular resource: image,
container, maybe volumes and networks in the future. We shouldn't have
containers inherit from its image labels: they are not the same obejcts,
and labels cannot be interpreted in the way.

It remains possible to apply metadata to an image using the LABEL
Dockerfile instruction, to query them using `docker inspect <img>`, or
to filter images on them using `docker images --filter <key>=<value>`.

Fixes #13770.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-05 11:11:22 -07:00
Jessie Frazelle
5c051e2e26 Merge pull request #13767 from duglin/TweakInNetOpts
Remove duplicate call to net.ParseIP
2015-06-05 10:46:31 -07:00
Alexander Morozov
078b8e54e4 Merge pull request #13768 from jfrazelle/fix-lxc-again-bleh
fix lxc build
2015-06-05 10:27:58 -07:00
Arnaud Porterie
efe5c64768 Merge pull request #13636 from tiborvass/refactor-tls
Refactor TLS code with a new `tlsconfig` package
2015-06-05 10:16:24 -07:00
Sebastiaan van Stijn
69c2f5649a Merge pull request #13748 from icecrime/experimental_docs
Minor changes to experimental docs
2015-06-05 19:11:51 +02:00
Jessica Frazelle
0adfb908a6 fix lxc build
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-05 09:50:30 -07:00
Doug Davis
b180de55ca Remove duplicate call to net.ParseIP
and a little cleanup

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-06-05 09:44:10 -07:00
Tibor Vass
bfed4b7cc3 Refactor TLS code with a new tlsconfig package
This patch creates a new `tlsconfig` package to handle creation of
secure-enough TLS configurations for clients and servers.

The package was created by refactoring TLS code in the client and the
daemon. After this patch, it is expected that all code creating TLS
configurations use this `tlsconfig` package for greater security,
consistency and readability.

On the server side, this fixes a bug where --tlsverify was not taken
into account. Now, if specified, it will require the client to
authenticate.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-06-05 12:38:38 -04:00
Phil Estes
edb7e84ddb Merge pull request #13751 from cpuguy83/use_closenotifier_for_logs
Fix goroutine leak on logs -f with no output
2015-06-05 11:43:47 -04:00
Brian (bex) Exelbierd
d32e01be1a Fixing typo in Dockerfile manpage
Signed-off-by: Brian Exelbierd <bex@pobox.com>
2015-06-05 16:33:11 +02:00
Sven Dowideit
159f5e0137 Merge pull request #13760 from SvenDowideit/update-dhe-docs-jun-5
Bring over DHE docs updates for publishing
2015-06-05 21:07:57 +10:00
Sven Dowideit
9ed2cb300b Bring over DHE docs updates for publishing
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-06-05 21:06:59 +10:00
Eric-Olivier Lamey
5fa60149e2 Restore --default-gateway{,-v6} daemon options.
This was added before the libnetwork merge, and then lost. Fixes #13755.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
2015-06-05 06:21:22 +00:00
Samuel Karp
ed39fbeb2a Adjust disallowed CpuShares in /containers/create
Previous versions of libcontainer allowed CpuShares that were greater
than the maximum or less than the minimum supported by the kernel, and
relied on the kernel to do the right thing. Newer libcontainer fails
after creating the container if the requested CpuShares is different
from what was actually created by the kernel, which breaks compatibility
with earlier Docker Remote API versions. This change explicitly adjusts
the requested CpuShares in API versions < 1.20.

Signed-off-by: Samuel Karp <skarp@amazon.com>
2015-06-04 17:19:39 -07:00
Jessie Frazelle
cd1a1ee972 Merge pull request #13752 from tianon/fix-release-debs
Fix release script to release _both_ .deb files
2015-06-04 16:37:59 -07:00
David Calavera
e33aeac708 Merge pull request #13640 from Microsoft/10662-implementmeminfo
Windows: Implement ReadMemInfo()
2015-06-04 16:09:24 -07:00
Tianon Gravi
4572329d4b Fix release script to release _both_ .deb files
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-06-04 16:08:12 -07:00
Antonio Murdaca
a06e0bb8b4 Merge pull request #13648 from tiborvass/print-debugtransport-to-test-output
registry: debugTransport should print with testing.T.Log
2015-06-05 00:42:22 +02:00
Brian Goff
a2602c617d Merge pull request #13684 from lizf-os/cleanup-verify-volumes-info
Cleanup Daemon.verifyVolumesInfo() a bit
2015-06-04 15:39:31 -07:00
Brian Goff
0c84604f54 Fix goroutine leak on logs -f with no output
Also noticed potential hang when only stdout or stderr are used with
follow=1

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-04 13:56:40 -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
Arnaud Porterie
b63ec6e4b1 Merge pull request #13734 from aboch/master
Fix for #13720. Unpublished ports missing in docker ps
2015-06-04 12:05:47 -07:00
John Howard
fd935ee63d Windows: Build docker.exe manifested and with icon
Signed-off-by: John Howard <John.Howard@microsoft.com>
2015-06-04 11:49:10 -07:00
Michael Crosby
b26428257f Merge pull request #13728 from calavera/copy_old_volume_content
Migrate data from old vfs paths to new local volumes path.
2015-06-04 11:14:34 -07:00
Tianon Gravi
7c2178b358 Merge pull request #13736 from SvenDowideit/double-the-double-the-lines
Tiny spelling issue in the debian control file :)
2015-06-04 11:10:55 -07:00
Alexander Morozov
cbe120db58 Merge pull request #13745 from icecrime/test_import_path
Fix kr/pty import path in test-integration-cli
2015-06-04 10:59:37 -07:00
Arnaud Porterie
d8680f7beb Remove reference to experimental release
Remove reference to experimental releases as it is really a nightly
channel rather than a scheduled release.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-04 10:33:20 -07:00
Arnaud Porterie
8352f2e264 Rename EXPERIMENTAL.md to README.md
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-04 10:32:50 -07:00
David Calavera
16a5590c5b Migrate data from old vfs paths to new local volumes path.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-04 10:16:19 -07:00
Alexander Morozov
9069cded57 Merge pull request #13586 from kvasdopil/zfs-88chars
Avoid 88-chars mountpoint length limit on freebsd
2015-06-04 10:05:01 -07:00
David Calavera
2c09dbb7dd Merge pull request #13733 from lizf-os/discovery-test-remove-tmpdir
Don't forget to clenaup tmpdir in TestFileSpecPlugin()
2015-06-04 09:21:53 -07:00
moxiegirl
4efedb3fba Merge pull request #13716 from moxiegirl/move-experimental
Moving experimental
2015-06-04 09:11:00 -07:00
Arnaud Porterie
9ec5e4f7df Fix kr/pty import path
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-04 09:02:14 -07:00
Zefan Li
d31224743b Don't forget to clenaup tmpdir in TestFileSpecPlugin()
Also remove redundant code.

Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-06-04 21:26:15 +08:00
Sven Dowideit
318defe1de Tiny spelling issue in the debian control file :)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-06-04 18:16:24 +10:00
Alessandro Boch
ea180a73bc Fix for #13720
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-03 23:39:27 -07:00
Jessie Frazelle
ef3e956aa2 Merge pull request #13704 from tianon/build-utc
Swap build-* to use UTC instead of local time
2015-06-03 22:05:09 -07:00
Arnaud Porterie
57bba29f79 Merge pull request #13732 from mavenugo/netdisabled
Using container NetworkDisabled to fix #13725
2015-06-03 21:40:15 -07:00
Madhu Venugopal
83208a531d Using container NetworkDisabled to fix #13725
container.config.NetworkDisabled is set for both daemon's
DisableNetwork and --networking=false case. Hence using
this flag instead to fix #13725.

There is an existing integration-test to catch this issue,
but it is working for the wrong reasons.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-03 17:31:22 -07:00
Arnaud Porterie
f37e6e180f Merge pull request #13731 from jfrazelle/fix-version-on-old-versions
fix version struct on old versions
2015-06-03 17:24:53 -07:00
Jessie Frazelle
fdd6175bca Merge pull request #13718 from runcom/fix-containers-json
SizeRW & SizeRootFs omitted if empty in /container/json call
2015-06-03 17:14:58 -07:00
Jessica Frazelle
229b599259 fix version struct on old versions
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-03 16:56:50 -07:00
Arnaud Porterie
babf751e1b Merge pull request #13715 from LK4D4/update_logrus
Update github.com/Sirupsen/logrus to 0.8.2
2015-06-03 14:24:37 -07:00
Jessie Frazelle
ca66419522 Merge pull request #13709 from jfrazelle/update-url
Update urls from .com to .org.
2015-06-03 14:21:38 -07:00
Antonio Murdaca
6945ac2d02 SizeRW & SizeRootFs omitted if empty in /container/json call
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-03 23:13:56 +02:00
Arnaud Porterie
ad56d797d3 Merge pull request #13712 from LK4D4/fix_leak_events
Support CloseNotifier for events
2015-06-03 13:43:39 -07:00
Mary Anthony
95dfc4c4a5 Moving experimental
Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-03 13:43:27 -07:00
Jessica Frazelle
7943bce894 Update urls from .com to .org.
I added 301 redirects from dockerproject.com to dockerproject.org but may as
well make sure everything is updated anyways.

Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-03 13:28:47 -07:00
Alexander Morozov
fa020341e4 Update github.com/Sirupsen/logrus to 0.8.2
Fix #13708

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-03 13:22:56 -07:00
Antonio Murdaca
f18ce101fb Merge pull request #13165 from ahmetalpbalkan/durations
Allow duration strings as --since/--until
2015-06-03 22:14:42 +02:00
Flavio Castelli
d0c4c7c83f Added openSUSE and SUSE Linux Enterprise support to install.sh
Handle docker installation on openSUSE and SUSE Linux Enterprise
via https://get.docker.io/

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2015-06-03 21:56:27 +02:00
Arnaud Porterie
a29633f687 Merge pull request #13703 from runcom/13691-container-ps-regression
Do not omit empty json field in /containers/json api response
2015-06-03 12:30:12 -07:00
Sebastiaan van Stijn
b30121984e Merge pull request #13702 from BenSeverson/patch-1
quick doc fix for windows versions
2015-06-03 21:24:13 +02:00
David Calavera
c962f53a3e Merge pull request #13645 from calavera/fix_stats_flaky_test
Fix stats flaky test.
2015-06-03 12:05:43 -07:00
Alexander Morozov
9e7fc245a7 Support CloseNotifier for events
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-03 11:42:51 -07:00
Ben Severson
a448b7aff2 quick doc fix for windows versions
Signed-off-by: Ben Severson <BenSeverson@users.noreply.github.com>
2015-06-03 10:28:11 -07:00
Tianon Gravi
aa54a93f74 Swap build-* to use UTC instead of local time
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-06-03 09:56:46 -07:00
Alexander Morozov
521926f6c4 Merge pull request #13231 from Microsoft/10662-chrootarchive
Windows: chrootarchive refactor
2015-06-03 09:54:42 -07:00
Antonio Murdaca
725f34151c Do not omit empty json field in /containers/json api response
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-03 18:53:40 +02:00
Sebastiaan van Stijn
0636bb7b73 Merge pull request #13672 from LK4D4/syslog_tag
Add syslog-tag option
2015-06-03 17:04:59 +02:00
moxiegirl
641f3e0932 Merge pull request #13205 from hqhq/hq_fix_ipforward_doc
Add docs for ip-forward
2015-06-03 07:50:19 -07:00
Antonio Murdaca
f03daf29dc Merge pull request #13696 from hqhq/hq_add_comment_inspect
Add comment about inspect output
2015-06-03 13:36:00 +02:00
Qiang Huang
01a9a9284f Add comment about inspect output
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-06-03 17:35:57 +08:00
Qiang Huang
8bfc8102be Don't check RESOURCE_COUNTERS in new kernel
Closes: #13543

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-06-03 17:26:39 +08:00
Qiang Huang
85fffe1341 Add docs for ip-forward
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-06-03 16:37:40 +08:00
Matt Moore
bd2575cc4f Make the v2 logic fallback on v1 when v2 requests cannot be authorized.
Signed-off-by: Matt Moore <mattmoor@google.com>
2015-06-02 21:22:59 -07:00
Jessie Frazelle
63823cd6c1 Merge pull request #13683 from crosbymichael/nat-test-fixes
Fix nat integration tests
2015-06-02 18:54:17 -07:00
yuchangchun
e0475d331b add a more accurate error description for invalid tag name
Signed-off-by: yuchangchun <yuchangchun1@huawei.com>
2015-06-03 09:38:39 +08:00
Michael Crosby
4f42097883 Fix nat integration tests
This removes complexity of current implementation and makes the test
correct and assert the right things.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-02 18:21:16 -07:00
Zefan Li
8b4c0decfc Cleanup Daemon.verifyVolumesInfo() a bit
vols.VolumesRW has been initialized so it can't be nil. Furthermore
it's ok to read a nil map.

Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-06-03 09:19:16 +08:00
Jessie Frazelle
25376c652d Merge pull request #13679 from icecrime/update_vendoring
Update vendoring
2015-06-02 17:41:48 -07:00
Arnaud Porterie
1664d6cd66 Update vendoring
Update libnetwork to 005bc475ee49a36ef2ad9c112d1b5ccdaba277d4
Synchronize changes to distribution (was missing _test.go file)

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-02 16:41:02 -07:00
David Calavera
af09b06dfa Merge pull request #13675 from runcom/13663-config-regression
Expose old config field for api < 1.19
2015-06-02 15:23:51 -07:00
Antonio Murdaca
6deaa58ba5 Expose old config field for api < 1.19
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-06-02 23:37:59 +02:00
David Calavera
6c42b3947a Merge pull request #12838 from fntlnz/test-cmd
Using dockerCmd when possible
2015-06-02 14:12:22 -07:00
Alexander Morozov
3f26066425 Merge pull request #13591 from kvasdopil/update-go-zfs
Update go-zfs to last version
2015-06-02 14:05:29 -07:00
Ahmet Alp Balkan
4e3b21f99e Allow duration strings as --since/--until
Fixes #13107. This change enables Go duration strings
computed relative to the client machine’s time to be used
as input parameters to `docker events --since/--until`
and `docker logs --since` arguments.

Added unit tests for pkg/timeutils.GetTimestamp as well.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-06-02 21:02:47 +00:00
Doug Davis
da255ec962 Merge pull request #13661 from vdemeester/pkg-jsonmessage-test-coverage
Add test coverage to pkg/jsonmessage
2015-06-02 16:54:50 -04:00
Sebastiaan van Stijn
7e8639a9df Merge pull request #13671 from moxiegirl/carry-13147-fix
Tweaking text identified in PR #13147
2015-06-02 21:48:47 +02:00
Alexander Morozov
3df19749d4 Wrap lines for journald docs
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-02 12:46:51 -07:00
Mary Anthony
cb4af853f6 Tweaking text identified in PR #13147
Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-02 12:44:47 -07:00
Alexander Morozov
8979fe4d8a Change address to syslog-address in syslog docs
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-02 12:44:23 -07:00
Alexander Morozov
a81af2e26a Add syslog-tag option for syslog log-driver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-02 12:43:00 -07:00
Vincent Demeester
e6bd8c1e19 Add test coverage to pkg/jsonmessage
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-06-02 21:19:38 +02:00
Phil Estes
63b5d5fadc Merge pull request #13668 from calavera/bump_libnetwork
Bump libnetwork for 1.7 release.
2015-06-02 15:04:38 -04:00
David Calavera
ad244668c3 Update libnetwork to 4ded6fe3641b71863cc5985652930ce40efc3af4
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-02 11:30:36 -07:00
Phil Estes
278798236b Merge pull request #13650 from jvgogh/master
Upon HTTP 302 redirect do not include "Authorization" header on 'untr…
2015-06-02 14:23:20 -04:00
Arnaud Porterie
274baf70bf Merge pull request #13576 from stevvooe/verify-digests
Properly verify manifests and layer digests on pull
2015-06-02 11:16:23 -07:00
Jessie Frazelle
7d33bc0bec Merge pull request #13656 from lizf-os/13641-skip-test-on-lxc
test: Skip TestDevicePermissions on lxc
2015-06-02 11:05:22 -07:00
David Calavera
ad41efd9a2 Bump libnetwork for 1.7 release.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-02 11:00:54 -07:00
David Calavera
814a92c5a1 Merge pull request #13607 from vieux/PrintfIfNotEmpty
do not print empty values in docker info
2015-06-02 10:52:45 -07:00
Sebastiaan van Stijn
bdb6fad34c Merge pull request #13654 from porjo/netipv6
Networking docs: add reference to ndppd
2015-06-02 19:06:17 +02:00
Arnaud Porterie
2de2782fe8 Merge pull request #13666 from runcom/13665-kill-signal-wrong-handled
Fix wrong kill signal parsing
2015-06-02 09:40:55 -07:00
Alexander Morozov
9f098cabfc Merge pull request #13664 from runcom/dead-code
Remove old struct
2015-06-02 09:37:55 -07:00
Sebastiaan van Stijn
fbadf11d20 Merge pull request #13633 from ZJU-SEL/fix-doc
fix typo.
2015-06-02 18:36:52 +02:00
Antonio Murdaca
39eec4c25b Fix wrong kill signal parsing
Signed-off-by: Antonio Murdaca <antonio.murdaca@gmail.com>
2015-06-02 18:01:19 +02:00
Vincent Batts
d13af493f8 Merge pull request #13630 from vdemeester/pkg-tarsum-test-coverage
Add test coverage for pkg/tarsum
2015-06-02 11:44:42 -04:00
Phil Estes
8a11b40fea Merge pull request #13553 from Microsoft/10662-revert908db
Windows: Undo 908db518 for Windows daemon
2015-06-02 10:22:39 -04:00
Antonio Murdaca
da1a77defd Remove old struct
Signed-off-by: Antonio Murdaca <antonio.murdaca@gmail.com>
2015-06-02 16:10:39 +02:00
James Turnbull
879f0fb338 Merge pull request #13657 from chriswahl/patch-1
Corrected VMWare to VMware
2015-06-02 07:41:25 -04:00
Alexey Guskov
ea5ce27564 update go-zfs to last version
Signed-off-by: Alexey Guskov <lexag@mail.ru>
2015-06-02 10:37:38 +03:00
Vincent Demeester
25f7d7822d Add test coverage for pkg/tarsum
And removing unused code.
- tarsum.go :
  NewTarSumHash could be non exported (for now)
  NewTarSumForLabel is never used, except for the tests
- fileinfosums.go:
  SortByPos is never used, except for the tests
- versionning.go:
  GetVersions is never used, expect for the tests

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-06-02 09:08:01 +02:00
Ian Bishop
b1a1cff368 Networking docs: add reference to ndppd
Signed-off-by: Ian Bishop <ianbishop@pace7.com>
2015-06-02 15:56:24 +10:00
Chris Wahl
55cea4952b Corrected VMWare to VMware
Corrected spelling of VMware.

Signed-off-by: Chris Wahl <github@wahlnetwork.com>
2015-06-01 22:34:43 -05:00
Zefan Li
e55649192e test: Skip TestDevicePermissions on lxc
Closes: #13641

Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-06-02 10:27:54 +08:00
He Simei
0d72772c37 fix typo.
Signed-off-by: He Simei <hesimei@zju.edu.cn>
2015-06-02 09:44:52 +08:00
Tibor Vass
1f903f652c Merge pull request #13651 from RichardScothern/v1-mirror-fix
Fallback to pull from hub if mirrors unavailable.
2015-06-01 21:09:54 -04:00
moxiegirl
cd79751cfa Merge pull request #13644 from mchiang0610/patch-1
Fix - Download button does not download
2015-06-01 17:33:38 -07:00
Arnaud Porterie
05b1d02423 Merge pull request #13609 from Microsoft/10662-refixserverwindows
Windows: Fix windows to match linux after compile break
2015-06-01 17:03:13 -07:00
Jeffrey van Gogh
65c5105fcc Upon HTTP 302 redirect do not include "Authorization" header on 'untrusted' registries.
Refactoring in Docker 1.7 changed the behavior to add this header where as Docker <= 1.6 wouldn't emit this Header on a HTTP 302 redirect.

This closes #13649

Signed-off-by: Jeffrey van Gogh <jvg@google.com>
2015-06-01 16:12:56 -07:00
Jessie Frazelle
aa8d8fdc0c Merge pull request #13611 from duglin/Issue13417a
Allow .dockerignore to ignore everything
2015-06-01 15:59:57 -07:00
Jessie Frazelle
1f472c3768 Merge pull request #13536 from Mic92/master
remove redundant mount/unmount calls on commit
2015-06-01 15:57:14 -07:00
Jessie Frazelle
f358b39521 Merge pull request #13597 from sanketsaurav/master
Proposing Bose, Raman and Ramanujan
2015-06-01 15:56:16 -07:00
Richard
6e4ff1bb13 If no endpoint could be established with the given mirror configuration,
fallback to pulling from the hub as per v1 behavior.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-06-01 15:18:56 -07:00
Victor Vieux
c790aa36ea no not print empty keys in docker info
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-06-01 15:05:20 -07:00
Tibor Vass
78bc233a01 registry: debugTransport should print with testing.T.Log
It should not print to STDOUT so that it only prints the debugTransport
output if there was an error in one of the registry tests.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-06-01 17:48:30 -04:00
Jessie Frazelle
488c355d94 Merge pull request #13643 from LK4D4/fix_registry_race
Fix race condition in registry/session
2015-06-01 14:44:12 -07:00
David Calavera
4fde1cb695 Fix stats flaky test.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-01 14:05:26 -07:00
Alexander Morozov
b7101d528d Merge pull request #13638 from icecrime/maintainers_add_calavera
Add @calavera to maintainers
2015-06-01 14:05:12 -07:00
Alexander Morozov
cd80a61cc1 Merge pull request #13443 from duglin/CleanupEvents
Cleanup container LogEvent calls
2015-06-01 14:04:33 -07:00
Michael Chiang
5606f32eec Fix - Download button does not download
Fix - Download button does not download

Users got confused when Kitematic is not being downloaded after clicking on the download button, and instead got brought to a screen to teach them how to download Kitematic.

The additional step caused a significant drop in Kitematic downloads. This pull request fixes the issue, to allow users to directly download Kitematic after clicking on the Download button. 

Signed-off-by: Michael Chiang <michael.chiang@docker.com>
2015-06-01 13:29:44 -07:00
Alexander Morozov
9d98c28855 Fix race condition in registry/session
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-01 13:25:18 -07:00
David Calavera
64a7431663 Merge pull request #13639 from tonistiigi/fix-git-escape
Make sure git remote subdirs don't escape git root
2015-06-01 13:04:39 -07:00
Stephen J Day
84413be3c9 Break down loadManifest function into constituent parts
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-06-01 13:02:50 -07:00
Phil Estes
71d960d455 Merge pull request #13557 from ewindisch/apparmor-unshare-priv
Expand unshare test to include privileged test
2015-06-01 15:43:37 -04:00
John Howard
22b195f241 Windows: Implement ReadMemInfo()
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-01 12:40:33 -07:00
Doug Davis
8232312c1e Cleanup container LogEvent calls
Move some calls to container.LogEvent down lower so that there's
less of a chance of them being missed. Also add a few more events
that appear to have been missed.

Added testcases for new events: commit, copy, resize, attach, rename, top

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-06-01 12:39:28 -07:00
Tonis Tiigi
7f7ebeffe8 Fix breakouts from git root during build
Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com>
2015-06-01 22:10:55 +03:00
Arnaud Porterie
62afcbc6d4 Add @calavera to maintainers
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-01 12:02:12 -07:00
Alexander Morozov
24fbcffeac Merge pull request #13560 from Microsoft/10662-statscollector
Windows: Factor out stat collector
2015-06-01 11:39:19 -07:00
Brian Goff
d156bc9dd4 Merge pull request #13637 from LK4D4/remove_debug
Remove useless debug message
2015-06-01 11:38:05 -07:00
Alexander Morozov
f1b59d64d2 Remove useless debug message
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-01 11:15:15 -07:00
Brian Goff
a7005c44b5 Merge pull request #13320 from coolljt0725/add_stats_no_stream_show_cpu_usage
Add docker stats --no-stream show cpu usage
2015-06-01 09:40:04 -07:00
David Calavera
6fb454b9f0 Merge pull request #13464 from davidrjenni/10184-fix-auto-created-devices
Fixes issue #10184.
2015-06-01 09:30:04 -07:00
Phil Estes
d37aad170f Merge pull request #13568 from jfrazelle/fix-release-script-for-experimental
fix release script for experimental
2015-06-01 12:29:45 -04:00
moxiegirl
7c190b9556 Merge pull request #13523 from moxiegirl/carry-12572-fix
Updating after the pr went through
2015-06-01 09:21:12 -07:00
Mary Anthony
3ce2797541 Updating after the pr went through
Updating with comments.

Signed-off-by: Mary Anthony <mary@docker.com>
2015-06-01 09:20:31 -07:00
John Howard
68c879406b Windows: Factor out stat collector
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-01 09:11:03 -07:00
Sebastiaan van Stijn
09bfbfd74e Merge pull request #13615 from gesellix/docs-container-create-start
indicate HostConfig to be used for "create container"
2015-06-01 17:46:32 +02:00
Brian Goff
b445004364 Merge pull request #13390 from mrjana/cnm_integ
Do not attempt releasing network when not attached to any network
2015-06-01 08:25:20 -07:00
Tobias Gesellchen
16e649c589 indicate HostConfig to be used for "create container"
Closes #13614

Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
2015-06-01 07:04:41 +02:00
Sven Dowideit
4caa9392f8 Merge pull request #13622 from jogo/spelling
Fix spelling mistakes in documentation
2015-06-01 11:37:48 +10:00
Joe Gordon
3d87b80b46 Fix spelling mistakes in documentation
While reading  some of the docs I noticed a few errors, so I ran
misspellings (https://pypi.python.org/pypi/misspellings) on markdown files

Signed-off-by: Joe Gordon <joe.gordon0@gmail.com>
2015-05-31 11:53:23 -07:00
moxiegirl
093f57a261 Merge pull request #13460 from moxiegirl/add-created-state-diagram
Updating event diagram with the created state. Cool, thank you.
2015-05-30 19:47:24 -07:00
Jessie Frazelle
0ea14e5c6d Merge pull request #13603 from tianon/consistent-dest
Make "DEST" a make.sh construct instead of ad-hoc
2015-05-30 16:42:10 -07:00
James Turnbull
73683e807d Merge pull request #13616 from konstruktoid/docs_openssl
Docs: sha256 and 4096 when using openssl
2015-05-30 19:20:21 -04:00
Thomas Sjögren
5cd64cb93f aes256 and 4096 bits
squashing down to a single commit and change back to cert.pem

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2015-05-31 01:05:49 +02:00
Lei Jitang
20927ffbe7 Correct the error message of pause and unpause non-running container
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-31 03:32:29 +08:00
Aidan Hobson Sayers
a121ac858e Restore DEBUG as DOCKER_DEBUG (removed in #10665), add as make variable
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
2015-05-30 19:37:36 +01:00
Tianon Gravi
ac3388367b Make "DEST" a make.sh construct instead of ad-hoc
Using "DEST" for our build artifacts inside individual bundlescripts was already well-established convention, but this officializes it by having `make.sh` itself set the variable and create the directory, also handling CYGWIN oddities in a single central place (instead of letting them spread outward from `hack/make/binary` like was definitely on their roadmap, whether they knew it or not; sneaky oddities).

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-30 11:16:43 -07:00
Sebastiaan van Stijn
f2154a5a6b Merge pull request #13367 from duglin/Issue13353
Add a "Created" state for new containers that haven't been run yet
2015-05-30 19:49:38 +02:00
Lei Jitang
96123a1fd5 Add docker stats --no-stream show cpu usage
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-31 01:25:51 +08:00
Doug Davis
dc697b1c9f Add a "Created" state for new containers that haven't been run yet
Closes #13353

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-30 07:48:46 -07:00
Sebastiaan van Stijn
279c877451 Merge pull request #13580 from vdemeester/update-api-commit
Update api documentation to add labels in commit
2015-05-30 14:44:05 +02:00
James Turnbull
18c11dc264 Merge pull request #13612 from duglin/DocsNewLine
Premature newline insertions
2015-05-30 08:33:46 -04:00
Doug Davis
e51b311129 Premature newline insertions
Noticed that there were a few newlines in the middle of a \`...\` blocks that
made the text look funny when displayed in HTML.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-30 04:46:24 -07:00
Doug Davis
82ea6ed2bc Allow .dockerignore to ignore everything
Change CLI error msg because it was too specific and didn't make sense
when there were errors not related to inaccessible files.

Removed some log.Error() calls since they're not really errors we should
log. Returning the error will be enough.

Closes: #13417

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-30 04:16:00 -07:00
Vincent Demeester
c61fa8471a Update api documentation to add labels in commit
It is already possible to set labels at commit when using the API. But
it is not present in the API documentation. Added an integration test
too, to validate this work (and will be in the future).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-05-30 11:31:51 +02:00
David R. Jenni
c913c9921b Fix issue #10184.
Merge user specified devices correctly with default devices.
Otherwise the user specified devices end up without permissions.

Signed-off-by: David R. Jenni <david.r.jenni@gmail.com>
2015-05-30 11:09:47 +02:00
John Howard
2b7569ccc3 Windows: Refix server_windows to match linux
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-29 21:25:27 -07:00
David Calavera
04c6f09fbd Merge pull request #12400 from coolljt0725/kill_all_containers_on_daemon_shutdown
Ensure all the running containers are killed on daemon shutdown
2015-05-29 16:45:57 -07:00
Stephen J Day
74528be903 Add tests for loadManifest digest verification
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-05-29 16:30:21 -07:00
Sebastiaan van Stijn
1613897d2d Merge pull request #13561 from icecrime/warn_overlay_docs
Add note about overlay not being production ready
2015-05-30 01:24:02 +02:00
Sanket Saurav
a18c0b3b3c Proposing Bose, Raman and Ramanujan
Signed-off-by: Sanket Saurav <sanketsaurav@gmail.com>
2015-05-30 04:14:11 +05:30
Jessie Frazelle
3aa4a3a0c5 Merge pull request #13606 from runcom/revert-doc-in-api-1-19
Revert api doc for 1.19 about PortSpecs removal
2015-05-29 15:42:56 -07:00
Antonio Murdaca
c42ede311b Revert api doc for 1.19 about PortSpecs removal
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-30 00:32:03 +02:00
Stephen J Day
1e653ab645 Attempt to retain tagging behavior
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-05-29 15:20:37 -07:00
Stephen J Day
06612cc0fe Properly verify manifests and layer digests on pull
To ensure manifest integrity when pulling by digest, this changeset ensures
that not only the remote digest provided by the registry is verified but also
that the digest provided on the command line is checked, as well. If this check
fails, the pull is cancelled as with an error. Inspection also should that
while layers were being verified against their digests, the error was being
treated as tech preview image signing verification error. This, in fact, is not
a tech preview and opens up the docker daemon to man in the middle attacks that
can be avoided with the v2 registry protocol.

As a matter of cleanliness, the digest package from the distribution project
has been updated to latest version. There were some recent improvements in the
digest package.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-05-29 15:20:28 -07:00
David Calavera
eaa9c1b97e Merge pull request #13596 from jfrazelle/11414-fix-once-and-for-all
fix bug with rmi multiple tag
2015-05-29 15:10:22 -07:00
David Calavera
4389fc8bf9 Merge pull request #13425 from runcom/13421-stats-default-stream
Fix regression in stats API endpoint
2015-05-29 15:05:21 -07:00
Antonio Murdaca
d79654d0f6 Merge pull request #13567 from draghuram/apiver
Make the version mismatch message more explicit.
2015-05-29 23:39:48 +02:00
Jessie Frazelle
d96ca04f24 Merge pull request #13601 from tianon/precise
Finally add precise/12.04 as a build-deb target
2015-05-29 14:35:07 -07:00
David Calavera
ec167972bf Merge pull request #13446 from runcom/remove-PortSpecs
Remove PortSpecs from Config
2015-05-29 14:31:48 -07:00
Jessie Frazelle
4d9191e15d Merge pull request #13604 from tianon/vim-embedded-shell
Add embedded shell script highlight to vim syntax
2015-05-29 14:17:07 -07:00
Jessie Frazelle
e2524d8ace Merge pull request #13605 from tianon/vim-dockerfile
Adjust vim ftdetect to match "Dockerfile", "dockerfile", and "Dockerfile.*" which are all reasonably safe to assume "this is a Dockerfile"
2015-05-29 14:16:50 -07:00
Jessie Frazelle
a39de41871 Merge pull request #13527 from duglin/FixImagesPrefixNotFound
Fix error when trying to delete an image due to a bad container
2015-05-29 14:09:26 -07:00
Jessica Frazelle
185f392691 fix bug with rmi multiple tag
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-29 14:04:06 -07:00
Phil Estes
1680c78e63 Merge pull request #13577 from WeiZhang555/httpClose
bug fix: close http response body no longer in use
2015-05-29 16:59:17 -04:00
Phil Estes
8d726709ad Merge pull request #13578 from WeiZhang555/errRet
return error when failed to read http response body
2015-05-29 16:57:27 -04:00
Arnaud Porterie
67cb748e26 Add note about overlay not being production ready
Add a paragraph in cli.md mentioning that overlay is not a production
ready graphdriver.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-29 13:53:09 -07:00
Tianon Gravi
e02744404d Adjust vim ftdetect to match "Dockerfile", "dockerfile", and "Dockerfile.*" which are all reasonably safe to assume "this is a Dockerfile"
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-29 13:46:51 -07:00
Tianon Gravi
62d3b1bf2e Add embedded shell script highlight to vim syntax
This highlights `RUN`, `CMD`, and `ENTRYPOINT` lines using shell highlighting.  It doesn't bother detecting the JSON forms, but that's OK because JSON arrays highlight pretty reasonably with shell highlights. :)

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-29 13:39:37 -07:00
Antonio Murdaca
ec97f41465 Fix regression in stats API endpoint where stream query param default is true
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-29 22:38:36 +02:00
Alexander Morozov
3b831a2f3a Merge pull request #13589 from vdemeester/pkg-stringutils-test-coverage
Add test coverage for pkg/stringutils
2015-05-29 13:38:12 -07:00
Antonio Murdaca
15134a3320 Remove PortSpecs from Config
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-29 22:38:09 +02:00
Alexander Morozov
c42810fe99 Merge pull request #13564 from burke/fix-memory-leak
Use bufio.Reader instead of bufio.Scanner for logger.Copier
2015-05-29 13:37:15 -07:00
Alexander Morozov
04a451998f Merge pull request #13255 from vdemeester/11588-pkg-pools-test-coverage
Add test coverage for pkg/pools (#11588)
2015-05-29 13:36:20 -07:00
David Calavera
4c9fd72a91 Merge pull request #13598 from calavera/fix_windows_build
Do not require cgroups capabilities on windows to run the integration tests.
2015-05-29 12:57:40 -07:00
Tianon Gravi
98180b8954 Finally add precise/12.04 as a build-deb target
Ubuntu Precise has a number of warts that made it non-trivial to add initially, but I've managed to work through some of them and come up with a working build.  Two important parts to note are that it has neither the `btrfs` nor the `devicemapper` graphdriver backends since `btrfs-tools` and `libdevmapper-dev` in the precise repositories are too ancient for them to even compile.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-29 12:55:58 -07:00
Jessie Frazelle
b21ef2d1d3 Merge pull request #13581 from s7v7nislands/fix_lxc_url
update lxc url
2015-05-29 11:48:44 -07:00
David Calavera
a914101296 Do not require cgroups capabilities on windows to run the integration tests.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-29 11:42:40 -07:00
Alexander Morozov
6d8e517bce Merge pull request #13482 from boucher/criu-libcontainer-update
Update vendored libcontainer
2015-05-29 10:28:58 -07:00
David Calavera
f1fed87fc0 Merge pull request #13392 from runcom/syslog-connection-url-log-opt
Add syslog-address log-opt
2015-05-29 10:21:57 -07:00
Jessica Frazelle
b372f9f224 fix experimental version and release script
add api version experimental

Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-29 10:00:22 -07:00
Tianon Gravi
24d9edd8d1 Merge pull request #13585 from albers/completion-1.7
Update bash completion for 1.7.0
2015-05-29 09:43:44 -07:00
Burke Libbey
f779cfc5d8 Use bufio.Reader instead of bufio.Scanner for logger.Copier
When using a scanner, log lines over 64K will crash the Copier with
bufio.ErrTooLong. Subsequently, the ioutils.bufReader will grow without
bound as the logs are no longer being flushed to disk.

Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2015-05-29 12:29:42 -04:00
moxiegirl
87d36079a7 Merge pull request #13574 from anchal-agrawal/13345-fix-mac-install-docs
Fixing Mac Boot2Docker installation doc  Your fix has left the building.
2015-05-29 09:13:04 -07:00
Brian Goff
00b8d37084 Merge pull request #13563 from calavera/fix_bind_mount_regression
Mount bind volumes coming from the old volumes configuration.
2015-05-29 11:13:33 -04:00
Vincent Demeester
6c36572e8b Add test coverage for pkg/stringutils
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-05-29 15:49:29 +02:00
Doug Davis
34342e9cef Merge pull request #13583 from vdemeester/pkg-timeutils-test-coverage
Add test coverage to pkg/timeutils
2015-05-29 09:35:34 -04:00
Alexey Guskov
112b7e6546 avoid 88-chars mountpoint length limit on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
2015-05-29 16:33:04 +03:00
moxiegirl
059dc15ab9 Merge pull request #12773 from HuKeping/update-docs
Fix inconsistent of remote API and document
2015-05-29 06:27:15 -07:00
Hu Keping
22fda380a9 Fix inconsistent of remote API and document
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-05-29 22:56:35 +08:00
Vincent Demeester
9aa8a590b7 Add test coverage to pkg/timeutils
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-05-29 15:09:35 +02:00
Harald Albers
b2832dffe5 Update bash completion for 1.7.0
Signed-off-by: Harald Albers <github@albersweb.de>
2015-05-29 12:42:59 +02:00
XiaoBing Jiang
2b69b326bc update lxc url
Signed-off-by: XiaoBing Jiang <s7v7nislands@gmail.com>
2015-05-29 16:10:57 +08:00
Zhang Wei
de225b5d13 return error when failed to read http response body
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-05-29 12:52:51 +08:00
Zhang Wei
6c49576a86 bug fix: close http response body no longer in use
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-05-29 12:03:40 +08:00
Anchal Agrawal
27ffccf540 Fixing Mac Boot2Docker installation doc
Signed-off-by: Anchal Agrawal <aagrawa4@illinois.edu>
2015-05-28 22:53:54 -05:00
Jessie Frazelle
7f6a7973cd Merge pull request #13566 from jfrazelle/fix-lxc-tests
skip test on lxc
2015-05-28 16:19:21 -07:00
Jessie Frazelle
fcdea09ea5 Merge pull request #13530 from jfrazelle/bump-api-version
bump api version to 1.20
2015-05-28 16:14:30 -07:00
David Calavera
7317b84ce0 Merge pull request #13558 from calavera/doc_ulimit
Add comment about ulimit format.
2015-05-28 15:51:06 -07:00
Antonio Murdaca
e8c88d2533 Add syslog-address log-opt
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-29 00:42:11 +02:00
Jessica Frazelle
e76d0f5571 bump api version to 1.20
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-28 15:32:05 -07:00
moxiegirl
742a8a6cff Merge pull request #13562 from moxiegirl/fixes-to-119-api
Fixes to the 1.19 version Thank you @thaJeztah and @jfrazelle!
2015-05-28 15:25:08 -07:00
Raghuram Devarakonda
7b6f9da52c Make the version mismatch message more explicit.
Signed-off-by: Raghuram Devarakonda <draghuram@gmail.com>
2015-05-28 17:54:48 -04:00
Jessica Frazelle
1392f99a97 skip test on lxc
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-28 14:54:12 -07:00
Mary Anthony
30901609a8 Fixes to the 1.19 version
updating with changes to this instant
Signed-off-by: Mary Anthony <mary@docker.com>
2015-05-28 14:25:26 -07:00
Jessie Frazelle
1f22676fcb Merge pull request #13559 from LK4D4/fix_systemd_listen
Treat systemd listeners as all other
2015-05-28 14:15:34 -07:00
David Calavera
9292859fce Add comment about ulimit format.
Fixes #12116

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-28 14:14:07 -07:00
David Calavera
53d9609de4 Mount bind volumes coming from the old volumes configuration.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-28 14:06:17 -07:00
Eric Windisch
e58161fedc Expand unshare test to include privileged test
This ensures that AppArmor, not other mechanisms used
by Docker or the kernel is restricting the mount.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-05-28 16:49:48 -04:00
Alexander Morozov
6f9fa64645 Treat systemd listeners as all other
Fix #13549

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-28 12:15:03 -07:00
John Howard
d66ae67418 Windows: Undo 908db518 for Windows daemon
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-28 12:04:09 -07:00
Alexander Morozov
3bda841e3e Merge pull request #13430 from runcom/fix-race-modify-request
Fix race in httpsRequestModifier.ModifyRequest when writing tlsConfig
2015-05-28 11:31:04 -07:00
David Calavera
37cc42ee0e Merge pull request #13416 from Microsoft/10662-fixintegrationtests
Windows: Pass temp environment through
2015-05-28 11:22:37 -07:00
David Calavera
617a0c2fde Merge pull request #13428 from duglin/niceHelp2
Nice help2
2015-05-28 11:09:02 -07:00
David Calavera
f99a962742 Merge pull request #13539 from tianon/deb-ubuntu-wily
Add Ubuntu Wily (15.10) as a build-deb target
2015-05-28 11:01:27 -07:00
David Calavera
24a0800d87 Merge pull request #13551 from albers/pgp-over-http
Use http for PGP key download
2015-05-28 10:59:14 -07:00
Jessie Frazelle
5bb6262d88 Merge pull request #13529 from hqhq/hq_skip_cgroup_test
Skip test if not have Cpu quota or Cpu period
2015-05-28 10:57:32 -07:00
David Calavera
85096cfd4f Merge pull request #13512 from moysesb/progressreader_close_silently
Close progressreader silently when read is complete.
2015-05-28 10:54:08 -07:00
David Calavera
0256bbdebb Merge pull request #13039 from stevenbrichards/13031-Upstart
Fix check for upstart not detecting properly
2015-05-28 10:38:55 -07:00
Alexander Morozov
b90732f801 Merge pull request #13548 from kvasdopil/zfs_magicnum
ZFS filesystem magic number check is fixed on FreeBSD
2015-05-28 10:27:12 -07:00
Moysés Borges
709fa2ad87 Modified progress reader to close silently when read is complete.
Closes #13432

Signed-off-by: Moysés Borges <moysesb@gmail.com>
2015-05-28 14:09:30 -03:00
Brian Goff
45488f9dc0 Merge pull request #13259 from Microsoft/10662-configbridge
Windows: factor out bridgeConfig from server+config
2015-05-28 12:59:57 -04:00
David Calavera
70bedc8ee5 Merge pull request #13538 from tianon/rpm-fedora-22
Add fedora:22 to our rpm targets
2015-05-28 09:55:09 -07:00
Steven Richards
e5ff643aed Fixes #13031 - Check for upstart or init is not detecting properly
This will now properly check whether /etc/init.d/docker or service docker is
invoking the script and respond to the user accordingly.

Signed-off-by: Steven Richards <steven@axiomzen.co>
2015-05-28 09:52:05 -07:00
Brian Goff
27919bab2d Merge pull request #13269 from Microsoft/10662-statsrefactor
Windows: refactor stats
2015-05-28 12:46:34 -04:00
Brian Goff
33c7c01a62 Merge pull request #13055 from Microsoft/10662-internalsfixperms
Windows: Fixup builder/internals.go
2015-05-28 12:31:45 -04:00
Brian Goff
a364dd8fc6 Merge pull request #13535 from coolljt0725/fix_automatically_publish_without_publish
Fix automatically publish ports without --publish-all or --publish
2015-05-28 11:49:53 -04:00
Alexey Guskov
36bf6e4440 zfs magicnumber check on freebsd is fixed
Signed-off-by: Alexey Guskov <lexag@mail.ru>
2015-05-28 18:38:08 +03:00
Harald Albers
c1c5d760a6 Use http for PGP key download
Signed-off-by: Harald Albers <github@albersweb.de>
2015-05-28 16:43:36 +02:00
Brian Goff
ac7a33b45c Merge pull request #13541 from coolljt0725/remove_reduntant_enter_create
Clean up: remove redundant '\n' in Create
2015-05-28 10:30:07 -04:00
Lei Jitang
bcd076b5fe Clean up: remove redundant '\n' in Create
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-28 17:08:55 +08:00
Tianon Gravi
38c77ba876 Add Ubuntu Wily (15.10) as a build-deb target
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-28 01:06:11 -07:00
Tianon Gravi
96903c837f Add fedora:22 to our rpm targets
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-28 01:01:45 -07:00
Sebastiaan van Stijn
7011d9ee8a Merge pull request #13515 from lloydde/doc-cli-lint
doc cli lint.
2015-05-28 09:13:25 +02:00
Qiang Huang
34e5b6af19 Skip test if not have Cpu quota or Cpu period
Closes: #13522

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-28 14:59:58 +08:00
Jörg Thalheim
6473b0f127 remove redundant mount/unmount calls on commit
daemon.Diff already implements mounting for naivegraphdriver and
aufs which does diffing on its owns does not need the container to be mounted.
So new filesystem driver should mount filesystems on their own if it is needed
to implement Diff(). This issue was reported by @kvasdopil while working on a
freebsd port, because freebsd does not allow mount an already mounted
filesystem. Also it saves some cycles for other operating systems as well.

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-28 08:43:31 +02:00
Tianon Gravi
15b45113eb Merge pull request #13532 from jfrazelle/fix-fix-release-script
fix release script
2015-05-27 23:17:45 -06:00
Jessica Frazelle
9f619282db fix release script
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-27 20:57:46 -07:00
Doug Davis
71a4990229 Fix error when trying to delete an image due to a bad container
I ran into a situation where I was trying:
	`docker rmi busybox`
and it kept failing saying:
    `could not find image: Prefix can't be empty`

While I have no idea how I got into this situation, it turns out this is
error message is from `daemon.canDeleteImage()`. In that func we loop over
all containers checking to see if they're using the image we're trying to
delete.  In my case though, I had a container with no ImageID. So the code
would die tryig to find that image (hence the "Prefix can't be empty" err).
This would stop all processing despite the fact that the container we're
checking had nothing to do with 'busybox'.

My change logs the bad situation in the logs and then skips that container.
There's no reason to fail all `docker rmi ...` calls just because of one
bad container.

Will continue to try to figure out how I got a container w/o an ImageID
but as of now I have no idea, I didn't do anything but normal docker cli
commands.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-27 19:19:43 -07:00
Lloyd Dewolf
b4a52fc4e9 doc cli lint.
- 79 char line length (non-command).
- Consistent single space between sentences.
- Replace start of line tabs with spaces.
- Remove trailing white space.
- Consistent "**Note:**" style.
  https://docs.docker.com/project/doc-style/#notes
- Replace the ``` sections with indented code.

Signed-off-by: Lloyd Dewolf <foolswisdom@gmail.com>
2015-05-27 15:07:57 -07:00
Dan Walsh
35a7f0c59e Merge branch 'master' of github.com:docker/docker into kill
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-05-27 16:37:32 -04:00
Dan Walsh
66121d1b45 Merge branch 'master' of github.com:docker/docker into kill
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-05-27 11:00:12 -04:00
Lei Jitang
13f2aa7068 Add --net=container with --publish --publish-all --expose error out
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-27 15:31:06 +08:00
Lei Jitang
bdb77078b5 Ensure all the running containers are killed on daemon shutdown
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-27 09:09:25 +08:00
boucher
4509f91b26 Update vendored libcontainer to v2.1
Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
2015-05-26 12:47:57 -07:00
Mary Anthony
9c65862cd6 Updating with the created state
Signed-off-by: Mary Anthony <mary@docker.com>
2015-05-25 07:33:01 -07:00
John Howard
ead2f80073 Windows: factor out bridge server+config
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-23 19:22:06 -07:00
Antonio Murdaca
a27395e6df Fix race in httpsRequestModifier.ModifyRequest when writing tlsConfig
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-23 23:50:08 +02:00
Doug Davis
8324d7918b Carry #11858
Continues 11858 by:
- Making sure the exit code is always zero when we ask for help
- Making sure the exit code isn't zero when we print help on error cases
- Making sure both short and long usage go to the same stream (stdout vs stderr)
- Making sure all docker commands support --help
- Test that all cmds send --help to stdout, exit code 0, show full usage, no blank lines at end
- Test that all cmds (that support it) show short usage on bad arg to stderr, no blank line at end
- Test that all cmds complain about a bad option, no blank line at end
- Test that docker (w/o subcmd) does the same stuff mentioned above properly

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-23 09:14:18 -07:00
John Howard
fba44a7ccf Windows: Pass temp environment through
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-22 15:14:22 -07:00
Jana Radhakrishnan
6cdf8623d5 Do not attempt releasing network when not attached to any network
Sometimes container.cleanup() can be called from multiple paths
for the same container during error conditions from monitor and
regular startup path. So if the container network has been already
released do not try to release it again.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-21 18:57:17 +00:00
John Howard
48f1cb4ebe Windows: refactor stats
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-20 09:08:45 -07:00
John Howard
62f648b061 Windows: chrootarchive refactor
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-20 08:56:42 -07:00
John Howard
010e3e046b Windows: Fixup builder\internals.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-20 08:55:13 -07:00
Qiang Huang
c646e514db Fix unit-test build error on ARM64
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-20 10:45:04 +08:00
Lorenzo Fontana
a2787469ac Using dockerCmd when possible
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
2015-05-19 20:33:59 +02:00
Jason Shepherd
48231d623f adding nicer help when missing arguments (#11858)
Signed-off-by: Jason Shepherd <jason@jasonshepherd.net>
2015-05-19 12:02:13 +10:00
Lei Jitang
9a09664b51 Fix automatically publish ports without --publish-all
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-18 02:57:17 +08:00
Vincent Demeester
07a75c48fd Add tests for pkg/pools
Fixes #11588

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-05-16 10:39:24 +02:00
Burke Libbey
03956610e5 ino and dev must both match for a file to be identical.
This case is triggered frequently on ZFS.

Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2015-05-05 11:06:54 -04:00
Dan Walsh
d0a4f310ef Merge branch 'master' of github.com:docker/docker into kill
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-04-29 15:06:47 -04:00
Burke Libbey
45c45a2c9a archive: Optimize ChangesDirs on Linux
If we tear through a few layers of abstraction, we can get at the inodes
contained in a directory without having to stat all the files. This
allows us to eliminate identical files much earlier in the changelist
generation process.

Signed-off-by: Burke Libbey <burke@libbey.me>
2015-04-27 21:26:13 -04:00
Regan McCooey
c92377e300 docker kill should return error if container is not running.
Assuming that docker kill is trying to actually kill the container
is a mistake.  If the container is not running we should report it
back to the caller as a error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Docker-DCO-1.1-Signed-off-by: Regan McCooey <rmccooey27@aol.com> (github: rmccooey27)

Docker-DCO-1.1-Signed-off-by: Regan McCooey <rmccooey27@aol.com> (github: rhatdan)
2015-04-24 08:33:21 -04:00
2105 changed files with 286245 additions and 124337 deletions

5
.gitignore vendored
View File

@@ -2,6 +2,7 @@
# if you want to ignore files created by your editor/tools,
# please consider a global .gitignore https://help.github.com/articles/ignoring-files
*.exe
*.exe~
*.orig
*.rej
*.test
@@ -13,7 +14,6 @@
.git/
.gopath/
.hg/
.idea
.vagrant*
Vagrantfile
a.out
@@ -30,5 +30,8 @@ docs/_build
docs/_static
docs/_templates
docs/changed-files
# generated by man/man/md2man-all.sh
man/man1
man/man5
pyenv
vendor/pkg/

View File

@@ -142,3 +142,30 @@ Jessica Frazelle <jess@docker.com> Jessie Frazelle <jfrazelle@users.noreply.gith
Thomas LEVEIL <thomasleveil@gmail.com> Thomas LÉVEIL <thomasleveil@users.noreply.github.com>
<oi@truffles.me.uk> <timruffles@googlemail.com>
<Vincent.Bernat@exoscale.ch> <bernat@luffy.cx>
Antonio Murdaca <antonio.murdaca@gmail.com> <me@runcom.ninja>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@linux.com>
Antonio Murdaca <antonio.murdaca@gmail.com> <runcom@users.noreply.github.com>
Darren Shepherd <darren.s.shepherd@gmail.com> <darren@rancher.com>
Deshi Xiao <dxiao@redhat.com> <dsxiao@dataman-inc.com>
Deshi Xiao <dxiao@redhat.com> <xiaods@gmail.com>
Doug Davis <dug@us.ibm.com> <duglin@users.noreply.github.com>
Jacob Atzen <jacob@jacobatzen.dk> <jatzen@gmail.com>
Jeff Nickoloff <jeff.nickoloff@gmail.com> <jeff@allingeek.com>
<jess@docker.com> <princess@docker.com>
John Howard (VM) <John.Howard@microsoft.com> John Howard <jhoward@microsoft.com>
Madhu Venugopal <madhu@socketplane.io> <madhu@docker.com>
Mary Anthony <mary.anthony@docker.com> <mary@docker.com>
Mary Anthony <mary.anthony@docker.com> moxiegirl <mary@docker.com>
Mary Anthony <mary.anthony@docker.com> <moxieandmore@gmail.com>
mattyw <mattyw@me.com> <gh@mattyw.net>
resouer <resouer@163.com> <resouer@gmail.com>
AJ Bowen <aj@gandi.net> soulshake <amy@gandi.net>
AJ Bowen <aj@gandi.net> soulshake <aj@gandi.net>
Tibor Vass <teabee89@gmail.com> <tibor@docker.com>
Tibor Vass <teabee89@gmail.com> <tiborvass@users.noreply.github.com>
Vincent Bernat <bernat@luffy.cx> <Vincent.Bernat@exoscale.ch>
Yestin Sun <sunyi0804@gmail.com> <yestin.sun@polyera.com>
bin liu <liubin0329@users.noreply.github.com> <liubin0329@gmail.com>
John Howard (VM) <John.Howard@microsoft.com> jhowardmsft <jhoward@microsoft.com>
Ankush Agarwal <ankushagarwal11@gmail.com> <ankushagarwal@users.noreply.github.com>
Tangi COLIN <tangicolin@gmail.com> tangicolin <tangicolin@gmail.com>

264
AUTHORS
View File

@@ -2,14 +2,18 @@
# For how it is generated, see `hack/generate-authors.sh`.
Aanand Prasad <aanand.prasad@gmail.com>
Aaron Davidson <aaron@databricks.com>
Aaron Feng <aaron.feng@gmail.com>
Aaron Huslage <huslage@gmail.com>
Aaron Welch <welch@packet.net>
Abel Muiño <amuino@gmail.com>
Abhinav Ajgaonkar <abhinav316@gmail.com>
Abhishek Chanda <abhishek.becs@gmail.com>
Abin Shahab <ashahab@altiscale.com>
Adam Miller <admiller@redhat.com>
Adam Singer <financeCoding@gmail.com>
Aditya <aditya@netroy.in>
Adria Casas <adriacasas88@gmail.com>
Adrian Mouat <adrian.mouat@gmail.com>
Adrien Folie <folie.adrien@gmail.com>
Ahmed Kamal <email.ahmedkamal@googlemail.com>
@@ -23,6 +27,9 @@ Albert Callarisa <shark234@gmail.com>
Albert Zhang <zhgwenming@gmail.com>
Aleksa Sarai <cyphar@cyphar.com>
Aleksandrs Fadins <aleks@s-ko.net>
Alena Prokharchyk <alena@rancher.com>
Alessandro Boch <aboch@docker.com>
Alessio Biancalana <dottorblaster@gmail.com>
Alex Gaynor <alex.gaynor@gmail.com>
Alex Warhawk <ax.warhawk@gmail.com>
Alexander Boyd <alex@opengroove.org>
@@ -30,14 +37,20 @@ Alexander Larsson <alexl@redhat.com>
Alexander Morozov <lk4d4@docker.com>
Alexander Shopov <ash@kambanaria.org>
Alexandr Morozov <lk4d4@docker.com>
Alexey Guskov <lexag@mail.ru>
Alexey Kotlyarov <alexey@infoxchange.net.au>
Alexey Shamrin <shamrin@gmail.com>
Alexis THOMAS <fr.alexisthomas@gmail.com>
Allen Madsen <blatyo@gmail.com>
almoehi <almoehi@users.noreply.github.com>
Alvin Richards <alvin.richards@docker.com>
amangoel <amangoel@gmail.com>
Amit Bakshi <ambakshi@gmail.com>
Amy Lindburg <amy.lindburg@docker.com>
Anand Patil <anand.prabhakar.patil@gmail.com>
AnandkumarPatel <anandkumarpatel@gmail.com>
Anchal Agrawal <aagrawa4@illinois.edu>
Anders Janmyr <anders@janmyr.com>
Andre Dublin <81dublin@gmail.com>
Andrea Luzzardi <aluzzardi@gmail.com>
Andrea Turli <andrea.turli@gmail.com>
@@ -45,15 +58,19 @@ Andreas Köhler <andi5.py@gmx.net>
Andreas Savvides <andreas@editd.com>
Andreas Tiefenthaler <at@an-ti.eu>
Andrew C. Bodine <acbodine@us.ibm.com>
Andrew Clay Shafer <andrewcshafer@gmail.com>
Andrew Duckworth <grillopress@gmail.com>
Andrew France <andrew@avito.co.uk>
Andrew Kuklewicz <kookster@gmail.com>
Andrew Macgregor <andrew.macgregor@agworld.com.au>
Andrew Martin <sublimino@gmail.com>
Andrew Munsell <andrew@wizardapps.net>
Andrew Weiss <andrew.weiss@outlook.com>
Andrew Williams <williams.andrew@gmail.com>
Andrews Medina <andrewsmedina@gmail.com>
Andrey Petrov <andrey.petrov@shazow.net>
Andrey Stolbovsky <andrey.stolbovsky@gmail.com>
André Martins <martins@noironetworks.com>
Andy Chambers <anchambers@paypal.com>
andy diller <dillera@gmail.com>
Andy Goldstein <agoldste@redhat.com>
@@ -61,18 +78,23 @@ Andy Kipp <andy@rstudio.com>
Andy Rothfusz <github@developersupport.net>
Andy Smith <github@anarkystic.com>
Andy Wilson <wilson.andrew.j+github@gmail.com>
Anes Hasicic <anes.hasicic@gmail.com>
Ankush Agarwal <ankushagarwal11@gmail.com>
Anthony Baire <Anthony.Baire@irisa.fr>
Anthony Bishopric <git@anthonybishopric.com>
Anton Löfgren <anton.lofgren@gmail.com>
Anton Nikitin <anton.k.nikitin@gmail.com>
Anton Tiurin <noxiouz@yandex.ru>
Antonio Murdaca <antonio.murdaca@gmail.com>
Antony Messerli <amesserl@rackspace.com>
apocas <petermdias@gmail.com>
ArikaChen <eaglesora@gmail.com>
Arnaud Porterie <arnaud.porterie@docker.com>
Arthur Barr <arthur.barr@uk.ibm.com>
Arthur Gautier <baloo@gandi.net>
Asbjørn Enge <asbjorn@hanafjedle.net>
averagehuman <averagehuman@users.noreply.github.com>
Avi Das <andas222@gmail.com>
Avi Miller <avi.miller@oracle.com>
Barnaby Gray <barnaby@pickle.me.uk>
Barry Allard <barry.allard@gmail.com>
@@ -80,22 +102,31 @@ Bartłomiej Piotrowski <b@bpiotrowski.pl>
bdevloed <boris.de.vloed@gmail.com>
Ben Firshman <ben@firshman.co.uk>
Ben Sargent <ben@brokendigits.com>
Ben Severson <BenSeverson@users.noreply.github.com>
Ben Toews <mastahyeti@gmail.com>
Ben Wiklund <ben@daisyowl.com>
Benjamin Atkin <ben@benatkin.com>
Benoit Chesneau <bchesneau@gmail.com>
Bernerd Schaefer <bj.schaefer@gmail.com>
Bert Goethals <bert@bertg.be>
Bharath Thiruveedula <bharath_ves@hotmail.com>
Bhiraj Butala <abhiraj.butala@gmail.com>
bin liu <liubin0329@users.noreply.github.com>
Blake Geno <blakegeno@gmail.com>
bobby abbott <ttobbaybbob@gmail.com>
boucher <rboucher@gmail.com>
Bouke Haarsma <bouke@webatoom.nl>
Boyd Hemphill <boyd@feedmagnet.com>
Bradley Cicenas <bradley.cicenas@gmail.com>
Bradley Wright <brad@intranation.com>
Brandon Liu <bdon@bdon.org>
Brandon Philips <brandon@ifup.org>
Brandon Rhodes <brandon@rhodesmill.org>
Brendan Dixon <brendand@microsoft.com>
Brent Salisbury <brent.salisbury@docker.com>
Brett Kochendorfer <brett.kochendorfer@gmail.com>
Brian (bex) Exelbierd <bexelbie@redhat.com>
Brian DeHamer <brian@dehamer.com>
Brian Dorsey <brian@dorseys.org>
Brian Flad <bflad417@gmail.com>
Brian Goff <cpuguy83@gmail.com>
@@ -106,48 +137,67 @@ Brice Jaglin <bjaglin@teads.tv>
Briehan Lombaard <briehan.lombaard@gmail.com>
Bruno Bigras <bigras.bruno@gmail.com>
Bruno Binet <bruno.binet@gmail.com>
Bruno Gazzera <bgazzera@paginar.com>
Bruno Renié <brutasse@gmail.com>
Bryan Bess <squarejaw@bsbess.com>
Bryan Boreham <bjboreham@gmail.com>
Bryan Matsuo <bryan.matsuo@gmail.com>
Bryan Murphy <bmurphy1976@gmail.com>
buddhamagnet <buddhamagnet@gmail.com>
Burke Libbey <burke@libbey.me>
Byung Kang <byung.kang.ctr@amrdec.army.mil>
Caleb Spare <cespare@gmail.com>
Calen Pennington <cale@edx.org>
Cameron Boehmer <cameron.boehmer@gmail.com>
Carl X. Su <bcbcarl@gmail.com>
Cary <caryhartline@users.noreply.github.com>
Casey Bisson <casey.bisson@joyent.com>
Charles Hooper <charles.hooper@dotcloud.com>
Charles Lindsay <chaz@chazomatic.us>
Charles Merriam <charles.merriam@gmail.com>
Charlie Lewis <charliel@lab41.org>
Chen Chao <cc272309126@gmail.com>
Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
cheney90 <cheney-90@hotmail.com>
Chewey <prosto-chewey@users.noreply.github.com>
Chia-liang Kao <clkao@clkao.org>
chli <chli@freewheel.tv>
Chris Alfonso <calfonso@redhat.com>
Chris Armstrong <chris@opdemand.com>
Chris Khoo <chris.khoo@gmail.com>
Chris Snow <chsnow123@gmail.com>
Chris St. Pierre <chris.a.st.pierre@gmail.com>
Chris Stivers <chris@stivers.us>
Chris Wahl <github@wahlnetwork.com>
chrismckinnel <chris.mckinnel@tangentlabs.co.uk>
Christian Berendt <berendt@b1-systems.de>
Christian Simon <simon@swine.de>
Christian Stefanescu <st.chris@gmail.com>
ChristoperBiscardi <biscarch@sketcht.com>
Christophe Troestler <christophe.Troestler@umons.ac.be>
Christopher Currie <codemonkey+github@gmail.com>
Christopher Latham <sudosurootdev@gmail.com>
Christopher Rigor <crigor@gmail.com>
Christy Perez <christy@linux.vnet.ibm.com>
Chun Chen <chenchun.feed@gmail.com>
Ciro S. Costa <ciro.costa@usp.br>
Clayton Coleman <ccoleman@redhat.com>
Coenraad Loubser <coenraad@wish.org.za>
Colin Dunklau <colin.dunklau@gmail.com>
Colin Rice <colin@daedrum.net>
Colin Walters <walters@verbum.org>
Colm Hally <colmhally@gmail.com>
Cory Forsyth <cory.forsyth@gmail.com>
cressie176 <github@stephen-cresswell.net>
Cristian Staretu <cristian.staretu@gmail.com>
Cruceru Calin-Cristian <crucerucalincristian@gmail.com>
Cyril F <cyrilf7x@gmail.com>
Daan van Berkel <daan.v.berkel.1980@gmail.com>
Daehyeok Mun <daehyeok@gmail.com>
Dafydd Crosby <dtcrsby@gmail.com>
dalanlan <dalanlan925@gmail.com>
Damjan Georgievski <gdamjan@gmail.com>
Dan Anolik <dan@anolik.net>
Dan Buch <d.buch@modcloth.com>
Dan Cotora <dan@bluevision.ro>
Dan Griffin <dgriffin@peer1.com>
@@ -157,35 +207,46 @@ Dan McPherson <dmcphers@redhat.com>
Dan Stine <sw@stinemail.com>
Dan Walsh <dwalsh@redhat.com>
Dan Williams <me@deedubs.com>
Daniel Antlinger <d.antlinger@gmx.at>
Daniel Exner <dex@dragonslave.de>
Daniel Farrell <dfarrell@redhat.com>
Daniel Garcia <daniel@danielgarcia.info>
Daniel Gasienica <daniel@gasienica.ch>
Daniel Menet <membership@sontags.ch>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com>
Daniel Nephin <dnephin@gmail.com>
Daniel Norberg <dano@spotify.com>
Daniel Nordberg <dnordberg@gmail.com>
Daniel Robinson <gottagetmac@gmail.com>
Daniel S <dan.streby@gmail.com>
Daniel Von Fange <daniel@leancoder.com>
Daniel YC Lin <dlin.tw@gmail.com>
Daniel Zhang <jmzwcn@gmail.com>
Daniel, Dao Quang Minh <dqminh89@gmail.com>
Danny Berger <dpb587@gmail.com>
Danny Yates <danny@codeaholics.org>
Darren Coxall <darren@darrencoxall.com>
Darren Shepherd <darren.s.shepherd@gmail.com>
Dave Henderson <Dave.Henderson@ca.ibm.com>
David Anderson <dave@natulte.net>
David Calavera <david.calavera@gmail.com>
David Corking <dmc-source@dcorking.com>
David Davis <daviddavis@redhat.com>
David Gageot <david@gageot.net>
David Gebler <davidgebler@gmail.com>
David Mackey <tdmackey@booleanhaiku.com>
David Mat <david@davidmat.com>
David Mcanulty <github@hellspark.com>
David Pelaez <pelaez89@gmail.com>
David R. Jenni <david.r.jenni@gmail.com>
David Röthlisberger <david@rothlis.net>
David Sissitka <me@dsissitka.com>
David Xia <dxia@spotify.com>
David Young <yangboh@cn.ibm.com>
Davide Ceretti <davide.ceretti@hogarthww.com>
Dawn Chen <dawnchen@google.com>
decadent <decadent@users.noreply.github.com>
Deng Guangxing <dengguangxing@huawei.com>
Deni Bertovic <deni@kset.org>
Derek <crq@kernel.org>
Derek <crquan@gmail.com>
@@ -193,39 +254,53 @@ Derek McGowan <derek@mcgstyle.net>
Deric Crago <deric.crago@gmail.com>
Deshi Xiao <dxiao@redhat.com>
Dinesh Subhraveti <dineshs@altiscale.com>
DiuDiugirl <sophia.wang@pku.edu.cn>
Djibril Koné <kone.djibril@gmail.com>
dkumor <daniel@dkumor.com>
Dmitry Demeshchuk <demeshchuk@gmail.com>
Dmitry Gusev <dmitry.gusev@gmail.com>
Dmitry V. Krivenok <krivenok.dmitry@gmail.com>
Dolph Mathews <dolph.mathews@gmail.com>
Dominik Finkbeiner <finkes93@gmail.com>
Dominik Honnef <dominik@honnef.co>
Don Kirkby <donkirkby@users.noreply.github.com>
Don Kjer <don.kjer@gmail.com>
Don Spaulding <donspauldingii@gmail.com>
Doug Davis <dug@us.ibm.com>
Doug MacEachern <dougm@vmware.com>
doug tangren <d.tangren@gmail.com>
Dr Nic Williams <drnicwilliams@gmail.com>
dragon788 <dragon788@users.noreply.github.com>
Dražen Lučanin <kermit666@gmail.com>
Dustin Sallings <dustin@spy.net>
Ed Costello <epc@epcostello.com>
Edmund Wagner <edmund-wagner@web.de>
Eiichi Tsukata <devel@etsukata.com>
Eike Herzbach <eike@herzbach.net>
Eivind Uggedal <eivind@uggedal.com>
Elias Probst <mail@eliasprobst.eu>
Elijah Zupancic <elijah@zupancic.name>
eluck <mail@eluck.me>
Emil Hernvall <emil@quench.at>
Emily Maier <emily@emilymaier.net>
Emily Rose <emily@contactvibe.com>
Emir Ozer <emirozer@yandex.com>
Enguerran <engcolson@gmail.com>
Eohyung Lee <liquidnuker@gmail.com>
Eric Hanchrow <ehanchrow@ine.com>
Eric Lee <thenorthsecedes@gmail.com>
Eric Myhre <hash@exultant.us>
Eric Paris <eparis@redhat.com>
Eric Rafaloff <erafaloff@gmail.com>
Eric Windisch <ewindisch@docker.com>
Eric-Olivier Lamey <eo@lamey.me>
Erik Dubbelboer <erik@dubbelboer.com>
Erik Hollensbe <github@hollensbe.org>
Erik Inge Bolsø <knan@redpill-linpro.com>
Erik Kristensen <erik@erikkristensen.com>
Erno Hopearuoho <erno.hopearuoho@gmail.com>
Erwin van der Koogh <info@erronis.nl>
Euan <euank@amazon.com>
Eugene Yakubovich <eugene.yakubovich@coreos.com>
eugenkrizo <eugen.krizo@gmail.com>
Evan Carmi <carmi@users.noreply.github.com>
@@ -233,58 +308,78 @@ Evan Hazlett <ejhazlett@gmail.com>
Evan Krall <krall@yelp.com>
Evan Phoenix <evan@fallingsnow.net>
Evan Wies <evan@neomantra.net>
Evgeny Vereshchagin <evvers@ya.ru>
Eystein Måløy Stenberg <eystein.maloy.stenberg@cfengine.com>
ezbercih <cem.ezberci@gmail.com>
Fabiano Rosas <farosas@br.ibm.com>
Fabio Falci <fabiofalci@gmail.com>
Fabio Rehm <fgrehm@gmail.com>
Fabrizio Regini <freegenie@gmail.com>
Faiz Khan <faizkhan00@gmail.com>
falmp <chico.lopes@gmail.com>
Fareed Dudhia <fareeddudhia@googlemail.com>
Felix Rabe <felix@rabe.io>
Felix Schindler <fschindler@weluse.de>
Ferenc Szabo <pragmaticfrank@gmail.com>
Fernando <fermayo@gmail.com>
Filipe Brandenburger <filbranden@google.com>
Flavio Castelli <fcastelli@suse.com>
FLGMwt <ryan.stelly@live.com>
Florian Weingarten <flo@hackvalue.de>
Francisco Carriedo <fcarriedo@gmail.com>
Francisco Souza <f@souza.cc>
Frank Herrmann <fgh@4gh.tv>
Frank Macreery <frank@macreery.com>
Frank Rosquin <frank.rosquin+github@gmail.com>
Fred Lifton <fred.lifton@docker.com>
Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
Frederik Loeffert <frederik@zitrusmedia.de>
Freek Kalter <freek@kalteronline.org>
Félix Baylac-Jacqué <baylac.felix@gmail.com>
Gabe Rosenhouse <gabe@missionst.com>
Gabor Nagy <mail@aigeruth.hu>
Gabriel Monroy <gabriel@opdemand.com>
Galen Sampson <galen.sampson@gmail.com>
Gareth Rushgrove <gareth@morethanseven.net>
Gaurav <gaurav.gosec@gmail.com>
gautam, prasanna <prasannagautam@gmail.com>
GennadySpb <lipenkov@gmail.com>
Geoffrey Bachelet <grosfrais@gmail.com>
George MacRorie <gmacr31@gmail.com>
George Xie <georgexsh@gmail.com>
Gereon Frey <gereon.frey@dynport.de>
German DZ <germ@ndz.com.ar>
Gert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Gianluca Borello <g.borello@gmail.com>
Giuseppe Mazzotta <gdm85@users.noreply.github.com>
Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Gleb M Borisov <borisov.gleb@gmail.com>
Glyn Normington <gnormington@gopivotal.com>
Goffert van Gool <goffert@phusion.nl>
golubbe <ben.golub@dotcloud.com>
Gosuke Miyashita <gosukenator@gmail.com>
Graydon Hoare <graydon@pobox.com>
Greg Fausak <greg@tacodata.com>
Greg Thornton <xdissent@me.com>
grossws <grossws@gmail.com>
grunny <mwgrunny@gmail.com>
Guilherme Salgado <gsalgado@gmail.com>
Guillaume Dufour <gdufour.prestataire@voyages-sncf.com>
Guillaume J. Charmes <guillaume.charmes@docker.com>
guoxiuyan <guoxiuyan@huawei.com>
Gurjeet Singh <gurjeet@singh.im>
Guruprasad <lgp171188@gmail.com>
Günter Zöchbauer <guenter@gzoechbauer.com>
Hans Rødtang <hansrodtang@gmail.com>
Harald Albers <github@albersweb.de>
Harley Laue <losinggeneration@gmail.com>
Harry Zhang <harryzhang@zju.edu.cn>
He Simei <hesimei@zju.edu.cn>
Hector Castro <hectcastro@gmail.com>
Henning Sprang <henning.sprang@gmail.com>
Hobofan <goisser94@gmail.com>
Hollie Teal <hollie@docker.com>
Hong Xu <hong@topbug.net>
Hu Keping <hukeping@huawei.com>
Hu Tao <hutao@cn.fujitsu.com>
Huayi Zhang <irachex@gmail.com>
@@ -292,21 +387,28 @@ Hugo Duncan <hugo@hugoduncan.org>
Hunter Blanks <hunter@twilio.com>
Huu Nguyen <huu@prismskylabs.com>
hyeongkyu.lee <hyeongkyu.lee@navercorp.com>
hyp3rdino <markus.kortlang@lhsystems.com>
Ian Babrou <ibobrik@gmail.com>
Ian Bishop <ianbishop@pace7.com>
Ian Bull <irbull@gmail.com>
Ian Calvert <ianjcalvert@gmail.com>
Ian Main <imain@redhat.com>
Ian Truslove <ian.truslove@gmail.com>
Iavael <iavaelooeyt@gmail.com>
Igor Dolzhikov <bluesriverz@gmail.com>
ILYA Khlopotov <ilya.khlopotov@gmail.com>
imre Fitos <imre.fitos+github@gmail.com>
inglesp <peter.inglesby@gmail.com>
Isaac Dupree <antispam@idupree.com>
Isabel Jimenez <contact.isabeljimenez@gmail.com>
Isao Jonas <isao.jonas@gmail.com>
Ivan Fraixedes <ifcdev@gmail.com>
J Bruni <joaohbruni@yahoo.com.br>
J. Nunn <jbnunn@gmail.com>
Jack Danger Canty <jackdanger@squareup.com>
Jacob Atzen <jacob@jacobatzen.dk>
Jacob Edelman <edelman.jd@gmail.com>
Jake Champlin <jake.champlin.27@gmail.com>
Jake Moshenko <jake@devtable.com>
jakedt <jake@devtable.com>
James Allen <jamesallen0108@gmail.com>
@@ -314,41 +416,67 @@ James Carr <james.r.carr@gmail.com>
James DeFelice <james.defelice@ishisystems.com>
James Harrison Fisher <jameshfisher@gmail.com>
James Kyle <james@jameskyle.org>
James Lal <james@lightsofapollo.com>
James Mills <prologic@shortcircuit.net.au>
James Turnbull <james@lovedthanlost.net>
Jamie Hannaford <jamie.hannaford@rackspace.com>
Jamshid Afshar <jafshar@yahoo.com>
Jan Keromnes <janx@linux.com>
Jan Koprowski <jan.koprowski@gmail.com>
Jan Pazdziora <jpazdziora@redhat.com>
Jan Toebes <jan@toebes.info>
Jan-Jaap Driessen <janjaapdriessen@gmail.com>
Jana Radhakrishnan <mrjana@docker.com>
Jared Biel <jared.biel@bolderthinking.com>
Jaroslaw Zabiello <hipertracker@gmail.com>
jaseg <jaseg@jaseg.net>
Jason Divock <jdivock@gmail.com>
Jason Giedymin <jasong@apache.org>
Jason Hall <imjasonh@gmail.com>
Jason Livesay <ithkuil@gmail.com>
Jason McVetta <jason.mcvetta@gmail.com>
Jason Plum <jplum@devonit.com>
Jason Shepherd <jason@jasonshepherd.net>
Jason Smith <jasonrichardsmith@gmail.com>
Jason Sommer <jsdirv@gmail.com>
Jason Stangroome <jason@codeassassin.com>
Jay <teguhwpurwanto@gmail.com>
Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Jean-Baptiste Dalido <jeanbaptiste@appgratis.com>
Jean-Paul Calderone <exarkun@twistedmatrix.com>
Jean-Tiare Le Bigot <jt@yadutaf.fr>
Jeff Anderson <jeff@docker.com>
Jeff Lindsay <progrium@gmail.com>
Jeff Nickoloff <jeff.nickoloff@gmail.com>
Jeff Welch <whatthejeff@gmail.com>
Jeffrey Bolle <jeffreybolle@gmail.com>
Jeffrey Morgan <jmorganca@gmail.com>
Jeffrey van Gogh <jvg@google.com>
Jeremy Grosser <jeremy@synack.me>
Jesse Dearing <jesse.dearing@gmail.com>
Jesse Dubay <jesse@thefortytwo.net>
Jessica Frazelle <jess@docker.com>
Jezeniel Zapanta <jpzapanta22@gmail.com>
jianbosun <wonderflow.sun@gmail.com>
Jilles Oldenbeuving <ojilles@gmail.com>
Jim Alateras <jima@comware.com.au>
Jim Perrin <jperrin@centos.org>
Jimmy Cuadra <jimmy@jimmycuadra.com>
Jimmy Puckett <jimmy.puckett@spinen.com>
jimmyxian <jimmyxian2004@yahoo.com.cn>
Jinsoo Park <cellpjs@gmail.com>
Jiri Popelka <jpopelka@redhat.com>
Jiří Župka <jzupka@redhat.com>
jjy <jiangjinyang@outlook.com>
jmzwcn <jmzwcn@gmail.com>
Joe Beda <joe.github@bedafamily.com>
Joe Ferguson <joe@infosiftr.com>
Joe Gordon <joe.gordon0@gmail.com>
Joe Shaw <joe@joeshaw.org>
Joe Van Dyk <joe@tanga.com>
Joel Friedly <joelfriedly@gmail.com>
Joel Handwell <joelhandwell@gmail.com>
Joey Gibson <joey@joeygibson.com>
Joffrey F <joffrey@docker.com>
Johan Euphrosine <proppy@google.com>
Johan Rydberg <johan.rydberg@gmail.com>
@@ -357,13 +485,17 @@ John Costa <john.costa@gmail.com>
John Feminella <jxf@jxf.me>
John Gardiner Myers <jgmyers@proofpoint.com>
John Gossman <johngos@microsoft.com>
John Howard (VM) <John.Howard@microsoft.com>
John OBrien III <jobrieniii@yahoo.com>
John Tims <john.k.tims@gmail.com>
John Warwick <jwarwick@gmail.com>
John Willis <john.willis@docker.com>
Jon Wedaman <jweede@gmail.com>
Jonas Pfenniger <jonas@pfenniger.name>
Jonathan A. Sternberg <jonathansternberg@gmail.com>
Jonathan Boulle <jonathanboulle@gmail.com>
Jonathan Camp <jonathan@irondojo.com>
Jonathan Dowland <jon+github@alcopop.org>
Jonathan McCrohan <jmccrohan@gmail.com>
Jonathan Mueller <j.mueller@apoveda.ch>
Jonathan Pares <jonathanpa@users.noreply.github.com>
@@ -373,15 +505,18 @@ Jordan Arentsen <blissdev@gmail.com>
Jordan Sissel <jls@semicomplete.com>
Joseph Anthony Pasquale Holsten <joseph@josephholsten.com>
Joseph Hager <ajhager@gmail.com>
Joseph Kern <jkern@semafour.net>
Josh <jokajak@gmail.com>
Josh Hawn <josh.hawn@docker.com>
Josh Poimboeuf <jpoimboe@redhat.com>
Josiah Kiehl <jkiehl@riotgames.com>
José Tomás Albornoz <jojo@eljojo.net>
JP <jpellerin@leapfrogonline.com>
Julian Taylor <jtaylor.debian@googlemail.com>
Julien Barbier <write0@gmail.com>
Julien Bordellier <julienbordellier@gmail.com>
Julien Dubois <julien.dubois@gmail.com>
Jun-Ru Chang <jrjang@gmail.com>
Justin Force <justin.force@gmail.com>
Justin Plock <jplock@users.noreply.github.com>
Justin Simonelis <justin.p.simonelis@gmail.com>
@@ -390,22 +525,28 @@ Jérôme Petazzoni <jerome.petazzoni@dotcloud.com>
Jörg Thalheim <joerg@higgsboson.tk>
Kamil Domanski <kamil@domanski.co>
Karan Lyons <karan@karanlyons.com>
kargakis <kargakis@users.noreply.github.com>
Karl Grzeszczak <karlgrz@gmail.com>
Katie McLaughlin <katie@glasnt.com>
Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Katrina Owen <katrina.owen@gmail.com>
Kawsar Saiyeed <kawsar.saiyeed@projiris.com>
Keli Hu <dev@keli.hu>
Ken Cochrane <kencochrane@gmail.com>
Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
Kent Johnson <kentoj@gmail.com>
Kevin "qwazerty" Houdebert <kevin.houdebert@gmail.com>
Kevin Clark <kevin.clark@gmail.com>
Kevin J. Lynagh <kevin@keminglabs.com>
Kevin Menard <kevin@nirvdrum.com>
Kevin Wallace <kevin@pentabarf.net>
Kevin Yap <me@kevinyap.ca>
Keyvan Fatehi <keyvanfatehi@gmail.com>
kies <lleelm@gmail.com>
Kim BKC Carlbacker <kim.carlbacker@gmail.com>
Kimbro Staken <kstaken@kstaken.com>
Kiran Gangadharan <kiran.daredevil@gmail.com>
Kirill SIbirev <l0kix2@gmail.com>
knappe <tyler.knappe@gmail.com>
Kohei Tsuruta <coheyxyz@gmail.com>
Konrad Kleine <konrad.wilhelm.kleine@gmail.com>
@@ -419,6 +560,8 @@ Lajos Papp <lajos.papp@sequenceiq.com>
Lakshan Perera <lakshan@laktek.com>
lalyos <lalyos@yahoo.com>
Lance Chen <cyen0312@gmail.com>
Lance Kinley <lkinley@loyaltymethods.com>
Lars Kellogg-Stedman <lars@redhat.com>
Lars R. Damerow <lars@pixar.com>
Laurie Voss <github@seldo.com>
leeplay <hyeongkyu.lee@navercorp.com>
@@ -428,17 +571,26 @@ Leszek Kowalski <github@leszekkowalski.pl>
Levi Gross <levi@levigross.com>
Lewis Marshall <lewis@lmars.net>
Lewis Peckover <lew+github@lew.io>
Liana Lo <liana.lixia@gmail.com>
Liang-Chi Hsieh <viirya@gmail.com>
limsy <seongyeol37@gmail.com>
Liu Hua <sdu.liu@huawei.com>
Lloyd Dewolf <foolswisdom@gmail.com>
Lokesh Mandvekar <lsm5@fedoraproject.org>
Lorenz Leutgeb <lorenz.leutgeb@gmail.com>
Lorenzo Fontana <fontanalorenzo@me.com>
Louis Opter <kalessin@kalessin.fr>
Luis Martínez de Bartolomé Izquierdo <lmartinez@biicode.com>
lukaspustina <lukas.pustina@centerdevice.com>
lukemarsden <luke@digital-crocus.com>
Lénaïc Huard <lhuard@amadeus.com>
Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Mabin <bin.ma@huawei.com>
Madhu Venugopal <madhu@socketplane.io>
Mahesh Tiyyagura <tmahesh@gmail.com>
malnick <malnick@gmail..com>
Malte Janduda <mail@janduda.net>
Manfred Touron <m@42.am>
Manfred Zabarauskas <manfredas@zabarauskas.com>
Manuel Meurer <manuel@krautcomputing.com>
Manuel Woelker <github@manuel.woelker.org>
@@ -450,38 +602,52 @@ Marcus Farkas <toothlessgear@finitebox.com>
Marcus Linke <marcus.linke@gmx.de>
Marcus Ramberg <marcus@nordaaker.com>
Marek Goldmann <marek.goldmann@gmail.com>
Marian Marinov <mm@yuhu.biz>
Marianna <mtesselh@gmail.com>
Marius Voila <marius.voila@gmail.com>
Mark Allen <mrallen1@yahoo.com>
Mark McGranaghan <mmcgrana@gmail.com>
Mark West <markewest@gmail.com>
Marko Mikulicic <mmikulicic@gmail.com>
Marko Tibold <marko@tibold.nl>
Markus Fix <lispmeister@gmail.com>
Martijn Dwars <ikben@martijndwars.nl>
Martijn van Oosterhout <kleptog@svana.org>
Martin Honermeyer <maze@strahlungsfrei.de>
Martin Redmond <martin@tinychat.com>
Mary Anthony <moxieandmore@gmail.com>
Mary Anthony <mary.anthony@docker.com>
Masahito Zembutsu <zembutsu@users.noreply.github.com>
Mason Malone <mason.malone@gmail.com>
Mateusz Sulima <sulima.mateusz@gmail.com>
Mathias Monnerville <mathias@monnerville.com>
Mathieu Le Marec - Pasquet <kiorky@cryptelium.net>
Matt Apperson <me@mattapperson.com>
Matt Bachmann <bachmann.matt@gmail.com>
Matt Bentley <mbentley@mbentley.net>
Matt Haggard <haggardii@gmail.com>
Matt McCormick <matt.mccormick@kitware.com>
Matthew Heon <mheon@redhat.com>
Matthew Mayer <matthewkmayer@gmail.com>
Matthew Mueller <mattmuelle@gmail.com>
Matthew Riley <mattdr@google.com>
Matthias Klumpp <matthias@tenstral.net>
Matthias Kühnle <git.nivoc@neverbox.com>
mattymo <raytrac3r@gmail.com>
mattyw <mattyw@me.com>
mauriyouth <mauriyouth@gmail.com>
Max Shytikov <mshytikov@gmail.com>
Maxim Kulkin <mkulkin@mirantis.com>
Maxim Treskin <zerthurd@gmail.com>
Maxime Petazzoni <max@signalfuse.com>
Meaglith Ma <genedna@gmail.com>
meejah <meejah@meejah.ca>
Megan Kostick <mkostick@us.ibm.com>
Mehul Kar <mehul.kar@gmail.com>
Mengdi Gao <usrgdd@gmail.com>
Mert Yazıcıoğlu <merty@users.noreply.github.com>
Michael A. Smith <michael@smith-li.com>
Michael Brown <michael@netdirect.ca>
Michael Chiang <mchiang@docker.com>
Michael Crosby <michael@docker.com>
Michael Gorsuch <gorsuch@github.com>
Michael Hudson-Doyle <michael.hudson@linaro.org>
@@ -491,26 +657,35 @@ Michael Scharf <github@scharf.gr>
Michael Stapelberg <michael+gh@stapelberg.de>
Michael Steinert <mike.steinert@gmail.com>
Michael Thies <michaelthies78@gmail.com>
Michael West <mwest@mdsol.com>
Michal Fojtik <mfojtik@redhat.com>
Michal Jemala <michal.jemala@gmail.com>
Michal Minar <miminar@redhat.com>
Michaël Pailloncy <mpapo.dev@gmail.com>
Michiel@unhosted <michiel@unhosted.org>
Miguel Angel Fernández <elmendalerenda@gmail.com>
Mihai Borobocea <MihaiBorobocea@gmail.com>
Mike Chelen <michael.chelen@gmail.com>
Mike Dillon <mike@embody.org>
Mike Gaffney <mike@uberu.com>
Mike Leone <mleone896@gmail.com>
Mike MacCana <mike.maccana@gmail.com>
Mike Naberezny <mike@naberezny.com>
Mike Snitzer <snitzer@redhat.com>
Mikhail Sobolev <mss@mawhrin.net>
Mingzhen Feng <fmzhen@zju.edu.cn>
Mitch Capper <mitch.capper@gmail.com>
Mohit Soni <mosoni@ebay.com>
Morgante Pell <morgante.pell@morgante.net>
Morten Siebuhr <sbhr@sbhr.dk>
Moysés Borges <moyses.furtado@wplex.com.br>
Mrunal Patel <mrunalp@gmail.com>
mschurenko <matt.schurenko@gmail.com>
Mustafa Akın <mustafa91@gmail.com>
Médi-Rémi Hashim <medimatrix@users.noreply.github.com>
Nan Monnand Deng <monnand@gmail.com>
Naoki Orii <norii@cs.cmu.edu>
Natalie Parker <nparker@omnifone.com>
Nate Eagleson <nate@nateeag.com>
Nate Jones <nate@endot.org>
Nathan Hsieh <hsieh.nathan@gmail.com>
@@ -518,8 +693,11 @@ Nathan Kleyn <nathan@nathankleyn.com>
Nathan LeClaire <nathan.leclaire@docker.com>
Neal McBurnett <neal@mcburnett.org>
Nelson Chen <crazysim@gmail.com>
Nghia Tran <nghia@google.com>
Niall O'Higgins <niallo@unworkable.org>
Nicholas E. Rabenau <nerab@gmx.at>
Nick Irvine <nfirvine@nfirvine.com>
Nick Parker <nikaios@gmail.com>
Nick Payne <nick@kurai.co.uk>
Nick Stenning <nick.stenning@digital.cabinet-office.gov.uk>
Nick Stinemates <nick@stinemates.org>
@@ -528,8 +706,11 @@ Nicolas Dudebout <nicolas.dudebout@gatech.edu>
Nicolas Goy <kuon@goyman.com>
Nicolas Kaiser <nikai@nikai.net>
NikolaMandic <mn080202@gmail.com>
nikolas <nnyby@columbia.edu>
noducks <onemannoducks@gmail.com>
Nolan Darilek <nolan@thewordnerd.info>
nponeccop <andy.melnikov@gmail.com>
Nuutti Kotivuori <naked@iki.fi>
nzwsch <hi@nzwsch.com>
O.S. Tezer <ostezer@gmail.com>
OddBloke <daniel@daniel-watkins.co.uk>
@@ -542,11 +723,14 @@ pandrew <letters@paulnotcom.se>
panticz <mail@konczalski.de>
Pascal Borreli <pascal@borreli.com>
Pascal Hartig <phartig@rdrei.net>
Patrick Devine <patrick.devine@docker.com>
Patrick Hemmer <patrick.hemmer@gmail.com>
Patrick Stapleton <github@gdi2290.com>
pattichen <craftsbear@gmail.com>
Paul <paul9869@gmail.com>
paul <paul@inkling.com>
Paul Annesley <paul@annesley.cc>
Paul Bellamy <paul.a.bellamy@gmail.com>
Paul Bowsher <pbowsher@globalpersonals.co.uk>
Paul Hammond <paul@paulhammond.org>
Paul Jimenez <pj@place.org>
@@ -554,11 +738,18 @@ Paul Lietar <paul@lietar.net>
Paul Morie <pmorie@gmail.com>
Paul Nasrat <pnasrat@gmail.com>
Paul Weaver <pauweave@cisco.com>
Pavel Lobashov <ShockwaveNN@gmail.com>
Pavel Tikhomirov <ptikhomirov@parallels.com>
Pavlos Ratis <dastergon@gentoo.org>
Peggy Li <peggyli.224@gmail.com>
Peter Bourgon <peter@bourgon.org>
Peter Braden <peterbraden@peterbraden.co.uk>
Peter Choi <reikani@Peters-MacBook-Pro.local>
Peter Dave Hello <PeterDaveHello@users.noreply.github.com>
Peter Ericson <pdericson@gmail.com>
Peter Esbensen <pkesbensen@gmail.com>
Peter Salvatore <peter@psftw.com>
Peter Volpe <petervo@redhat.com>
Peter Waller <p@pwaller.net>
Phil <underscorephil@gmail.com>
Phil Estes <estesp@linux.vnet.ibm.com>
@@ -572,6 +763,7 @@ Pierre-Alain RIVIERE <pariviere@ippon.fr>
Piotr Bogdan <ppbogdan@gmail.com>
pixelistik <pixelistik@users.noreply.github.com>
Porjo <porjo38@yahoo.com.au>
Pradeep Chhetri <pradeep@indix.com>
Prasanna Gautam <prasannagautam@gmail.com>
Przemek Hejman <przemyslaw.hejman@gmail.com>
pysqz <randomq@126.com>
@@ -580,6 +772,7 @@ Quentin Brossard <qbrossard@gmail.com>
r0n22 <cameron.regan@gmail.com>
Rafal Jeczalik <rjeczalik@gmail.com>
Rafe Colton <rafael.colton@gmail.com>
Raghuram Devarakonda <draghuram@gmail.com>
Rajat Pandit <rp@rajatpandit.com>
Rajdeep Dua <dua_rajdeep@yahoo.com>
Ralph Bean <rbean@redhat.com>
@@ -588,13 +781,19 @@ Ramon van Alteren <ramon@vanalteren.nl>
Recursive Madman <recursive.madman@gmx.de>
Remi Rampin <remirampin@gmail.com>
Renato Riccieri Santos Zannon <renato.riccieri@gmail.com>
resouer <resouer@163.com>
rgstephens <greg@udon.org>
Rhys Hiltner <rhys@twitch.tv>
Rich Seymour <rseymour@gmail.com>
Richard <richard.scothern@gmail.com>
Richard Burnison <rburnison@ebay.com>
Richard Harvey <richard@squarecows.com>
Richard Metzler <richard@paadee.com>
Richo Healey <richo@psych0tik.net>
Rick Bradley <rick@users.noreply.github.com>
Rick van de Loo <rickvandeloo@gmail.com>
Rick Wieman <git@rickw.nl>
Rik Nijessen <rik@keefo.nl>
Robert Bachmann <rb@robertbachmann.at>
Robert Bittle <guywithnose@gmail.com>
Robert Obryk <robryk@gmail.com>
@@ -608,6 +807,7 @@ Rohit Jnagal <jnagal@google.com>
Roland Huß <roland@jolokia.org>
Roland Moriz <rmoriz@users.noreply.github.com>
Ron Smits <ron.smits@gmail.com>
root <docker-dummy@example.com>
Rovanion Luckey <rovanion.luckey@gmail.com>
Rudolph Gottesheim <r.gottesheim@loot.at>
Ryan Anderson <anderson.ryanc@gmail.com>
@@ -618,6 +818,11 @@ Ryan O'Donnell <odonnellryanc@gmail.com>
Ryan Seto <ryanseto@yak.net>
Ryan Thomas <rthomas@atlassian.com>
Rémy Greinhofer <remy.greinhofer@livelovely.com>
s. rannou <mxs@sbrk.org>
s00318865 <sunyuan3@huawei.com>
Sabin Basyal <sabin.basyal@gmail.com>
Sachin Joshi <sachin_jayant_joshi@hotmail.com>
Sam Abed <sam.abed@gmail.com>
Sam Alba <sam.alba@gmail.com>
Sam Bailey <cyprix@cyprix.com.au>
Sam J Sharpe <sam.sharpe@digital.cabinet-office.gov.uk>
@@ -626,6 +831,9 @@ Sam Rijs <srijs@airpost.net>
Sami Wagiaalla <swagiaal@redhat.com>
Samuel Andaya <samuel@andaya.net>
Samuel PHAN <samuel-phan@users.noreply.github.com>
Sankar சங்கர் <sankar.curiosity@gmail.com>
Sanket Saurav <sanketsaurav@gmail.com>
sapphiredev <se.imas.kr@gmail.com>
Satnam Singh <satnam@raintown.org>
satoru <satorulogic@gmail.com>
Satoshi Amemiya <satoshi_amemiya@voyagegroup.com>
@@ -634,26 +842,35 @@ Scott Collier <emailscottcollier@gmail.com>
Scott Johnston <scott@docker.com>
Scott Stamp <scottstamp851@gmail.com>
Scott Walls <sawalls@umich.edu>
sdreyesg <sdreyesg@gmail.com>
Sean Cronin <seancron@gmail.com>
Sean P. Kane <skane@newrelic.com>
Sebastiaan van Steenis <mail@superseb.nl>
Sebastiaan van Stijn <github@gone.nl>
Senthil Kumar Selvaraj <senthil.thecoder@gmail.com>
SeongJae Park <sj38.park@gmail.com>
Seongyeol Lim <seongyeol37@gmail.com>
Sergey Alekseev <sergey.alekseev.minsk@gmail.com>
Sergey Evstifeev <sergey.evstifeev@gmail.com>
Shane Canon <scanon@lbl.gov>
shaunol <shaunol@gmail.com>
Shawn Landden <shawn@churchofgit.com>
Shawn Siefkas <shawn.siefkas@meredith.com>
Shih-Yuan Lee <fourdollars@gmail.com>
Shijiang Wei <mountkin@gmail.com>
Shishir Mahajan <shishir.mahajan@redhat.com>
shuai-z <zs.broccoli@gmail.com>
sidharthamani <sid@rancher.com>
Silas Sewell <silas@sewell.org>
Simei He <hesimei@zju.edu.cn>
Simon Eskildsen <sirup@sirupsen.com>
Simon Leinen <simon.leinen@gmail.com>
Simon Taranto <simon.taranto@gmail.com>
Sindhu S <sindhus@live.in>
Sjoerd Langkemper <sjoerd-github@linuxonly.nl>
Solomon Hykes <solomon@docker.com>
Song Gao <song@gao.io>
Soulou <leo@unbekandt.eu>
soulshake <amy@gandi.net>
Sridatta Thatipamala <sthatipamala@gmail.com>
Sridhar Ratnakumar <sridharr@activestate.com>
Srini Brahmaroutu <sbrahma@us.ibm.com>
@@ -661,20 +878,30 @@ Srini Brahmaroutu <srbrahma@us.ibm.com>
Steeve Morin <steeve.morin@gmail.com>
Stefan Praszalowicz <stefan@greplin.com>
Stephen Crosby <stevecrozz@gmail.com>
Stephen J Day <stephen.day@docker.com>
Steve Francia <steve.francia@gmail.com>
Steve Koch <stevekochscience@gmail.com>
Steven Burgess <steven.a.burgess@hotmail.com>
Steven Merrill <steven.merrill@gmail.com>
Steven Richards <steven@axiomzen.co>
Steven Taylor <steven.taylor@me.com>
Sven Dowideit <SvenDowideit@home.org.au>
Swapnil Daingade <swapnil.daingade@gmail.com>
Sylvain Baubeau <sbaubeau@redhat.com>
Sylvain Bellemare <sylvain.bellemare@ezeep.com>
Sébastien <sebastien@yoozio.com>
Sébastien Luttringer <seblu@seblu.net>
Sébastien Stormacq <sebsto@users.noreply.github.com>
tang0th <tang0th@gmx.com>
Tangi COLIN <tangicolin@gmail.com>
Tatsuki Sugiura <sugi@nemui.org>
Tatsushi Inagaki <e29253@jp.ibm.com>
Ted M. Young <tedyoung@gmail.com>
Tehmasp Chaudhri <tehmasp@gmail.com>
Tejesh Mehta <tejesh.mehta@gmail.com>
Thatcher Peskens <thatcher@docker.com>
theadactyl <thea.lamkin@gmail.com>
Thell 'Bo' Fowler <thell@tbfowler.name>
Thermionix <bond711@gmail.com>
Thijs Terlouw <thijsterlouw@gmail.com>
Thomas Bikeev <thomas.bikeev@mac.com>
@@ -683,8 +910,11 @@ Thomas Hansen <thomas.hansen@gmail.com>
Thomas LEVEIL <thomasleveil@gmail.com>
Thomas Orozco <thomas@orozco.fr>
Thomas Schroeter <thomas@cliqz.com>
Thomas Sjögren <konstruktoid@users.noreply.github.com>
Thomas Texier <sharkone@en-mousse.org>
Tianon Gravi <admwiggin@gmail.com>
Tibor Vass <teabee89@gmail.com>
Tiffany Low <tiffany@box.com>
Tim Bosse <taim@bosboot.org>
Tim Hockin <thockin@google.com>
Tim Ruffles <oi@truffles.me.uk>
@@ -698,6 +928,7 @@ Tobias Gesellchen <tobias@gesellix.de>
Tobias Schmidt <ts@soundcloud.com>
Tobias Schwab <tobias.schwab@dynport.de>
Todd Lunter <tlunter@gmail.com>
Todd Whiteman <todd.whiteman@joyent.com>
Tom Fotherby <tom+github@peopleperhour.com>
Tom Hulihan <hulihan.tom159@gmail.com>
Tom Maaswinkel <tom.maaswinkel@12wiki.eu>
@@ -705,16 +936,22 @@ Tomas Tomecek <ttomecek@redhat.com>
Tomasz Lipinski <tlipinski@users.noreply.github.com>
Tomasz Nurkiewicz <nurkiewicz@gmail.com>
Tommaso Visconti <tommaso.visconti@gmail.com>
Tomáš Hrčka <thrcka@redhat.com>
Tonis Tiigi <tonistiigi@gmail.com>
Tonny Xu <tonny.xu@gmail.com>
Tony Daws <tony@daws.ca>
Tony Miller <mcfiredrill@gmail.com>
Torstein Husebø <torstein@huseboe.net>
tpng <benny.tpng@gmail.com>
Travis Cline <travis.cline@gmail.com>
Travis Thieman <travis.thieman@gmail.com>
Trent Ogren <tedwardo2@gmail.com>
Tristan Carel <tristan.carel@gmail.com>
Tyler Brock <tyler.brock@gmail.com>
Tzu-Jung Lee <roylee17@gmail.com>
Ulysse Carion <ulyssecarion@gmail.com>
unknown <sebastiaan@ws-key-sebas3.dpi1.dpi>
vagrant <vagrant@ubuntu-14.04-amd64-vbox>
Vaidas Jablonskis <jablonskis@gmail.com>
vgeta <gopikannan.venugopalsamy@gmail.com>
Victor Coisne <victor.coisne@dotcloud.com>
@@ -725,6 +962,7 @@ Viktor Vojnovski <viktor.vojnovski@amadeus.com>
Vincent Batts <vbatts@redhat.com>
Vincent Bernat <bernat@luffy.cx>
Vincent Bernat <Vincent.Bernat@exoscale.ch>
Vincent Demeester <vincent@sbr.pm>
Vincent Giersch <vincent.giersch@ovh.net>
Vincent Mayers <vincent.mayers@inbloom.org>
Vincent Woo <me@vincentwoo.com>
@@ -738,6 +976,7 @@ Vivek Goyal <vgoyal@redhat.com>
Vladimir Bulyga <xx@ccxx.cc>
Vladimir Kirillov <proger@wilab.org.ua>
Vladimir Rutsky <altsysrq@gmail.com>
VladimirAus <v_roudakov@yahoo.com>
Vojtech Vitek (V-Teq) <vvitek@redhat.com>
waitingkuo <waitingkuo0527@gmail.com>
Walter Leibbrandt <github@wrl.co.za>
@@ -745,25 +984,46 @@ Walter Stanish <walter@pratyeka.org>
Ward Vandewege <ward@jhvc.com>
WarheadsSE <max@warheads.net>
Wayne Chang <wayne@neverfear.org>
Wei-Ting Kuo <waitingkuo0527@gmail.com>
Wes Morgan <cap10morgan@gmail.com>
Will Dietz <w@wdtz.org>
Will Rouesnel <w.rouesnel@gmail.com>
Will Weaver <monkey@buildingbananas.com>
willhf <willhf@gmail.com>
William Delanoue <william.delanoue@gmail.com>
William Henry <whenry@redhat.com>
William Riancho <wr.wllm@gmail.com>
William Thurston <thurstw@amazon.com>
WiseTrem <shepelyov.g@gmail.com>
wlan0 <sidharthamn@gmail.com>
Wolfgang Powisch <powo@powo.priv.at>
wonderflow <wonderflow.sun@gmail.com>
xamyzhao <x.amy.zhao@gmail.com>
XiaoBing Jiang <s7v7nislands@gmail.com>
Xinzi Zhou <imdreamrunner@gmail.com>
Xiuming Chen <cc@cxm.cc>
xuzhaokui <cynicholas@gmail.com>
y00277921 <yuchangchun1@huawei.com>
Yahya <ya7yaz@gmail.com>
YAMADA Tsuyoshi <tyamada@minimum2scp.org>
Yan Feng <yanfeng2@huawei.com>
Yang Bai <hamo.by@gmail.com>
Yasunori Mahata <nori@mahata.net>
Yestin Sun <sunyi0804@gmail.com>
Yihang Ho <hoyihang5@gmail.com>
Yohei Ueda <yohei@jp.ibm.com>
Yongzhi Pan <panyongzhi@gmail.com>
Yuan Sun <sunyuan3@huawei.com>
Yurii Rashkovskii <yrashk@gmail.com>
Zac Dover <zdover@redhat.com>
Zach Borboa <zachborboa@gmail.com>
Zain Memon <zain@inzain.net>
Zaiste! <oh@zaiste.net>
Zane DeGraffenried <zane.deg@gmail.com>
Zefan Li <lizefan@huawei.com>
Zen Lin(Zhinan Lin) <linzhinan@huawei.com>
Zhang Wei <zhangwei555@huawei.com>
Zhang Wentao <zhangwentao234@huawei.com>
Zilin Du <zilin.du@gmail.com>
zimbatm <zimbatm@zimbatm.com>
Zoltan Tombol <zoltan.tombol@gmail.com>

View File

@@ -1,5 +1,195 @@
# Changelog
## 1.8.3 (2015-10-12)
### Distribution
- Fix layer IDs lead to local graph poisoning (CVE-2014-8178)
- Fix manifest validation and parsing logic errors allow pull-by-digest validation bypass (CVE-2014-8179)
+ Add `--disable-legacy-registry` to prevent a daemon from using a v1 registry
## 1.8.2 (2015-09-10)
### Distribution
- Fixes rare edge case of handling GNU LongLink and LongName entries.
- Fix ^C on docker pull.
- Fix docker pull issues on client disconnection.
- Fix issue that caused the daemon to panic when loggers weren't configured properly.
- Fix goroutine leak pulling images from registry V2.
### Runtime
- Fix a bug mounting cgroups for docker daemons running inside docker containers.
- Initialize log configuration properly.
### Client:
- Handle `-q` flag in `docker ps` properly when there is a default format.
### Networking
- Fix several corner cases with netlink.
### Contrib
- Fix several issues with bash completion.
## 1.8.1 (2015-08-12)
### Distribution
- Fix a bug where pushing multiple tags would result in invalid images
## 1.8.0 (2015-08-11)
### Distribution
+ Trusted pull, push and build, disabled by default
* Make tar layers deterministic between registries
* Don't allow deleting the image of running containers
* Check if a tag name to load is a valid digest
* Allow one character repository names
* Add a more accurate error description for invalid tag name
* Make build cache ignore mtime
### Cli
+ Add support for DOCKER_CONFIG/--config to specify config file dir
+ Add --type flag for docker inspect command
+ Add formatting options to `docker ps` with `--format`
+ Replace `docker -d` with new subcommand `docker daemon`
* Zsh completion updates and improvements
* Add some missing events to bash completion
* Support daemon urls with base paths in `docker -H`
* Validate status= filter to docker ps
* Display when a container is in --net=host in docker ps
* Extend docker inspect to export image metadata related to graph driver
* Restore --default-gateway{,-v6} daemon options
* Add missing unpublished ports in docker ps
* Allow duration strings in `docker events` as --since/--until
* Expose more mounts information in `docker inspect`
### Runtime
+ Add new Fluentd logging driver
+ Allow `docker import` to load from local files
+ Add logging driver for GELF via UDP
+ Allow to copy files from host to containers with `docker cp`
+ Promote volume drivers from experimental to master
+ Add rollover log driver, and --log-driver-opts flag
+ Add memory swappiness tuning options
* Remove cgroup read-only flag when privileged
* Make /proc, /sys, & /dev readonly for readonly containers
* Add cgroup bind mount by default
* Overlay: Export metadata for container and image in `docker inspect`
* Devicemapper: external device activation
* Devicemapper: Compare uuid of base device on startup
* Remove RC4 from the list of registry cipher suites
* Add syslog-facility option
* LXC execdriver compatibility with recent LXC versions
* Mark LXC execriver as deprecated (to be removed with the migration to runc)
### Plugins
* Separate plugin sockets and specs locations
* Allow TLS connections to plugins
### Bug fixes
- Add missing 'Names' field to /containers/json API output
- Make `docker rmi --dangling` safe when pulling
- Devicemapper: Change default basesize to 100G
- Go Scheduler issue with sync.Mutex and gcc
- Fix issue where Search API endpoint would panic due to empty AuthConfig
- Set image canonical names correctly
- Check dockerinit only if lxc driver is used
- Fix ulimit usage of nproc
- Always attach STDIN if -i,--interactive is specified
- Show error messages when saving container state fails
- Fixed incorrect assumption on --bridge=none treated as disable network
- Check for invalid port specifications in host configuration
- Fix endpoint leave failure for --net=host mode
- Fix goroutine leak in the stats API if the container is not running
- Check for apparmor file before reading it
- Fix DOCKER_TLS_VERIFY being ignored
- Set umask to the default on startup
- Correct the message of pause and unpause a non-running container
- Adjust disallowed CpuShares in container creation
- ZFS: correctly apply selinux context
- Display empty string instead of <nil> when IP opt is nil
- `docker kill` returns error when container is not running
- Fix COPY/ADD quoted/json form
- Fix goroutine leak on logs -f with no output
- Remove panic in nat package on invalid hostport
- Fix container linking in Fedora 22
- Fix error caused using default gateways outside of the allocated range
- Format times in inspect command with a template as RFC3339Nano
- Make registry client to accept 2xx and 3xx http status responses as successful
- Fix race issue that caused the daemon to crash with certain layer downloads failed in a specific order.
- Fix error when the docker ps format was not valid.
- Remove redundant ip forward check.
- Fix issue trying to push images to repository mirrors.
- Fix error cleaning up network entrypoints when there is an initialization issue.
## 1.7.1 (2015-07-14)
#### Runtime
- Fix default user spawning exec process with `docker exec`
- Make `--bridge=none` not to configure the network bridge
- Publish networking stats properly
- Fix implicit devicemapper selection with static binaries
- Fix socket connections that hung intermittently
- Fix bridge interface creation on CentOS/RHEL 6.6
- Fix local dns lookups added to resolv.conf
- Fix copy command mounting volumes
- Fix read/write privileges in volumes mounted with --volumes-from
#### Remote API
- Fix unmarshalling of Command and Entrypoint
- Set limit for minimum client version supported
- Validate port specification
- Return proper errors when attach/reattach fail
#### Distribution
- Fix pulling private images
- Fix fallback between registry V2 and V1
## 1.7.0 (2015-06-16)
#### Runtime
+ Experimental feature: support for out-of-process volume plugins
* The userland proxy can be disabled in favor of hairpin NAT using the daemons `--userland-proxy=false` flag
* The `exec` command supports the `-u|--user` flag to specify the new process owner
+ Default gateway for containers can be specified daemon-wide using the `--default-gateway` and `--default-gateway-v6` flags
+ The CPU CFS (Completely Fair Scheduler) quota can be set in `docker run` using `--cpu-quota`
+ Container block IO can be controlled in `docker run` using`--blkio-weight`
+ ZFS support
+ The `docker logs` command supports a `--since` argument
+ UTS namespace can be shared with the host with `docker run --uts=host`
#### Quality
* Networking stack was entirely rewritten as part of the libnetwork effort
* Engine internals refactoring
* Volumes code was entirely rewritten to support the plugins effort
+ Sending SIGUSR1 to a daemon will dump all goroutines stacks without exiting
#### Build
+ Support ${variable:-value} and ${variable:+value} syntax for environment variables
+ Support resource management flags `--cgroup-parent`, `--cpu-period`, `--cpu-quota`, `--cpuset-cpus`, `--cpuset-mems`
+ git context changes with branches and directories
* The .dockerignore file support exclusion rules
#### Distribution
+ Client support for v2 mirroring support for the official registry
#### Bugfixes
* Firewalld is now supported and will automatically be used when available
* mounting --device recursively
## 1.6.2 (2015-05-13)
#### Runtime
@@ -15,7 +205,7 @@
- Prohibit mount of /sys
#### Runtime
- Update Apparmor policy to not allow mounts
- Update AppArmor policy to not allow mounts
## 1.6.0 (2015-04-07)
@@ -86,7 +276,7 @@
#### Notable Features since 1.3.0
+ Set key=value labels to the daemon (displayed in `docker info`), applied with
new `-label` daemon flag
+ Add support for `ENV` in Dockerfile of the form:
+ Add support for `ENV` in Dockerfile of the form:
`ENV name=value name2=value2...`
+ New Overlayfs Storage Driver
+ `docker info` now returns an `ID` and `Name` field
@@ -309,7 +499,7 @@
#### Hack
* Clean up "go test" output from "make test" to be much more readable/scannable.
* Excluse more "definitely not unit tested Go source code" directories from hack/make/test.
* Exclude more "definitely not unit tested Go source code" directories from hack/make/test.
+ Generate md5 and sha256 hashes when building, and upload them via hack/release.sh.
- Include contributed completions in Ubuntu PPA.
+ Add cli integration tests.
@@ -548,7 +738,7 @@
- Fix broken images API for version less than 1.7
- Use the right encoding for all API endpoints which return JSON
- Move remote api client to api/
- Queue calls to the API using generic socket wait
- Queue calls to the API using generic socket wait
#### Runtime
@@ -589,7 +779,7 @@ With the ongoing changes to the networking and execution subsystems of docker te
* The ADD instruction now supports caching, which avoids unnecessarily re-uploading the same source content again and again when it hasnt changed
* The new ONBUILD instruction adds to your image a “trigger” instruction to be executed at a later time, when the image is used as the base for another build
* Docker now ships with an experimental storage driver which uses the BTRFS filesystem for copy-on-write
* Docker is officially supported on Mac OSX
* Docker is officially supported on Mac OS X
* The Docker daemon supports systemd socket activation
## 0.7.6 (2014-01-14)
@@ -628,7 +818,7 @@ With the ongoing changes to the networking and execution subsystems of docker te
- Do not add hostname when networking is disabled
* Return most recent image from the cache by date
- Return all errors from docker wait
* Add Content-Type Header "application/json" to GET /version and /info responses
* Add Content-Type Header "application/json" to GET /version and /info responses
#### Other
@@ -643,12 +833,12 @@ With the ongoing changes to the networking and execution subsystems of docker te
- Fix ADD caching issue with . prefixed path
- Fix docker build on devicemapper by reverting sparse file tar option
- Fix issue with file caching and prevent wrong cache hit
* Use same error handling while unmarshalling CMD and ENTRYPOINT
* Use same error handling while unmarshalling CMD and ENTRYPOINT
#### Documentation
* Simplify and streamline Amazon Quickstart
* Install instructions use unprefixed fedora image
* Install instructions use unprefixed Fedora image
* Update instructions for mtu flag for Docker on GCE
+ Add Ubuntu Saucy to installation
- Fix for wrong version warning on master instead of latest
@@ -656,7 +846,7 @@ With the ongoing changes to the networking and execution subsystems of docker te
#### Runtime
- Only get the image's rootfs when we need to calculate the image size
- Correctly handle unmapping UDP ports
- Correctly handle unmapping UDP ports
* Make CopyFileWithTar use a pipe instead of a buffer to save memory on docker build
- Fix login message to say pull instead of push
- Fix "docker load" help by removing "SOURCE" prompt and mentioning STDIN
@@ -823,7 +1013,7 @@ With the ongoing changes to the networking and execution subsystems of docker te
* Improve unit tests
* The test suite now runs all tests even if one fails
* Refactor C in Go (Devmapper)
- Fix OSX compilation
- Fix OS X compilation
## 0.7.0 (2013-11-25)
@@ -841,7 +1031,7 @@ With the ongoing changes to the networking and execution subsystems of docker te
#### Runtime
* Improve stability, fixes some race conditons
* Improve stability, fixes some race conditions
* Skip the volumes mounted when deleting the volumes of container.
* Fix layer size computation: handle hard links correctly
* Use the work Path for docker cp CONTAINER:PATH

View File

@@ -4,7 +4,7 @@ Want to hack on Docker? Awesome! We have a contributor's guide that explains
[setting up a Docker development environment and the contribution
process](https://docs.docker.com/project/who-written-for/).
![Contributors guide](docs/sources/static_files/contributors.png)
![Contributors guide](docs/static_files/contributors.png)
This page contains information about reporting issues as well as some tips and
guidelines useful to experienced open source contributors. Finally, make sure
@@ -28,8 +28,8 @@ Please **DO NOT** file a public issue, instead send your report privately to
[security@docker.com](mailto:security@docker.com),
Security reports are greatly appreciated and we will publicly thank you for it.
We also like to send gifts&mdash;if you're into Docker schwag make sure to let
us know We currently do not offer a paid security bounty program, but are not
We also like to send gifts&mdash;if you're into Docker schwag, make sure to let
us know. We currently do not offer a paid security bounty program, but are not
ruling it out in the future.
@@ -220,7 +220,7 @@ set of patches that should be reviewed together: for example, upgrading the
version of a vendored dependency and taking advantage of its now available new
feature constitute two separate units of work. Implementing a new function and
calling it in another file constitute a single logical unit of work. The very
high majory of submissions should have a single commit, so if in doubt: squash
high majority of submissions should have a single commit, so if in doubt: squash
down to one.
After every commit, [make sure the test suite passes]
@@ -234,6 +234,8 @@ close an issue. Including references automatically closes the issue on a merge.
Please do not add yourself to the `AUTHORS` file, as it is regenerated regularly
from the Git history.
Please see the [Coding Style](#coding-style) for further guidelines.
### Merge approval
Docker maintainers use LGTM (Looks Good To Me) in comments on the code review to
@@ -317,7 +319,7 @@ maintainer to make a difference on the project!
### IRC meetings
There are two monthly meetings taking place on #docker-dev IRC to accomodate all
There are two monthly meetings taking place on #docker-dev IRC to accommodate all
timezones. Anybody can propose a topic for discussion prior to the meeting.
If you feel the conversation is going off-topic, feel free to point it out.
@@ -385,3 +387,49 @@ do need a fair way to deal with people who are making our community suck.
appeals, we know that mistakes happen, and we'll work with you to come up with a
fair solution if there has been a misunderstanding.
## Coding Style
Unless explicitly stated, we follow all coding guidelines from the Go
community. While some of these standards may seem arbitrary, they somehow seem
to result in a solid, consistent codebase.
It is possible that the code base does not currently comply with these
guidelines. We are not looking for a massive PR that fixes this, since that
goes against the spirit of the guidelines. All new contributions should make a
best effort to clean up and make the code base better than they left it.
Obviously, apply your best judgement. Remember, the goal here is to make the
code base easier for humans to navigate and understand. Always keep that in
mind when nudging others to comply.
The rules:
1. All code should be formatted with `gofmt -s`.
2. All code should pass the default levels of
[`golint`](https://github.com/golang/lint).
3. All code should follow the guidelines covered in [Effective
Go](http://golang.org/doc/effective_go.html) and [Go Code Review
Comments](https://github.com/golang/go/wiki/CodeReviewComments).
4. Comment the code. Tell us the why, the history and the context.
5. Document _all_ declarations and methods, even private ones. Declare
expectations, caveats and anything else that may be important. If a type
gets exported, having the comments already there will ensure it's ready.
6. Variable name length should be proportional to it's context and no longer.
`noCommaALongVariableNameLikeThisIsNotMoreClearWhenASimpleCommentWouldDo`.
In practice, short methods will have short variable names and globals will
have longer names.
7. No underscores in package names. If you need a compound name, step back,
and re-examine why you need a compound name. If you still think you need a
compound name, lose the underscore.
8. No utils or helpers packages. If a function is not general enough to
warrant it's own package, it has not been written generally enough to be a
part of a util package. Just leave it unexported and well-documented.
9. All tests should run with `go test` and outside tooling should not be
required. No, we don't need another unit testing framework. Assertion
packages are acceptable if they provide _real_ incremental value.
10. Even though we call these "rules" above, they are actually just
guidelines. Since you've read all the rules, you now know that.
If you are having trouble getting into the mood of idiomatic Go, we recommend
reading through [Effective Go](http://golang.org/doc/effective_go.html). The
[Go Blog](http://blog.golang.org/) is also a great resource. Drinking the
kool-aid is a lot easier than going thirsty.

View File

@@ -19,14 +19,14 @@
# -e GPG_PASSPHRASE=gloubiboulga \
# docker hack/release.sh
#
# Note: Apparmor used to mess with privileged mode, but this is no longer
# Note: AppArmor used to mess with privileged mode, but this is no longer
# the case. Therefore, you don't have to disable it anymore.
#
FROM ubuntu:14.04
MAINTAINER Tianon Gravi <admwiggin@gmail.com> (@tianon)
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61
RUN echo deb http://ppa.launchpad.net/zfs-native/stable/ubuntu trusty main > /etc/apt/sources.list.d/zfs.list
# Packaged dependencies
@@ -37,6 +37,7 @@ RUN apt-get update && apt-get install -y \
bash-completion \
btrfs-tools \
build-essential \
createrepo \
curl \
dpkg-sig \
git \
@@ -69,7 +70,7 @@ RUN cd /usr/local/lvm2 \
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# Install lxc
ENV LXC_VERSION 1.0.7
ENV LXC_VERSION 1.1.2
RUN mkdir -p /usr/src/lxc \
&& curl -sSL https://linuxcontainers.org/downloads/lxc/lxc-${LXC_VERSION}.tar.gz | tar -v -C /usr/src/lxc/ -xz --strip-components=1
RUN cd /usr/src/lxc \
@@ -116,21 +117,37 @@ RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT) \
&& go install -v golang.org/x/tools/cmd/cover \
&& go install -v golang.org/x/tools/cmd/vet
# Grab Go's lint tool
ENV GO_LINT_COMMIT f42f5c1c440621302702cb0741e9d2ca547ae80f
RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
&& go install -v github.com/golang/lint/golint
# TODO replace FPM with some very minimal debhelper stuff
RUN gem install --no-rdoc --no-ri fpm --version 1.3.2
# Install registry
ENV REGISTRY_COMMIT d957768537c5af40e4f4cd96871f7b2bde9e2923
ENV REGISTRY_COMMIT ec87e9b6971d831f0eff752ddb54fb64693e51cd
RUN set -x \
&& git clone https://github.com/docker/distribution.git /go/src/github.com/docker/distribution \
&& (cd /go/src/github.com/docker/distribution && git checkout -q $REGISTRY_COMMIT) \
&& GOPATH=/go/src/github.com/docker/distribution/Godeps/_workspace:/go \
go build -o /go/bin/registry-v2 github.com/docker/distribution/cmd/registry \
&& rm -rf /go/src/github.com/docker/distribution/
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
&& rm -rf "$GOPATH"
# Install notary server
ENV NOTARY_COMMIT 8e8122eb5528f621afcd4e2854c47302f17392f7
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_COMMIT") \
&& GOPATH="$GOPATH/src/github.com/docker/notary/Godeps/_workspace:$GOPATH" \
go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
&& rm -rf "$GOPATH"
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT 91985b239764fe54714fa0a93d52aa362357d251
ENV DOCKER_PY_COMMIT 8a87001d09852058f08a807ab6e8491d57ca1e88
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
&& git checkout -q $DOCKER_PY_COMMIT
@@ -162,26 +179,36 @@ RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image.sh /docker-frozen-images \
busybox:latest@4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125 \
hello-world:frozen@e45a5af57b00862e5ef5782a9925979a02ba2b12dff832fd0991335f4a11e5c5 \
busybox:latest@8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55 \
hello-world:frozen@91c95931e552b11604fea91c2f537284149ec32fff0f700a4769cfd31d7696ae \
jess/unshare@5c9f6ea50341a2a8eb6677527f2bdedbf331ae894a41714fda770fb130f3314d
# see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
# Download man page generator
RUN set -x \
&& git clone -b v1.0.1 https://github.com/cpuguy83/go-md2man.git /go/src/github.com/cpuguy83/go-md2man \
&& git clone -b v1.2 https://github.com/russross/blackfriday.git /go/src/github.com/russross/blackfriday
&& export GOPATH="$(mktemp -d)" \
&& git clone -b v1.0.3 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
&& git clone -b v1.2 https://github.com/russross/blackfriday.git "$GOPATH/src/github.com/russross/blackfriday" \
&& go get -v -d github.com/cpuguy83/go-md2man \
&& go build -v -o /usr/local/bin/go-md2man github.com/cpuguy83/go-md2man \
&& rm -rf "$GOPATH"
# Download toml validator
ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
RUN set -x \
&& git clone https://github.com/BurntSushi/toml.git /go/src/github.com/BurntSushi/toml \
&& (cd /go/src/github.com/BurntSushi/toml && git checkout -q $TOMLV_COMMIT)
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" \
&& (cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT") \
&& go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \
&& rm -rf "$GOPATH"
# copy vendor/ because go-md2man needs golang.org/x/net
COPY vendor /go/src/github.com/docker/docker/vendor
RUN go install -v github.com/cpuguy83/go-md2man \
github.com/BurntSushi/toml/cmd/tomlv
# Build/install the tool for embedding resources in Windows binaries
ENV RSRC_COMMIT e48dbf1b7fc464a9e85fcec450dddf80816b76e0
RUN set -x \
&& git clone https://github.com/akavel/rsrc.git /go/src/github.com/akavel/rsrc \
&& cd /go/src/github.com/akavel/rsrc \
&& git checkout -q $RSRC_COMMIT \
&& go install -v
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]

View File

@@ -124,98 +124,8 @@ the relevant operators.
* If the change affects the governance, philosophy, goals or principles of the project,
it must be approved by BDFL.
* A pull request can be in 1 of 5 distinct states, for each of which there is a corresponding label
that needs to be applied. `Rules.review.states` contains the list of states with possible targets
for each.
"""
# Triage
[Rules.review.states.0-needs-triage]
# Maintainers are expected to triage new incoming pull requests by removing
# the `0-triage` label and adding the correct labels (e.g. `1-design-review`)
# potentially skipping some steps depending on the kind of pull request.
# Use common sense for judging.
#
# Checking for DCO should be done at this stage.
#
# If an owner, responsible for closing or merging, can be assigned to the PR,
# the better.
close = "e.g. unresponsive contributor without DCO"
3-docs-review = "non-proposal documentation-only change"
2-code-review = "e.g. trivial bugfix"
1-design-review = "general case"
# Design review
[Rules.review.states.1-needs-design-review]
# Maintainers are expected to comment on the design of the pull request.
# Review of documentation is expected only in the context of design validation,
# not for stylistic changes.
#
# Ideally, documentation should reflect the expected behavior of the code.
# No code review should take place in this step.
#
# Once design is approved, a maintainer should make sure to remove this label
# and add the next one.
close = "design rejected"
3-docs-review = "proposals with only documentation changes"
2-code-review = "general case"
# Code review
[Rules.review.states.2-needs-code-review]
# Maintainers are expected to review the code and ensure that it is good
# quality and in accordance with the documentation in the PR.
#
# If documentation is absent but expected, maintainers should ask for documentation.
#
# All tests should pass.
#
# Once code is approved according to the rules of the subsystem, a maintainer
# should make sure to remove this label and add the next one.
close = ""
1-design-review = "raises design concerns"
4-merge = "trivial change not impacting documentation"
3-docs-review = "general case"
# Docs review
[Rules.review.states.3-needs-docs-review]
# Maintainers are expected to review the documentation in its bigger context,
# ensuring consistency, completeness, validity, and breadth of coverage across
# all extent and new documentation.
#
# They should ask for any editorial change that makes the documentation more
# consistent and easier to understand.
#
# Changes and additions to docs must be reviewed and approved (LGTM'd) by a minimum of
# two docs sub-project maintainers. If the docs change originates with a docs
# maintainer, only one additional LGTM is required (since we assume a docs maintainer
# approves of their own PR).
#
# Once documentation is approved (see below), a maintainer should make sure to remove this
# label and add the next one.
close = ""
2-code-review = "requires more code changes"
1-design-review = "raises design concerns"
4-merge = "general case"
# Merge
[Rules.review.states.4-needs-merge]
# Maintainers are expected to merge this pull request as soon as possible.
# They can ask for a rebase, or carry the pull request themselves.
# These should be the easy PRs to merge.
close = "carry PR"
merge = ""
[Rules.DCO]
title = "Helping contributors with the DCO"
@@ -314,7 +224,7 @@ made through a pull request.
"jfrazelle",
"crosbymichael"
]
[Org.Operators.community]
people = [
"theadactyl"
@@ -326,7 +236,7 @@ made through a pull request.
# day of a new maintainer, the best advice should be "follow the C.M.'s example and you'll
# be fine".
"Chief Maintainer" = "crosbymichael"
# The community manager is responsible for serving the project community, including users,
# contributors and partners. This involves:
# - facilitating communication between maintainers, contributors and users
@@ -335,7 +245,7 @@ made through a pull request.
# - anything the project community needs to be successful
#
# The community manager is a point of contact for any contributor who has questions, concerns
# or feedback about project operations.
# or feedback about project operations.
"Community Manager" = "theadactyl"
[Org."Core maintainers"]
@@ -357,6 +267,7 @@ made through a pull request.
people = [
"calavera",
"crosbymichael",
"erikh",
"estesp",
@@ -536,6 +447,11 @@ made through a pull request.
Email = "ben@firshman.co.uk"
GitHub = "bfirsh"
[people.calavera]
Name = "David Calavera"
Email = "david.calavera@gmail.com"
GitHub = "calavera"
[people.cpuguy83]
Name = "Brian Goff"
Email = "cpuguy83@gmail.com"
@@ -650,7 +566,7 @@ made through a pull request.
Name = "Sebastiaan van Stijn"
Email = "github@gone.nl"
GitHub = "thaJeztah"
[people.theadactyl]
Name = "Thea Lamkin"
Email = "thea@docker.com"

View File

@@ -6,6 +6,7 @@
DOCKER_ENVS := \
-e BUILDFLAGS \
-e DOCKER_CLIENTONLY \
-e DOCKER_DEBUG \
-e DOCKER_EXECDRIVER \
-e DOCKER_EXPERIMENTAL \
-e DOCKER_GRAPHDRIVER \
@@ -22,11 +23,6 @@ DOCKER_ENVS := \
BIND_DIR := $(if $(BINDDIR),$(BINDDIR),$(if $(DOCKER_HOST),,bundles))
DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/docker/$(BIND_DIR)")
# to allow `make DOCSDIR=docs docs-shell` (to create a bind mount in docs)
DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR))
# to allow `make DOCSPORT=9000 docs`
DOCSPORT := 8000
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
DOCKER_IMAGE := docker-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
@@ -50,19 +46,11 @@ binary: build
cross: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary cross
docs: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" mkdocs serve
deb: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary build-deb
docs-shell: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash
docs-release: docs-build
$(DOCKER_RUN_DOCS) -e OPTIONS -e BUILD_ROOT -e DISTRIBUTION_ID \
-v $(CURDIR)/docs/awsconfig:/docs/awsconfig \
"$(DOCKER_DOCS_IMAGE)" ./release.sh
docs-test: docs-build
$(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" ./test.sh
rpm: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary build-rpm
test: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration-cli test-docker-py
@@ -77,7 +65,7 @@ test-docker-py: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py
validate: build
$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-test validate-toml validate-vet
$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet
shell: build
$(DOCKER_RUN_DOCKER) bash
@@ -85,13 +73,8 @@ shell: build
build: bundles
docker build -t "$(DOCKER_IMAGE)" .
docs-build:
cp ./VERSION docs/VERSION
echo "$(GIT_BRANCH)" > docs/GIT_BRANCH
# echo "$(AWS_S3_BUCKET)" > docs/AWS_S3_BUCKET
echo "$(GITCOMMIT)" > docs/GITCOMMIT
docker pull docs/base
docker build -t "$(DOCKER_DOCS_IMAGE)" docs
bundles:
mkdir bundles
docs:
$(MAKE) -C docs docs

View File

@@ -13,12 +13,12 @@ databases, and backend services without depending on a particular stack
or provider.
Docker began as an open-source implementation of the deployment engine which
powers [dotCloud](https://dotcloud.com), a popular Platform-as-a-Service.
powers [dotCloud](https://www.dotcloud.com), a popular Platform-as-a-Service.
It benefits directly from the experience accumulated over several years
of large-scale operation and support of hundreds of thousands of
applications and databases.
![Docker L](docs/sources/static_files/docker-logo-compressed.png "Docker")
![Docker L](docs/static_files/docker-logo-compressed.png "Docker")
## Security Disclosure
@@ -30,7 +30,7 @@ security@docker.com and not by creating a github issue.
A common method for distributing applications and sandboxing their
execution is to use virtual machines, or VMs. Typical VM formats are
VMWare's vmdk, Oracle Virtualbox's vdi, and Amazon EC2's ami. In theory
VMware's vmdk, Oracle VirtualBox's vdi, and Amazon EC2's ami. In theory
these formats should allow every developer to automatically package
their application into a "machine" for easy distribution and deployment.
In practice, that almost never happens, for a few reasons:
@@ -58,7 +58,7 @@ takes place at the kernel level. Most modern operating system kernels
now support the primitives necessary for containerization, including
Linux with [openvz](https://openvz.org),
[vserver](http://linux-vserver.org) and more recently
[lxc](http://lxc.sourceforge.net), Solaris with
[lxc](https://linuxcontainers.org/), Solaris with
[zones](https://docs.oracle.com/cd/E26502_01/html/E29024/preface-1.html#scrolltoc),
and FreeBSD with
[Jails](https://www.freebsd.org/doc/handbook/jails.html).
@@ -168,9 +168,9 @@ Under the hood
Under the hood, Docker is built on the following components:
* The
[cgroup](http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage-part-24-c)
[cgroups](https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt)
and
[namespacing](http://blog.dotcloud.com/under-the-hood-linux-kernels-on-dotcloud-part)
[namespaces](http://man7.org/linux/man-pages/man7/namespaces.7.html)
capabilities of the Linux kernel
* The [Go](https://golang.org) programming language
* The [Docker Image Specification](https://github.com/docker/docker/blob/master/image/spec/v1.md)
@@ -180,10 +180,10 @@ Contributing to Docker
======================
[![GoDoc](https://godoc.org/github.com/docker/docker?status.svg)](https://godoc.org/github.com/docker/docker)
[![Jenkins Build Status](https://jenkins.dockerproject.com/job/Docker%20Master/badge/icon)](https://jenkins.dockerproject.com/job/Docker%20Master/)
[![Jenkins Build Status](https://jenkins.dockerproject.org/job/Docker%20Master/badge/icon)](https://jenkins.dockerproject.org/job/Docker%20Master/)
Want to hack on Docker? Awesome! We have [instructions to help you get
started contributing code or documentation.](https://docs.docker.com/project/who-written-for/).
started contributing code or documentation](https://docs.docker.com/project/who-written-for/).
These instructions are probably not perfect, please let us know if anything
feels wrong or incomplete. Better yet, submit a PR and improve them yourself.
@@ -192,12 +192,12 @@ Getting the development builds
==============================
Want to run Docker from a master build? You can download
master builds at [master.dockerproject.com](https://master.dockerproject.com).
master builds at [master.dockerproject.org](https://master.dockerproject.org).
They are updated with each commit merged into the master branch.
Don't know how to use that super cool new feature in the master build? Check
out the master docs at
[docs.master.dockerproject.com](http://docs.master.dockerproject.com).
[docs.master.dockerproject.org](http://docs.master.dockerproject.org).
How the project is run
======================
@@ -289,7 +289,7 @@ system
* [Docker Compose](https://github.com/docker/compose) (formerly Fig):
Define and run multi-container apps
* [Kitematic](https://github.com/kitematic/kitematic): The easiest way to use
Docker on a Mac
Docker on Mac and Windows
If you know of another project underway that should be listed here, please help
us keep this list up-to-date by submitting a PR.

183
ROADMAP.md Normal file
View File

@@ -0,0 +1,183 @@
Docker Engine Roadmap
=====================
### How should I use this document?
This document provides description of items that the project decided to prioritize. This should
serve as a reference point for Docker contributors to understand where the project is going, and
help determine if a contribution could be conflicting with some longer terms plans.
The fact that a feature isn't listed here doesn't mean that a patch for it will automatically be
refused (except for those mentioned as "frozen features" below)! We are always happy to receive
patches for new cool features we haven't thought about, or didn't judge priority. Please however
understand that such patches might take longer for us to review.
### How can I help?
Short term objectives are listed in the [wiki](https://github.com/docker/docker/wiki) and described
in [Issues](https://github.com/docker/docker/issues?q=is%3Aopen+is%3Aissue+label%3Aroadmap). Our
goal is to split down the workload in such way that anybody can jump in and help. Please comment on
issues if you want to take it to avoid duplicating effort! Similarly, if a maintainer is already
assigned on an issue you'd like to participate in, pinging him on IRC or GitHub to offer your help is
the best way to go.
### How can I add something to the roadmap?
The roadmap process is new to the Docker Engine: we are only beginning to structure and document the
project objectives. Our immediate goal is to be more transparent, and work with our community to
focus our efforts on fewer prioritized topics.
We hope to offer in the near future a process allowing anyone to propose a topic to the roadmap, but
we are not quite there yet. For the time being, the BDFL remains the keeper of the roadmap, and we
won't be accepting pull requests adding or removing items from this file.
# 1. Features and refactoring
## 1.1 Security
Security is a top objective for the Docker Engine. The most notable items we intend to provide in
the near future are:
- Trusted distribution of images: the effort is driven by the [distribution](https://github.com/docker/distribution)
group but will have significant impact on the Engine
- [User namespaces](https://github.com/docker/docker/pull/12648)
- [Seccomp support](https://github.com/docker/libcontainer/pull/613)
## 1.2 Plumbing project
We define a plumbing tool as a standalone piece of software usable and meaningful on its own. In
the current state of the Docker Engine, most subsystems provide independent functionalities (such
the builder, pushing and pulling images, running applications in a containerized environment, etc)
but all are coupled in a single binary. We want to offer the users to flexibility to use only the
pieces they need, and we will also gain in maintainability by splitting the project among multiple
repositories.
As it currently stands, the rough design outlines is to have:
- Low level plumbing tools, each dealing with one responsibility (e.g., [runC](https://runc.io))
- Docker subsystems services, each exposing an elementary concept over an API, and relying on one or
multiple lower level plumbing tools for their implementation (e.g., network management)
- Docker Engine to expose higher level actions (e.g., create a container with volume `V` and network
`N`), while still providing pass-through access to the individual subsystems.
The architectural details are still being worked on, but one thing we know for sure is that we need
to technically decouple the pieces.
### 1.2.1 Runtime
A Runtime tool already exists today in the form of [runC](https://github.com/opencontainers/runc).
We intend to modify the Engine to directly call out to a binary implementing the Open Containers
Specification such as runC rather than relying on libcontainer to set the container runtime up.
This plan will deprecate the existing [`execdriver`](https://github.com/docker/docker/tree/master/daemon/execdriver)
as different runtime backends will be implemented as separated binaries instead of being compiled
into the Engine.
### 1.2.2 Builder
The Builder (i.e., the ability to build an image from a Dockerfile) is already nicely decoupled,
but would benefit from being entirely separated from the Engine, and rely on the standard Engine
API for its operations.
### 1.2.3 Distribution
Distribution already has a [dedicated repository](https://github.com/docker/distribution) which
holds the implementation for Registry v2 and client libraries. We could imagine going further by
having the Engine call out to a binary providing image distribution related functionalities.
There are two short term goals related to image distribution. The first is stabilize and simplify
the push/pull code. Following that is the conversion to the more secure Registry V2 protocol.
### 1.2.4 Networking
Most of networking related code was already decoupled today in [libnetwork](https://github.com/docker/libnetwork).
As with other ingredients, we might want to take it a step further and make it a meaningful utility
that the Engine would call out to instead of a library.
## 1.3 Plugins
An initiative around plugins started with Docker 1.7.0, with the goal of allowing for out of
process extensibility of some Docker functionalities, starting with volumes and networking. The
approach is to provide specific extension points rather than generic hooking facilities. We also
deliberately keep the extensions API the simplest possible, expanding as we discover valid use
cases that cannot be implemented.
At the time of writing:
- Plugin support is merged as an experimental feature: real world use cases and user feedback will
help us refine the UX to make the feature more user friendly.
- There are no immediate plans to expand on the number of pluggable subsystems.
- Golang 1.5 might add language support for [plugins](https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGhFDelrAP0NqSS_00RgZQ)
which we consider supporting as an alternative to JSON/HTTP.
## 1.4 Volume management
Volumes are not a first class citizen in the Engine today: we would like better volume management,
similar to the way network are managed in the new [CNM](https://github.com/docker/docker/issues/9983).
## 1.5 Better API implementation
The current Engine API is insufficiently typed, versioned, and ultimately hard to maintain. We
also suffer from the lack of a common implementation with [Swarm](https://github.com/docker/swarm).
## 1.6 Checkpoint/restore
Support for checkpoint/restore was [merged](https://github.com/docker/libcontainer/pull/479) in
[libcontainer](https://github.com/docker/libcontainer) and made available through [runC](https://runc.io):
we intend to take advantage of it in the Engine.
# 2 Frozen features
## 2.1 Docker exec
We won't accept patches expanding the surface of `docker exec`, which we intend to keep as a
*debugging* feature, as well as being strongly dependent on the the Runtime ingredient effort.
## 2.2 Dockerfile syntax
The Dockerfile syntax as we know it is simple, and has proven succesful in supporting all our
[official images](https://github.com/docker-library/official-images). Although this is *not* a
definitive move, we temporarily won't accept more patches to the Dockerfile syntax for several
reasons:
- Long term impact of syntax changes is a sensitive matter that require an amount of attention
the volume of Engine codebase and activity today doesn't allow us to provide.
- Allowing the Builder to be implemented as a separate utility consuming the Engine's API will
open the door for many possibilities, such as offering alternate syntaxes or DSL for existing
languages without cluttering the Engine's codebase.
- A standalone Builder will also offer the opportunity for a better dedicated group of maintainers
to own the Dockerfile syntax and decide collectively on the direction to give it.
- Our experience with official images tend to show that no new instruction or syntax expansion is
*strictly* necessary for the majority of use cases, and although we are aware many things are still
lacking for many, we cannot make it a priority yet for the above reasons.
Again, this is not about saying that the Dockerfile syntax is done, it's about making choices about
what we want to do first!
## 2.3 Remote Registry Operations
A large amount of work is ongoing in the area of image distribution and
provenance. This includes moving to the V2 Registry API and heavily
refactoring the code that powers these features. The desired result is more
secure, reliable and easier to use image distribution.
Part of the problem with this part of the code base is the lack of a stable
and flexible interface. If new features are added that access the registry
without solidifying these interfaces, achieving feature parity will continue
to be elusive. While we get a handle on this situation, we are imposing a
moratorium on new code that accesses the Registry API in commands that don't
already make remote calls.
Currently, only the following commands cause interaction with a remote
registry:
- push
- pull
- run
- build
- search
- login
In the interest of stabilizing the registry access model during this ongoing
work, we are not accepting additions to other commands that will cause remote
interaction with the Registry API. This moratorium will lift when the goals of
the distribution project have been met.

View File

@@ -1 +1 @@
1.7.0-dev
1.8.3

View File

@@ -8,6 +8,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/signal"
)
@@ -16,23 +17,23 @@ import (
//
// Usage: docker attach [OPTIONS] CONTAINER
func (cli *DockerCli) CmdAttach(args ...string) error {
var (
cmd = cli.Subcmd("attach", "CONTAINER", "Attach to a running container", true)
noStdin = cmd.Bool([]string{"#nostdin", "-no-stdin"}, false, "Do not attach STDIN")
proxy = cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxy all received signals to the process")
)
cmd := Cli.Subcmd("attach", []string{"CONTAINER"}, "Attach to a running container", true)
noStdin := cmd.Bool([]string{"#nostdin", "-no-stdin"}, false, "Do not attach STDIN")
proxy := cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxy all received signals to the process")
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
name := cmd.Arg(0)
stream, _, err := cli.call("GET", "/containers/"+name+"/json", nil, nil)
serverResp, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/json", nil, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
var c types.ContainerJSON
if err := json.NewDecoder(stream).Decode(&c); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {
return err
}
@@ -76,7 +77,7 @@ func (cli *DockerCli) CmdAttach(args ...string) error {
return err
}
if status != 0 {
return StatusError{StatusCode: status}
return Cli.StatusError{StatusCode: status}
}
return nil

View File

@@ -1,6 +1,7 @@
package client
import (
"archive/tar"
"bufio"
"encoding/base64"
"encoding/json"
@@ -13,20 +14,25 @@ import (
"os/exec"
"path"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"github.com/docker/docker/api"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/graph/tags"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/fileutils"
"github.com/docker/docker/pkg/httputils"
"github.com/docker/docker/pkg/jsonmessage"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/progressreader"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/pkg/ulimit"
"github.com/docker/docker/pkg/units"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/docker/registry"
@@ -43,7 +49,7 @@ const (
//
// Usage: docker build [OPTIONS] PATH | URL | -
func (cli *DockerCli) CmdBuild(args ...string) error {
cmd := cli.Subcmd("build", "PATH | URL | -", "Build a new image from the source code at PATH", true)
cmd := Cli.Subcmd("build", []string{"PATH | URL | -"}, "Build a new image from the source code at PATH", true)
tag := cmd.String([]string{"t", "-tag"}, "", "Repository name (and optionally a tag) for the image")
suppressOutput := cmd.Bool([]string{"q", "-quiet"}, false, "Suppress the verbose output generated by the containers")
noCache := cmd.Bool([]string{"#no-cache", "-no-cache"}, false, "Do not use cache when building the image")
@@ -60,154 +66,117 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
flCPUSetMems := cmd.String([]string{"-cpuset-mems"}, "", "MEMs in which to allow execution (0-3, 0,1)")
flCgroupParent := cmd.String([]string{"-cgroup-parent"}, "", "Optional parent cgroup for the container")
ulimits := make(map[string]*ulimit.Ulimit)
flUlimits := opts.NewUlimitOpt(&ulimits)
cmd.Var(flUlimits, []string{"-ulimit"}, "Ulimit options")
cmd.Require(flag.Exact, 1)
// For trusted pull on "FROM <image>" instruction.
addTrustedFlags(cmd, true)
cmd.ParseFlags(args, true)
var (
context archive.Archive
context io.ReadCloser
isRemote bool
err error
)
_, err = exec.LookPath("git")
hasGit := err == nil
if cmd.Arg(0) == "-" {
// As a special case, 'docker build -' will build from either an empty context with the
// contents of stdin as a Dockerfile, or a tar-ed context from stdin.
buf := bufio.NewReader(cli.in)
magic, err := buf.Peek(tarHeaderSize)
if err != nil && err != io.EOF {
return fmt.Errorf("failed to peek context header from STDIN: %v", err)
}
if !archive.IsArchive(magic) {
dockerfile, err := ioutil.ReadAll(buf)
if err != nil {
return fmt.Errorf("failed to read Dockerfile from STDIN: %v", err)
}
// -f option has no meaning when we're reading it from stdin,
// so just use our default Dockerfile name
*dockerfileName = api.DefaultDockerfileName
context, err = archive.Generate(*dockerfileName, string(dockerfile))
} else {
context = ioutil.NopCloser(buf)
}
} else if urlutil.IsURL(cmd.Arg(0)) && (!urlutil.IsGitURL(cmd.Arg(0)) || !hasGit) {
isRemote = true
} else {
root := cmd.Arg(0)
if urlutil.IsGitURL(root) {
root, err = utils.GitClone(root)
if err != nil {
return err
}
defer os.RemoveAll(root)
}
if _, err := os.Stat(root); err != nil {
return err
}
specifiedContext := cmd.Arg(0)
absRoot, err := filepath.Abs(root)
if err != nil {
return err
}
var (
contextDir string
tempDir string
relDockerfile string
)
filename := *dockerfileName // path to Dockerfile
if *dockerfileName == "" {
// No -f/--file was specified so use the default
*dockerfileName = api.DefaultDockerfileName
filename = filepath.Join(absRoot, *dockerfileName)
// Just to be nice ;-) look for 'dockerfile' too but only
// use it if we found it, otherwise ignore this check
if _, err = os.Lstat(filename); os.IsNotExist(err) {
tmpFN := path.Join(absRoot, strings.ToLower(*dockerfileName))
if _, err = os.Lstat(tmpFN); err == nil {
*dockerfileName = strings.ToLower(*dockerfileName)
filename = tmpFN
}
}
}
origDockerfile := *dockerfileName // used for error msg
if filename, err = filepath.Abs(filename); err != nil {
return err
}
// Verify that 'filename' is within the build context
filename, err = symlink.FollowSymlinkInScope(filename, absRoot)
if err != nil {
return fmt.Errorf("The Dockerfile (%s) must be within the build context (%s)", origDockerfile, root)
}
// Now reset the dockerfileName to be relative to the build context
*dockerfileName, err = filepath.Rel(absRoot, filename)
if err != nil {
return err
}
// And canonicalize dockerfile name to a platform-independent one
*dockerfileName, err = archive.CanonicalTarNameForPath(*dockerfileName)
if err != nil {
return fmt.Errorf("Cannot canonicalize dockerfile path %s: %v", *dockerfileName, err)
}
if _, err = os.Lstat(filename); os.IsNotExist(err) {
return fmt.Errorf("Cannot locate Dockerfile: %s", origDockerfile)
}
var includes = []string{"."}
excludes, err := utils.ReadDockerIgnore(path.Join(root, ".dockerignore"))
if err != nil {
return err
}
// If .dockerignore mentions .dockerignore or the Dockerfile
// then make sure we send both files over to the daemon
// because Dockerfile is, obviously, needed no matter what, and
// .dockerignore is needed to know if either one needs to be
// removed. The deamon will remove them for us, if needed, after it
// parses the Dockerfile.
keepThem1, _ := fileutils.Matches(".dockerignore", excludes)
keepThem2, _ := fileutils.Matches(*dockerfileName, excludes)
if keepThem1 || keepThem2 {
includes = append(includes, ".dockerignore", *dockerfileName)
}
if err := utils.ValidateContextDirectory(root, excludes); err != nil {
return fmt.Errorf("Error checking context is accessible: '%s'. Please check permissions and try again.", err)
}
options := &archive.TarOptions{
Compression: archive.Uncompressed,
ExcludePatterns: excludes,
IncludeFiles: includes,
}
context, err = archive.TarWithOptions(root, options)
if err != nil {
return err
}
switch {
case specifiedContext == "-":
tempDir, relDockerfile, err = getContextFromReader(cli.in, *dockerfileName)
case urlutil.IsGitURL(specifiedContext) && hasGit:
tempDir, relDockerfile, err = getContextFromGitURL(specifiedContext, *dockerfileName)
case urlutil.IsURL(specifiedContext):
tempDir, relDockerfile, err = getContextFromURL(cli.out, specifiedContext, *dockerfileName)
default:
contextDir, relDockerfile, err = getContextFromLocalDir(specifiedContext, *dockerfileName)
}
// windows: show error message about modified file permissions
// FIXME: this is not a valid warning when the daemon is running windows. should be removed once docker engine for windows can build.
if runtime.GOOS == "windows" {
fmt.Fprintln(cli.err, `SECURITY WARNING: You are building a Docker image from Windows against a Linux Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.`)
if err != nil {
return fmt.Errorf("unable to prepare context: %s", err)
}
var body io.Reader
if tempDir != "" {
defer os.RemoveAll(tempDir)
contextDir = tempDir
}
// Resolve the FROM lines in the Dockerfile to trusted digest references
// using Notary. On a successful build, we must tag the resolved digests
// to the original name specified in the Dockerfile.
newDockerfile, resolvedTags, err := rewriteDockerfileFrom(filepath.Join(contextDir, relDockerfile), cli.trustedReference)
if err != nil {
return fmt.Errorf("unable to process Dockerfile: %v", err)
}
defer newDockerfile.Close()
// And canonicalize dockerfile name to a platform-independent one
relDockerfile, err = archive.CanonicalTarNameForPath(relDockerfile)
if err != nil {
return fmt.Errorf("cannot canonicalize dockerfile path %s: %v", relDockerfile, err)
}
var includes = []string{"."}
excludes, err := utils.ReadDockerIgnore(path.Join(contextDir, ".dockerignore"))
if err != nil {
return err
}
if err := utils.ValidateContextDirectory(contextDir, excludes); err != nil {
return fmt.Errorf("Error checking context: '%s'.", err)
}
// If .dockerignore mentions .dockerignore or the Dockerfile
// then make sure we send both files over to the daemon
// because Dockerfile is, obviously, needed no matter what, and
// .dockerignore is needed to know if either one needs to be
// removed. The deamon will remove them for us, if needed, after it
// parses the Dockerfile. Ignore errors here, as they will have been
// caught by ValidateContextDirectory above.
keepThem1, _ := fileutils.Matches(".dockerignore", excludes)
keepThem2, _ := fileutils.Matches(relDockerfile, excludes)
if keepThem1 || keepThem2 {
includes = append(includes, ".dockerignore", relDockerfile)
}
context, err = archive.TarWithOptions(contextDir, &archive.TarOptions{
Compression: archive.Uncompressed,
ExcludePatterns: excludes,
IncludeFiles: includes,
})
if err != nil {
return err
}
// Wrap the tar archive to replace the Dockerfile entry with the rewritten
// Dockerfile which uses trusted pulls.
context = replaceDockerfileTarWrapper(context, newDockerfile, relDockerfile)
// Setup an upload progress bar
// FIXME: ProgressReader shouldn't be this annoying to use
if context != nil {
sf := streamformatter.NewStreamFormatter()
body = progressreader.New(progressreader.Config{
In: context,
Out: cli.out,
Formatter: sf,
NewLines: true,
ID: "",
Action: "Sending build context to Docker daemon",
})
}
sf := streamformatter.NewStreamFormatter()
var body io.Reader = progressreader.New(progressreader.Config{
In: context,
Out: cli.out,
Formatter: sf,
NewLines: true,
ID: "",
Action: "Sending build context to Docker daemon",
})
var memory int64
if *flMemoryString != "" {
@@ -280,7 +249,14 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
v.Set("memswap", strconv.FormatInt(memorySwap, 10))
v.Set("cgroupparent", *flCgroupParent)
v.Set("dockerfile", *dockerfileName)
v.Set("dockerfile", relDockerfile)
ulimitsVar := flUlimits.GetList()
ulimitsJson, err := json.Marshal(ulimitsVar)
if err != nil {
return err
}
v.Set("ulimits", string(ulimitsJson))
headers := http.Header(make(map[string][]string))
buf, err := json.Marshal(cli.configFile.AuthConfigs)
@@ -288,23 +264,371 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
return err
}
headers.Add("X-Registry-Config", base64.URLEncoding.EncodeToString(buf))
headers.Set("Content-Type", "application/tar")
if context != nil {
headers.Set("Content-Type", "application/tar")
}
sopts := &streamOpts{
rawTerminal: true,
in: body,
out: cli.out,
headers: headers,
}
err = cli.stream("POST", fmt.Sprintf("/build?%s", v.Encode()), sopts)
serverResp, err := cli.stream("POST", fmt.Sprintf("/build?%s", v.Encode()), sopts)
// Windows: show error message about modified file permissions.
if runtime.GOOS == "windows" {
h, err := httputils.ParseServerHeader(serverResp.header.Get("Server"))
if err == nil {
if h.OS != "windows" {
fmt.Fprintln(cli.err, `SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.`)
}
}
}
if jerr, ok := err.(*jsonmessage.JSONError); ok {
// If no error code is set, default to 1
if jerr.Code == 0 {
jerr.Code = 1
}
return StatusError{Status: jerr.Message, StatusCode: jerr.Code}
return Cli.StatusError{Status: jerr.Message, StatusCode: jerr.Code}
}
return err
if err != nil {
return err
}
// Since the build was successful, now we must tag any of the resolved
// images from the above Dockerfile rewrite.
for _, resolved := range resolvedTags {
if err := cli.tagTrusted(resolved.repoInfo, resolved.digestRef, resolved.tagRef); err != nil {
return err
}
}
return nil
}
// getDockerfileRelPath uses the given context directory for a `docker build`
// and returns the absolute path to the context directory, the relative path of
// the dockerfile in that context directory, and a non-nil error on success.
func getDockerfileRelPath(givenContextDir, givenDockerfile string) (absContextDir, relDockerfile string, err error) {
if absContextDir, err = filepath.Abs(givenContextDir); err != nil {
return "", "", fmt.Errorf("unable to get absolute context directory: %v", err)
}
// The context dir might be a symbolic link, so follow it to the actual
// target directory.
absContextDir, err = filepath.EvalSymlinks(absContextDir)
if err != nil {
return "", "", fmt.Errorf("unable to evaluate symlinks in context path: %v", err)
}
stat, err := os.Lstat(absContextDir)
if err != nil {
return "", "", fmt.Errorf("unable to stat context directory %q: %v", absContextDir, err)
}
if !stat.IsDir() {
return "", "", fmt.Errorf("context must be a directory: %s", absContextDir)
}
absDockerfile := givenDockerfile
if absDockerfile == "" {
// No -f/--file was specified so use the default relative to the
// context directory.
absDockerfile = filepath.Join(absContextDir, api.DefaultDockerfileName)
// Just to be nice ;-) look for 'dockerfile' too but only
// use it if we found it, otherwise ignore this check
if _, err = os.Lstat(absDockerfile); os.IsNotExist(err) {
altPath := filepath.Join(absContextDir, strings.ToLower(api.DefaultDockerfileName))
if _, err = os.Lstat(altPath); err == nil {
absDockerfile = altPath
}
}
}
// If not already an absolute path, the Dockerfile path should be joined to
// the base directory.
if !filepath.IsAbs(absDockerfile) {
absDockerfile = filepath.Join(absContextDir, absDockerfile)
}
// Verify that 'filename' is within the build context
absDockerfile, err = symlink.FollowSymlinkInScope(absDockerfile, absContextDir)
if err != nil {
return "", "", fmt.Errorf("The Dockerfile (%s) must be within the build context (%s)", givenDockerfile, givenContextDir)
}
if _, err := os.Lstat(absDockerfile); err != nil {
if os.IsNotExist(err) {
return "", "", fmt.Errorf("Cannot locate Dockerfile: absDockerfile: %q", absDockerfile)
}
return "", "", fmt.Errorf("unable to stat Dockerfile: %v", err)
}
if relDockerfile, err = filepath.Rel(absContextDir, absDockerfile); err != nil {
return "", "", fmt.Errorf("unable to get relative Dockerfile path: %v", err)
}
return absContextDir, relDockerfile, nil
}
// writeToFile copies from the given reader and writes it to a file with the
// given filename.
func writeToFile(r io.Reader, filename string) error {
file, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.FileMode(0600))
if err != nil {
return fmt.Errorf("unable to create file: %v", err)
}
defer file.Close()
if _, err := io.Copy(file, r); err != nil {
return fmt.Errorf("unable to write file: %v", err)
}
return nil
}
// getContextFromReader will read the contents of the given reader as either a
// Dockerfile or tar archive to be extracted to a temporary directory used as
// the context directory. Returns the absolute path to the temporary context
// directory, the relative path of the dockerfile in that context directory,
// and a non-nil error on success.
func getContextFromReader(r io.Reader, dockerfileName string) (absContextDir, relDockerfile string, err error) {
buf := bufio.NewReader(r)
magic, err := buf.Peek(tarHeaderSize)
if err != nil && err != io.EOF {
return "", "", fmt.Errorf("failed to peek context header from STDIN: %v", err)
}
if absContextDir, err = ioutil.TempDir("", "docker-build-context-"); err != nil {
return "", "", fmt.Errorf("unbale to create temporary context directory: %v", err)
}
defer func(d string) {
if err != nil {
os.RemoveAll(d)
}
}(absContextDir)
if !archive.IsArchive(magic) { // Input should be read as a Dockerfile.
// -f option has no meaning when we're reading it from stdin,
// so just use our default Dockerfile name
relDockerfile = api.DefaultDockerfileName
return absContextDir, relDockerfile, writeToFile(buf, filepath.Join(absContextDir, relDockerfile))
}
if err := archive.Untar(buf, absContextDir, nil); err != nil {
return "", "", fmt.Errorf("unable to extract stdin to temporary context direcotry: %v", err)
}
return getDockerfileRelPath(absContextDir, dockerfileName)
}
// getContextFromGitURL uses a Git URL as context for a `docker build`. The
// git repo is cloned into a temporary directory used as the context directory.
// Returns the absolute path to the temporary context directory, the relative
// path of the dockerfile in that context directory, and a non-nil error on
// success.
func getContextFromGitURL(gitURL, dockerfileName string) (absContextDir, relDockerfile string, err error) {
if absContextDir, err = utils.GitClone(gitURL); err != nil {
return "", "", fmt.Errorf("unable to 'git clone' to temporary context directory: %v", err)
}
return getDockerfileRelPath(absContextDir, dockerfileName)
}
// getContextFromURL uses a remote URL as context for a `docker build`. The
// remote resource is downloaded as either a Dockerfile or a context tar
// archive and stored in a temporary directory used as the context directory.
// Returns the absolute path to the temporary context directory, the relative
// path of the dockerfile in that context directory, and a non-nil error on
// success.
func getContextFromURL(out io.Writer, remoteURL, dockerfileName string) (absContextDir, relDockerfile string, err error) {
response, err := httputils.Download(remoteURL)
if err != nil {
return "", "", fmt.Errorf("unable to download remote context %s: %v", remoteURL, err)
}
defer response.Body.Close()
// Pass the response body through a progress reader.
progReader := &progressreader.Config{
In: response.Body,
Out: out,
Formatter: streamformatter.NewStreamFormatter(),
Size: int(response.ContentLength),
NewLines: true,
ID: "",
Action: fmt.Sprintf("Downloading build context from remote url: %s", remoteURL),
}
return getContextFromReader(progReader, dockerfileName)
}
// getContextFromLocalDir uses the given local directory as context for a
// `docker build`. Returns the absolute path to the local context directory,
// the relative path of the dockerfile in that context directory, and a non-nil
// error on success.
func getContextFromLocalDir(localDir, dockerfileName string) (absContextDir, relDockerfile string, err error) {
// When using a local context directory, when the Dockerfile is specified
// with the `-f/--file` option then it is considered relative to the
// current directory and not the context directory.
if dockerfileName != "" {
if dockerfileName, err = filepath.Abs(dockerfileName); err != nil {
return "", "", fmt.Errorf("unable to get absolute path to Dockerfile: %v", err)
}
}
return getDockerfileRelPath(localDir, dockerfileName)
}
var dockerfileFromLinePattern = regexp.MustCompile(`(?i)^[\s]*FROM[ \f\r\t\v]+(?P<image>[^ \f\r\t\v\n#]+)`)
type trustedDockerfile struct {
*os.File
size int64
}
func (td *trustedDockerfile) Close() error {
td.File.Close()
return os.Remove(td.File.Name())
}
// resolvedTag records the repository, tag, and resolved digest reference
// from a Dockerfile rewrite.
type resolvedTag struct {
repoInfo *registry.RepositoryInfo
digestRef, tagRef registry.Reference
}
// rewriteDockerfileFrom rewrites the given Dockerfile by resolving images in
// "FROM <image>" instructions to a digest reference. `translator` is a
// function that takes a repository name and tag reference and returns a
// trusted digest reference.
func rewriteDockerfileFrom(dockerfileName string, translator func(string, registry.Reference) (registry.Reference, error)) (newDockerfile *trustedDockerfile, resolvedTags []*resolvedTag, err error) {
dockerfile, err := os.Open(dockerfileName)
if err != nil {
return nil, nil, fmt.Errorf("unable to open Dockerfile: %v", err)
}
defer dockerfile.Close()
scanner := bufio.NewScanner(dockerfile)
// Make a tempfile to store the rewritten Dockerfile.
tempFile, err := ioutil.TempFile("", "trusted-dockerfile-")
if err != nil {
return nil, nil, fmt.Errorf("unable to make temporary trusted Dockerfile: %v", err)
}
trustedFile := &trustedDockerfile{
File: tempFile,
}
defer func() {
if err != nil {
// Close the tempfile if there was an error during Notary lookups.
// Otherwise the caller should close it.
trustedFile.Close()
}
}()
// Scan the lines of the Dockerfile, looking for a "FROM" line.
for scanner.Scan() {
line := scanner.Text()
matches := dockerfileFromLinePattern.FindStringSubmatch(line)
if matches != nil && matches[1] != "scratch" {
// Replace the line with a resolved "FROM repo@digest"
repo, tag := parsers.ParseRepositoryTag(matches[1])
if tag == "" {
tag = tags.DEFAULTTAG
}
repoInfo, err := registry.ParseRepositoryInfo(repo)
if err != nil {
return nil, nil, fmt.Errorf("unable to parse repository info: %v", err)
}
ref := registry.ParseReference(tag)
if !ref.HasDigest() && isTrusted() {
trustedRef, err := translator(repo, ref)
if err != nil {
return nil, nil, err
}
line = dockerfileFromLinePattern.ReplaceAllLiteralString(line, fmt.Sprintf("FROM %s", trustedRef.ImageName(repo)))
resolvedTags = append(resolvedTags, &resolvedTag{
repoInfo: repoInfo,
digestRef: trustedRef,
tagRef: ref,
})
}
}
n, err := fmt.Fprintln(tempFile, line)
if err != nil {
return nil, nil, err
}
trustedFile.size += int64(n)
}
tempFile.Seek(0, os.SEEK_SET)
return trustedFile, resolvedTags, scanner.Err()
}
// replaceDockerfileTarWrapper wraps the given input tar archive stream and
// replaces the entry with the given Dockerfile name with the contents of the
// new Dockerfile. Returns a new tar archive stream with the replaced
// Dockerfile.
func replaceDockerfileTarWrapper(inputTarStream io.ReadCloser, newDockerfile *trustedDockerfile, dockerfileName string) io.ReadCloser {
pipeReader, pipeWriter := io.Pipe()
go func() {
tarReader := tar.NewReader(inputTarStream)
tarWriter := tar.NewWriter(pipeWriter)
defer inputTarStream.Close()
for {
hdr, err := tarReader.Next()
if err == io.EOF {
// Signals end of archive.
tarWriter.Close()
pipeWriter.Close()
return
}
if err != nil {
pipeWriter.CloseWithError(err)
return
}
var content io.Reader = tarReader
if hdr.Name == dockerfileName {
// This entry is the Dockerfile. Since the tar archive was
// generated from a directory on the local filesystem, the
// Dockerfile will only appear once in the archive.
hdr.Size = newDockerfile.size
content = newDockerfile
}
if err := tarWriter.WriteHeader(hdr); err != nil {
pipeWriter.CloseWithError(err)
return
}
if _, err := io.Copy(tarWriter, content); err != nil {
pipeWriter.CloseWithError(err)
return
}
}
}()
return pipeReader
}

View File

@@ -2,31 +2,34 @@ package client
import (
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path/filepath"
"reflect"
"strings"
"text/template"
"github.com/docker/docker/cli"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/pkg/homedir"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/sockets"
"github.com/docker/docker/pkg/term"
"github.com/docker/docker/utils"
"github.com/docker/docker/pkg/tlsconfig"
)
// DockerCli represents the docker command line client.
// Instances of the client can be returned from NewDockerCli.
type DockerCli struct {
// initializing closure
init func() error
// proto holds the client protocol i.e. unix.
proto string
// addr holds the client address.
addr string
// basePath holds the path to prepend to the requests
basePath string
// configFile has the client configuration file
configFile *cliconfig.ConfigFile
@@ -55,82 +58,11 @@ type DockerCli struct {
transport *http.Transport
}
var funcMap = template.FuncMap{
"json": func(v interface{}) string {
a, _ := json.Marshal(v)
return string(a)
},
}
func (cli *DockerCli) Out() io.Writer {
return cli.out
}
func (cli *DockerCli) Err() io.Writer {
return cli.err
}
func (cli *DockerCli) getMethod(args ...string) (func(...string) error, bool) {
camelArgs := make([]string, len(args))
for i, s := range args {
if len(s) == 0 {
return nil, false
}
camelArgs[i] = strings.ToUpper(s[:1]) + strings.ToLower(s[1:])
func (cli *DockerCli) Initialize() error {
if cli.init == nil {
return nil
}
methodName := "Cmd" + strings.Join(camelArgs, "")
method := reflect.ValueOf(cli).MethodByName(methodName)
if !method.IsValid() {
return nil, false
}
return method.Interface().(func(...string) error), true
}
// Cmd executes the specified command.
func (cli *DockerCli) Cmd(args ...string) error {
if len(args) > 1 {
method, exists := cli.getMethod(args[:2]...)
if exists {
return method(args[2:]...)
}
}
if len(args) > 0 {
method, exists := cli.getMethod(args[0])
if !exists {
return fmt.Errorf("docker: '%s' is not a docker command. See 'docker --help'.", args[0])
}
return method(args[1:]...)
}
return cli.CmdHelp()
}
// Subcmd is a subcommand of the main "docker" command.
// A subcommand represents an action that can be performed
// from the Docker command line client.
//
// To see all available subcommands, run "docker --help".
func (cli *DockerCli) Subcmd(name, signature, description string, exitOnError bool) *flag.FlagSet {
var errorHandling flag.ErrorHandling
if exitOnError {
errorHandling = flag.ExitOnError
} else {
errorHandling = flag.ContinueOnError
}
flags := flag.NewFlagSet(name, errorHandling)
flags.Usage = func() {
options := ""
if signature != "" {
signature = " " + signature
}
if flags.FlagCountUndeprecated() > 0 {
options = " [OPTIONS]"
}
fmt.Fprintf(cli.out, "\nUsage: docker %s%s%s\n\n%s\n\n", name, options, signature, description)
flags.SetOutput(cli.out)
flags.PrintDefaults()
os.Exit(0)
}
return flags
return cli.init()
}
// CheckTtyInput checks if we are trying to attach to a container tty
@@ -145,59 +77,86 @@ func (cli *DockerCli) CheckTtyInput(attachStdin, ttyMode bool) error {
return nil
}
func (cli *DockerCli) PsFormat() string {
return cli.configFile.PsFormat
}
// NewDockerCli returns a DockerCli instance with IO output and error streams set by in, out and err.
// The key file, protocol (i.e. unix) and address are passed in as strings, along with the tls.Config. If the tls.Config
// is set the client scheme will be set to https.
// The client will be given a 32-second timeout (see https://github.com/docker/docker/pull/8035).
func NewDockerCli(in io.ReadCloser, out, err io.Writer, keyFile string, proto, addr string, tlsConfig *tls.Config) *DockerCli {
var (
inFd uintptr
outFd uintptr
isTerminalIn = false
isTerminalOut = false
scheme = "http"
)
if tlsConfig != nil {
scheme = "https"
}
if in != nil {
inFd, isTerminalIn = term.GetFdInfo(in)
func NewDockerCli(in io.ReadCloser, out, err io.Writer, clientFlags *cli.ClientFlags) *DockerCli {
cli := &DockerCli{
in: in,
out: out,
err: err,
keyFile: clientFlags.Common.TrustKey,
}
if out != nil {
outFd, isTerminalOut = term.GetFdInfo(out)
cli.init = func() error {
clientFlags.PostParse()
hosts := clientFlags.Common.Hosts
switch len(hosts) {
case 0:
defaultHost := os.Getenv("DOCKER_HOST")
if defaultHost == "" {
defaultHost = opts.DefaultHost
}
defaultHost, err := opts.ValidateHost(defaultHost)
if err != nil {
return err
}
hosts = []string{defaultHost}
case 1:
// only accept one host to talk to
default:
return errors.New("Please specify only one -H")
}
protoAddrParts := strings.SplitN(hosts[0], "://", 2)
cli.proto, cli.addr = protoAddrParts[0], protoAddrParts[1]
if cli.proto == "tcp" {
// error is checked in pkg/parsers already
parsed, _ := url.Parse("tcp://" + cli.addr)
cli.addr = parsed.Host
cli.basePath = parsed.Path
}
if clientFlags.Common.TLSOptions != nil {
cli.scheme = "https"
var e error
cli.tlsConfig, e = tlsconfig.Client(*clientFlags.Common.TLSOptions)
if e != nil {
return e
}
} else {
cli.scheme = "http"
}
if cli.in != nil {
cli.inFd, cli.isTerminalIn = term.GetFdInfo(cli.in)
}
if cli.out != nil {
cli.outFd, cli.isTerminalOut = term.GetFdInfo(cli.out)
}
// The transport is created here for reuse during the client session.
cli.transport = &http.Transport{
TLSClientConfig: cli.tlsConfig,
}
sockets.ConfigureTCPTransport(cli.transport, cli.proto, cli.addr)
configFile, e := cliconfig.Load(cliconfig.ConfigDir())
if e != nil {
fmt.Fprintf(cli.err, "WARNING: Error loading config file:%v\n", e)
}
cli.configFile = configFile
return nil
}
if err == nil {
err = out
}
// The transport is created here for reuse during the client session.
tr := &http.Transport{
TLSClientConfig: tlsConfig,
}
utils.ConfigureTCPTransport(tr, proto, addr)
configFile, e := cliconfig.Load(filepath.Join(homedir.Get(), ".docker"))
if e != nil {
fmt.Fprintf(err, "WARNING: Error loading config file:%v\n", e)
}
return &DockerCli{
proto: proto,
addr: addr,
configFile: configFile,
in: in,
out: out,
err: err,
keyFile: keyFile,
inFd: inFd,
outFd: outFd,
isTerminalIn: isTerminalIn,
isTerminalOut: isTerminalOut,
tlsConfig: tlsConfig,
scheme: scheme,
transport: tr,
}
return cli
}

View File

@@ -3,15 +3,3 @@
// Run "docker help SUBCOMMAND" or "docker SUBCOMMAND --help" to see more information on any Docker subcommand, including the full list of options supported for the subcommand.
// See https://docs.docker.com/installation/ for instructions on installing Docker.
package client
import "fmt"
// An StatusError reports an unsuccessful exit by a command.
type StatusError struct {
Status string
StatusCode int
}
func (e StatusError) Error() string {
return fmt.Sprintf("Status: %s, Code: %d", e.Status, e.StatusCode)
}

View File

@@ -6,6 +6,7 @@ import (
"net/url"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
@@ -17,7 +18,7 @@ import (
//
// Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
func (cli *DockerCli) CmdCommit(args ...string) error {
cmd := cli.Subcmd("commit", "CONTAINER [REPOSITORY[:TAG]]", "Create a new image from a container's changes", true)
cmd := Cli.Subcmd("commit", []string{"CONTAINER [REPOSITORY[:TAG]]"}, "Create a new image from a container's changes", true)
flPause := cmd.Bool([]string{"p", "-pause"}, true, "Pause container during commit")
flComment := cmd.String([]string{"m", "-message"}, "", "Commit message")
flAuthor := cmd.String([]string{"a", "#author", "-author"}, "", "Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")")
@@ -27,6 +28,7 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
flConfig := cmd.String([]string{"#run", "#-run"}, "", "This option is deprecated and will be removed in a future version in favor of inline Dockerfile-compatible commands")
cmd.Require(flag.Max, 2)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var (
@@ -66,12 +68,14 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
return err
}
}
stream, _, err := cli.call("POST", "/commit?"+v.Encode(), config, nil)
serverResp, err := cli.call("POST", "/commit?"+v.Encode(), config, nil)
if err != nil {
return err
}
if err := json.NewDecoder(stream).Decode(&response); err != nil {
defer serverResp.body.Close()
if err := json.NewDecoder(serverResp.body).Decode(&response); err != nil {
return err
}

View File

@@ -1,57 +1,324 @@
package client
import (
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/pkg/archive"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdCp copies files/folders from a path on the container to a directory on the host running the command.
//
// If HOSTDIR is '-', the data is written as a tar file to STDOUT.
//
// Usage: docker cp CONTAINER:PATH HOSTDIR
func (cli *DockerCli) CmdCp(args ...string) error {
cmd := cli.Subcmd("cp", "CONTAINER:PATH HOSTDIR|-", "Copy files/folders from a PATH on the container to a HOSTDIR on the host\nrunning the command. Use '-' to write the data as a tar file to STDOUT.", true)
cmd.Require(flag.Exact, 2)
type copyDirection int
const (
fromContainer copyDirection = (1 << iota)
toContainer
acrossContainers = fromContainer | toContainer
)
// CmdCp copies files/folders to or from a path in a container.
//
// When copying from a container, if LOCALPATH is '-' the data is written as a
// tar archive file to STDOUT.
//
// When copying to a container, if LOCALPATH is '-' the data is read as a tar
// archive file from STDIN, and the destination CONTAINER:PATH, must specify
// a directory.
//
// Usage:
// docker cp CONTAINER:PATH LOCALPATH|-
// docker cp LOCALPATH|- CONTAINER:PATH
func (cli *DockerCli) CmdCp(args ...string) error {
cmd := Cli.Subcmd(
"cp",
[]string{"CONTAINER:PATH LOCALPATH|-", "LOCALPATH|- CONTAINER:PATH"},
strings.Join([]string{
"Copy files/folders between a container and your host.\n",
"Use '-' as the source to read a tar archive from stdin\n",
"and extract it to a directory destination in a container.\n",
"Use '-' as the destination to stream a tar archive of a\n",
"container source to stdout.",
}, ""),
true,
)
cmd.Require(flag.Exact, 2)
cmd.ParseFlags(args, true)
// deal with path name with `:`
info := strings.SplitN(cmd.Arg(0), ":", 2)
if len(info) != 2 {
return fmt.Errorf("Error: Path not specified")
if cmd.Arg(0) == "" {
return fmt.Errorf("source can not be empty")
}
if cmd.Arg(1) == "" {
return fmt.Errorf("destination can not be empty")
}
cfg := &types.CopyConfig{
Resource: info[1],
srcContainer, srcPath := splitCpArg(cmd.Arg(0))
dstContainer, dstPath := splitCpArg(cmd.Arg(1))
var direction copyDirection
if srcContainer != "" {
direction |= fromContainer
}
stream, statusCode, err := cli.call("POST", "/containers/"+info[0]+"/copy", cfg, nil)
if stream != nil {
defer stream.Close()
if dstContainer != "" {
direction |= toContainer
}
if statusCode == 404 {
return fmt.Errorf("No such container: %v", info[0])
switch direction {
case fromContainer:
return cli.copyFromContainer(srcContainer, srcPath, dstPath)
case toContainer:
return cli.copyToContainer(srcPath, dstContainer, dstPath)
case acrossContainers:
// Copying between containers isn't supported.
return fmt.Errorf("copying between containers is not supported")
default:
// User didn't specify any container.
return fmt.Errorf("must specify at least one container source")
}
}
// We use `:` as a delimiter between CONTAINER and PATH, but `:` could also be
// in a valid LOCALPATH, like `file:name.txt`. We can resolve this ambiguity by
// requiring a LOCALPATH with a `:` to be made explicit with a relative or
// absolute path:
// `/path/to/file:name.txt` or `./file:name.txt`
//
// This is apparently how `scp` handles this as well:
// http://www.cyberciti.biz/faq/rsync-scp-file-name-with-colon-punctuation-in-it/
//
// We can't simply check for a filepath separator because container names may
// have a separator, e.g., "host0/cname1" if container is in a Docker cluster,
// so we have to check for a `/` or `.` prefix. Also, in the case of a Windows
// client, a `:` could be part of an absolute Windows path, in which case it
// is immediately proceeded by a backslash.
func splitCpArg(arg string) (container, path string) {
if filepath.IsAbs(arg) {
// Explicit local absolute path, e.g., `C:\foo` or `/foo`.
return "", arg
}
parts := strings.SplitN(arg, ":", 2)
if len(parts) == 1 || strings.HasPrefix(parts[0], ".") {
// Either there's no `:` in the arg
// OR it's an explicit local relative path like `./file:name.txt`.
return "", arg
}
return parts[0], parts[1]
}
func (cli *DockerCli) statContainerPath(containerName, path string) (types.ContainerPathStat, error) {
var stat types.ContainerPathStat
query := make(url.Values, 1)
query.Set("path", filepath.ToSlash(path)) // Normalize the paths used in the API.
urlStr := fmt.Sprintf("/containers/%s/archive?%s", containerName, query.Encode())
response, err := cli.call("HEAD", urlStr, nil, nil)
if err != nil {
return err
return stat, err
}
defer response.body.Close()
if response.statusCode != http.StatusOK {
return stat, fmt.Errorf("unexpected status code from daemon: %d", response.statusCode)
}
hostPath := cmd.Arg(1)
if statusCode == 200 {
if hostPath == "-" {
_, err = io.Copy(cli.out, stream)
} else {
err = archive.Untar(stream, hostPath, &archive.TarOptions{NoLchown: true})
}
return getContainerPathStatFromHeader(response.header)
}
func getContainerPathStatFromHeader(header http.Header) (types.ContainerPathStat, error) {
var stat types.ContainerPathStat
encodedStat := header.Get("X-Docker-Container-Path-Stat")
statDecoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(encodedStat))
err := json.NewDecoder(statDecoder).Decode(&stat)
if err != nil {
err = fmt.Errorf("unable to decode container path stat header: %s", err)
}
return stat, err
}
func resolveLocalPath(localPath string) (absPath string, err error) {
if absPath, err = filepath.Abs(localPath); err != nil {
return
}
return archive.PreserveTrailingDotOrSeparator(absPath, localPath), nil
}
func (cli *DockerCli) copyFromContainer(srcContainer, srcPath, dstPath string) (err error) {
if dstPath != "-" {
// Get an absolute destination path.
dstPath, err = resolveLocalPath(dstPath)
if err != nil {
return err
}
}
query := make(url.Values, 1)
query.Set("path", filepath.ToSlash(srcPath)) // Normalize the paths used in the API.
urlStr := fmt.Sprintf("/containers/%s/archive?%s", srcContainer, query.Encode())
response, err := cli.call("GET", urlStr, nil, nil)
if err != nil {
return err
}
defer response.body.Close()
if response.statusCode != http.StatusOK {
return fmt.Errorf("unexpected status code from daemon: %d", response.statusCode)
}
if dstPath == "-" {
// Send the response to STDOUT.
_, err = io.Copy(os.Stdout, response.body)
return err
}
// In order to get the copy behavior right, we need to know information
// about both the source and the destination. The response headers include
// stat info about the source that we can use in deciding exactly how to
// copy it locally. Along with the stat info about the local destination,
// we have everything we need to handle the multiple possibilities there
// can be when copying a file/dir from one location to another file/dir.
stat, err := getContainerPathStatFromHeader(response.header)
if err != nil {
return fmt.Errorf("unable to get resource stat from response: %s", err)
}
// Prepare source copy info.
srcInfo := archive.CopyInfo{
Path: srcPath,
Exists: true,
IsDir: stat.Mode.IsDir(),
}
// See comments in the implementation of `archive.CopyTo` for exactly what
// goes into deciding how and whether the source archive needs to be
// altered for the correct copy behavior.
return archive.CopyTo(response.body, srcInfo, dstPath)
}
func (cli *DockerCli) copyToContainer(srcPath, dstContainer, dstPath string) (err error) {
if srcPath != "-" {
// Get an absolute source path.
srcPath, err = resolveLocalPath(srcPath)
if err != nil {
return err
}
}
// In order to get the copy behavior right, we need to know information
// about both the source and destination. The API is a simple tar
// archive/extract API but we can use the stat info header about the
// destination to be more informed about exactly what the destination is.
// Prepare destination copy info by stat-ing the container path.
dstInfo := archive.CopyInfo{Path: dstPath}
dstStat, err := cli.statContainerPath(dstContainer, dstPath)
// If the destination is a symbolic link, we should evaluate it.
if err == nil && dstStat.Mode&os.ModeSymlink != 0 {
linkTarget := dstStat.LinkTarget
if !filepath.IsAbs(linkTarget) {
// Join with the parent directory.
dstParent, _ := archive.SplitPathDirEntry(dstPath)
linkTarget = filepath.Join(dstParent, linkTarget)
}
dstInfo.Path = linkTarget
dstStat, err = cli.statContainerPath(dstContainer, linkTarget)
}
// Ignore any error and assume that the parent directory of the destination
// path exists, in which case the copy may still succeed. If there is any
// type of conflict (e.g., non-directory overwriting an existing directory
// or vice versia) the extraction will fail. If the destination simply did
// not exist, but the parent directory does, the extraction will still
// succeed.
if err == nil {
dstInfo.Exists, dstInfo.IsDir = true, dstStat.Mode.IsDir()
}
var (
content io.Reader
resolvedDstPath string
)
if srcPath == "-" {
// Use STDIN.
content = os.Stdin
resolvedDstPath = dstInfo.Path
if !dstInfo.IsDir {
return fmt.Errorf("destination %q must be a directory", fmt.Sprintf("%s:%s", dstContainer, dstPath))
}
} else {
// Prepare source copy info.
srcInfo, err := archive.CopyInfoSourcePath(srcPath)
if err != nil {
return err
}
srcArchive, err := archive.TarResource(srcInfo)
if err != nil {
return err
}
defer srcArchive.Close()
// With the stat info about the local source as well as the
// destination, we have enough information to know whether we need to
// alter the archive that we upload so that when the server extracts
// it to the specified directory in the container we get the disired
// copy behavior.
// See comments in the implementation of `archive.PrepareArchiveCopy`
// for exactly what goes into deciding how and whether the source
// archive needs to be altered for the correct copy behavior when it is
// extracted. This function also infers from the source and destination
// info which directory to extract to, which may be the parent of the
// destination that the user specified.
dstDir, preparedArchive, err := archive.PrepareArchiveCopy(srcArchive, srcInfo, dstInfo)
if err != nil {
return err
}
defer preparedArchive.Close()
resolvedDstPath = dstDir
content = preparedArchive
}
query := make(url.Values, 2)
query.Set("path", filepath.ToSlash(resolvedDstPath)) // Normalize the paths used in the API.
// Do not allow for an existing directory to be overwritten by a non-directory and vice versa.
query.Set("noOverwriteDirNonDir", "true")
urlStr := fmt.Sprintf("/containers/%s/archive?%s", dstContainer, query.Encode())
response, err := cli.stream("PUT", urlStr, &streamOpts{in: content})
if err != nil {
return err
}
defer response.body.Close()
if response.statusCode != http.StatusOK {
return fmt.Errorf("unexpected status code from daemon: %d", response.statusCode)
}
return nil
}

View File

@@ -10,11 +10,11 @@ import (
"strings"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/graph/tags"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
)
func (cli *DockerCli) pullImage(image string) error {
@@ -52,7 +52,7 @@ func (cli *DockerCli) pullImageCustomOut(image string, out io.Writer) error {
out: out,
headers: map[string][]string{"X-Registry-Auth": registryAuthHeader},
}
if err := cli.stream("POST", "/images/create?"+v.Encode(), sopts); err != nil {
if _, err := cli.stream("POST", "/images/create?"+v.Encode(), sopts); err != nil {
return err
}
return nil
@@ -94,30 +94,54 @@ func (cli *DockerCli) createContainer(config *runconfig.Config, hostConfig *runc
defer containerIDFile.Close()
}
//create the container
stream, statusCode, err := cli.call("POST", "/containers/create?"+containerValues.Encode(), mergedConfig, nil)
//if image not found try to pull it
if statusCode == 404 && strings.Contains(err.Error(), config.Image) {
repo, tag := parsers.ParseRepositoryTag(config.Image)
if tag == "" {
tag = tags.DEFAULTTAG
repo, tag := parsers.ParseRepositoryTag(config.Image)
if tag == "" {
tag = tags.DEFAULTTAG
}
ref := registry.ParseReference(tag)
var trustedRef registry.Reference
if isTrusted() && !ref.HasDigest() {
var err error
trustedRef, err = cli.trustedReference(repo, ref)
if err != nil {
return nil, err
}
fmt.Fprintf(cli.err, "Unable to find image '%s' locally\n", utils.ImageReference(repo, tag))
config.Image = trustedRef.ImageName(repo)
}
//create the container
serverResp, err := cli.call("POST", "/containers/create?"+containerValues.Encode(), mergedConfig, nil)
//if image not found try to pull it
if serverResp.statusCode == 404 && strings.Contains(err.Error(), config.Image) {
fmt.Fprintf(cli.err, "Unable to find image '%s' locally\n", ref.ImageName(repo))
// we don't want to write to stdout anything apart from container.ID
if err = cli.pullImageCustomOut(config.Image, cli.err); err != nil {
return nil, err
}
if trustedRef != nil && !ref.HasDigest() {
repoInfo, err := registry.ParseRepositoryInfo(repo)
if err != nil {
return nil, err
}
if err := cli.tagTrusted(repoInfo, trustedRef, ref); err != nil {
return nil, err
}
}
// Retry
if stream, _, err = cli.call("POST", "/containers/create?"+containerValues.Encode(), mergedConfig, nil); err != nil {
if serverResp, err = cli.call("POST", "/containers/create?"+containerValues.Encode(), mergedConfig, nil); err != nil {
return nil, err
}
} else if err != nil {
return nil, err
}
defer serverResp.body.Close()
var response types.ContainerCreateResponse
if err := json.NewDecoder(stream).Decode(&response); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&response); err != nil {
return nil, err
}
for _, warning := range response.Warnings {
@@ -135,7 +159,8 @@ func (cli *DockerCli) createContainer(config *runconfig.Config, hostConfig *runc
//
// Usage: docker create [OPTIONS] IMAGE [COMMAND] [ARG...]
func (cli *DockerCli) CmdCreate(args ...string) error {
cmd := cli.Subcmd("create", "IMAGE [COMMAND] [ARG...]", "Create a new container", true)
cmd := Cli.Subcmd("create", []string{"IMAGE [COMMAND] [ARG...]"}, "Create a new container", true)
addTrustedFlags(cmd, true)
// These are flags not stored in Config/HostConfig
var (
@@ -145,6 +170,7 @@ func (cli *DockerCli) CmdCreate(args ...string) error {
config, hostConfig, cmd, err := runconfig.Parse(cmd, args)
if err != nil {
cmd.ReportError(err.Error(), true)
os.Exit(1)
}
if config.Image == "" {
cmd.Usage()

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/pkg/archive"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -17,21 +18,24 @@ import (
//
// Usage: docker diff CONTAINER
func (cli *DockerCli) CmdDiff(args ...string) error {
cmd := cli.Subcmd("diff", "CONTAINER", "Inspect changes on a container's filesystem", true)
cmd := Cli.Subcmd("diff", []string{"CONTAINER"}, "Inspect changes on a container's filesystem", true)
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
if cmd.Arg(0) == "" {
return fmt.Errorf("Container name cannot be empty")
}
rdr, _, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/changes", nil, nil)
serverResp, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/changes", nil, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
changes := []types.ContainerChange{}
if err := json.NewDecoder(rdr).Decode(&changes); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&changes); err != nil {
return err
}

View File

@@ -2,7 +2,9 @@ package client
import (
"net/url"
"time"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers/filters"
@@ -13,7 +15,7 @@ import (
//
// Usage: docker events [OPTIONS]
func (cli *DockerCli) CmdEvents(args ...string) error {
cmd := cli.Subcmd("events", "", "Get real time events from the server", true)
cmd := Cli.Subcmd("events", nil, "Get real time events from the server", true)
since := cmd.String([]string{"#since", "-since"}, "", "Show all events created since timestamp")
until := cmd.String([]string{"-until"}, "", "Stream events until this timestamp")
flFilter := opts.NewListOpts(nil)
@@ -36,11 +38,12 @@ func (cli *DockerCli) CmdEvents(args ...string) error {
return err
}
}
ref := time.Now()
if *since != "" {
v.Set("since", timeutils.GetTimestamp(*since))
v.Set("since", timeutils.GetTimestamp(*since, ref))
}
if *until != "" {
v.Set("until", timeutils.GetTimestamp(*until))
v.Set("until", timeutils.GetTimestamp(*until, ref))
}
if len(eventFilterArgs) > 0 {
filterJSON, err := filters.ToParam(eventFilterArgs)
@@ -53,7 +56,7 @@ func (cli *DockerCli) CmdEvents(args ...string) error {
rawTerminal: true,
out: cli.out,
}
if err := cli.stream("GET", "/events?"+v.Encode(), sopts); err != nil {
if _, err := cli.stream("GET", "/events?"+v.Encode(), sopts); err != nil {
return err
}
return nil

View File

@@ -7,6 +7,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/runconfig"
)
@@ -15,21 +16,23 @@ import (
//
// Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
func (cli *DockerCli) CmdExec(args ...string) error {
cmd := cli.Subcmd("exec", "CONTAINER COMMAND [ARG...]", "Run a command in a running container", true)
cmd := Cli.Subcmd("exec", []string{"CONTAINER COMMAND [ARG...]"}, "Run a command in a running container", true)
execConfig, err := runconfig.ParseExec(cmd, args)
// just in case the ParseExec does not exit
if execConfig.Container == "" || err != nil {
return StatusError{StatusCode: 1}
return Cli.StatusError{StatusCode: 1}
}
stream, _, err := cli.call("POST", "/containers/"+execConfig.Container+"/exec", execConfig, nil)
serverResp, err := cli.call("POST", "/containers/"+execConfig.Container+"/exec", execConfig, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
var response types.ContainerExecCreateResponse
if err := json.NewDecoder(stream).Decode(&response); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&response); err != nil {
return err
}
@@ -124,7 +127,7 @@ func (cli *DockerCli) CmdExec(args ...string) error {
}
if status != 0 {
return StatusError{StatusCode: status}
return Cli.StatusError{StatusCode: status}
}
return nil

View File

@@ -5,6 +5,7 @@ import (
"io"
"os"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -14,7 +15,7 @@ import (
//
// Usage: docker export [OPTIONS] CONTAINER
func (cli *DockerCli) CmdExport(args ...string) error {
cmd := cli.Subcmd("export", "CONTAINER", "Export a filesystem as a tar archive (streamed to STDOUT by default)", true)
cmd := Cli.Subcmd("export", []string{"CONTAINER"}, "Export the contents of a container's filesystem as a tar archive", true)
outfile := cmd.String([]string{"o", "-output"}, "", "Write to a file, instead of STDOUT")
cmd.Require(flag.Exact, 1)
@@ -38,7 +39,7 @@ func (cli *DockerCli) CmdExport(args ...string) error {
rawTerminal: true,
out: output,
}
if err := cli.stream("GET", "/containers/"+image+"/export", sopts); err != nil {
if _, err := cli.stream("GET", "/containers/"+image+"/export", sopts); err != nil {
return err
}

View File

@@ -1,34 +0,0 @@
package client
import (
"fmt"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdHelp displays information on a Docker command.
//
// If more than one command is specified, information is only shown for the first command.
//
// Usage: docker help COMMAND or docker COMMAND --help
func (cli *DockerCli) CmdHelp(args ...string) error {
if len(args) > 1 {
method, exists := cli.getMethod(args[:2]...)
if exists {
method("--help")
return nil
}
}
if len(args) > 0 {
method, exists := cli.getMethod(args[0])
if !exists {
return fmt.Errorf("docker: '%s' is not a docker command. See 'docker --help'.", args[0])
}
method("--help")
return nil
}
flag.Usage()
return nil
}

View File

@@ -138,18 +138,18 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
if err != nil {
return err
}
req, err := http.NewRequest(method, fmt.Sprintf("/v%s%s", api.APIVERSION, path), params)
req, err := http.NewRequest(method, fmt.Sprintf("%s/v%s%s", cli.basePath, api.Version, path), params)
if err != nil {
return err
}
// Add CLI Config's HTTP Headers BEFORE we set the Docker headers
// then the user can't change OUR headers
for k, v := range cli.configFile.HttpHeaders {
for k, v := range cli.configFile.HTTPHeaders {
req.Header.Set(k, v)
}
req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION)
req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION+" ("+runtime.GOOS+")")
req.Header.Set("Content-Type", "text/plain")
req.Header.Set("Connection", "Upgrade")
req.Header.Set("Upgrade", "tcp")

View File

@@ -7,6 +7,7 @@ import (
"time"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
@@ -17,20 +18,23 @@ import (
//
// Usage: docker history [OPTIONS] IMAGE
func (cli *DockerCli) CmdHistory(args ...string) error {
cmd := cli.Subcmd("history", "IMAGE", "Show the history of an image", true)
cmd := Cli.Subcmd("history", []string{"IMAGE"}, "Show the history of an image", true)
human := cmd.Bool([]string{"H", "-human"}, true, "Print sizes and dates in human readable format")
quiet := cmd.Bool([]string{"q", "-quiet"}, false, "Only show numeric IDs")
noTrunc := cmd.Bool([]string{"#notrunc", "-no-trunc"}, false, "Don't truncate output")
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
rdr, _, err := cli.call("GET", "/images/"+cmd.Arg(0)+"/history", nil, nil)
serverResp, err := cli.call("GET", "/images/"+cmd.Arg(0)+"/history", nil, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
history := []types.ImageHistory{}
if err := json.NewDecoder(rdr).Decode(&history); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&history); err != nil {
return err
}

View File

@@ -8,6 +8,7 @@ import (
"time"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
@@ -21,7 +22,7 @@ import (
//
// Usage: docker images [OPTIONS] [REPOSITORY]
func (cli *DockerCli) CmdImages(args ...string) error {
cmd := cli.Subcmd("images", "[REPOSITORY]", "List images", true)
cmd := Cli.Subcmd("images", []string{"[REPOSITORY]"}, "List images", true)
quiet := cmd.Bool([]string{"q", "-quiet"}, false, "Only show numeric IDs")
all := cmd.Bool([]string{"a", "-all"}, false, "Show all images (default hides intermediate images)")
noTrunc := cmd.Bool([]string{"#notrunc", "-no-trunc"}, false, "Don't truncate output")
@@ -30,6 +31,7 @@ func (cli *DockerCli) CmdImages(args ...string) error {
flFilter := opts.NewListOpts(nil)
cmd.Var(&flFilter, []string{"f", "-filter"}, "Filter output based on conditions provided")
cmd.Require(flag.Max, 1)
cmd.ParseFlags(args, true)
// Consolidate all filter flags, and sanity check them early.
@@ -61,13 +63,15 @@ func (cli *DockerCli) CmdImages(args ...string) error {
v.Set("all", "1")
}
rdr, _, err := cli.call("GET", "/images/json?"+v.Encode(), nil, nil)
serverResp, err := cli.call("GET", "/images/json?"+v.Encode(), nil, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
images := []types.Image{}
if err := json.NewDecoder(rdr).Decode(&images); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&images); err != nil {
return err
}

View File

@@ -4,20 +4,23 @@ import (
"fmt"
"io"
"net/url"
"os"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/docker/registry"
)
// CmdImport creates an empty filesystem image, imports the contents of the tarball into the image, and optionally tags the image.
//
// The URL argument is the address of a tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) file. If the URL is '-', then the tar file is read from STDIN.
// The URL argument is the address of a tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) file or a path to local file relative to docker client. If the URL is '-', then the tar file is read from STDIN.
//
// Usage: docker import [OPTIONS] URL [REPOSITORY[:TAG]]
// Usage: docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]
func (cli *DockerCli) CmdImport(args ...string) error {
cmd := cli.Subcmd("import", "URL|- [REPOSITORY[:TAG]]", "Create an empty filesystem image and import the contents of the\ntarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then\noptionally tag it.", true)
cmd := Cli.Subcmd("import", []string{"file|URL|- [REPOSITORY[:TAG]]"}, "Create an empty filesystem image and import the contents of the\ntarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then\noptionally tag it.", true)
flChanges := opts.NewListOpts(nil)
cmd.Var(&flChanges, []string{"c", "-change"}, "Apply Dockerfile instruction to the created image")
cmd.Require(flag.Min, 1)
@@ -36,7 +39,7 @@ func (cli *DockerCli) CmdImport(args ...string) error {
v.Add("changes", change)
}
if cmd.NArg() == 3 {
fmt.Fprintf(cli.err, "[DEPRECATED] The format 'URL|- [REPOSITORY [TAG]]' has been deprecated. Please use URL|- [REPOSITORY[:TAG]]\n")
fmt.Fprintf(cli.err, "[DEPRECATED] The format 'file|URL|- [REPOSITORY [TAG]]' has been deprecated. Please use file|URL|- [REPOSITORY[:TAG]]\n")
v.Set("tag", cmd.Arg(2))
}
@@ -52,6 +55,15 @@ func (cli *DockerCli) CmdImport(args ...string) error {
if src == "-" {
in = cli.in
} else if !urlutil.IsURL(src) {
v.Set("fromSrc", "-")
file, err := os.Open(src)
if err != nil {
return err
}
defer file.Close()
in = file
}
sopts := &streamOpts{
@@ -60,5 +72,6 @@ func (cli *DockerCli) CmdImport(args ...string) error {
out: cli.out,
}
return cli.stream("POST", "/images/create?"+v.Encode(), sopts)
_, err := cli.stream("POST", "/images/create?"+v.Encode(), sopts)
return err
}

View File

@@ -5,6 +5,9 @@ import (
"fmt"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/pkg/httputils"
"github.com/docker/docker/pkg/ioutils"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/units"
)
@@ -13,36 +16,39 @@ import (
//
// Usage: docker info
func (cli *DockerCli) CmdInfo(args ...string) error {
cmd := cli.Subcmd("info", "", "Display system-wide information", true)
cmd := Cli.Subcmd("info", nil, "Display system-wide information", true)
cmd.Require(flag.Exact, 0)
cmd.ParseFlags(args, false)
rdr, _, err := cli.call("GET", "/info", nil, nil)
cmd.ParseFlags(args, true)
serverResp, err := cli.call("GET", "/info", nil, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
info := &types.Info{}
if err := json.NewDecoder(rdr).Decode(info); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(info); err != nil {
return fmt.Errorf("Error reading remote info: %v", err)
}
fmt.Fprintf(cli.out, "Containers: %d\n", info.Containers)
fmt.Fprintf(cli.out, "Images: %d\n", info.Images)
fmt.Fprintf(cli.out, "Storage Driver: %s\n", info.Driver)
ioutils.FprintfIfNotEmpty(cli.out, "Storage Driver: %s\n", info.Driver)
if info.DriverStatus != nil {
for _, pair := range info.DriverStatus {
fmt.Fprintf(cli.out, " %s: %s\n", pair[0], pair[1])
}
}
fmt.Fprintf(cli.out, "Execution Driver: %s\n", info.ExecutionDriver)
fmt.Fprintf(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
fmt.Fprintf(cli.out, "Kernel Version: %s\n", info.KernelVersion)
fmt.Fprintf(cli.out, "Operating System: %s\n", info.OperatingSystem)
ioutils.FprintfIfNotEmpty(cli.out, "Execution Driver: %s\n", info.ExecutionDriver)
ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion)
ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem)
fmt.Fprintf(cli.out, "CPUs: %d\n", info.NCPU)
fmt.Fprintf(cli.out, "Total Memory: %s\n", units.BytesSize(float64(info.MemTotal)))
fmt.Fprintf(cli.out, "Name: %s\n", info.Name)
fmt.Fprintf(cli.out, "ID: %s\n", info.ID)
ioutils.FprintfIfNotEmpty(cli.out, "Name: %s\n", info.Name)
ioutils.FprintfIfNotEmpty(cli.out, "ID: %s\n", info.ID)
if info.Debug {
fmt.Fprintf(cli.out, "Debug mode (server): %v\n", info.Debug)
@@ -55,15 +61,9 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
fmt.Fprintf(cli.out, "Docker Root Dir: %s\n", info.DockerRootDir)
}
if info.HttpProxy != "" {
fmt.Fprintf(cli.out, "Http Proxy: %s\n", info.HttpProxy)
}
if info.HttpsProxy != "" {
fmt.Fprintf(cli.out, "Https Proxy: %s\n", info.HttpsProxy)
}
if info.NoProxy != "" {
fmt.Fprintf(cli.out, "No Proxy: %s\n", info.NoProxy)
}
ioutils.FprintfIfNotEmpty(cli.out, "Http Proxy: %s\n", info.HttpProxy)
ioutils.FprintfIfNotEmpty(cli.out, "Https Proxy: %s\n", info.HttpsProxy)
ioutils.FprintfIfNotEmpty(cli.out, "No Proxy: %s\n", info.NoProxy)
if info.IndexServerAddress != "" {
u := cli.configFile.AuthConfigs[info.IndexServerAddress].Username
@@ -72,15 +72,27 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
fmt.Fprintf(cli.out, "Registry: %v\n", info.IndexServerAddress)
}
}
if !info.MemoryLimit {
fmt.Fprintf(cli.err, "WARNING: No memory limit support\n")
}
if !info.SwapLimit {
fmt.Fprintf(cli.err, "WARNING: No swap limit support\n")
}
if !info.IPv4Forwarding {
fmt.Fprintf(cli.err, "WARNING: IPv4 forwarding is disabled.\n")
// Only output these warnings if the server supports these features
if h, err := httputils.ParseServerHeader(serverResp.header.Get("Server")); err == nil {
if h.OS != "windows" {
if !info.MemoryLimit {
fmt.Fprintf(cli.err, "WARNING: No memory limit support\n")
}
if !info.SwapLimit {
fmt.Fprintf(cli.err, "WARNING: No swap limit support\n")
}
if !info.IPv4Forwarding {
fmt.Fprintf(cli.err, "WARNING: IPv4 forwarding is disabled.\n")
}
if !info.BridgeNfIptables {
fmt.Fprintf(cli.err, "WARNING: bridge-nf-call-iptables is disabled\n")
}
if !info.BridgeNfIp6tables {
fmt.Fprintf(cli.err, "WARNING: bridge-nf-call-ip6tables is disabled\n")
}
}
}
if info.Labels != nil {
fmt.Fprintln(cli.out, "Labels:")
for _, attribute := range info.Labels {

View File

@@ -9,41 +9,55 @@ import (
"text/template"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
var funcMap = template.FuncMap{
"json": func(v interface{}) string {
a, _ := json.Marshal(v)
return string(a)
},
}
// CmdInspect displays low-level information on one or more containers or images.
//
// Usage: docker inspect [OPTIONS] CONTAINER|IMAGE [CONTAINER|IMAGE...]
func (cli *DockerCli) CmdInspect(args ...string) error {
cmd := cli.Subcmd("inspect", "CONTAINER|IMAGE [CONTAINER|IMAGE...]", "Return low-level information on a container or image", true)
cmd := Cli.Subcmd("inspect", []string{"CONTAINER|IMAGE [CONTAINER|IMAGE...]"}, "Return low-level information on a container or image", true)
tmplStr := cmd.String([]string{"f", "#format", "-format"}, "", "Format the output using the given go template")
inspectType := cmd.String([]string{"-type"}, "", "Return JSON for specified type, (e.g image or container)")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var tmpl *template.Template
var err error
var obj []byte
if *tmplStr != "" {
var err error
if tmpl, err = template.New("").Funcs(funcMap).Parse(*tmplStr); err != nil {
return StatusError{StatusCode: 64,
return Cli.StatusError{StatusCode: 64,
Status: "Template parsing error: " + err.Error()}
}
}
if *inspectType != "" && *inspectType != "container" && *inspectType != "image" {
return fmt.Errorf("%q is not a valid value for --type", *inspectType)
}
indented := new(bytes.Buffer)
indented.WriteString("[\n")
status := 0
isImage := false
for _, name := range cmd.Args() {
obj, _, err := readBody(cli.call("GET", "/containers/"+name+"/json", nil, nil))
if err != nil {
obj, _, err = readBody(cli.call("GET", "/images/"+name+"/json", nil, nil))
isImage = true
if err != nil {
if *inspectType == "" || *inspectType == "container" {
obj, _, err = readBody(cli.call("GET", "/containers/"+name+"/json", nil, nil))
if err != nil && *inspectType == "container" {
if strings.Contains(err.Error(), "No such") {
fmt.Fprintf(cli.err, "Error: No such image or container: %s\n", name)
fmt.Fprintf(cli.err, "Error: No such container: %s\n", name)
} else {
fmt.Fprintf(cli.err, "%s", err)
}
@@ -52,8 +66,27 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
}
}
if obj == nil && (*inspectType == "" || *inspectType == "image") {
obj, _, err = readBody(cli.call("GET", "/images/"+name+"/json", nil, nil))
isImage = true
if err != nil {
if strings.Contains(err.Error(), "No such") {
if *inspectType == "" {
fmt.Fprintf(cli.err, "Error: No such image or container: %s\n", name)
} else {
fmt.Fprintf(cli.err, "Error: No such image: %s\n", name)
}
} else {
fmt.Fprintf(cli.err, "%s", err)
}
status = 1
continue
}
}
if tmpl == nil {
if err = json.Indent(indented, obj, "", " "); err != nil {
if err := json.Indent(indented, obj, "", " "); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
status = 1
continue
@@ -109,13 +142,16 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
indented.WriteString("]\n")
if tmpl == nil {
// Note that we will always write "[]" when "-f" isn't specified,
// to make sure the output would always be array, see
// https://github.com/docker/docker/pull/9500#issuecomment-65846734
if _, err := io.Copy(cli.out, indented); err != nil {
return err
}
}
if status != 0 {
return StatusError{StatusCode: status}
return Cli.StatusError{StatusCode: status}
}
return nil
}

View File

@@ -3,6 +3,7 @@ package client
import (
"fmt"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -10,7 +11,7 @@ import (
//
// Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdKill(args ...string) error {
cmd := cli.Subcmd("kill", "CONTAINER [CONTAINER...]", "Kill a running container using SIGKILL or a specified signal", true)
cmd := Cli.Subcmd("kill", []string{"CONTAINER [CONTAINER...]"}, "Kill a running container using SIGKILL or a specified signal", true)
signal := cmd.String([]string{"s", "-signal"}, "KILL", "Signal to send to the container")
cmd.Require(flag.Min, 1)

View File

@@ -4,6 +4,7 @@ import (
"io"
"os"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -13,7 +14,7 @@ import (
//
// Usage: docker load [OPTIONS]
func (cli *DockerCli) CmdLoad(args ...string) error {
cmd := cli.Subcmd("load", "", "Load an image from a tar archive on STDIN", true)
cmd := Cli.Subcmd("load", nil, "Load an image from a tar archive or STDIN", true)
infile := cmd.String([]string{"i", "-input"}, "", "Read from a tar archive file, instead of STDIN")
cmd.Require(flag.Exact, 0)
@@ -34,7 +35,7 @@ func (cli *DockerCli) CmdLoad(args ...string) error {
in: input,
out: cli.out,
}
if err := cli.stream("POST", "/images/load", sopts); err != nil {
if _, err := cli.stream("POST", "/images/load", sopts); err != nil {
return err
}
return nil

View File

@@ -9,6 +9,7 @@ import (
"strings"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/cliconfig"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/term"
@@ -21,7 +22,7 @@ import (
//
// Usage: docker login SERVER
func (cli *DockerCli) CmdLogin(args ...string) error {
cmd := cli.Subcmd("login", "[SERVER]", "Register or log in to a Docker registry server, if no server is\nspecified \""+registry.IndexServerAddress()+"\" is the default.", true)
cmd := Cli.Subcmd("login", []string{"[SERVER]"}, "Register or log in to a Docker registry server, if no server is\nspecified \""+registry.IndexServer+"\" is the default.", true)
cmd.Require(flag.Max, 1)
var username, password, email string
@@ -32,7 +33,7 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
cmd.ParseFlags(args, true)
serverAddress := registry.IndexServerAddress()
serverAddress := registry.IndexServer
if len(cmd.Args()) > 0 {
serverAddress = cmd.Arg(0)
}
@@ -113,8 +114,8 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
authconfig.ServerAddress = serverAddress
cli.configFile.AuthConfigs[serverAddress] = authconfig
stream, statusCode, err := cli.call("POST", "/auth", cli.configFile.AuthConfigs[serverAddress], nil)
if statusCode == 401 {
serverResp, err := cli.call("POST", "/auth", cli.configFile.AuthConfigs[serverAddress], nil)
if serverResp.statusCode == 401 {
delete(cli.configFile.AuthConfigs, serverAddress)
if err2 := cli.configFile.Save(); err2 != nil {
fmt.Fprintf(cli.out, "WARNING: could not save config file: %v\n", err2)
@@ -125,8 +126,10 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
return err
}
defer serverResp.body.Close()
var response types.AuthResponse
if err := json.NewDecoder(stream).Decode(&response); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&response); err != nil {
// Upon error, remove entry
delete(cli.configFile.AuthConfigs, serverAddress)
return err

View File

@@ -3,6 +3,7 @@ package client
import (
"fmt"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/registry"
)
@@ -13,11 +14,12 @@ import (
//
// Usage: docker logout [SERVER]
func (cli *DockerCli) CmdLogout(args ...string) error {
cmd := cli.Subcmd("logout", "[SERVER]", "Log out from a Docker registry, if no server is\nspecified \""+registry.IndexServerAddress()+"\" is the default.", true)
cmd := Cli.Subcmd("logout", []string{"[SERVER]"}, "Log out from a Docker registry, if no server is\nspecified \""+registry.IndexServer+"\" is the default.", true)
cmd.Require(flag.Max, 1)
cmd.ParseFlags(args, false)
serverAddress := registry.IndexServerAddress()
cmd.ParseFlags(args, true)
serverAddress := registry.IndexServer
if len(cmd.Args()) > 0 {
serverAddress = cmd.Arg(0)
}

View File

@@ -4,8 +4,10 @@ import (
"encoding/json"
"fmt"
"net/url"
"time"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/timeutils"
)
@@ -14,26 +16,24 @@ import (
//
// docker logs [OPTIONS] CONTAINER
func (cli *DockerCli) CmdLogs(args ...string) error {
var (
cmd = cli.Subcmd("logs", "CONTAINER", "Fetch the logs of a container", true)
follow = cmd.Bool([]string{"f", "-follow"}, false, "Follow log output")
since = cmd.String([]string{"-since"}, "", "Show logs since timestamp")
times = cmd.Bool([]string{"t", "-timestamps"}, false, "Show timestamps")
tail = cmd.String([]string{"-tail"}, "all", "Number of lines to show from the end of the logs")
)
cmd := Cli.Subcmd("logs", []string{"CONTAINER"}, "Fetch the logs of a container", true)
follow := cmd.Bool([]string{"f", "-follow"}, false, "Follow log output")
since := cmd.String([]string{"-since"}, "", "Show logs since timestamp")
times := cmd.Bool([]string{"t", "-timestamps"}, false, "Show timestamps")
tail := cmd.String([]string{"-tail"}, "all", "Number of lines to show from the end of the logs")
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
name := cmd.Arg(0)
stream, _, err := cli.call("GET", "/containers/"+name+"/json", nil, nil)
serverResp, err := cli.call("GET", "/containers/"+name+"/json", nil, nil)
if err != nil {
return err
}
var c types.ContainerJSON
if err := json.NewDecoder(stream).Decode(&c); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {
return err
}
@@ -46,7 +46,7 @@ func (cli *DockerCli) CmdLogs(args ...string) error {
v.Set("stderr", "1")
if *since != "" {
v.Set("since", timeutils.GetTimestamp(*since))
v.Set("since", timeutils.GetTimestamp(*since, time.Now()))
}
if *times {
@@ -64,5 +64,6 @@ func (cli *DockerCli) CmdLogs(args ...string) error {
err: cli.err,
}
return cli.stream("GET", "/containers/"+name+"/logs?"+v.Encode(), sopts)
_, err = cli.stream("GET", "/containers/"+name+"/logs?"+v.Encode(), sopts)
return err
}

15
api/client/network.go Normal file
View File

@@ -0,0 +1,15 @@
// +build experimental
package client
import (
"os"
nwclient "github.com/docker/libnetwork/client"
)
func (cli *DockerCli) CmdNetwork(args ...string) error {
nCli := nwclient.NewNetworkCli(cli.out, cli.err, nwclient.CallFunc(cli.callWrapper))
args = append([]string{"network"}, args...)
return nCli.Cmd(os.Args[0], args...)
}

View File

@@ -3,6 +3,7 @@ package client
import (
"fmt"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -10,9 +11,10 @@ import (
//
// Usage: docker pause CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdPause(args ...string) error {
cmd := cli.Subcmd("pause", "CONTAINER [CONTAINER...]", "Pause all processes within a container", true)
cmd := Cli.Subcmd("pause", []string{"CONTAINER [CONTAINER...]"}, "Pause all processes within a container", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, false)
cmd.ParseFlags(args, true)
var errNames []string
for _, name := range cmd.Args() {

View File

@@ -5,8 +5,9 @@ import (
"fmt"
"strings"
"github.com/docker/docker/nat"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/nat"
)
// CmdPort lists port mappings for a container.
@@ -14,22 +15,25 @@ import (
//
// Usage: docker port CONTAINER [PRIVATE_PORT[/PROTO]]
func (cli *DockerCli) CmdPort(args ...string) error {
cmd := cli.Subcmd("port", "CONTAINER [PRIVATE_PORT[/PROTO]]", "List port mappings for the CONTAINER, or lookup the public-facing port that\nis NAT-ed to the PRIVATE_PORT", true)
cmd := Cli.Subcmd("port", []string{"CONTAINER [PRIVATE_PORT[/PROTO]]"}, "List port mappings for the CONTAINER, or lookup the public-facing port that\nis NAT-ed to the PRIVATE_PORT", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
stream, _, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/json", nil, nil)
serverResp, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/json", nil, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
var c struct {
NetworkSettings struct {
Ports nat.PortMap
}
}
if err := json.NewDecoder(stream).Decode(&c); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {
return err
}
@@ -45,9 +49,13 @@ func (cli *DockerCli) CmdPort(args ...string) error {
proto = parts[1]
}
natPort := port + "/" + proto
if frontends, exists := c.NetworkSettings.Ports[nat.Port(port+"/"+proto)]; exists && frontends != nil {
newP, err := nat.NewPort(proto, port)
if err != nil {
return err
}
if frontends, exists := c.NetworkSettings.Ports[newP]; exists && frontends != nil {
for _, frontend := range frontends {
fmt.Fprintf(cli.out, "%s:%s\n", frontend.HostIp, frontend.HostPort)
fmt.Fprintf(cli.out, "%s:%s\n", frontend.HostIP, frontend.HostPort)
}
return nil
}
@@ -56,7 +64,7 @@ func (cli *DockerCli) CmdPort(args ...string) error {
for from, frontends := range c.NetworkSettings.Ports {
for _, frontend := range frontends {
fmt.Fprintf(cli.out, "%s -> %s:%s\n", from, frontend.HostIp, frontend.HostPort)
fmt.Fprintf(cli.out, "%s -> %s:%s\n", from, frontend.HostIP, frontend.HostPort)
}
}

View File

@@ -2,21 +2,15 @@ package client
import (
"encoding/json"
"fmt"
"net/url"
"strconv"
"strings"
"text/tabwriter"
"time"
"github.com/docker/docker/api"
"github.com/docker/docker/api/client/ps"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers/filters"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
"github.com/docker/docker/pkg/units"
)
// CmdPs outputs a list of Docker containers.
@@ -29,7 +23,7 @@ func (cli *DockerCli) CmdPs(args ...string) error {
psFilterArgs = filters.Args{}
v = url.Values{}
cmd = cli.Subcmd("ps", "", "List containers", true)
cmd = Cli.Subcmd("ps", nil, "List containers", true)
quiet = cmd.Bool([]string{"q", "-quiet"}, false, "Only display numeric IDs")
size = cmd.Bool([]string{"s", "-size"}, false, "Display total file sizes")
all = cmd.Bool([]string{"a", "-all"}, false, "Show all containers (default shows just running)")
@@ -38,6 +32,7 @@ func (cli *DockerCli) CmdPs(args ...string) error {
since = cmd.String([]string{"#sinceId", "#-since-id", "-since"}, "", "Show created since Id or Name, include non-running")
before = cmd.String([]string{"#beforeId", "#-before-id", "-before"}, "", "Show only container created before Id or Name")
last = cmd.Int([]string{"n"}, -1, "Show n last created containers, include non-running")
format = cmd.String([]string{"-format"}, "", "Pretty-print containers using a Go template")
flFilter = opts.NewListOpts(nil)
)
cmd.Require(flag.Exact, 0)
@@ -86,90 +81,36 @@ func (cli *DockerCli) CmdPs(args ...string) error {
v.Set("filters", filterJSON)
}
rdr, _, err := cli.call("GET", "/containers/json?"+v.Encode(), nil, nil)
serverResp, err := cli.call("GET", "/containers/json?"+v.Encode(), nil, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
containers := []types.Container{}
if err := json.NewDecoder(rdr).Decode(&containers); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&containers); err != nil {
return err
}
w := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)
if !*quiet {
fmt.Fprint(w, "CONTAINER ID\tIMAGE\tCOMMAND\tCREATED\tSTATUS\tPORTS\tNAMES")
if *size {
fmt.Fprintln(w, "\tSIZE")
f := *format
if len(f) == 0 {
if len(cli.PsFormat()) > 0 && !*quiet {
f = cli.PsFormat()
} else {
fmt.Fprint(w, "\n")
f = "table"
}
}
stripNamePrefix := func(ss []string) []string {
for i, s := range ss {
ss[i] = s[1:]
}
return ss
psCtx := ps.Context{
Output: cli.out,
Format: f,
Quiet: *quiet,
Size: *size,
Trunc: !*noTrunc,
}
for _, container := range containers {
ID := container.ID
if !*noTrunc {
ID = stringid.TruncateID(ID)
}
if *quiet {
fmt.Fprintln(w, ID)
continue
}
var (
names = stripNamePrefix(container.Names)
command = strconv.Quote(container.Command)
)
if !*noTrunc {
command = stringutils.Truncate(command, 20)
// only display the default name for the container with notrunc is passed
for _, name := range names {
if len(strings.Split(name, "/")) == 1 {
names = []string{name}
break
}
}
}
image := container.Image
if image == "" {
image = "<no image>"
}
fmt.Fprintf(w, "%s\t%s\t%s\t%s ago\t%s\t%s\t%s\t", ID, image, command,
units.HumanDuration(time.Now().UTC().Sub(time.Unix(int64(container.Created), 0))),
container.Status, api.DisplayablePorts(container.Ports), strings.Join(names, ","))
if *size {
if container.SizeRootFs > 0 {
fmt.Fprintf(w, "%s (virtual %s)\n", units.HumanSize(float64(container.SizeRw)), units.HumanSize(float64(container.SizeRootFs)))
} else {
fmt.Fprintf(w, "%s\n", units.HumanSize(float64(container.SizeRw)))
}
continue
}
fmt.Fprint(w, "\n")
}
if !*quiet {
w.Flush()
}
ps.Format(psCtx, containers)
return nil
}

220
api/client/ps/custom.go Normal file
View File

@@ -0,0 +1,220 @@
package ps
import (
"bytes"
"fmt"
"strconv"
"strings"
"text/tabwriter"
"text/template"
"time"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
"github.com/docker/docker/pkg/units"
)
const (
tableKey = "table"
idHeader = "CONTAINER ID"
imageHeader = "IMAGE"
namesHeader = "NAMES"
commandHeader = "COMMAND"
createdAtHeader = "CREATED AT"
runningForHeader = "CREATED"
statusHeader = "STATUS"
portsHeader = "PORTS"
sizeHeader = "SIZE"
labelsHeader = "LABELS"
)
type containerContext struct {
trunc bool
header []string
c types.Container
}
func (c *containerContext) ID() string {
c.addHeader(idHeader)
if c.trunc {
return stringid.TruncateID(c.c.ID)
}
return c.c.ID
}
func (c *containerContext) Names() string {
c.addHeader(namesHeader)
names := stripNamePrefix(c.c.Names)
if c.trunc {
for _, name := range names {
if len(strings.Split(name, "/")) == 1 {
names = []string{name}
break
}
}
}
return strings.Join(names, ",")
}
func (c *containerContext) Image() string {
c.addHeader(imageHeader)
if c.c.Image == "" {
return "<no image>"
}
return c.c.Image
}
func (c *containerContext) Command() string {
c.addHeader(commandHeader)
command := c.c.Command
if c.trunc {
command = stringutils.Truncate(command, 20)
}
return strconv.Quote(command)
}
func (c *containerContext) CreatedAt() string {
c.addHeader(createdAtHeader)
return time.Unix(int64(c.c.Created), 0).String()
}
func (c *containerContext) RunningFor() string {
c.addHeader(runningForHeader)
createdAt := time.Unix(int64(c.c.Created), 0)
return units.HumanDuration(time.Now().UTC().Sub(createdAt))
}
func (c *containerContext) Ports() string {
c.addHeader(portsHeader)
return api.DisplayablePorts(c.c.Ports)
}
func (c *containerContext) Status() string {
c.addHeader(statusHeader)
return c.c.Status
}
func (c *containerContext) Size() string {
c.addHeader(sizeHeader)
srw := units.HumanSize(float64(c.c.SizeRw))
sv := units.HumanSize(float64(c.c.SizeRootFs))
sf := srw
if c.c.SizeRootFs > 0 {
sf = fmt.Sprintf("%s (virtual %s)", srw, sv)
}
return sf
}
func (c *containerContext) Labels() string {
c.addHeader(labelsHeader)
if c.c.Labels == nil {
return ""
}
var joinLabels []string
for k, v := range c.c.Labels {
joinLabels = append(joinLabels, fmt.Sprintf("%s=%s", k, v))
}
return strings.Join(joinLabels, ",")
}
func (c *containerContext) Label(name string) string {
n := strings.Split(name, ".")
r := strings.NewReplacer("-", " ", "_", " ")
h := r.Replace(n[len(n)-1])
c.addHeader(h)
if c.c.Labels == nil {
return ""
}
return c.c.Labels[name]
}
func (c *containerContext) fullHeader() string {
if c.header == nil {
return ""
}
return strings.Join(c.header, "\t")
}
func (c *containerContext) addHeader(header string) {
if c.header == nil {
c.header = []string{}
}
c.header = append(c.header, strings.ToUpper(header))
}
func customFormat(ctx Context, containers []types.Container) {
var (
table bool
header string
format = ctx.Format
buffer = bytes.NewBufferString("")
)
if strings.HasPrefix(ctx.Format, tableKey) {
table = true
format = format[len(tableKey):]
}
format = strings.Trim(format, " ")
r := strings.NewReplacer(`\t`, "\t", `\n`, "\n")
format = r.Replace(format)
if table && ctx.Size {
format += "\t{{.Size}}"
}
tmpl, err := template.New("").Parse(format)
if err != nil {
buffer.WriteString(fmt.Sprintf("Template parsing error: %v\n", err))
buffer.WriteTo(ctx.Output)
return
}
for _, container := range containers {
containerCtx := &containerContext{
trunc: ctx.Trunc,
c: container,
}
if err := tmpl.Execute(buffer, containerCtx); err != nil {
buffer = bytes.NewBufferString(fmt.Sprintf("Template parsing error: %v\n", err))
buffer.WriteTo(ctx.Output)
return
}
if table && len(header) == 0 {
header = containerCtx.fullHeader()
}
buffer.WriteString("\n")
}
if table {
if len(header) == 0 {
// if we still don't have a header, we didn't have any containers so we need to fake it to get the right headers from the template
containerCtx := &containerContext{}
tmpl.Execute(bytes.NewBufferString(""), containerCtx)
header = containerCtx.fullHeader()
}
t := tabwriter.NewWriter(ctx.Output, 20, 1, 3, ' ', 0)
t.Write([]byte(header))
t.Write([]byte("\n"))
buffer.WriteTo(t)
t.Flush()
} else {
buffer.WriteTo(ctx.Output)
}
}
func stripNamePrefix(ss []string) []string {
for i, s := range ss {
ss[i] = s[1:]
}
return ss
}

View File

@@ -0,0 +1,102 @@
package ps
import (
"bytes"
"reflect"
"strings"
"testing"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stringid"
)
func TestContainerPsContext(t *testing.T) {
containerId := stringid.GenerateRandomID()
unix := time.Now().Unix()
var ctx containerContext
cases := []struct {
container types.Container
trunc bool
expValue string
expHeader string
call func() string
}{
{types.Container{ID: containerId}, true, stringid.TruncateID(containerId), idHeader, ctx.ID},
{types.Container{Names: []string{"/foobar_baz"}}, true, "foobar_baz", namesHeader, ctx.Names},
{types.Container{Image: "ubuntu"}, true, "ubuntu", imageHeader, ctx.Image},
{types.Container{Image: ""}, true, "<no image>", imageHeader, ctx.Image},
{types.Container{Command: "sh -c 'ls -la'"}, true, `"sh -c 'ls -la'"`, commandHeader, ctx.Command},
{types.Container{Created: int(unix)}, true, time.Unix(unix, 0).String(), createdAtHeader, ctx.CreatedAt},
{types.Container{Ports: []types.Port{{PrivatePort: 8080, PublicPort: 8080, Type: "tcp"}}}, true, "8080/tcp", portsHeader, ctx.Ports},
{types.Container{Status: "RUNNING"}, true, "RUNNING", statusHeader, ctx.Status},
{types.Container{SizeRw: 10}, true, "10 B", sizeHeader, ctx.Size},
{types.Container{SizeRw: 10, SizeRootFs: 20}, true, "10 B (virtual 20 B)", sizeHeader, ctx.Size},
{types.Container{Labels: map[string]string{"cpu": "6", "storage": "ssd"}}, true, "cpu=6,storage=ssd", labelsHeader, ctx.Labels},
}
for _, c := range cases {
ctx = containerContext{c: c.container, trunc: c.trunc}
v := c.call()
if strings.Contains(v, ",") {
// comma-separated values means probably a map input, which won't
// be guaranteed to have the same order as our expected value
// We'll create maps and use reflect.DeepEquals to check instead:
entriesMap := make(map[string]string)
expMap := make(map[string]string)
entries := strings.Split(v, ",")
expectedEntries := strings.Split(c.expValue, ",")
for _, entry := range entries {
keyval := strings.Split(entry, "=")
entriesMap[keyval[0]] = keyval[1]
}
for _, expected := range expectedEntries {
keyval := strings.Split(expected, "=")
expMap[keyval[0]] = keyval[1]
}
if !reflect.DeepEqual(expMap, entriesMap) {
t.Fatalf("Expected entries: %v, got: %v", c.expValue, v)
}
} else if v != c.expValue {
t.Fatalf("Expected %s, was %s\n", c.expValue, v)
}
h := ctx.fullHeader()
if h != c.expHeader {
t.Fatalf("Expected %s, was %s\n", c.expHeader, h)
}
}
c := types.Container{Labels: map[string]string{"com.docker.swarm.swarm-id": "33", "com.docker.swarm.node_name": "ubuntu"}}
ctx = containerContext{c: c, trunc: true}
sid := ctx.Label("com.docker.swarm.swarm-id")
node := ctx.Label("com.docker.swarm.node_name")
if sid != "33" {
t.Fatalf("Expected 33, was %s\n", sid)
}
if node != "ubuntu" {
t.Fatalf("Expected ubuntu, was %s\n", node)
}
h := ctx.fullHeader()
if h != "SWARM ID\tNODE NAME" {
t.Fatalf("Expected %s, was %s\n", "SWARM ID\tNODE NAME", h)
}
}
func TestContainerPsFormatError(t *testing.T) {
out := bytes.NewBufferString("")
ctx := Context{
Format: "{{InvalidFunction}}",
Output: out,
}
customFormat(ctx, make([]types.Container, 0))
if out.String() != "Template parsing error: template: :1: function \"InvalidFunction\" not defined\n" {
t.Fatalf("Expected format error, got `%v`\n", out.String())
}
}

View File

@@ -0,0 +1,65 @@
package ps
import (
"io"
"github.com/docker/docker/api/types"
)
const (
tableFormatKey = "table"
rawFormatKey = "raw"
defaultTableFormat = "table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.RunningFor}} ago\t{{.Status}}\t{{.Ports}}\t{{.Names}}"
defaultQuietFormat = "{{.ID}}"
)
type Context struct {
Output io.Writer
Format string
Size bool
Quiet bool
Trunc bool
}
func Format(ctx Context, containers []types.Container) {
switch ctx.Format {
case tableFormatKey:
tableFormat(ctx, containers)
case rawFormatKey:
rawFormat(ctx, containers)
default:
customFormat(ctx, containers)
}
}
func rawFormat(ctx Context, containers []types.Container) {
if ctx.Quiet {
ctx.Format = `container_id: {{.ID}}`
} else {
ctx.Format = `container_id: {{.ID}}
image: {{.Image}}
command: {{.Command}}
created_at: {{.CreatedAt}}
status: {{.Status}}
names: {{.Names}}
labels: {{.Labels}}
ports: {{.Ports}}
`
if ctx.Size {
ctx.Format += `size: {{.Size}}
`
}
}
customFormat(ctx, containers)
}
func tableFormat(ctx Context, containers []types.Container) {
ctx.Format = defaultTableFormat
if ctx.Quiet {
ctx.Format = defaultQuietFormat
}
customFormat(ctx, containers)
}

View File

@@ -4,37 +4,34 @@ import (
"fmt"
"net/url"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/graph/tags"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"
)
// CmdPull pulls an image or a repository from the registry.
//
// Usage: docker pull [OPTIONS] IMAGENAME[:TAG|@DIGEST]
func (cli *DockerCli) CmdPull(args ...string) error {
cmd := cli.Subcmd("pull", "NAME[:TAG|@DIGEST]", "Pull an image or a repository from the registry", true)
cmd := Cli.Subcmd("pull", []string{"NAME[:TAG|@DIGEST]"}, "Pull an image or a repository from a registry", true)
allTags := cmd.Bool([]string{"a", "-all-tags"}, false, "Download all tagged images in the repository")
addTrustedFlags(cmd, true)
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
remote := cmd.Arg(0)
var (
v = url.Values{}
remote = cmd.Arg(0)
newRemote = remote
)
taglessRemote, tag := parsers.ParseRepositoryTag(remote)
if tag == "" && !*allTags {
newRemote = utils.ImageReference(taglessRemote, tags.DEFAULTTAG)
}
if tag != "" && *allTags {
tag = tags.DEFAULTTAG
fmt.Fprintf(cli.out, "Using default tag: %s\n", tag)
} else if tag != "" && *allTags {
return fmt.Errorf("tag can't be used with --all-tags/-a")
}
v.Set("fromImage", newRemote)
ref := registry.ParseReference(tag)
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(taglessRemote)
@@ -42,6 +39,15 @@ func (cli *DockerCli) CmdPull(args ...string) error {
return err
}
if isTrusted() && !ref.HasDigest() {
// Check if tag is digest
authConfig := registry.ResolveAuthConfig(cli.configFile, repoInfo.Index)
return cli.trustedPull(repoInfo, ref, authConfig)
}
v := url.Values{}
v.Set("fromImage", ref.ImageName(taglessRemote))
_, _, err = cli.clientRequestAttemptLogin("POST", "/images/create?"+v.Encode(), nil, cli.out, repoInfo.Index, "pull")
return err
}

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"net/url"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
@@ -13,14 +14,13 @@ import (
//
// Usage: docker push NAME[:TAG]
func (cli *DockerCli) CmdPush(args ...string) error {
cmd := cli.Subcmd("push", "NAME[:TAG]", "Push an image or a repository to the registry", true)
cmd := Cli.Subcmd("push", []string{"NAME[:TAG]"}, "Push an image or a repository to a registry", true)
addTrustedFlags(cmd, false)
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
name := cmd.Arg(0)
remote, tag := parsers.ParseRepositoryTag(name)
remote, tag := parsers.ParseRepositoryTag(cmd.Arg(0))
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(remote)
@@ -41,6 +41,10 @@ func (cli *DockerCli) CmdPush(args ...string) error {
return fmt.Errorf("You cannot push a \"root\" repository. Please rename your repository to <user>/<repo> (ex: %s/%s)", username, repoInfo.LocalName)
}
if isTrusted() {
return cli.trustedPush(repoInfo, tag, authConfig)
}
v := url.Values{}
v.Set("tag", tag)

View File

@@ -3,6 +3,7 @@ package client
import (
"fmt"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -10,8 +11,9 @@ import (
//
// Usage: docker rename OLD_NAME NEW_NAME
func (cli *DockerCli) CmdRename(args ...string) error {
cmd := cli.Subcmd("rename", "OLD_NAME NEW_NAME", "Rename a container", true)
cmd := Cli.Subcmd("rename", []string{"OLD_NAME NEW_NAME"}, "Rename a container", true)
cmd.Require(flag.Exact, 2)
cmd.ParseFlags(args, true)
oldName := cmd.Arg(0)

View File

@@ -5,6 +5,7 @@ import (
"net/url"
"strconv"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -12,7 +13,7 @@ import (
//
// Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdRestart(args ...string) error {
cmd := cli.Subcmd("restart", "CONTAINER [CONTAINER...]", "Restart a running container", true)
cmd := Cli.Subcmd("restart", []string{"CONTAINER [CONTAINER...]"}, "Restart a running container", true)
nSeconds := cmd.Int([]string{"t", "-time"}, 10, "Seconds to wait for stop before killing the container")
cmd.Require(flag.Min, 1)

View File

@@ -5,6 +5,7 @@ import (
"net/url"
"strings"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -12,7 +13,7 @@ import (
//
// Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdRm(args ...string) error {
cmd := cli.Subcmd("rm", "CONTAINER [CONTAINER...]", "Remove one or more containers", true)
cmd := Cli.Subcmd("rm", []string{"CONTAINER [CONTAINER...]"}, "Remove one or more containers", true)
v := cmd.Bool([]string{"v", "-volumes"}, false, "Remove the volumes associated with the container")
link := cmd.Bool([]string{"l", "#link", "-link"}, false, "Remove the specified link")
force := cmd.Bool([]string{"f", "-force"}, false, "Force the removal of a running container (uses SIGKILL)")

View File

@@ -6,6 +6,7 @@ import (
"net/url"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -13,12 +14,11 @@ import (
//
// Usage: docker rmi [OPTIONS] IMAGE [IMAGE...]
func (cli *DockerCli) CmdRmi(args ...string) error {
var (
cmd = cli.Subcmd("rmi", "IMAGE [IMAGE...]", "Remove one or more images", true)
force = cmd.Bool([]string{"f", "-force"}, false, "Force removal of the image")
noprune = cmd.Bool([]string{"-no-prune"}, false, "Do not delete untagged parents")
)
cmd := Cli.Subcmd("rmi", []string{"IMAGE [IMAGE...]"}, "Remove one or more images", true)
force := cmd.Bool([]string{"f", "-force"}, false, "Force removal of the image")
noprune := cmd.Bool([]string{"-no-prune"}, false, "Do not delete untagged parents")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
v := url.Values{}
@@ -31,13 +31,15 @@ func (cli *DockerCli) CmdRmi(args ...string) error {
var errNames []string
for _, name := range cmd.Args() {
rdr, _, err := cli.call("DELETE", "/images/"+name+"?"+v.Encode(), nil, nil)
serverResp, err := cli.call("DELETE", "/images/"+name+"?"+v.Encode(), nil, nil)
if err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
defer serverResp.body.Close()
dels := []types.ImageDelete{}
if err := json.NewDecoder(rdr).Decode(&dels); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&dels); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
continue

View File

@@ -5,8 +5,10 @@ import (
"io"
"net/url"
"os"
"runtime"
"github.com/Sirupsen/logrus"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/signal"
@@ -38,7 +40,8 @@ func (cid *cidFile) Write(id string) error {
//
// Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
func (cli *DockerCli) CmdRun(args ...string) error {
cmd := cli.Subcmd("run", "IMAGE [COMMAND] [ARG...]", "Run a command in a new container", true)
cmd := Cli.Subcmd("run", []string{"IMAGE [COMMAND] [ARG...]"}, "Run a command in a new container", true)
addTrustedFlags(cmd, true)
// These are flags not stored in Config/HostConfig
var (
@@ -57,6 +60,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
// just in case the Parse does not exit
if err != nil {
cmd.ReportError(err.Error(), true)
os.Exit(1)
}
if len(hostConfig.Dns) > 0 {
@@ -102,6 +106,13 @@ func (cli *DockerCli) CmdRun(args ...string) error {
sigProxy = false
}
// Telling the Windows daemon the initial size of the tty during start makes
// a far better user experience rather than relying on subsequent resizes
// to cause things to catch up.
if runtime.GOOS == "windows" {
hostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = cli.getTtySize()
}
createResponse, err := cli.createContainer(config, hostConfig, hostConfig.ContainerIDFile, *flName)
if err != nil {
return err
@@ -240,7 +251,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
}
}
if status != 0 {
return StatusError{StatusCode: status}
return Cli.StatusError{StatusCode: status}
}
return nil
}

View File

@@ -6,6 +6,7 @@ import (
"net/url"
"os"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -15,7 +16,7 @@ import (
//
// Usage: docker save [OPTIONS] IMAGE [IMAGE...]
func (cli *DockerCli) CmdSave(args ...string) error {
cmd := cli.Subcmd("save", "IMAGE [IMAGE...]", "Save an image(s) to a tar archive (streamed to STDOUT by default)", true)
cmd := Cli.Subcmd("save", []string{"IMAGE [IMAGE...]"}, "Save an image(s) to a tar archive (streamed to STDOUT by default)", true)
outfile := cmd.String([]string{"o", "-output"}, "", "Write to an file, instead of STDOUT")
cmd.Require(flag.Min, 1)
@@ -41,7 +42,7 @@ func (cli *DockerCli) CmdSave(args ...string) error {
if len(cmd.Args()) == 1 {
image := cmd.Arg(0)
if err := cli.stream("GET", "/images/"+image+"/get", sopts); err != nil {
if _, err := cli.stream("GET", "/images/"+image+"/get", sopts); err != nil {
return err
}
} else {
@@ -49,7 +50,7 @@ func (cli *DockerCli) CmdSave(args ...string) error {
for _, arg := range cmd.Args() {
v.Add("names", arg)
}
if err := cli.stream("GET", "/images/get?"+v.Encode(), sopts); err != nil {
if _, err := cli.stream("GET", "/images/get?"+v.Encode(), sopts); err != nil {
return err
}
}

View File

@@ -8,6 +8,7 @@ import (
"strings"
"text/tabwriter"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/stringutils"
@@ -25,7 +26,7 @@ func (r ByStars) Less(i, j int) bool { return r[i].StarCount < r[j].StarCount }
//
// Usage: docker search [OPTIONS] TERM
func (cli *DockerCli) CmdSearch(args ...string) error {
cmd := cli.Subcmd("search", "TERM", "Search the Docker Hub for images", true)
cmd := Cli.Subcmd("search", []string{"TERM"}, "Search the Docker Hub for images", true)
noTrunc := cmd.Bool([]string{"#notrunc", "-no-trunc"}, false, "Don't truncate output")
trusted := cmd.Bool([]string{"#t", "#trusted", "#-trusted"}, false, "Only show trusted builds")
automated := cmd.Bool([]string{"-automated"}, false, "Only show automated builds")
@@ -50,6 +51,8 @@ func (cli *DockerCli) CmdSearch(args ...string) error {
return err
}
defer rdr.Close()
results := ByStars{}
if err := json.NewDecoder(rdr).Decode(&results); err != nil {
return err

15
api/client/service.go Normal file
View File

@@ -0,0 +1,15 @@
// +build experimental
package client
import (
"os"
nwclient "github.com/docker/libnetwork/client"
)
func (cli *DockerCli) CmdService(args ...string) error {
nCli := nwclient.NewNetworkCli(cli.out, cli.err, nwclient.CallFunc(cli.callWrapper))
args = append([]string{"service"}, args...)
return nCli.Cmd(os.Args[0], args...)
}

View File

@@ -9,6 +9,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/signal"
@@ -44,30 +45,32 @@ func (cli *DockerCli) forwardAllSignals(cid string) chan os.Signal {
//
// Usage: docker start [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdStart(args ...string) error {
cmd := Cli.Subcmd("start", []string{"CONTAINER [CONTAINER...]"}, "Start one or more stopped containers", true)
attach := cmd.Bool([]string{"a", "-attach"}, false, "Attach STDOUT/STDERR and forward signals")
openStdin := cmd.Bool([]string{"i", "-interactive"}, false, "Attach container's STDIN")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var (
cErr chan error
tty bool
cmd = cli.Subcmd("start", "CONTAINER [CONTAINER...]", "Start one or more stopped containers", true)
attach = cmd.Bool([]string{"a", "-attach"}, false, "Attach STDOUT/STDERR and forward signals")
openStdin = cmd.Bool([]string{"i", "-interactive"}, false, "Attach container's STDIN")
)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
if *attach || *openStdin {
if cmd.NArg() > 1 {
return fmt.Errorf("You cannot start and attach multiple containers at once.")
}
stream, _, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/json", nil, nil)
serverResp, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/json", nil, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
var c types.ContainerJSON
if err := json.NewDecoder(stream).Decode(&c); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {
return err
}
@@ -160,7 +163,7 @@ func (cli *DockerCli) CmdStart(args ...string) error {
return err
}
if status != 0 {
return StatusError{StatusCode: status}
return Cli.StatusError{StatusCode: status}
}
}
return nil

View File

@@ -12,6 +12,7 @@ import (
"time"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/units"
)
@@ -35,19 +36,20 @@ func (s *containerStats) Collect(cli *DockerCli, streamStats bool) {
} else {
v.Set("stream", "0")
}
stream, _, err := cli.call("GET", "/containers/"+s.Name+"/stats?"+v.Encode(), nil, nil)
serverResp, err := cli.call("GET", "/containers/"+s.Name+"/stats?"+v.Encode(), nil, nil)
if err != nil {
s.mu.Lock()
s.err = err
s.mu.Unlock()
return
}
defer stream.Close()
defer serverResp.body.Close()
var (
previousCPU uint64
previousSystem uint64
start = true
dec = json.NewDecoder(stream)
dec = json.NewDecoder(serverResp.body)
u = make(chan error, 1)
)
go func() {
@@ -61,10 +63,9 @@ func (s *containerStats) Collect(cli *DockerCli, streamStats bool) {
memPercent = float64(v.MemoryStats.Usage) / float64(v.MemoryStats.Limit) * 100.0
cpuPercent = 0.0
)
if !start {
cpuPercent = calculateCPUPercent(previousCPU, previousSystem, v)
}
start = false
previousCPU = v.PreCpuStats.CpuUsage.TotalUsage
previousSystem = v.PreCpuStats.SystemUsage
cpuPercent = calculateCPUPercent(previousCPU, previousSystem, v)
s.mu.Lock()
s.CPUPercentage = cpuPercent
s.Memory = float64(v.MemoryStats.Usage)
@@ -73,8 +74,6 @@ func (s *containerStats) Collect(cli *DockerCli, streamStats bool) {
s.NetworkRx = float64(v.Network.RxBytes)
s.NetworkTx = float64(v.Network.TxBytes)
s.mu.Unlock()
previousCPU = v.CpuStats.CpuUsage.TotalUsage
previousSystem = v.CpuStats.SystemUsage
u <- nil
if !streamStats {
return
@@ -126,9 +125,10 @@ func (s *containerStats) Display(w io.Writer) error {
//
// Usage: docker stats CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdStats(args ...string) error {
cmd := cli.Subcmd("stats", "CONTAINER [CONTAINER...]", "Display a live stream of one or more containers' resource usage statistics", true)
cmd := Cli.Subcmd("stats", []string{"CONTAINER [CONTAINER...]"}, "Display a live stream of one or more containers' resource usage statistics", true)
noStream := cmd.Bool([]string{"-no-stream"}, false, "Disable streaming stats and only pull the first result")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
names := cmd.Args()
@@ -151,7 +151,7 @@ func (cli *DockerCli) CmdStats(args ...string) error {
}
// do a quick pause so that any failed connections for containers that do not exist are able to be
// evicted before we display the initial or default values.
time.Sleep(500 * time.Millisecond)
time.Sleep(1500 * time.Millisecond)
var errs []string
for _, c := range cStats {
c.mu.Lock()

View File

@@ -5,6 +5,7 @@ import (
"net/url"
"strconv"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -14,7 +15,7 @@ import (
//
// Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdStop(args ...string) error {
cmd := cli.Subcmd("stop", "CONTAINER [CONTAINER...]", "Stop a running container by sending SIGTERM and then SIGKILL after a\ngrace period", true)
cmd := Cli.Subcmd("stop", []string{"CONTAINER [CONTAINER...]"}, "Stop a running container by sending SIGTERM and then SIGKILL after a\ngrace period", true)
nSeconds := cmd.Int([]string{"t", "-time"}, 10, "Seconds to wait for stop before killing it")
cmd.Require(flag.Min, 1)

View File

@@ -3,6 +3,7 @@ package client
import (
"net/url"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
@@ -12,7 +13,7 @@ import (
//
// Usage: docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]
func (cli *DockerCli) CmdTag(args ...string) error {
cmd := cli.Subcmd("tag", "IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]", "Tag an image into a repository", true)
cmd := Cli.Subcmd("tag", []string{"IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]"}, "Tag an image into a repository", true)
force := cmd.Bool([]string{"f", "#force", "-force"}, false, "Force")
cmd.Require(flag.Exact, 2)

View File

@@ -8,6 +8,7 @@ import (
"text/tabwriter"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -15,7 +16,7 @@ import (
//
// Usage: docker top CONTAINER
func (cli *DockerCli) CmdTop(args ...string) error {
cmd := cli.Subcmd("top", "CONTAINER [ps OPTIONS]", "Display the running processes of a container", true)
cmd := Cli.Subcmd("top", []string{"CONTAINER [ps OPTIONS]"}, "Display the running processes of a container", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
@@ -25,13 +26,15 @@ func (cli *DockerCli) CmdTop(args ...string) error {
val.Set("ps_args", strings.Join(cmd.Args()[1:], " "))
}
stream, _, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/top?"+val.Encode(), nil, nil)
serverResp, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/top?"+val.Encode(), nil, nil)
if err != nil {
return err
}
defer serverResp.body.Close()
procList := types.ContainerProcessList{}
if err := json.NewDecoder(stream).Decode(&procList); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&procList); err != nil {
return err
}

454
api/client/trust.go Normal file
View File

@@ -0,0 +1,454 @@
package client
import (
"bufio"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"net"
"net/http"
"net/url"
"os"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/registry/client/auth"
"github.com/docker/distribution/registry/client/transport"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/pkg/ansiescape"
"github.com/docker/docker/pkg/ioutils"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/tlsconfig"
"github.com/docker/docker/registry"
"github.com/docker/notary/client"
"github.com/docker/notary/pkg/passphrase"
"github.com/docker/notary/trustmanager"
"github.com/endophage/gotuf/data"
)
var untrusted bool
func addTrustedFlags(fs *flag.FlagSet, verify bool) {
var trusted bool
if e := os.Getenv("DOCKER_CONTENT_TRUST"); e != "" {
if t, err := strconv.ParseBool(e); t || err != nil {
// treat any other value as true
trusted = true
}
}
message := "Skip image signing"
if verify {
message = "Skip image verification"
}
fs.BoolVar(&untrusted, []string{"-disable-content-trust"}, !trusted, message)
}
func isTrusted() bool {
return !untrusted
}
var targetRegexp = regexp.MustCompile(`([\S]+): digest: ([\S]+) size: ([\d]+)`)
type target struct {
reference registry.Reference
digest digest.Digest
size int64
}
func (cli *DockerCli) trustDirectory() string {
return filepath.Join(cliconfig.ConfigDir(), "trust")
}
// certificateDirectory returns the directory containing
// TLS certificates for the given server. An error is
// returned if there was an error parsing the server string.
func (cli *DockerCli) certificateDirectory(server string) (string, error) {
u, err := url.Parse(server)
if err != nil {
return "", err
}
return filepath.Join(cliconfig.ConfigDir(), "tls", u.Host), nil
}
func trustServer(index *registry.IndexInfo) string {
if s := os.Getenv("DOCKER_CONTENT_TRUST_SERVER"); s != "" {
if !strings.HasPrefix(s, "https://") {
return "https://" + s
}
return s
}
if index.Official {
return registry.NotaryServer
}
return "https://" + index.Name
}
type simpleCredentialStore struct {
auth cliconfig.AuthConfig
}
func (scs simpleCredentialStore) Basic(u *url.URL) (string, string) {
return scs.auth.Username, scs.auth.Password
}
func (cli *DockerCli) getNotaryRepository(repoInfo *registry.RepositoryInfo, authConfig cliconfig.AuthConfig) (*client.NotaryRepository, error) {
server := trustServer(repoInfo.Index)
if !strings.HasPrefix(server, "https://") {
return nil, errors.New("unsupported scheme: https required for trust server")
}
var cfg = tlsconfig.ClientDefault
cfg.InsecureSkipVerify = !repoInfo.Index.Secure
// Get certificate base directory
certDir, err := cli.certificateDirectory(server)
if err != nil {
return nil, err
}
logrus.Debugf("reading certificate directory: %s", certDir)
if err := registry.ReadCertsDirectory(&cfg, certDir); err != nil {
return nil, err
}
base := &http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
TLSClientConfig: &cfg,
DisableKeepAlives: true,
}
// Skip configuration headers since request is not going to Docker daemon
modifiers := registry.DockerHeaders(http.Header{})
authTransport := transport.NewTransport(base, modifiers...)
pingClient := &http.Client{
Transport: authTransport,
Timeout: 5 * time.Second,
}
endpointStr := server + "/v2/"
req, err := http.NewRequest("GET", endpointStr, nil)
if err != nil {
return nil, err
}
resp, err := pingClient.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
challengeManager := auth.NewSimpleChallengeManager()
if err := challengeManager.AddResponse(resp); err != nil {
return nil, err
}
creds := simpleCredentialStore{auth: authConfig}
tokenHandler := auth.NewTokenHandler(authTransport, creds, repoInfo.CanonicalName, "push", "pull")
basicHandler := auth.NewBasicHandler(creds)
modifiers = append(modifiers, transport.RequestModifier(auth.NewAuthorizer(challengeManager, tokenHandler, basicHandler)))
tr := transport.NewTransport(base, modifiers...)
return client.NewNotaryRepository(cli.trustDirectory(), repoInfo.CanonicalName, server, tr, cli.getPassphraseRetriever())
}
func convertTarget(t client.Target) (target, error) {
h, ok := t.Hashes["sha256"]
if !ok {
return target{}, errors.New("no valid hash, expecting sha256")
}
return target{
reference: registry.ParseReference(t.Name),
digest: digest.NewDigestFromHex("sha256", hex.EncodeToString(h)),
size: t.Length,
}, nil
}
func (cli *DockerCli) getPassphraseRetriever() passphrase.Retriever {
aliasMap := map[string]string{
"root": "offline",
"snapshot": "tagging",
"targets": "tagging",
}
baseRetriever := passphrase.PromptRetrieverWithInOut(cli.in, cli.out, aliasMap)
env := map[string]string{
"root": os.Getenv("DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE"),
"snapshot": os.Getenv("DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE"),
"targets": os.Getenv("DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE"),
}
return func(keyName string, alias string, createNew bool, numAttempts int) (string, bool, error) {
if v := env[alias]; v != "" {
return v, numAttempts > 1, nil
}
return baseRetriever(keyName, alias, createNew, numAttempts)
}
}
func (cli *DockerCli) trustedReference(repo string, ref registry.Reference) (registry.Reference, error) {
repoInfo, err := registry.ParseRepositoryInfo(repo)
if err != nil {
return nil, err
}
// Resolve the Auth config relevant for this server
authConfig := registry.ResolveAuthConfig(cli.configFile, repoInfo.Index)
notaryRepo, err := cli.getNotaryRepository(repoInfo, authConfig)
if err != nil {
fmt.Fprintf(cli.out, "Error establishing connection to trust repository: %s\n", err)
return nil, err
}
t, err := notaryRepo.GetTargetByName(ref.String())
if err != nil {
return nil, err
}
r, err := convertTarget(*t)
if err != nil {
return nil, err
}
return registry.DigestReference(r.digest), nil
}
func (cli *DockerCli) tagTrusted(repoInfo *registry.RepositoryInfo, trustedRef, ref registry.Reference) error {
fullName := trustedRef.ImageName(repoInfo.LocalName)
fmt.Fprintf(cli.out, "Tagging %s as %s\n", fullName, ref.ImageName(repoInfo.LocalName))
tv := url.Values{}
tv.Set("repo", repoInfo.LocalName)
tv.Set("tag", ref.String())
tv.Set("force", "1")
if _, _, err := readBody(cli.call("POST", "/images/"+fullName+"/tag?"+tv.Encode(), nil, nil)); err != nil {
return err
}
return nil
}
func notaryError(err error) error {
switch err.(type) {
case *json.SyntaxError:
logrus.Debugf("Notary syntax error: %s", err)
return errors.New("no trust data available for remote repository")
case client.ErrExpired:
return fmt.Errorf("remote repository out-of-date: %v", err)
case trustmanager.ErrKeyNotFound:
return fmt.Errorf("signing keys not found: %v", err)
}
return err
}
func (cli *DockerCli) trustedPull(repoInfo *registry.RepositoryInfo, ref registry.Reference, authConfig cliconfig.AuthConfig) error {
var (
v = url.Values{}
refs = []target{}
)
notaryRepo, err := cli.getNotaryRepository(repoInfo, authConfig)
if err != nil {
fmt.Fprintf(cli.out, "Error establishing connection to trust repository: %s\n", err)
return err
}
if ref.String() == "" {
// List all targets
targets, err := notaryRepo.ListTargets()
if err != nil {
return notaryError(err)
}
for _, tgt := range targets {
t, err := convertTarget(*tgt)
if err != nil {
fmt.Fprintf(cli.out, "Skipping target for %q\n", repoInfo.LocalName)
continue
}
refs = append(refs, t)
}
} else {
t, err := notaryRepo.GetTargetByName(ref.String())
if err != nil {
return notaryError(err)
}
r, err := convertTarget(*t)
if err != nil {
return err
}
refs = append(refs, r)
}
v.Set("fromImage", repoInfo.LocalName)
for i, r := range refs {
displayTag := r.reference.String()
if displayTag != "" {
displayTag = ":" + displayTag
}
fmt.Fprintf(cli.out, "Pull (%d of %d): %s%s@%s\n", i+1, len(refs), repoInfo.LocalName, displayTag, r.digest)
v.Set("tag", r.digest.String())
_, _, err = cli.clientRequestAttemptLogin("POST", "/images/create?"+v.Encode(), nil, cli.out, repoInfo.Index, "pull")
if err != nil {
return err
}
// If reference is not trusted, tag by trusted reference
if !r.reference.HasDigest() {
if err := cli.tagTrusted(repoInfo, registry.DigestReference(r.digest), r.reference); err != nil {
return err
}
}
}
return nil
}
func selectKey(keys map[string]string) string {
if len(keys) == 0 {
return ""
}
keyIDs := []string{}
for k := range keys {
keyIDs = append(keyIDs, k)
}
// TODO(dmcgowan): let user choose if multiple keys, now pick consistently
sort.Strings(keyIDs)
return keyIDs[0]
}
func targetStream(in io.Writer) (io.WriteCloser, <-chan []target) {
r, w := io.Pipe()
out := io.MultiWriter(in, w)
targetChan := make(chan []target)
go func() {
targets := []target{}
scanner := bufio.NewScanner(r)
scanner.Split(ansiescape.ScanANSILines)
for scanner.Scan() {
line := scanner.Bytes()
if matches := targetRegexp.FindSubmatch(line); len(matches) == 4 {
dgst, err := digest.ParseDigest(string(matches[2]))
if err != nil {
// Line does match what is expected, continue looking for valid lines
logrus.Debugf("Bad digest value %q in matched line, ignoring\n", string(matches[2]))
continue
}
s, err := strconv.ParseInt(string(matches[3]), 10, 64)
if err != nil {
// Line does match what is expected, continue looking for valid lines
logrus.Debugf("Bad size value %q in matched line, ignoring\n", string(matches[3]))
continue
}
targets = append(targets, target{
reference: registry.ParseReference(string(matches[1])),
digest: dgst,
size: s,
})
}
}
targetChan <- targets
}()
return ioutils.NewWriteCloserWrapper(out, w.Close), targetChan
}
func (cli *DockerCli) trustedPush(repoInfo *registry.RepositoryInfo, tag string, authConfig cliconfig.AuthConfig) error {
streamOut, targetChan := targetStream(cli.out)
v := url.Values{}
v.Set("tag", tag)
_, _, err := cli.clientRequestAttemptLogin("POST", "/images/"+repoInfo.LocalName+"/push?"+v.Encode(), nil, streamOut, repoInfo.Index, "push")
// Close stream channel to finish target parsing
if err := streamOut.Close(); err != nil {
return err
}
// Check error from request
if err != nil {
return err
}
// Get target results
targets := <-targetChan
if tag == "" {
fmt.Fprintf(cli.out, "No tag specified, skipping trust metadata push\n")
return nil
}
if len(targets) == 0 {
fmt.Fprintf(cli.out, "No targets found, skipping trust metadata push\n")
return nil
}
fmt.Fprintf(cli.out, "Signing and pushing trust metadata\n")
repo, err := cli.getNotaryRepository(repoInfo, authConfig)
if err != nil {
fmt.Fprintf(cli.out, "Error establishing connection to notary repository: %s\n", err)
return err
}
for _, target := range targets {
h, err := hex.DecodeString(target.digest.Hex())
if err != nil {
return err
}
t := &client.Target{
Name: target.reference.String(),
Hashes: data.Hashes{
string(target.digest.Algorithm()): h,
},
Length: int64(target.size),
}
if err := repo.AddTarget(t); err != nil {
return err
}
}
err = repo.Publish()
if _, ok := err.(*client.ErrRepoNotInitialized); !ok {
return notaryError(err)
}
ks := repo.KeyStoreManager
keys := ks.RootKeyStore().ListKeys()
rootKey := selectKey(keys)
if rootKey == "" {
rootKey, err = ks.GenRootKey("ecdsa")
if err != nil {
return err
}
}
cryptoService, err := ks.GetRootCryptoService(rootKey)
if err != nil {
return err
}
if err := repo.Initialize(cryptoService); err != nil {
return notaryError(err)
}
fmt.Fprintf(cli.out, "Finished initializing %q\n", repoInfo.CanonicalName)
return notaryError(repo.Publish())
}

View File

@@ -3,6 +3,7 @@ package client
import (
"fmt"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -10,9 +11,10 @@ import (
//
// Usage: docker unpause CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdUnpause(args ...string) error {
cmd := cli.Subcmd("unpause", "CONTAINER [CONTAINER...]", "Unpause all processes within a container", true)
cmd := Cli.Subcmd("unpause", []string{"CONTAINER [CONTAINER...]"}, "Unpause all processes within a container", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, false)
cmd.ParseFlags(args, true)
var errNames []string
for _, name := range cmd.Args() {

View File

@@ -33,7 +33,13 @@ var (
errConnectionRefused = errors.New("Cannot connect to the Docker daemon. Is 'docker -d' running on this host?")
)
// HTTPClient creates a new HTP client with the cli's client transport instance.
type serverResponse struct {
body io.ReadCloser
header http.Header
statusCode int
}
// HTTPClient creates a new HTTP client with the cli's client transport instance.
func (cli *DockerCli) HTTPClient() *http.Client {
return &http.Client{Transport: cli.transport}
}
@@ -48,23 +54,29 @@ func (cli *DockerCli) encodeData(data interface{}) (*bytes.Buffer, error) {
return params, nil
}
func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers map[string][]string) (io.ReadCloser, string, int, error) {
func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers map[string][]string) (*serverResponse, error) {
serverResp := &serverResponse{
body: nil,
statusCode: -1,
}
expectedPayload := (method == "POST" || method == "PUT")
if expectedPayload && in == nil {
in = bytes.NewReader([]byte{})
}
req, err := http.NewRequest(method, fmt.Sprintf("/v%s%s", api.APIVERSION, path), in)
req, err := http.NewRequest(method, fmt.Sprintf("%s/v%s%s", cli.basePath, api.Version, path), in)
if err != nil {
return nil, "", -1, err
return serverResp, err
}
// Add CLI Config's HTTP Headers BEFORE we set the Docker headers
// then the user can't change OUR headers
for k, v := range cli.configFile.HttpHeaders {
for k, v := range cli.configFile.HTTPHeaders {
req.Header.Set(k, v)
}
req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION)
req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION+" ("+runtime.GOOS+")")
req.URL.Host = cli.addr
req.URL.Scheme = cli.scheme
@@ -79,33 +91,38 @@ func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers m
}
resp, err := cli.HTTPClient().Do(req)
statusCode := -1
if resp != nil {
statusCode = resp.StatusCode
serverResp.statusCode = resp.StatusCode
}
if err != nil {
if strings.Contains(err.Error(), "connection refused") {
return nil, "", statusCode, errConnectionRefused
return serverResp, errConnectionRefused
}
if cli.tlsConfig == nil {
return nil, "", statusCode, fmt.Errorf("%v. Are you trying to connect to a TLS-enabled daemon without TLS?", err)
return serverResp, fmt.Errorf("%v.\n* Are you trying to connect to a TLS-enabled daemon without TLS?\n* Is your docker daemon up and running?", err)
}
return nil, "", statusCode, fmt.Errorf("An error occurred trying to connect: %v", err)
if cli.tlsConfig != nil && strings.Contains(err.Error(), "remote error: bad certificate") {
return serverResp, fmt.Errorf("The server probably has client authentication (--tlsverify) enabled. Please check your TLS client certification settings: %v", err)
}
return serverResp, fmt.Errorf("An error occurred trying to connect: %v", err)
}
if statusCode < 200 || statusCode >= 400 {
if serverResp.statusCode < 200 || serverResp.statusCode >= 400 {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, "", statusCode, err
return serverResp, err
}
if len(body) == 0 {
return nil, "", statusCode, fmt.Errorf("Error: request returned %s for API route and version %s, check if the server supports the requested API version", http.StatusText(statusCode), req.URL)
return serverResp, fmt.Errorf("Error: request returned %s for API route and version %s, check if the server supports the requested API version", http.StatusText(serverResp.statusCode), req.URL)
}
return nil, "", statusCode, fmt.Errorf("Error response from daemon: %s", bytes.TrimSpace(body))
return serverResp, fmt.Errorf("Error response from daemon: %s", bytes.TrimSpace(body))
}
return resp.Body, resp.Header.Get("Content-Type"), statusCode, nil
serverResp.body = resp.Body
serverResp.header = resp.Header
return serverResp, nil
}
func (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reader, out io.Writer, index *registry.IndexInfo, cmdName string) (io.ReadCloser, int, error) {
@@ -119,24 +136,25 @@ func (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reade
}
// begin the request
body, contentType, statusCode, err := cli.clientRequest(method, path, in, map[string][]string{
serverResp, err := cli.clientRequest(method, path, in, map[string][]string{
"X-Registry-Auth": registryAuthHeader,
})
if err == nil && out != nil {
// If we are streaming output, complete the stream since
// errors may not appear until later.
err = cli.streamBody(body, contentType, true, out, nil)
err = cli.streamBody(serverResp.body, serverResp.header.Get("Content-Type"), true, out, nil)
}
if err != nil {
// Since errors in a stream appear after status 200 has been written,
// we may need to change the status code.
if strings.Contains(err.Error(), "Authentication is required") ||
strings.Contains(err.Error(), "Status 401") ||
strings.Contains(err.Error(), "401 Unauthorized") ||
strings.Contains(err.Error(), "status code 401") {
statusCode = http.StatusUnauthorized
serverResp.statusCode = http.StatusUnauthorized
}
}
return body, statusCode, err
return serverResp.body, serverResp.statusCode, err
}
// Resolve the Auth config relevant for this server
@@ -153,10 +171,20 @@ func (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reade
return body, statusCode, err
}
func (cli *DockerCli) call(method, path string, data interface{}, headers map[string][]string) (io.ReadCloser, int, error) {
func (cli *DockerCli) callWrapper(method, path string, data interface{}, headers map[string][]string) (io.ReadCloser, http.Header, int, error) {
sr, err := cli.call(method, path, data, headers)
return sr.body, sr.header, sr.statusCode, err
}
func (cli *DockerCli) call(method, path string, data interface{}, headers map[string][]string) (*serverResponse, error) {
params, err := cli.encodeData(data)
if err != nil {
return nil, -1, err
sr := &serverResponse{
body: nil,
header: nil,
statusCode: -1,
}
return sr, nil
}
if data != nil {
@@ -166,8 +194,8 @@ func (cli *DockerCli) call(method, path string, data interface{}, headers map[st
headers["Content-Type"] = []string{"application/json"}
}
body, _, statusCode, err := cli.clientRequest(method, path, params, headers)
return body, statusCode, err
serverResp, err := cli.clientRequest(method, path, params, headers)
return serverResp, err
}
type streamOpts struct {
@@ -178,12 +206,12 @@ type streamOpts struct {
headers map[string][]string
}
func (cli *DockerCli) stream(method, path string, opts *streamOpts) error {
body, contentType, _, err := cli.clientRequest(method, path, opts.in, opts.headers)
func (cli *DockerCli) stream(method, path string, opts *streamOpts) (*serverResponse, error) {
serverResp, err := cli.clientRequest(method, path, opts.in, opts.headers)
if err != nil {
return err
return serverResp, err
}
return cli.streamBody(body, contentType, opts.rawTerminal, opts.out, opts.err)
return serverResp, cli.streamBody(serverResp.body, serverResp.header.Get("Content-Type"), opts.rawTerminal, opts.out, opts.err)
}
func (cli *DockerCli) streamBody(body io.ReadCloser, contentType string, rawTerminal bool, stdout, stderr io.Writer) error {
@@ -228,13 +256,15 @@ func (cli *DockerCli) resizeTty(id string, isExec bool) {
}
func waitForExit(cli *DockerCli, containerID string) (int, error) {
stream, _, err := cli.call("POST", "/containers/"+containerID+"/wait", nil, nil)
serverResp, err := cli.call("POST", "/containers/"+containerID+"/wait", nil, nil)
if err != nil {
return -1, err
}
defer serverResp.body.Close()
var res types.ContainerWaitResponse
if err := json.NewDecoder(stream).Decode(&res); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&res); err != nil {
return -1, err
}
@@ -244,7 +274,7 @@ func waitForExit(cli *DockerCli, containerID string) (int, error) {
// getExitCode perform an inspect on the container. It returns
// the running state and the exit code.
func getExitCode(cli *DockerCli, containerID string) (bool, int, error) {
stream, _, err := cli.call("GET", "/containers/"+containerID+"/json", nil, nil)
serverResp, err := cli.call("GET", "/containers/"+containerID+"/json", nil, nil)
if err != nil {
// If we can't connect, then the daemon probably died.
if err != errConnectionRefused {
@@ -253,8 +283,10 @@ func getExitCode(cli *DockerCli, containerID string) (bool, int, error) {
return false, -1, nil
}
defer serverResp.body.Close()
var c types.ContainerJSON
if err := json.NewDecoder(stream).Decode(&c); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {
return false, -1, err
}
@@ -264,7 +296,7 @@ func getExitCode(cli *DockerCli, containerID string) (bool, int, error) {
// getExecExitCode perform an inspect on the exec command. It returns
// the running state and the exit code.
func getExecExitCode(cli *DockerCli, execID string) (bool, int, error) {
stream, _, err := cli.call("GET", "/exec/"+execID+"/json", nil, nil)
serverResp, err := cli.call("GET", "/exec/"+execID+"/json", nil, nil)
if err != nil {
// If we can't connect, then the daemon probably died.
if err != errConnectionRefused {
@@ -273,6 +305,8 @@ func getExecExitCode(cli *DockerCli, execID string) (bool, int, error) {
return false, -1, nil
}
defer serverResp.body.Close()
//TODO: Should we reconsider having a type in api/types?
//this is a response to exex/id/json not container
var c struct {
@@ -280,7 +314,7 @@ func getExecExitCode(cli *DockerCli, execID string) (bool, int, error) {
ExitCode int
}
if err := json.NewDecoder(stream).Decode(&c); err != nil {
if err := json.NewDecoder(serverResp.body).Decode(&c); err != nil {
return false, -1, err
}
@@ -330,16 +364,16 @@ func (cli *DockerCli) getTtySize() (int, int) {
return int(ws.Height), int(ws.Width)
}
func readBody(stream io.ReadCloser, statusCode int, err error) ([]byte, int, error) {
if stream != nil {
defer stream.Close()
func readBody(serverResp *serverResponse, err error) ([]byte, int, error) {
if serverResp.body != nil {
defer serverResp.body.Close()
}
if err != nil {
return nil, statusCode, err
return nil, serverResp.statusCode, err
}
body, err := ioutil.ReadAll(stream)
body, err := ioutil.ReadAll(serverResp.body)
if err != nil {
return nil, -1, err
}
return body, statusCode, nil
return body, serverResp.statusCode, nil
}

View File

@@ -2,54 +2,95 @@ package client
import (
"encoding/json"
"fmt"
"runtime"
"text/template"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/autogen/dockerversion"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/utils"
)
var VersionTemplate = `Client:
Version: {{.Client.Version}}
API version: {{.Client.ApiVersion}}
Go version: {{.Client.GoVersion}}
Git commit: {{.Client.GitCommit}}
Built: {{.Client.BuildTime}}
OS/Arch: {{.Client.Os}}/{{.Client.Arch}}{{if .Client.Experimental}}
Experimental: {{.Client.Experimental}}{{end}}{{if .ServerOK}}
Server:
Version: {{.Server.Version}}
API version: {{.Server.ApiVersion}}
Go version: {{.Server.GoVersion}}
Git commit: {{.Server.GitCommit}}
Built: {{.Server.BuildTime}}
OS/Arch: {{.Server.Os}}/{{.Server.Arch}}{{if .Server.Experimental}}
Experimental: {{.Server.Experimental}}{{end}}{{end}}`
type VersionData struct {
Client types.Version
ServerOK bool
Server types.Version
}
// CmdVersion shows Docker version information.
//
// Available version information is shown for: client Docker version, client API version, client Go version, client Git commit, client OS/Arch, server Docker version, server API version, server Go version, server Git commit, and server OS/Arch.
//
// Usage: docker version
func (cli *DockerCli) CmdVersion(args ...string) error {
cmd := cli.Subcmd("version", "", "Show the Docker version information.", true)
func (cli *DockerCli) CmdVersion(args ...string) (err error) {
cmd := Cli.Subcmd("version", nil, "Show the Docker version information.", true)
tmplStr := cmd.String([]string{"f", "#format", "-format"}, "", "Format the output using the given go template")
cmd.Require(flag.Exact, 0)
cmd.ParseFlags(args, false)
if dockerversion.VERSION != "" {
fmt.Fprintf(cli.out, "Client version: %s\n", dockerversion.VERSION)
cmd.ParseFlags(args, true)
if *tmplStr == "" {
*tmplStr = VersionTemplate
}
fmt.Fprintf(cli.out, "Client API version: %s\n", api.APIVERSION)
fmt.Fprintf(cli.out, "Go version (client): %s\n", runtime.Version())
if dockerversion.GITCOMMIT != "" {
fmt.Fprintf(cli.out, "Git commit (client): %s\n", dockerversion.GITCOMMIT)
}
fmt.Fprintf(cli.out, "OS/Arch (client): %s/%s\n", runtime.GOOS, runtime.GOARCH)
stream, _, err := cli.call("GET", "/version", nil, nil)
var tmpl *template.Template
if tmpl, err = template.New("").Funcs(funcMap).Parse(*tmplStr); err != nil {
return Cli.StatusError{StatusCode: 64,
Status: "Template parsing error: " + err.Error()}
}
vd := VersionData{
Client: types.Version{
Version: dockerversion.VERSION,
ApiVersion: api.Version,
GoVersion: runtime.Version(),
GitCommit: dockerversion.GITCOMMIT,
BuildTime: dockerversion.BUILDTIME,
Os: runtime.GOOS,
Arch: runtime.GOARCH,
Experimental: utils.ExperimentalBuild(),
},
}
defer func() {
if err2 := tmpl.Execute(cli.out, vd); err2 != nil && err == nil {
err = err2
}
cli.out.Write([]byte{'\n'})
}()
serverResp, err := cli.call("GET", "/version", nil, nil)
if err != nil {
return err
}
var v types.Version
if err := json.NewDecoder(stream).Decode(&v); err != nil {
fmt.Fprintf(cli.err, "Error reading remote version: %s\n", err)
return err
defer serverResp.body.Close()
if err = json.NewDecoder(serverResp.body).Decode(&vd.Server); err != nil {
return Cli.StatusError{StatusCode: 1,
Status: "Error reading remote version: " + err.Error()}
}
fmt.Fprintf(cli.out, "Server version: %s\n", v.Version)
if v.ApiVersion != "" {
fmt.Fprintf(cli.out, "Server API version: %s\n", v.ApiVersion)
}
fmt.Fprintf(cli.out, "Go version (server): %s\n", v.GoVersion)
fmt.Fprintf(cli.out, "Git commit (server): %s\n", v.GitCommit)
fmt.Fprintf(cli.out, "OS/Arch (server): %s/%s\n", v.Os, v.Arch)
vd.ServerOK = true
return nil
return
}

View File

@@ -3,6 +3,7 @@ package client
import (
"fmt"
Cli "github.com/docker/docker/cli"
flag "github.com/docker/docker/pkg/mflag"
)
@@ -12,7 +13,7 @@ import (
//
// Usage: docker wait CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdWait(args ...string) error {
cmd := cli.Subcmd("wait", "CONTAINER [CONTAINER...]", "Block until a container stops, then print its exit code.", true)
cmd := Cli.Subcmd("wait", []string{"CONTAINER [CONTAINER...]"}, "Block until a container stops, then print its exit code.", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)

View File

@@ -16,8 +16,14 @@ import (
// Common constants for daemon and client.
const (
APIVERSION version.Version = "1.19" // Current REST API version
DefaultDockerfileName string = "Dockerfile" // Default filename with Docker commands, read by docker build
// Current REST API version
Version version.Version = "1.20"
// Minimun REST API version supported
MinVersion version.Version = "1.12"
// Default filename with Docker commands, read by docker build
DefaultDockerfileName string = "Dockerfile"
)
type ByPrivatePort []types.Port

View File

@@ -1,6 +1,7 @@
package server
import (
"fmt"
"net/http"
"strconv"
"strings"
@@ -11,6 +12,15 @@ func boolValue(r *http.Request, k string) bool {
return !(s == "" || s == "0" || s == "no" || s == "false" || s == "none")
}
// boolValueOrDefault returns the default bool passed if the query param is
// missing, otherwise it's just a proxy to boolValue above
func boolValueOrDefault(r *http.Request, k string, d bool) bool {
if _, ok := r.Form[k]; !ok {
return d
}
return boolValue(r, k)
}
func int64ValueOrZero(r *http.Request, k string) int64 {
val, err := strconv.ParseInt(r.FormValue(k), 10, 64)
if err != nil {
@@ -18,3 +28,29 @@ func int64ValueOrZero(r *http.Request, k string) int64 {
}
return val
}
type archiveOptions struct {
name string
path string
}
func archiveFormValues(r *http.Request, vars map[string]string) (archiveOptions, error) {
if vars == nil {
return archiveOptions{}, fmt.Errorf("Missing parameter")
}
if err := parseForm(r); err != nil {
return archiveOptions{}, err
}
name := vars["name"]
path := r.Form.Get("path")
switch {
case name == "":
return archiveOptions{}, fmt.Errorf("bad parameter: 'name' cannot be empty")
case path == "":
return archiveOptions{}, fmt.Errorf("bad parameter: 'path' cannot be empty")
}
return archiveOptions{name, path}, nil
}

View File

@@ -33,6 +33,21 @@ func TestBoolValue(t *testing.T) {
}
}
func TestBoolValueOrDefault(t *testing.T) {
r, _ := http.NewRequest("GET", "", nil)
if !boolValueOrDefault(r, "queryparam", true) {
t.Fatal("Expected to get true default value, got false")
}
v := url.Values{}
v.Set("param", "")
r, _ = http.NewRequest("GET", "", nil)
r.Form = v
if boolValueOrDefault(r, "param", true) {
t.Fatal("Expected not to get true")
}
}
func TestInt64ValueOrZero(t *testing.T) {
cases := map[string]int64{
"": 0,

View File

@@ -1,6 +1,7 @@
package server
import (
"crypto/tls"
"encoding/base64"
"encoding/json"
"fmt"
@@ -13,8 +14,8 @@ import (
"strings"
"time"
"code.google.com/p/go.net/websocket"
"github.com/gorilla/mux"
"golang.org/x/net/websocket"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api"
@@ -33,10 +34,10 @@ import (
"github.com/docker/docker/pkg/sockets"
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/ulimit"
"github.com/docker/docker/pkg/version"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
"github.com/docker/libnetwork/portallocator"
)
type ServerConfig struct {
@@ -45,11 +46,7 @@ type ServerConfig struct {
CorsHeaders string
Version string
SocketGroup string
Tls bool
TlsVerify bool
TlsCa string
TlsCert string
TlsKey string
TLSConfig *tls.Config
}
type Server struct {
@@ -97,15 +94,17 @@ func (s *Server) ServeApi(protoAddrs []string) error {
if err != nil {
return err
}
s.servers = append(s.servers, srv)
s.servers = append(s.servers, srv...)
go func(proto, addr string) {
logrus.Infof("Listening for HTTP on %s (%s)", proto, addr)
if err := srv.Serve(); err != nil && strings.Contains(err.Error(), "use of closed network connection") {
err = nil
}
chErrors <- err
}(protoAddrParts[0], protoAddrParts[1])
for _, s := range srv {
logrus.Infof("Listening for HTTP on %s (%s)", protoAddrParts[0], protoAddrParts[1])
go func(s serverCloser) {
if err := s.Serve(); err != nil && strings.Contains(err.Error(), "use of closed network connection") {
err = nil
}
chErrors <- err
}(s)
}
}
for i := 0; i < len(protoAddrs); i++ {
@@ -246,12 +245,18 @@ func (s *Server) postAuth(version version.Version, w http.ResponseWriter, r *htt
func (s *Server) getVersion(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
v := &types.Version{
Version: dockerversion.VERSION,
ApiVersion: api.APIVERSION,
ApiVersion: api.Version,
GitCommit: dockerversion.GITCOMMIT,
GoVersion: runtime.Version(),
Os: runtime.GOOS,
Arch: runtime.GOARCH,
BuildTime: dockerversion.BUILDTIME,
}
if version.GreaterThanOrEqualTo("1.19") {
v.Experimental = utils.ExperimentalBuild()
}
if kernelVersion, err := kernel.GetKernelVersion(); err == nil {
v.KernelVersion = kernelVersion.String()
}
@@ -271,14 +276,20 @@ func (s *Server) postContainersKill(version version.Version, w http.ResponseWrit
name := vars["name"]
// If we have a signal, look at it. Otherwise, do nothing
if sigStr := vars["signal"]; sigStr != "" {
if sigStr := r.Form.Get("signal"); sigStr != "" {
// Check if we passed the signal as a number:
// The largest legal signal is 31, so let's parse on 5 bits
sig, err := strconv.ParseUint(sigStr, 10, 5)
sigN, err := strconv.ParseUint(sigStr, 10, 5)
if err != nil {
// The signal is not a number, treat it as a string (either like
// "KILL" or like "SIGKILL")
sig = uint64(signal.SignalMap[strings.TrimPrefix(sigStr, "SIG")])
syscallSig, ok := signal.SignalMap[strings.TrimPrefix(sigStr, "SIG")]
if !ok {
return fmt.Errorf("Invalid signal: %s", sigStr)
}
sig = uint64(syscallSig)
} else {
sig = sigN
}
if sig == 0 {
@@ -287,7 +298,13 @@ func (s *Server) postContainersKill(version version.Version, w http.ResponseWrit
}
if err := s.daemon.ContainerKill(name, sig); err != nil {
return err
_, isStopped := err.(daemon.ErrContainerNotRunning)
// Return error that's not caused because the container is stopped.
// Return error if the container is not running and the api is >= 1.20
// to keep backwards compatibility.
if version.GreaterThanOrEqualTo("1.20") || !isStopped {
return fmt.Errorf("Cannot kill container %s: %v", name, err)
}
}
w.WriteHeader(http.StatusNoContent)
@@ -386,6 +403,7 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
}
until = u
}
timer := time.NewTimer(0)
timer.Stop()
if until > 0 {
@@ -399,6 +417,9 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
}
isFiltered := func(field string, filter []string) bool {
if len(field) == 0 {
return false
}
if len(filter) == 0 {
return false
}
@@ -419,7 +440,9 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
d := s.daemon
es := d.EventsService
w.Header().Set("Content-Type", "application/json")
enc := json.NewEncoder(ioutils.NewWriteFlusher(w))
outStream := ioutils.NewWriteFlusher(w)
outStream.Write(nil) // make sure response is sent immediately
enc := json.NewEncoder(outStream)
getContainerId := func(cn string) string {
c, err := d.Get(cn)
@@ -435,8 +458,8 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
ef["container"][i] = getContainerId(cn)
}
if isFiltered(ev.Status, ef["event"]) || isFiltered(ev.From, ef["image"]) ||
isFiltered(ev.ID, ef["container"]) {
if isFiltered(ev.Status, ef["event"]) || (isFiltered(ev.ID, ef["image"]) &&
isFiltered(ev.From, ef["image"])) || isFiltered(ev.ID, ef["container"]) {
return nil
}
@@ -444,6 +467,9 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
}
current, l := es.Subscribe()
if since == -1 {
current = nil
}
defer es.Evict(l)
for _, ev := range current {
if ev.Time < since {
@@ -453,6 +479,12 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
return err
}
}
var closeNotify <-chan bool
if closeNotifier, ok := w.(http.CloseNotifier); ok {
closeNotify = closeNotifier.CloseNotify()
}
for {
select {
case ev := <-l:
@@ -465,6 +497,9 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
}
case <-timer.C:
return nil
case <-closeNotify:
logrus.Debug("Client disconnected, stop sending events")
return nil
}
}
}
@@ -550,7 +585,27 @@ func (s *Server) getContainersStats(version version.Version, w http.ResponseWrit
return fmt.Errorf("Missing parameter")
}
return s.daemon.ContainerStats(vars["name"], boolValue(r, "stream"), ioutils.NewWriteFlusher(w))
stream := boolValueOrDefault(r, "stream", true)
var out io.Writer
if !stream {
w.Header().Set("Content-Type", "application/json")
out = w
} else {
out = ioutils.NewWriteFlusher(w)
}
var closeNotifier <-chan bool
if notifier, ok := w.(http.CloseNotifier); ok {
closeNotifier = notifier.CloseNotify()
}
config := &daemon.ContainerStatsConfig{
Stream: stream,
OutStream: out,
Stop: closeNotifier,
}
return s.daemon.ContainerStats(vars["name"], config)
}
func (s *Server) getContainersLogs(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
@@ -576,6 +631,22 @@ func (s *Server) getContainersLogs(version version.Version, w http.ResponseWrite
since = time.Unix(s, 0)
}
var closeNotifier <-chan bool
if notifier, ok := w.(http.CloseNotifier); ok {
closeNotifier = notifier.CloseNotify()
}
c, err := s.daemon.Get(vars["name"])
if err != nil {
return err
}
outStream := ioutils.NewWriteFlusher(w)
// write an empty chunk of data (this is to ensure that the
// HTTP Response is sent immediatly, even if the container has
// not yet produced any data)
outStream.Write(nil)
logsConfig := &daemon.ContainerLogsConfig{
Follow: boolValue(r, "follow"),
Timestamps: boolValue(r, "timestamps"),
@@ -583,10 +654,11 @@ func (s *Server) getContainersLogs(version version.Version, w http.ResponseWrite
Tail: r.Form.Get("tail"),
UseStdout: stdout,
UseStderr: stderr,
OutStream: ioutils.NewWriteFlusher(w),
OutStream: outStream,
Stop: closeNotifier,
}
if err := s.daemon.ContainerLogs(vars["name"], logsConfig); err != nil {
if err := s.daemon.ContainerLogs(c, logsConfig); err != nil {
fmt.Fprintf(w, "Error running logs job: %s\n", err)
}
@@ -622,7 +694,7 @@ func (s *Server) postCommit(version version.Version, w http.ResponseWriter, r *h
return err
}
cont := r.Form.Get("container")
cname := r.Form.Get("container")
pause := boolValue(r, "pause")
if r.FormValue("pause") == "" && version.GreaterThanOrEqualTo("1.13") {
@@ -634,11 +706,7 @@ func (s *Server) postCommit(version version.Version, w http.ResponseWriter, r *h
return err
}
if c == nil {
c = &runconfig.Config{}
}
containerCommitConfig := &daemon.ContainerCommitConfig{
commitCfg := &builder.CommitConfig{
Pause: pause,
Repo: r.Form.Get("repo"),
Tag: r.Form.Get("tag"),
@@ -648,7 +716,7 @@ func (s *Server) postCommit(version version.Version, w http.ResponseWriter, r *h
Config: c,
}
imgID, err := builder.Commit(s.daemon, cont, containerCommitConfig)
imgID, err := builder.Commit(cname, s.daemon, commitCfg)
if err != nil {
return err
}
@@ -768,7 +836,7 @@ func (s *Server) getImagesSearch(version version.Version, w http.ResponseWriter,
if err != nil {
return err
}
return json.NewEncoder(w).Encode(query.Results)
return writeJSON(w, http.StatusOK, query.Results)
}
func (s *Server) postImagesPush(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
@@ -873,6 +941,7 @@ func (s *Server) postContainersCreate(version version.Version, w http.ResponseWr
if err != nil {
return err
}
adjustCpuShares(version, hostConfig)
containerId, warnings, err := s.daemon.ContainerCreate(name, config, hostConfig)
if err != nil {
@@ -1070,6 +1139,11 @@ func (s *Server) postContainersAttach(version version.Version, w http.ResponseWr
return fmt.Errorf("Missing parameter")
}
cont, err := s.daemon.Get(vars["name"])
if err != nil {
return err
}
inStream, outStream, err := hijackServer(w)
if err != nil {
return err
@@ -1090,10 +1164,9 @@ func (s *Server) postContainersAttach(version version.Version, w http.ResponseWr
UseStderr: boolValue(r, "stderr"),
Logs: boolValue(r, "logs"),
Stream: boolValue(r, "stream"),
Multiplex: version.GreaterThanOrEqualTo("1.6"),
}
if err := s.daemon.ContainerAttachWithLogs(vars["name"], attachWithLogsConfig); err != nil {
if err := s.daemon.ContainerAttachWithLogs(cont, attachWithLogsConfig); err != nil {
fmt.Fprintf(outStream, "Error attaching: %s\n", err)
}
@@ -1108,6 +1181,11 @@ func (s *Server) wsContainersAttach(version version.Version, w http.ResponseWrit
return fmt.Errorf("Missing parameter")
}
cont, err := s.daemon.Get(vars["name"])
if err != nil {
return err
}
h := websocket.Handler(func(ws *websocket.Conn) {
defer ws.Close()
@@ -1119,7 +1197,7 @@ func (s *Server) wsContainersAttach(version version.Version, w http.ResponseWrit
Stream: boolValue(r, "stream"),
}
if err := s.daemon.ContainerWsAttachWithLogs(vars["name"], wsAttachWithLogsConfig); err != nil {
if err := s.daemon.ContainerWsAttachWithLogs(cont, wsAttachWithLogsConfig); err != nil {
logrus.Errorf("Error attaching websocket: %s", err)
}
})
@@ -1133,6 +1211,14 @@ func (s *Server) getContainersByName(version version.Version, w http.ResponseWri
return fmt.Errorf("Missing parameter")
}
if version.LessThan("1.20") {
containerJSONRaw, err := s.daemon.ContainerInspectPre120(vars["name"])
if err != nil {
return err
}
return writeJSON(w, http.StatusOK, containerJSONRaw)
}
containerJSON, err := s.daemon.ContainerInspect(vars["name"])
if err != nil {
return err
@@ -1168,18 +1254,17 @@ func (s *Server) getImagesByName(version version.Version, w http.ResponseWriter,
func (s *Server) postBuild(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
var (
authConfig = &cliconfig.AuthConfig{}
configFileEncoded = r.Header.Get("X-Registry-Config")
configFile = &cliconfig.ConfigFile{}
buildConfig = builder.NewBuildConfig()
authConfigs = map[string]cliconfig.AuthConfig{}
authConfigsEncoded = r.Header.Get("X-Registry-Config")
buildConfig = builder.NewBuildConfig()
)
if configFileEncoded != "" {
configFileJson := base64.NewDecoder(base64.URLEncoding, strings.NewReader(configFileEncoded))
if err := json.NewDecoder(configFileJson).Decode(configFile); err != nil {
if authConfigsEncoded != "" {
authConfigsJSON := base64.NewDecoder(base64.URLEncoding, strings.NewReader(authConfigsEncoded))
if err := json.NewDecoder(authConfigsJSON).Decode(&authConfigs); err != nil {
// for a pull it is not an error if no auth was given
// to increase compatibility with the existing api it is defaulting to be empty
configFile = &cliconfig.ConfigFile{}
// to increase compatibility with the existing api it is defaulting
// to be empty.
}
}
@@ -1206,17 +1291,25 @@ func (s *Server) postBuild(version version.Version, w http.ResponseWriter, r *ht
buildConfig.SuppressOutput = boolValue(r, "q")
buildConfig.NoCache = boolValue(r, "nocache")
buildConfig.ForceRemove = boolValue(r, "forcerm")
buildConfig.AuthConfig = authConfig
buildConfig.ConfigFile = configFile
buildConfig.AuthConfigs = authConfigs
buildConfig.MemorySwap = int64ValueOrZero(r, "memswap")
buildConfig.Memory = int64ValueOrZero(r, "memory")
buildConfig.CpuShares = int64ValueOrZero(r, "cpushares")
buildConfig.CpuPeriod = int64ValueOrZero(r, "cpuperiod")
buildConfig.CpuQuota = int64ValueOrZero(r, "cpuquota")
buildConfig.CpuSetCpus = r.FormValue("cpusetcpus")
buildConfig.CpuSetMems = r.FormValue("cpusetmems")
buildConfig.CPUShares = int64ValueOrZero(r, "cpushares")
buildConfig.CPUPeriod = int64ValueOrZero(r, "cpuperiod")
buildConfig.CPUQuota = int64ValueOrZero(r, "cpuquota")
buildConfig.CPUSetCpus = r.FormValue("cpusetcpus")
buildConfig.CPUSetMems = r.FormValue("cpusetmems")
buildConfig.CgroupParent = r.FormValue("cgroupparent")
var buildUlimits = []*ulimit.Ulimit{}
ulimitsJson := r.FormValue("ulimits")
if ulimitsJson != "" {
if err := json.NewDecoder(strings.NewReader(ulimitsJson)).Decode(&buildUlimits); err != nil {
return err
}
buildConfig.Ulimits = buildUlimits
}
// Job cancellation. Note: not all job types support this.
if closeNotifier, ok := w.(http.CloseNotifier); ok {
finished := make(chan struct{})
@@ -1243,6 +1336,7 @@ func (s *Server) postBuild(version version.Version, w http.ResponseWriter, r *ht
return nil
}
// postContainersCopy is deprecated in favor of getContainersArchivePath.
func (s *Server) postContainersCopy(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if vars == nil {
return fmt.Errorf("Missing parameter")
@@ -1282,10 +1376,74 @@ func (s *Server) postContainersCopy(version version.Version, w http.ResponseWrit
return nil
}
// // Encode the stat to JSON, base64 encode, and place in a header.
func setContainerPathStatHeader(stat *types.ContainerPathStat, header http.Header) error {
statJSON, err := json.Marshal(stat)
if err != nil {
return err
}
header.Set(
"X-Docker-Container-Path-Stat",
base64.StdEncoding.EncodeToString(statJSON),
)
return nil
}
func (s *Server) headContainersArchive(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
v, err := archiveFormValues(r, vars)
if err != nil {
return err
}
stat, err := s.daemon.ContainerStatPath(v.name, v.path)
if err != nil {
return err
}
return setContainerPathStatHeader(stat, w.Header())
}
func (s *Server) getContainersArchive(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
v, err := archiveFormValues(r, vars)
if err != nil {
return err
}
tarArchive, stat, err := s.daemon.ContainerArchivePath(v.name, v.path)
if err != nil {
return err
}
defer tarArchive.Close()
if err := setContainerPathStatHeader(stat, w.Header()); err != nil {
return err
}
w.Header().Set("Content-Type", "application/x-tar")
_, err = io.Copy(w, tarArchive)
return err
}
func (s *Server) putContainersArchive(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
v, err := archiveFormValues(r, vars)
if err != nil {
return err
}
noOverwriteDirNonDir := boolValue(r, "noOverwriteDirNonDir")
return s.daemon.ContainerExtractToDir(v.name, v.path, noOverwriteDirNonDir, r.Body)
}
func (s *Server) postContainerExecCreate(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
if err := checkForJson(r); err != nil {
return err
}
name := vars["name"]
execConfig := &runconfig.ExecConfig{}
@@ -1400,22 +1558,15 @@ func (s *Server) ping(version version.Version, w http.ResponseWriter, r *http.Re
}
func (s *Server) initTcpSocket(addr string) (l net.Listener, err error) {
if !s.cfg.TlsVerify {
if s.cfg.TLSConfig == nil || s.cfg.TLSConfig.ClientAuth != tls.RequireAndVerifyClientCert {
logrus.Warn("/!\\ DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING /!\\")
}
var c *sockets.TlsConfig
if s.cfg.Tls || s.cfg.TlsVerify {
c = sockets.NewTlsConfig(s.cfg.TlsCert, s.cfg.TlsKey, s.cfg.TlsCa, s.cfg.TlsVerify)
}
if l, err = sockets.NewTcpSocket(addr, c, s.start); err != nil {
if l, err = sockets.NewTcpSocket(addr, s.cfg.TLSConfig, s.start); err != nil {
return nil, err
}
if err := allocateDaemonPort(addr); err != nil {
return nil, err
}
return
}
@@ -1430,22 +1581,35 @@ func makeHttpHandler(logging bool, localMethod string, localRoute string, handle
if strings.Contains(r.Header.Get("User-Agent"), "Docker-Client/") {
userAgent := strings.Split(r.Header.Get("User-Agent"), "/")
// v1.20 onwards includes the GOOS of the client after the version
// such as Docker/1.7.0 (linux)
if len(userAgent) == 2 && strings.Contains(userAgent[1], " ") {
userAgent[1] = strings.Split(userAgent[1], " ")[0]
}
if len(userAgent) == 2 && !dockerVersion.Equal(version.Version(userAgent[1])) {
logrus.Debugf("Warning: client and server don't have the same version (client: %s, server: %s)", userAgent[1], dockerVersion)
}
}
version := version.Version(mux.Vars(r)["version"])
if version == "" {
version = api.APIVERSION
version = api.Version
}
if corsHeaders != "" {
writeCorsHeaders(w, r, corsHeaders)
}
if version.GreaterThan(api.APIVERSION) {
http.Error(w, fmt.Errorf("client and server don't have same version (client API version: %s, server API version: %s)", version, api.APIVERSION).Error(), http.StatusBadRequest)
if version.GreaterThan(api.Version) {
http.Error(w, fmt.Errorf("client is newer than server (client API version: %s, server API version: %s)", version, api.Version).Error(), http.StatusBadRequest)
return
}
if version.LessThan(api.MinVersion) {
http.Error(w, fmt.Errorf("client is too old, minimum supported API version is %s, please upgrade your client to a newer version", api.MinVersion).Error(), http.StatusBadRequest)
return
}
w.Header().Set("Server", "Docker/"+dockerversion.VERSION+" ("+runtime.GOOS+")")
if err := handlerFunc(version, w, r, mux.Vars(r)); err != nil {
logrus.Errorf("Handler for %s %s returned error: %s", localMethod, localRoute, err)
@@ -1461,6 +1625,9 @@ func createRouter(s *Server) *mux.Router {
ProfilerSetup(r, "/debug/")
}
m := map[string]map[string]HttpApiFunc{
"HEAD": {
"/containers/{name:.*}/archive": s.headContainersArchive,
},
"GET": {
"/_ping": s.ping,
"/events": s.getEvents,
@@ -1482,6 +1649,7 @@ func createRouter(s *Server) *mux.Router {
"/containers/{name:.*}/stats": s.getContainersStats,
"/containers/{name:.*}/attach/ws": s.wsContainersAttach,
"/exec/{id:.*}/json": s.getExecByID,
"/containers/{name:.*}/archive": s.getContainersArchive,
},
"POST": {
"/auth": s.postAuth,
@@ -1507,6 +1675,9 @@ func createRouter(s *Server) *mux.Router {
"/exec/{name:.*}/resize": s.postContainerExecResize,
"/containers/{name:.*}/rename": s.postContainerRename,
},
"PUT": {
"/containers/{name:.*}/archive": s.putContainersArchive,
},
"DELETE": {
"/containers/{name:.*}": s.deleteContainers,
"/images/{name:.*}": s.deleteImages,
@@ -1546,30 +1717,3 @@ func createRouter(s *Server) *mux.Router {
return r
}
func allocateDaemonPort(addr string) error {
host, port, err := net.SplitHostPort(addr)
if err != nil {
return err
}
intPort, err := strconv.Atoi(port)
if err != nil {
return err
}
var hostIPs []net.IP
if parsedIP := net.ParseIP(host); parsedIP != nil {
hostIPs = append(hostIPs, parsedIP)
} else if hostIPs, err = net.LookupIP(host); err != nil {
return fmt.Errorf("failed to lookup %s address in host specification", host)
}
pa := portallocator.Get()
for _, hostIP := range hostIPs {
if _, err := pa.RequestPort(hostIP, "tcp", intPort); err != nil {
return fmt.Errorf("failed to allocate daemon listening port %d (err: %v)", intPort, err)
}
}
return nil
}

View File

@@ -0,0 +1,17 @@
// +build experimental
package server
func (s *Server) registerSubRouter() {
httpHandler := s.daemon.NetworkApiRouter()
subrouter := s.router.PathPrefix("/v{version:[0-9.]+}/networks").Subrouter()
subrouter.Methods("GET", "POST", "PUT", "DELETE").HandlerFunc(httpHandler)
subrouter = s.router.PathPrefix("/networks").Subrouter()
subrouter.Methods("GET", "POST", "PUT", "DELETE").HandlerFunc(httpHandler)
subrouter = s.router.PathPrefix("/v{version:[0-9.]+}/services").Subrouter()
subrouter.Methods("GET", "POST", "PUT", "DELETE").HandlerFunc(httpHandler)
subrouter = s.router.PathPrefix("/services").Subrouter()
subrouter.Methods("GET", "POST", "PUT", "DELETE").HandlerFunc(httpHandler)
}

View File

@@ -6,68 +6,71 @@ import (
"fmt"
"net"
"net/http"
"strconv"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/daemon"
"github.com/docker/docker/pkg/sockets"
"github.com/docker/docker/pkg/systemd"
"github.com/docker/docker/pkg/version"
"github.com/docker/docker/runconfig"
"github.com/docker/libnetwork/portallocator"
)
// newServer sets up the required serverCloser and does protocol specific checking.
func (s *Server) newServer(proto, addr string) (serverCloser, error) {
const (
// See http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/tree/kernel/sched/sched.h?id=8cd9234c64c584432f6992fe944ca9e46ca8ea76#n269
linuxMinCpuShares = 2
linuxMaxCpuShares = 262144
)
// newServer sets up the required serverClosers and does protocol specific checking.
func (s *Server) newServer(proto, addr string) ([]serverCloser, error) {
var (
err error
l net.Listener
ls []net.Listener
)
switch proto {
case "fd":
ls, err := systemd.ListenFD(addr)
ls, err = systemd.ListenFD(addr)
if err != nil {
return nil, err
}
chErrors := make(chan error, len(ls))
// We don't want to start serving on these sockets until the
// daemon is initialized and installed. Otherwise required handlers
// won't be ready.
<-s.start
// Since ListenFD will return one or more sockets we have
// to create a go func to spawn off multiple serves
for i := range ls {
listener := ls[i]
go func() {
httpSrv := http.Server{Handler: s.router}
chErrors <- httpSrv.Serve(listener)
}()
}
for i := 0; i < len(ls); i++ {
if err := <-chErrors; err != nil {
return nil, err
}
}
return nil, nil
case "tcp":
l, err = s.initTcpSocket(addr)
l, err := s.initTcpSocket(addr)
if err != nil {
return nil, err
}
ls = append(ls, l)
case "unix":
if l, err = sockets.NewUnixSocket(addr, s.cfg.SocketGroup, s.start); err != nil {
l, err := sockets.NewUnixSocket(addr, s.cfg.SocketGroup, s.start)
if err != nil {
return nil, err
}
ls = append(ls, l)
default:
return nil, fmt.Errorf("Invalid protocol format: %q", proto)
}
return &HttpServer{
&http.Server{
Addr: addr,
Handler: s.router,
},
l,
}, nil
var res []serverCloser
for _, l := range ls {
res = append(res, &HttpServer{
&http.Server{
Addr: addr,
Handler: s.router,
},
l,
})
}
return res, nil
}
func (s *Server) AcceptConnections(d *daemon.Daemon) {
// Tell the init daemon we are accepting requests
s.daemon = d
s.registerSubRouter()
go systemd.SdNotify("READY=1")
// close the lock so the listeners start accepting connections
select {
@@ -76,3 +79,45 @@ func (s *Server) AcceptConnections(d *daemon.Daemon) {
close(s.start)
}
}
func allocateDaemonPort(addr string) error {
host, port, err := net.SplitHostPort(addr)
if err != nil {
return err
}
intPort, err := strconv.Atoi(port)
if err != nil {
return err
}
var hostIPs []net.IP
if parsedIP := net.ParseIP(host); parsedIP != nil {
hostIPs = append(hostIPs, parsedIP)
} else if hostIPs, err = net.LookupIP(host); err != nil {
return fmt.Errorf("failed to lookup %s address in host specification", host)
}
pa := portallocator.Get()
for _, hostIP := range hostIPs {
if _, err := pa.RequestPort(hostIP, "tcp", intPort); err != nil {
return fmt.Errorf("failed to allocate daemon listening port %d (err: %v)", intPort, err)
}
}
return nil
}
func adjustCpuShares(version version.Version, hostConfig *runconfig.HostConfig) {
if version.LessThan("1.19") {
if hostConfig != nil && hostConfig.CpuShares > 0 {
// Handle unsupported CpuShares
if hostConfig.CpuShares < linuxMinCpuShares {
logrus.Warnf("Changing requested CpuShares of %d to minimum allowed of %d", hostConfig.CpuShares, linuxMinCpuShares)
hostConfig.CpuShares = linuxMinCpuShares
} else if hostConfig.CpuShares > linuxMaxCpuShares {
logrus.Warnf("Changing requested CpuShares of %d to maximum allowed of %d", hostConfig.CpuShares, linuxMaxCpuShares)
hostConfig.CpuShares = linuxMaxCpuShares
}
}
}
}

View File

@@ -0,0 +1,68 @@
// +build linux
package server
import (
"testing"
"github.com/docker/docker/pkg/version"
"github.com/docker/docker/runconfig"
)
func TestAdjustCpuSharesOldApi(t *testing.T) {
apiVersion := version.Version("1.18")
hostConfig := &runconfig.HostConfig{
CpuShares: linuxMinCpuShares - 1,
}
adjustCpuShares(apiVersion, hostConfig)
if hostConfig.CpuShares != linuxMinCpuShares {
t.Errorf("Expected CpuShares to be %d", linuxMinCpuShares)
}
hostConfig.CpuShares = linuxMaxCpuShares + 1
adjustCpuShares(apiVersion, hostConfig)
if hostConfig.CpuShares != linuxMaxCpuShares {
t.Errorf("Expected CpuShares to be %d", linuxMaxCpuShares)
}
hostConfig.CpuShares = 0
adjustCpuShares(apiVersion, hostConfig)
if hostConfig.CpuShares != 0 {
t.Error("Expected CpuShares to be unchanged")
}
hostConfig.CpuShares = 1024
adjustCpuShares(apiVersion, hostConfig)
if hostConfig.CpuShares != 1024 {
t.Error("Expected CpuShares to be unchanged")
}
}
func TestAdjustCpuSharesNoAdjustment(t *testing.T) {
apiVersion := version.Version("1.19")
hostConfig := &runconfig.HostConfig{
CpuShares: linuxMinCpuShares - 1,
}
adjustCpuShares(apiVersion, hostConfig)
if hostConfig.CpuShares != linuxMinCpuShares-1 {
t.Errorf("Expected CpuShares to be %d", linuxMinCpuShares-1)
}
hostConfig.CpuShares = linuxMaxCpuShares + 1
adjustCpuShares(apiVersion, hostConfig)
if hostConfig.CpuShares != linuxMaxCpuShares+1 {
t.Errorf("Expected CpuShares to be %d", linuxMaxCpuShares+1)
}
hostConfig.CpuShares = 0
adjustCpuShares(apiVersion, hostConfig)
if hostConfig.CpuShares != 0 {
t.Error("Expected CpuShares to be unchanged")
}
hostConfig.CpuShares = 1024
adjustCpuShares(apiVersion, hostConfig)
if hostConfig.CpuShares != 1024 {
t.Error("Expected CpuShares to be unchanged")
}
}

View File

@@ -0,0 +1,6 @@
// +build !experimental
package server
func (s *Server) registerSubRouter() {
}

View File

@@ -8,34 +8,44 @@ import (
"net/http"
"github.com/docker/docker/daemon"
"github.com/docker/docker/pkg/version"
"github.com/docker/docker/runconfig"
)
// NewServer sets up the required Server and does protocol specific checking.
func (s *Server) newServer(proto, addr string) (Server, error) {
func (s *Server) newServer(proto, addr string) ([]serverCloser, error) {
var (
err error
l net.Listener
ls []net.Listener
)
switch proto {
case "tcp":
l, err = s.initTcpSocket(addr)
l, err := s.initTcpSocket(addr)
if err != nil {
return nil, err
}
ls = append(ls, l)
default:
return nil, errors.New("Invalid protocol format. Windows only supports tcp.")
}
return &HttpServer{
&http.Server{
Addr: addr,
Handler: s.router,
},
l,
}, nil
var res []serverCloser
for _, l := range ls {
res = append(res, &HttpServer{
&http.Server{
Addr: addr,
Handler: s.router,
},
l,
})
}
return res, nil
}
func (s *Server) AcceptConnections(d *daemon.Daemon) {
s.daemon = d
s.registerSubRouter()
// close the lock so the listeners start accepting connections
select {
case <-s.start:
@@ -43,3 +53,10 @@ func (s *Server) AcceptConnections(d *daemon.Daemon) {
close(s.start)
}
}
func allocateDaemonPort(addr string) error {
return nil
}
func adjustCpuShares(version version.Version, hostConfig *runconfig.HostConfig) {
}

View File

@@ -48,6 +48,7 @@ type MemoryStats struct {
Limit uint64 `json:"limit"`
}
// TODO Windows: This can be factored out
type BlkioStatEntry struct {
Major uint64 `json:"major"`
Minor uint64 `json:"minor"`
@@ -55,6 +56,7 @@ type BlkioStatEntry struct {
Value uint64 `json:"value"`
}
// TODO Windows: This can be factored out
type BlkioStats struct {
// number of bytes tranferred to and from the block device
IoServiceBytesRecursive []BlkioStatEntry `json:"io_service_bytes_recursive"`
@@ -67,6 +69,7 @@ type BlkioStats struct {
SectorsRecursive []BlkioStatEntry `json:"sectors_recursive"`
}
// TODO Windows: This will require refactoring
type Network struct {
RxBytes uint64 `json:"rx_bytes"`
RxPackets uint64 `json:"rx_packets"`
@@ -81,6 +84,7 @@ type Network struct {
type Stats struct {
Read time.Time `json:"read"`
Network Network `json:"network,omitempty"`
PreCpuStats CpuStats `json:"precpu_stats,omitempty"`
CpuStats CpuStats `json:"cpu_stats,omitempty"`
MemoryStats MemoryStats `json:"memory_stats,omitempty"`
BlkioStats BlkioStats `json:"blkio_stats,omitempty"`

View File

@@ -1,6 +1,7 @@
package types
import (
"os"
"time"
"github.com/docker/docker/daemon/network"
@@ -75,12 +76,17 @@ type Image struct {
Labels map[string]string
}
type GraphDriverData struct {
Name string
Data map[string]string
}
// GET "/images/{name:.*}/json"
type ImageInspect struct {
Id string
Parent string
Comment string
Created time.Time
Created string
Container string
ContainerConfig *runconfig.Config
DockerVersion string
@@ -90,27 +96,31 @@ type ImageInspect struct {
Os string
Size int64
VirtualSize int64
GraphDriver GraphDriverData
}
// GET "/containers/json"
type Port struct {
IP string
IP string `json:",omitempty"`
PrivatePort int
PublicPort int
PublicPort int `json:",omitempty"`
Type string
}
type Container struct {
ID string `json:"Id"`
Names []string `json:",omitempty"`
Image string `json:",omitempty"`
Command string `json:",omitempty"`
Created int `json:",omitempty"`
Ports []Port `json:",omitempty"`
SizeRw int `json:",omitempty"`
SizeRootFs int `json:",omitempty"`
Labels map[string]string `json:",omitempty"`
Status string `json:",omitempty"`
ID string `json:"Id"`
Names []string
Image string
Command string
Created int
Ports []Port
SizeRw int `json:",omitempty"`
SizeRootFs int `json:",omitempty"`
Labels map[string]string
Status string
HostConfig struct {
NetworkMode string `json:",omitempty"`
}
}
// POST "/containers/"+containerID+"/copy"
@@ -118,6 +128,17 @@ type CopyConfig struct {
Resource string
}
// ContainerPathStat is used to encode the header from
// GET /containers/{name:.*}/archive
// "name" is basename of the resource.
type ContainerPathStat struct {
Name string `json:"name"`
Size int64 `json:"size"`
Mode os.FileMode `json:"mode"`
Mtime time.Time `json:"mtime"`
LinkTarget string `json:"linkTarget"`
}
// GET "/containers/{name:.*}/top"
type ContainerProcessList struct {
Processes [][]string
@@ -132,6 +153,8 @@ type Version struct {
Os string
Arch string
KernelVersion string `json:",omitempty"`
Experimental bool `json:",omitempty"`
BuildTime string `json:",omitempty"`
}
// GET "/info"
@@ -146,6 +169,8 @@ type Info struct {
CpuCfsPeriod bool
CpuCfsQuota bool
IPv4Forwarding bool
BridgeNfIptables bool
BridgeNfIp6tables bool
Debug bool
NFd int
OomKillDisable bool
@@ -189,17 +214,16 @@ type ContainerState struct {
Pid int
ExitCode int
Error string
StartedAt time.Time
FinishedAt time.Time
StartedAt string
FinishedAt string
}
// GET "/containers/{name:.*}/json"
type ContainerJSON struct {
type ContainerJSONBase struct {
Id string
Created time.Time
Created string
Path string
Args []string
Config *runconfig.Config
State *ContainerState
Image string
NetworkSettings *network.Settings
@@ -213,9 +237,42 @@ type ContainerJSON struct {
ExecDriver string
MountLabel string
ProcessLabel string
Volumes map[string]string
VolumesRW map[string]bool
AppArmorProfile string
ExecIDs []string
HostConfig *runconfig.HostConfig
GraphDriver GraphDriverData
}
type ContainerJSON struct {
*ContainerJSONBase
Mounts []MountPoint
Config *runconfig.Config
}
// backcompatibility struct along with ContainerConfig
type ContainerJSONPre120 struct {
*ContainerJSONBase
Volumes map[string]string
VolumesRW map[string]bool
Config *ContainerConfig
}
type ContainerConfig struct {
*runconfig.Config
// backward compatibility, they now live in HostConfig
Memory int64
MemorySwap int64
CpuShares int64
Cpuset string
}
// MountPoint represents a mount point configuration inside the container.
type MountPoint struct {
Name string `json:",omitempty"`
Source string
Destination string
Driver string `json:",omitempty"`
Mode string // this is internally named `Relabel`
RW bool
}

View File

@@ -5,6 +5,7 @@ import (
"strings"
)
// FlagType is the type of the build flag
type FlagType int
const (
@@ -12,28 +13,32 @@ const (
stringType
)
type BuilderFlags struct {
// BFlags contains all flags information for the builder
type BFlags struct {
Args []string // actual flags/args from cmd line
flags map[string]*Flag
used map[string]*Flag
Err error
}
// Flag contains all information for a flag
type Flag struct {
bf *BuilderFlags
bf *BFlags
name string
flagType FlagType
Value string
}
func NewBuilderFlags() *BuilderFlags {
return &BuilderFlags{
// NewBFlags return the new BFlags struct
func NewBFlags() *BFlags {
return &BFlags{
flags: make(map[string]*Flag),
used: make(map[string]*Flag),
}
}
func (bf *BuilderFlags) AddBool(name string, def bool) *Flag {
// AddBool adds a bool flag to BFlags
func (bf *BFlags) AddBool(name string, def bool) *Flag {
flag := bf.addFlag(name, boolType)
if flag == nil {
return nil
@@ -46,7 +51,8 @@ func (bf *BuilderFlags) AddBool(name string, def bool) *Flag {
return flag
}
func (bf *BuilderFlags) AddString(name string, def string) *Flag {
// AddString adds a string flag to BFlags
func (bf *BFlags) AddString(name string, def string) *Flag {
flag := bf.addFlag(name, stringType)
if flag == nil {
return nil
@@ -55,7 +61,7 @@ func (bf *BuilderFlags) AddString(name string, def string) *Flag {
return flag
}
func (bf *BuilderFlags) addFlag(name string, flagType FlagType) *Flag {
func (bf *BFlags) addFlag(name string, flagType FlagType) *Flag {
if _, ok := bf.flags[name]; ok {
bf.Err = fmt.Errorf("Duplicate flag defined: %s", name)
return nil
@@ -71,6 +77,7 @@ func (bf *BuilderFlags) addFlag(name string, flagType FlagType) *Flag {
return newFlag
}
// IsUsed checks if the flag is used
func (fl *Flag) IsUsed() bool {
if _, ok := fl.bf.used[fl.name]; ok {
return true
@@ -78,6 +85,7 @@ func (fl *Flag) IsUsed() bool {
return false
}
// IsTrue checks if a bool flag is true
func (fl *Flag) IsTrue() bool {
if fl.flagType != boolType {
// Should never get here
@@ -86,7 +94,8 @@ func (fl *Flag) IsTrue() bool {
return fl.Value == "true"
}
func (bf *BuilderFlags) Parse() error {
// Parse parses and checks if the BFlags is valid
func (bf *BFlags) Parse() error {
// If there was an error while defining the possible flags
// go ahead and bubble it back up here since we didn't do it
// earlier in the processing

View File

@@ -10,7 +10,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf := NewBuilderFlags()
bf := NewBFlags()
bf.Args = []string{}
if err := bf.Parse(); err != nil {
t.Fatalf("Test1 of %q was supposed to work: %s", bf.Args, err)
@@ -18,7 +18,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
bf.Args = []string{"--"}
if err := bf.Parse(); err != nil {
t.Fatalf("Test2 of %q was supposed to work: %s", bf.Args, err)
@@ -26,7 +26,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flStr1 := bf.AddString("str1", "")
flBool1 := bf.AddBool("bool1", false)
bf.Args = []string{}
@@ -43,7 +43,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flStr1 = bf.AddString("str1", "HI")
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{}
@@ -67,7 +67,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flStr1 = bf.AddString("str1", "HI")
bf.Args = []string{"--str1"}
@@ -77,7 +77,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flStr1 = bf.AddString("str1", "HI")
bf.Args = []string{"--str1="}
@@ -92,7 +92,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flStr1 = bf.AddString("str1", "HI")
bf.Args = []string{"--str1=BYE"}
@@ -107,7 +107,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1"}
@@ -121,7 +121,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1=true"}
@@ -135,7 +135,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1=false"}
@@ -149,7 +149,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1=false1"}
@@ -159,7 +159,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool2"}
@@ -169,7 +169,7 @@ func TestBuilderFlags(t *testing.T) {
// ---
bf = NewBuilderFlags()
bf = NewBFlags()
flStr1 = bf.AddString("str1", "HI")
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1", "--str1=BYE"}

View File

@@ -1,6 +1,7 @@
// This package contains the set of Dockerfile commands.
// Package command contains the set of Dockerfile commands.
package command
// Define constants for the command strings
const (
Env = "env"
Label = "label"

View File

@@ -10,6 +10,7 @@ package builder
import (
"fmt"
"io/ioutil"
"path"
"path/filepath"
"regexp"
"runtime"
@@ -17,8 +18,8 @@ import (
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/nat"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/nat"
"github.com/docker/docker/runconfig"
)
@@ -29,7 +30,7 @@ const (
)
// dispatch with no layer / parsing. This is effectively not a command.
func nullDispatch(b *Builder, args []string, attributes map[string]bool, original string) error {
func nullDispatch(b *builder, args []string, attributes map[string]bool, original string) error {
return nil
}
@@ -38,10 +39,7 @@ func nullDispatch(b *Builder, args []string, attributes map[string]bool, origina
// Sets the environment variable foo to bar, also makes interpolation
// in the dockerfile available from the next statement on via ${foo}.
//
func env(b *Builder, args []string, attributes map[string]bool, original string) error {
if runtime.GOOS == "windows" {
return fmt.Errorf("ENV is not supported on Windows.")
}
func env(b *builder, args []string, attributes map[string]bool, original string) error {
if len(args) == 0 {
return fmt.Errorf("ENV requires at least one argument")
}
@@ -100,7 +98,7 @@ func env(b *Builder, args []string, attributes map[string]bool, original string)
// MAINTAINER some text <maybe@an.email.address>
//
// Sets the maintainer metadata.
func maintainer(b *Builder, args []string, attributes map[string]bool, original string) error {
func maintainer(b *builder, args []string, attributes map[string]bool, original string) error {
if len(args) != 1 {
return fmt.Errorf("MAINTAINER requires exactly one argument")
}
@@ -117,7 +115,7 @@ func maintainer(b *Builder, args []string, attributes map[string]bool, original
//
// Sets the Label variable foo to bar,
//
func label(b *Builder, args []string, attributes map[string]bool, original string) error {
func label(b *builder, args []string, attributes map[string]bool, original string) error {
if len(args) == 0 {
return fmt.Errorf("LABEL requires at least one argument")
}
@@ -153,7 +151,7 @@ func label(b *Builder, args []string, attributes map[string]bool, original strin
// Add the file 'foo' to '/path'. Tarball and Remote URL (git, http) handling
// exist here. If you do not wish to have this automatic handling, use COPY.
//
func add(b *Builder, args []string, attributes map[string]bool, original string) error {
func add(b *builder, args []string, attributes map[string]bool, original string) error {
if len(args) < 2 {
return fmt.Errorf("ADD requires at least two arguments")
}
@@ -169,7 +167,7 @@ func add(b *Builder, args []string, attributes map[string]bool, original string)
//
// Same as 'ADD' but without the tar and remote url handling.
//
func dispatchCopy(b *Builder, args []string, attributes map[string]bool, original string) error {
func dispatchCopy(b *builder, args []string, attributes map[string]bool, original string) error {
if len(args) < 2 {
return fmt.Errorf("COPY requires at least two arguments")
}
@@ -185,7 +183,7 @@ func dispatchCopy(b *Builder, args []string, attributes map[string]bool, origina
//
// This sets the image the dockerfile will build on top of.
//
func from(b *Builder, args []string, attributes map[string]bool, original string) error {
func from(b *builder, args []string, attributes map[string]bool, original string) error {
if len(args) != 1 {
return fmt.Errorf("FROM requires one argument")
}
@@ -233,7 +231,7 @@ func from(b *Builder, args []string, attributes map[string]bool, original string
// special cases. search for 'OnBuild' in internals.go for additional special
// cases.
//
func onbuild(b *Builder, args []string, attributes map[string]bool, original string) error {
func onbuild(b *builder, args []string, attributes map[string]bool, original string) error {
if len(args) == 0 {
return fmt.Errorf("ONBUILD requires at least one argument")
}
@@ -260,7 +258,7 @@ func onbuild(b *Builder, args []string, attributes map[string]bool, original str
//
// Set the working directory for future RUN/CMD/etc statements.
//
func workdir(b *Builder, args []string, attributes map[string]bool, original string) error {
func workdir(b *builder, args []string, attributes map[string]bool, original string) error {
if len(args) != 1 {
return fmt.Errorf("WORKDIR requires exactly one argument")
}
@@ -269,12 +267,39 @@ func workdir(b *Builder, args []string, attributes map[string]bool, original str
return err
}
// Note that workdir passed comes from the Dockerfile. Hence it is in
// Linux format using forward-slashes, even on Windows. However,
// b.Config.WorkingDir is in platform-specific notation (in other words
// on Windows will use `\`
workdir := args[0]
if !filepath.IsAbs(workdir) {
workdir = filepath.Join("/", b.Config.WorkingDir, workdir)
isAbs := false
if runtime.GOOS == "windows" {
// Alternate processing for Windows here is necessary as we can't call
// filepath.IsAbs(workDir) as that would verify Windows style paths,
// along with drive-letters (eg c:\pathto\file.txt). We (arguably
// correctly or not) check for both forward and back slashes as this
// is what the 1.4.2 GoLang implementation of IsAbs() does in the
// isSlash() function.
isAbs = workdir[0] == '\\' || workdir[0] == '/'
} else {
isAbs = filepath.IsAbs(workdir)
}
if !isAbs {
current := b.Config.WorkingDir
if runtime.GOOS == "windows" {
// Convert to Linux format before join
current = strings.Replace(current, "\\", "/", -1)
}
// Must use path.Join so works correctly on Windows, not filepath
workdir = path.Join("/", current, workdir)
}
// Convert to platform specific format
if runtime.GOOS == "windows" {
workdir = strings.Replace(workdir, "/", "\\", -1)
}
b.Config.WorkingDir = workdir
return b.commit("", b.Config.Cmd, fmt.Sprintf("WORKDIR %v", workdir))
@@ -290,7 +315,7 @@ func workdir(b *Builder, args []string, attributes map[string]bool, original str
// RUN echo hi # cmd /S /C echo hi (Windows)
// RUN [ "echo", "hi" ] # echo hi
//
func run(b *Builder, args []string, attributes map[string]bool, original string) error {
func run(b *builder, args []string, attributes map[string]bool, original string) error {
if b.image == "" && !b.noBaseImage {
return fmt.Errorf("Please provide a source image with `from` prior to run")
}
@@ -299,7 +324,7 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
return err
}
args = handleJsonArgs(args, attributes)
args = handleJSONArgs(args, attributes)
if !attributes["json"] {
if runtime.GOOS != "windows" {
@@ -361,12 +386,12 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
// Set the default command to run in the container (which may be empty).
// Argument handling is the same as RUN.
//
func cmd(b *Builder, args []string, attributes map[string]bool, original string) error {
func cmd(b *builder, args []string, attributes map[string]bool, original string) error {
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
cmdSlice := handleJsonArgs(args, attributes)
cmdSlice := handleJSONArgs(args, attributes)
if !attributes["json"] {
if runtime.GOOS != "windows" {
@@ -397,12 +422,12 @@ func cmd(b *Builder, args []string, attributes map[string]bool, original string)
// Handles command processing similar to CMD and RUN, only b.Config.Entrypoint
// is initialized at NewBuilder time instead of through argument parsing.
//
func entrypoint(b *Builder, args []string, attributes map[string]bool, original string) error {
func entrypoint(b *builder, args []string, attributes map[string]bool, original string) error {
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
parsed := handleJsonArgs(args, attributes)
parsed := handleJSONArgs(args, attributes)
switch {
case attributes["json"]:
@@ -438,7 +463,7 @@ func entrypoint(b *Builder, args []string, attributes map[string]bool, original
// Expose ports for links and port mappings. This all ends up in
// b.Config.ExposedPorts for runconfig.
//
func expose(b *Builder, args []string, attributes map[string]bool, original string) error {
func expose(b *builder, args []string, attributes map[string]bool, original string) error {
portsTab := args
if len(args) == 0 {
@@ -453,19 +478,11 @@ func expose(b *Builder, args []string, attributes map[string]bool, original stri
b.Config.ExposedPorts = make(nat.PortSet)
}
ports, bindingMap, err := nat.ParsePortSpecs(append(portsTab, b.Config.PortSpecs...))
ports, _, err := nat.ParsePortSpecs(portsTab)
if err != nil {
return err
}
for _, bindings := range bindingMap {
if bindings[0].HostIp != "" || bindings[0].HostPort != "" {
fmt.Fprintf(b.ErrStream, " ---> Using Dockerfile's EXPOSE instruction"+
" to map host ports to container ports (ip:hostPort:containerPort) is deprecated.\n"+
" Please use -p to publish the ports.\n")
}
}
// instead of using ports directly, we build a list of ports and sort it so
// the order is consistent. This prevents cache burst where map ordering
// changes between builds
@@ -479,7 +496,6 @@ func expose(b *Builder, args []string, attributes map[string]bool, original stri
i++
}
sort.Strings(portList)
b.Config.PortSpecs = nil
return b.commit("", b.Config.Cmd, fmt.Sprintf("EXPOSE %s", strings.Join(portList, " ")))
}
@@ -488,9 +504,9 @@ func expose(b *Builder, args []string, attributes map[string]bool, original stri
// Set the user to 'foo' for future commands and when running the
// ENTRYPOINT/CMD at container run time.
//
func user(b *Builder, args []string, attributes map[string]bool, original string) error {
func user(b *builder, args []string, attributes map[string]bool, original string) error {
if runtime.GOOS == "windows" {
return fmt.Errorf("USER is not supported on Windows.")
return fmt.Errorf("USER is not supported on Windows")
}
if len(args) != 1 {
@@ -509,9 +525,9 @@ func user(b *Builder, args []string, attributes map[string]bool, original string
//
// Expose the volume /foo for use. Will also accept the JSON array form.
//
func volume(b *Builder, args []string, attributes map[string]bool, original string) error {
func volume(b *builder, args []string, attributes map[string]bool, original string) error {
if runtime.GOOS == "windows" {
return fmt.Errorf("VOLUME is not supported on Windows.")
return fmt.Errorf("VOLUME is not supported on Windows")
}
if len(args) == 0 {
return fmt.Errorf("VOLUME requires at least one argument")

View File

@@ -37,6 +37,7 @@ import (
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/pkg/tarsum"
"github.com/docker/docker/pkg/ulimit"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
)
@@ -53,10 +54,10 @@ var replaceEnvAllowed = map[string]struct{}{
command.User: {},
}
var evaluateTable map[string]func(*Builder, []string, map[string]bool, string) error
var evaluateTable map[string]func(*builder, []string, map[string]bool, string) error
func init() {
evaluateTable = map[string]func(*Builder, []string, map[string]bool, string) error{
evaluateTable = map[string]func(*builder, []string, map[string]bool, string) error{
command.Env: env,
command.Label: label,
command.Maintainer: maintainer,
@@ -74,9 +75,9 @@ func init() {
}
}
// internal struct, used to maintain configuration of the Dockerfile's
// builder is an internal struct, used to maintain configuration of the Dockerfile's
// processing as it evaluates the parsing result.
type Builder struct {
type builder struct {
Daemon *daemon.Daemon
// effectively stdio for the run. Because it is not stdio, I said
@@ -98,8 +99,8 @@ type Builder struct {
// the final configs of the Dockerfile but dont want the layers
disableCommit bool
AuthConfig *cliconfig.AuthConfig
ConfigFile *cliconfig.ConfigFile
// Registry server auth configs used to pull images when handling `FROM`.
AuthConfigs map[string]cliconfig.AuthConfig
// Deprecated, original writer used for ImagePull. To be removed.
OutOld io.Writer
@@ -115,7 +116,7 @@ type Builder struct {
image string // image name for commit processing
maintainer string // maintainer name. could probably be removed.
cmdSet bool // indicates is CMD was set in current Dockerfile
BuilderFlags *BuilderFlags // current cmd's BuilderFlags - temporary
BuilderFlags *BFlags // current cmd's BuilderFlags - temporary
context tarsum.TarSum // the context is a tarball that is uploaded by the client
contextPath string // the path of the temporary directory the local context is unpacked to (server side)
noBaseImage bool // indicates that this build does not start from any base image, but is being built from an empty file system.
@@ -129,8 +130,12 @@ type Builder struct {
cgroupParent string
memory int64
memorySwap int64
ulimits []*ulimit.Ulimit
cancelled <-chan struct{} // When closed, job was cancelled.
activeImages []string
id string // Used to hold reference images
}
// Run the builder with the context. This is the lynchpin of this package. This
@@ -145,7 +150,7 @@ type Builder struct {
// processing.
// * Print a happy message and return the image ID.
//
func (b *Builder) Run(context io.Reader) (string, error) {
func (b *builder) Run(context io.Reader) (string, error) {
if err := b.readContext(context); err != nil {
return "", err
}
@@ -196,7 +201,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
// Reads a Dockerfile from the current context. It assumes that the
// 'filename' is a relative path from the root of the context
func (b *Builder) readDockerfile() error {
func (b *builder) readDockerfile() error {
// If no -f was specified then look for 'Dockerfile'. If we can't find
// that then look for 'dockerfile'. If neither are found then default
// back to 'Dockerfile' and use that in the error message.
@@ -274,7 +279,7 @@ func (b *Builder) readDockerfile() error {
// such as `RUN` in ONBUILD RUN foo. There is special case logic in here to
// deal with that, at least until it becomes more of a general concern with new
// features.
func (b *Builder) dispatch(stepN int, ast *parser.Node) error {
func (b *builder) dispatch(stepN int, ast *parser.Node) error {
cmd := ast.Value
attrs := ast.Attributes
original := ast.Original
@@ -337,7 +342,7 @@ func (b *Builder) dispatch(stepN int, ast *parser.Node) error {
// XXX yes, we skip any cmds that are not valid; the parser should have
// picked these out already.
if f, ok := evaluateTable[cmd]; ok {
b.BuilderFlags = NewBuilderFlags()
b.BuilderFlags = NewBFlags()
b.BuilderFlags.Args = flags
return f(b, strList, attrs, original)
}

View File

@@ -12,8 +12,8 @@ import (
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"runtime"
"sort"
"strings"
"syscall"
@@ -21,9 +21,10 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/docker/builder/parser"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/daemon"
"github.com/docker/docker/graph"
imagepkg "github.com/docker/docker/image"
"github.com/docker/docker/image"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/chrootarchive"
"github.com/docker/docker/pkg/httputils"
@@ -39,30 +40,40 @@ import (
"github.com/docker/docker/runconfig"
)
func (b *Builder) readContext(context io.Reader) error {
func (b *builder) readContext(context io.Reader) (err error) {
tmpdirPath, err := ioutil.TempDir("", "docker-build")
if err != nil {
return err
return
}
// Make sure we clean-up upon error. In the happy case the caller
// is expected to manage the clean-up
defer func() {
if err != nil {
if e := os.RemoveAll(tmpdirPath); e != nil {
logrus.Debugf("[BUILDER] failed to remove temporary context: %s", e)
}
}
}()
decompressedStream, err := archive.DecompressStream(context)
if err != nil {
return err
return
}
if b.context, err = tarsum.NewTarSum(decompressedStream, true, tarsum.Version0); err != nil {
return err
if b.context, err = tarsum.NewTarSum(decompressedStream, true, tarsum.Version1); err != nil {
return
}
if err := chrootarchive.Untar(b.context, tmpdirPath, nil); err != nil {
return err
if err = chrootarchive.Untar(b.context, tmpdirPath, nil); err != nil {
return
}
b.contextPath = tmpdirPath
return nil
return
}
func (b *Builder) commit(id string, autoCmd *runconfig.Command, comment string) error {
func (b *builder) commit(id string, autoCmd *runconfig.Command, comment string) error {
if b.disableCommit {
return nil
}
@@ -72,7 +83,11 @@ func (b *Builder) commit(id string, autoCmd *runconfig.Command, comment string)
b.Config.Image = b.image
if id == "" {
cmd := b.Config.Cmd
b.Config.Cmd = runconfig.NewCommand("/bin/sh", "-c", "#(nop) "+comment)
if runtime.GOOS != "windows" {
b.Config.Cmd = runconfig.NewCommand("/bin/sh", "-c", "#(nop) "+comment)
} else {
b.Config.Cmd = runconfig.NewCommand("cmd", "/S /C", "REM (nop) "+comment)
}
defer func(cmd *runconfig.Command) { b.Config.Cmd = cmd }(cmd)
hit, err := b.probeCache()
@@ -103,11 +118,19 @@ func (b *Builder) commit(id string, autoCmd *runconfig.Command, comment string)
autoConfig := *b.Config
autoConfig.Cmd = autoCmd
commitCfg := &daemon.ContainerCommitConfig{
Author: b.maintainer,
Pause: true,
Config: &autoConfig,
}
// Commit the container
image, err := b.Daemon.Commit(container, "", "", "", b.maintainer, true, &autoConfig)
image, err := b.Daemon.Commit(container, commitCfg)
if err != nil {
return err
}
b.Daemon.Graph().Retain(b.id, image.ID)
b.activeImages = append(b.activeImages, image.ID)
b.image = image.ID
return nil
}
@@ -120,7 +143,7 @@ type copyInfo struct {
tmpDir string
}
func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecompression bool, cmdName string) error {
func (b *builder) runContextCommand(args []string, allowRemote bool, allowDecompression bool, cmdName string) error {
if b.context == nil {
return fmt.Errorf("No context given. Impossible to use %s", cmdName)
}
@@ -129,7 +152,8 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecomp
return fmt.Errorf("Invalid %s format - at least two arguments required", cmdName)
}
dest := args[len(args)-1] // last one is always the dest
// Work in daemon-specific filepath semantics
dest := filepath.FromSlash(args[len(args)-1]) // last one is always the dest
copyInfos := []*copyInfo{}
@@ -164,8 +188,7 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecomp
if len(copyInfos) == 0 {
return fmt.Errorf("No source files were specified")
}
if len(copyInfos) > 1 && !strings.HasSuffix(dest, "/") {
if len(copyInfos) > 1 && !strings.HasSuffix(dest, string(os.PathSeparator)) {
return fmt.Errorf("When using %s with more than one source file, the destination must be a directory and end with a /", cmdName)
}
@@ -191,7 +214,11 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecomp
}
cmd := b.Config.Cmd
b.Config.Cmd = runconfig.NewCommand("/bin/sh", "-c", fmt.Sprintf("#(nop) %s %s in %s", cmdName, srcHash, dest))
if runtime.GOOS != "windows" {
b.Config.Cmd = runconfig.NewCommand("/bin/sh", "-c", fmt.Sprintf("#(nop) %s %s in %s", cmdName, srcHash, dest))
} else {
b.Config.Cmd = runconfig.NewCommand("cmd", "/S /C", fmt.Sprintf("REM (nop) %s %s in %s", cmdName, srcHash, dest))
}
defer func(cmd *runconfig.Command) { b.Config.Cmd = cmd }(cmd)
hit, err := b.probeCache()
@@ -214,39 +241,59 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecomp
}
defer container.Unmount()
if err := container.PrepareStorage(); err != nil {
return err
}
for _, ci := range copyInfos {
if err := b.addContext(container, ci.origPath, ci.destPath, ci.decompress); err != nil {
return err
}
}
if err := container.CleanupStorage(); err != nil {
return err
}
if err := b.commit(container.ID, cmd, fmt.Sprintf("%s %s in %s", cmdName, origPaths, dest)); err != nil {
return err
}
return nil
}
func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath string, destPath string, allowRemote bool, allowDecompression bool, allowWildcards bool) error {
func calcCopyInfo(b *builder, cmdName string, cInfos *[]*copyInfo, origPath string, destPath string, allowRemote bool, allowDecompression bool, allowWildcards bool) error {
if origPath != "" && origPath[0] == '/' && len(origPath) > 1 {
// Work in daemon-specific OS filepath semantics. However, we save
// the the origPath passed in here, as it might also be a URL which
// we need to check for in this function.
passedInOrigPath := origPath
origPath = filepath.FromSlash(origPath)
destPath = filepath.FromSlash(destPath)
if origPath != "" && origPath[0] == os.PathSeparator && len(origPath) > 1 {
origPath = origPath[1:]
}
origPath = strings.TrimPrefix(origPath, "./")
origPath = strings.TrimPrefix(origPath, "."+string(os.PathSeparator))
// Twiddle the destPath when its a relative path - meaning, make it
// relative to the WORKINGDIR
if !filepath.IsAbs(destPath) {
hasSlash := strings.HasSuffix(destPath, "/")
destPath = filepath.Join("/", b.Config.WorkingDir, destPath)
hasSlash := strings.HasSuffix(destPath, string(os.PathSeparator))
destPath = filepath.Join(string(os.PathSeparator), filepath.FromSlash(b.Config.WorkingDir), destPath)
// Make sure we preserve any trailing slash
if hasSlash {
destPath += "/"
destPath += string(os.PathSeparator)
}
}
// In the remote/URL case, download it and gen its hashcode
if urlutil.IsURL(origPath) {
if urlutil.IsURL(passedInOrigPath) {
// As it's a URL, we go back to processing on what was passed in
// to this function
origPath = passedInOrigPath
if !allowRemote {
return fmt.Errorf("Source can't be a URL for %s", cmdName)
}
@@ -272,7 +319,7 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
ci.tmpDir = tmpDirName
// Create a tmp file within our tmp dir
tmpFileName := path.Join(tmpDirName, "tmp")
tmpFileName := filepath.Join(tmpDirName, "tmp")
tmpFile, err := os.OpenFile(tmpFileName, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)
if err != nil {
return err
@@ -312,19 +359,19 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
return err
}
ci.origPath = path.Join(filepath.Base(tmpDirName), filepath.Base(tmpFileName))
ci.origPath = filepath.Join(filepath.Base(tmpDirName), filepath.Base(tmpFileName))
// If the destination is a directory, figure out the filename.
if strings.HasSuffix(ci.destPath, "/") {
if strings.HasSuffix(ci.destPath, string(os.PathSeparator)) {
u, err := url.Parse(origPath)
if err != nil {
return err
}
path := u.Path
if strings.HasSuffix(path, "/") {
if strings.HasSuffix(path, string(os.PathSeparator)) {
path = path[:len(path)-1]
}
parts := strings.Split(path, "/")
parts := strings.Split(path, string(os.PathSeparator))
filename := parts[len(parts)-1]
if filename == "" {
return fmt.Errorf("cannot determine filename from url: %s", u)
@@ -337,7 +384,7 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
if err != nil {
return err
}
tarSum, err := tarsum.NewTarSum(r, true, tarsum.Version0)
tarSum, err := tarsum.NewTarSum(r, true, tarsum.Version1)
if err != nil {
return err
}
@@ -351,12 +398,12 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
}
// Deal with wildcards
if allowWildcards && ContainsWildcards(origPath) {
if allowWildcards && containsWildcards(origPath) {
for _, fileInfo := range b.context.GetSums() {
if fileInfo.Name() == "" {
continue
}
match, _ := path.Match(origPath, fileInfo.Name())
match, _ := filepath.Match(origPath, fileInfo.Name())
if !match {
continue
}
@@ -373,7 +420,7 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
if err := b.checkPathForAddition(origPath); err != nil {
return err
}
fi, _ := os.Stat(path.Join(b.contextPath, origPath))
fi, _ := os.Stat(filepath.Join(b.contextPath, origPath))
ci := copyInfo{}
ci.origPath = origPath
@@ -394,20 +441,20 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
// Must be a dir
var subfiles []string
absOrigPath := path.Join(b.contextPath, ci.origPath)
absOrigPath := filepath.Join(b.contextPath, ci.origPath)
// Add a trailing / to make sure we only pick up nested files under
// the dir and not sibling files of the dir that just happen to
// start with the same chars
if !strings.HasSuffix(absOrigPath, "/") {
absOrigPath += "/"
if !strings.HasSuffix(absOrigPath, string(os.PathSeparator)) {
absOrigPath += string(os.PathSeparator)
}
// Need path w/o / too to find matching dir w/o trailing /
// Need path w/o slash too to find matching dir w/o trailing slash
absOrigPathNoSlash := absOrigPath[:len(absOrigPath)-1]
for _, fileInfo := range b.context.GetSums() {
absFile := path.Join(b.contextPath, fileInfo.Name())
absFile := filepath.Join(b.contextPath, fileInfo.Name())
// Any file in the context that starts with the given path will be
// picked up and its hashcode used. However, we'll exclude the
// root dir itself. We do this for a coupel of reasons:
@@ -428,7 +475,7 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
return nil
}
func ContainsWildcards(name string) bool {
func containsWildcards(name string) bool {
for i := 0; i < len(name); i++ {
ch := name[i]
if ch == '\\' {
@@ -440,21 +487,25 @@ func ContainsWildcards(name string) bool {
return false
}
func (b *Builder) pullImage(name string) (*imagepkg.Image, error) {
func (b *builder) pullImage(name string) (*image.Image, error) {
remote, tag := parsers.ParseRepositoryTag(name)
if tag == "" {
tag = "latest"
}
pullRegistryAuth := b.AuthConfig
if len(b.ConfigFile.AuthConfigs) > 0 {
pullRegistryAuth := &cliconfig.AuthConfig{}
if len(b.AuthConfigs) > 0 {
// The request came with a full auth config file, we prefer to use that
repoInfo, err := b.Daemon.RegistryService.ResolveRepository(remote)
if err != nil {
return nil, err
}
resolvedAuth := registry.ResolveAuthConfig(b.ConfigFile, repoInfo.Index)
pullRegistryAuth = &resolvedAuth
resolvedConfig := registry.ResolveAuthConfig(
&cliconfig.ConfigFile{AuthConfigs: b.AuthConfigs},
repoInfo.Index,
)
pullRegistryAuth = &resolvedConfig
}
imagePullConfig := &graph.ImagePullConfig{
@@ -474,14 +525,15 @@ func (b *Builder) pullImage(name string) (*imagepkg.Image, error) {
return image, nil
}
func (b *Builder) processImageFrom(img *imagepkg.Image) error {
func (b *builder) processImageFrom(img *image.Image) error {
b.image = img.ID
if img.Config != nil {
b.Config = img.Config
}
if len(b.Config.Env) == 0 {
// The default path will be blank on Windows (set by HCS)
if len(b.Config.Env) == 0 && daemon.DefaultPathEnv != "" {
b.Config.Env = append(b.Config.Env, "PATH="+daemon.DefaultPathEnv)
}
@@ -525,7 +577,7 @@ func (b *Builder) processImageFrom(img *imagepkg.Image) error {
// in the current server `b.Daemon`. If an image is found, probeCache returns
// `(true, nil)`. If no image is found, it returns `(false, nil)`. If there
// is any error, it returns `(false, err)`.
func (b *Builder) probeCache() (bool, error) {
func (b *builder) probeCache() (bool, error) {
if !b.UtilizeCache || b.cacheBusted {
return false, nil
}
@@ -543,10 +595,12 @@ func (b *Builder) probeCache() (bool, error) {
fmt.Fprintf(b.OutStream, " ---> Using cache\n")
logrus.Debugf("[BUILDER] Use cached version")
b.image = cache.ID
b.Daemon.Graph().Retain(b.id, cache.ID)
b.activeImages = append(b.activeImages, cache.ID)
return true, nil
}
func (b *Builder) create() (*daemon.Container, error) {
func (b *builder) create() (*daemon.Container, error) {
if b.image == "" && !b.noBaseImage {
return nil, fmt.Errorf("Please provide a source image with `from` prior to run")
}
@@ -561,7 +615,7 @@ func (b *Builder) create() (*daemon.Container, error) {
CgroupParent: b.cgroupParent,
Memory: b.memory,
MemorySwap: b.memorySwap,
NetworkMode: "bridge",
Ulimits: b.ulimits,
}
config := *b.Config
@@ -590,7 +644,7 @@ func (b *Builder) create() (*daemon.Container, error) {
return c, nil
}
func (b *Builder) run(c *daemon.Container) error {
func (b *builder) run(c *daemon.Container) error {
var errCh chan error
if b.Verbose {
errCh = c.Attach(nil, b.OutStream, b.ErrStream)
@@ -630,8 +684,8 @@ func (b *Builder) run(c *daemon.Container) error {
return nil
}
func (b *Builder) checkPathForAddition(orig string) error {
origPath := path.Join(b.contextPath, orig)
func (b *builder) checkPathForAddition(orig string) error {
origPath := filepath.Join(b.contextPath, orig)
origPath, err := filepath.EvalSymlinks(origPath)
if err != nil {
if os.IsNotExist(err) {
@@ -639,7 +693,11 @@ func (b *Builder) checkPathForAddition(orig string) error {
}
return err
}
if !strings.HasPrefix(origPath, b.contextPath) {
contextPath, err := filepath.EvalSymlinks(b.contextPath)
if err != nil {
return err
}
if !strings.HasPrefix(origPath, contextPath) {
return fmt.Errorf("Forbidden path outside the build context: %s (%s)", orig, origPath)
}
if _, err := os.Stat(origPath); err != nil {
@@ -651,27 +709,31 @@ func (b *Builder) checkPathForAddition(orig string) error {
return nil
}
func (b *Builder) addContext(container *daemon.Container, orig, dest string, decompress bool) error {
func (b *builder) addContext(container *daemon.Container, orig, dest string, decompress bool) error {
var (
err error
destExists = true
origPath = path.Join(b.contextPath, orig)
origPath = filepath.Join(b.contextPath, orig)
destPath string
)
// Work in daemon-local OS specific file paths
dest = filepath.FromSlash(dest)
destPath, err = container.GetResourcePath(dest)
if err != nil {
return err
}
// Preserve the trailing '/'
if strings.HasSuffix(dest, "/") || dest == "." {
destPath = destPath + "/"
// Preserve the trailing slash
if strings.HasSuffix(dest, string(os.PathSeparator)) || dest == "." {
destPath = destPath + string(os.PathSeparator)
}
destStat, err := os.Stat(destPath)
if err != nil {
if !os.IsNotExist(err) {
logrus.Errorf("Error performing os.Stat on %s. %s", destPath, err)
return err
}
destExists = false
@@ -694,9 +756,9 @@ func (b *Builder) addContext(container *daemon.Container, orig, dest string, dec
// First try to unpack the source as an archive
// to support the untar feature we need to clean up the path a little bit
// because tar is very forgiving. First we need to strip off the archive's
// filename from the path but this is only added if it does not end in / .
// filename from the path but this is only added if it does not end in slash
tarDest := destPath
if strings.HasSuffix(tarDest, "/") {
if strings.HasSuffix(tarDest, string(os.PathSeparator)) {
tarDest = filepath.Dir(destPath)
}
@@ -708,7 +770,7 @@ func (b *Builder) addContext(container *daemon.Container, orig, dest string, dec
}
}
if err := os.MkdirAll(path.Dir(destPath), 0755); err != nil {
if err := system.MkdirAll(filepath.Dir(destPath), 0755); err != nil {
return err
}
if err := chrootarchive.CopyWithTar(origPath, destPath); err != nil {
@@ -717,7 +779,7 @@ func (b *Builder) addContext(container *daemon.Container, orig, dest string, dec
resPath := destPath
if destExists && destStat.IsDir() {
resPath = path.Join(destPath, path.Base(origPath))
resPath = filepath.Join(destPath, filepath.Base(origPath))
}
return fixPermissions(origPath, resPath, 0, 0, destExists)
@@ -730,39 +792,7 @@ func copyAsDirectory(source, destination string, destExisted bool) error {
return fixPermissions(source, destination, 0, 0, destExisted)
}
func fixPermissions(source, destination string, uid, gid int, destExisted bool) error {
// If the destination didn't already exist, or the destination isn't a
// directory, then we should Lchown the destination. Otherwise, we shouldn't
// Lchown the destination.
destStat, err := os.Stat(destination)
if err != nil {
// This should *never* be reached, because the destination must've already
// been created while untar-ing the context.
return err
}
doChownDestination := !destExisted || !destStat.IsDir()
// We Walk on the source rather than on the destination because we don't
// want to change permissions on things we haven't created or modified.
return filepath.Walk(source, func(fullpath string, info os.FileInfo, err error) error {
// Do not alter the walk root iff. it existed before, as it doesn't fall under
// the domain of "things we should chown".
if !doChownDestination && (source == fullpath) {
return nil
}
// Path is prefixed by source: substitute with destination instead.
cleaned, err := filepath.Rel(source, fullpath)
if err != nil {
return err
}
fullpath = path.Join(destination, cleaned)
return os.Lchown(fullpath, uid, gid)
})
}
func (b *Builder) clearTmp() {
func (b *builder) clearTmp() {
for c := range b.TmpContainers {
rmConfig := &daemon.ContainerRmConfig{
ForceRemove: true,

View File

@@ -0,0 +1,40 @@
// +build linux
package builder
import (
"os"
"path/filepath"
)
func fixPermissions(source, destination string, uid, gid int, destExisted bool) error {
// If the destination didn't already exist, or the destination isn't a
// directory, then we should Lchown the destination. Otherwise, we shouldn't
// Lchown the destination.
destStat, err := os.Stat(destination)
if err != nil {
// This should *never* be reached, because the destination must've already
// been created while untar-ing the context.
return err
}
doChownDestination := !destExisted || !destStat.IsDir()
// We Walk on the source rather than on the destination because we don't
// want to change permissions on things we haven't created or modified.
return filepath.Walk(source, func(fullpath string, info os.FileInfo, err error) error {
// Do not alter the walk root iff. it existed before, as it doesn't fall under
// the domain of "things we should chown".
if !doChownDestination && (source == fullpath) {
return nil
}
// Path is prefixed by source: substitute with destination instead.
cleaned, err := filepath.Rel(source, fullpath)
if err != nil {
return err
}
fullpath = filepath.Join(destination, cleaned)
return os.Lchown(fullpath, uid, gid)
})
}

View File

@@ -0,0 +1,8 @@
// +build windows
package builder
func fixPermissions(source, destination string, uid, gid int, destExisted bool) error {
// chown is not supported on Windows
return nil
}

View File

@@ -2,6 +2,7 @@ package builder
import (
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
@@ -17,25 +18,34 @@ import (
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/httputils"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/progressreader"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/ulimit"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
)
// When downloading remote contexts, limit the amount (in bytes)
// to be read from the response body in order to detect its Content-Type
const maxPreambleLength = 100
// whitelist of commands allowed for a commit/import
var validCommitCommands = map[string]bool{
"entrypoint": true,
"cmd": true,
"user": true,
"workdir": true,
"entrypoint": true,
"env": true,
"volume": true,
"expose": true,
"label": true,
"onbuild": true,
"user": true,
"volume": true,
"workdir": true,
}
// Config contains all configs for a build job
type Config struct {
DockerfileName string
RemoteURL string
@@ -47,14 +57,14 @@ type Config struct {
Pull bool
Memory int64
MemorySwap int64
CpuShares int64
CpuPeriod int64
CpuQuota int64
CpuSetCpus string
CpuSetMems string
CPUShares int64
CPUPeriod int64
CPUQuota int64
CPUSetCpus string
CPUSetMems string
CgroupParent string
AuthConfig *cliconfig.AuthConfig
ConfigFile *cliconfig.ConfigFile
Ulimits []*ulimit.Ulimit
AuthConfigs map[string]cliconfig.AuthConfig
Stdout io.Writer
Context io.ReadCloser
@@ -65,32 +75,36 @@ type Config struct {
cancelOnce sync.Once
}
// When called, causes the Job.WaitCancelled channel to unblock.
// Cancel signals the build job to cancel
func (b *Config) Cancel() {
b.cancelOnce.Do(func() {
close(b.cancelled)
})
}
// Returns a channel which is closed ("never blocks") when the job is cancelled.
// WaitCancelled returns a channel which is closed ("never blocks") when
// the job is cancelled.
func (b *Config) WaitCancelled() <-chan struct{} {
return b.cancelled
}
// NewBuildConfig returns a new Config struct
func NewBuildConfig() *Config {
return &Config{
AuthConfig: &cliconfig.AuthConfig{},
ConfigFile: &cliconfig.ConfigFile{},
cancelled: make(chan struct{}),
AuthConfigs: map[string]cliconfig.AuthConfig{},
cancelled: make(chan struct{}),
}
}
// Build is the main interface of the package, it gathers the Builder
// struct and calls builder.Run() to do all the real build job.
func Build(d *daemon.Daemon, buildConfig *Config) error {
var (
repoName string
tag string
context io.ReadCloser
)
sf := streamformatter.NewJSONStreamFormatter()
repoName, tag = parsers.ParseRepositoryTag(buildConfig.RepoName)
if repoName != "" {
@@ -121,29 +135,52 @@ func Build(d *daemon.Daemon, buildConfig *Config) error {
} else if urlutil.IsURL(buildConfig.RemoteURL) {
f, err := httputils.Download(buildConfig.RemoteURL)
if err != nil {
return err
return fmt.Errorf("Error downloading remote context %s: %v", buildConfig.RemoteURL, err)
}
defer f.Body.Close()
dockerFile, err := ioutil.ReadAll(f.Body)
if err != nil {
return err
}
ct := f.Header.Get("Content-Type")
clen := int(f.ContentLength)
contentType, bodyReader, err := inspectResponse(ct, f.Body, clen)
// When we're downloading just a Dockerfile put it in
// the default name - don't allow the client to move/specify it
buildConfig.DockerfileName = api.DefaultDockerfileName
defer bodyReader.Close()
c, err := archive.Generate(buildConfig.DockerfileName, string(dockerFile))
if err != nil {
return err
return fmt.Errorf("Error detecting content type for remote %s: %v", buildConfig.RemoteURL, err)
}
if contentType == httputils.MimeTypes.TextPlain {
dockerFile, err := ioutil.ReadAll(bodyReader)
if err != nil {
return err
}
// When we're downloading just a Dockerfile put it in
// the default name - don't allow the client to move/specify it
buildConfig.DockerfileName = api.DefaultDockerfileName
c, err := archive.Generate(buildConfig.DockerfileName, string(dockerFile))
if err != nil {
return err
}
context = c
} else {
// Pass through - this is a pre-packaged context, presumably
// with a Dockerfile with the right name inside it.
prCfg := progressreader.Config{
In: bodyReader,
Out: buildConfig.Stdout,
Formatter: sf,
Size: clen,
NewLines: true,
ID: "Downloading context",
Action: buildConfig.RemoteURL,
}
context = progressreader.New(prCfg)
}
context = c
}
defer context.Close()
sf := streamformatter.NewJSONStreamFormatter()
builder := &Builder{
builder := &builder{
Daemon: d,
OutStream: &streamformatter.StdoutFormater{
Writer: buildConfig.Stdout,
@@ -160,31 +197,40 @@ func Build(d *daemon.Daemon, buildConfig *Config) error {
Pull: buildConfig.Pull,
OutOld: buildConfig.Stdout,
StreamFormatter: sf,
AuthConfig: buildConfig.AuthConfig,
ConfigFile: buildConfig.ConfigFile,
AuthConfigs: buildConfig.AuthConfigs,
dockerfileName: buildConfig.DockerfileName,
cpuShares: buildConfig.CpuShares,
cpuPeriod: buildConfig.CpuPeriod,
cpuQuota: buildConfig.CpuQuota,
cpuSetCpus: buildConfig.CpuSetCpus,
cpuSetMems: buildConfig.CpuSetMems,
cpuShares: buildConfig.CPUShares,
cpuPeriod: buildConfig.CPUPeriod,
cpuQuota: buildConfig.CPUQuota,
cpuSetCpus: buildConfig.CPUSetCpus,
cpuSetMems: buildConfig.CPUSetMems,
cgroupParent: buildConfig.CgroupParent,
memory: buildConfig.Memory,
memorySwap: buildConfig.MemorySwap,
ulimits: buildConfig.Ulimits,
cancelled: buildConfig.WaitCancelled(),
id: stringid.GenerateRandomID(),
}
defer func() {
builder.Daemon.Graph().Release(builder.id, builder.activeImages...)
}()
id, err := builder.Run(context)
if err != nil {
return err
}
if repoName != "" {
return d.Repositories().Tag(repoName, tag, id, true)
}
return nil
}
// BuildFromConfig will do build directly from parameter 'changes', which comes
// from Dockerfile entries, it will:
//
// - call parse.Parse() to get AST root from Dockerfile entries
// - do build by calling builder.dispatch() to call all entries' handling routines
func BuildFromConfig(d *daemon.Daemon, c *runconfig.Config, changes []string) (*runconfig.Config, error) {
ast, err := parser.Parse(bytes.NewBufferString(strings.Join(changes, "\n")))
if err != nil {
@@ -198,7 +244,7 @@ func BuildFromConfig(d *daemon.Daemon, c *runconfig.Config, changes []string) (*
}
}
builder := &Builder{
builder := &builder{
Daemon: d,
Config: c,
OutStream: ioutil.Discard,
@@ -215,12 +261,28 @@ func BuildFromConfig(d *daemon.Daemon, c *runconfig.Config, changes []string) (*
return builder.Config, nil
}
func Commit(d *daemon.Daemon, name string, c *daemon.ContainerCommitConfig) (string, error) {
// CommitConfig contains build configs for commit operation
type CommitConfig struct {
Pause bool
Repo string
Tag string
Author string
Comment string
Changes []string
Config *runconfig.Config
}
// Commit will create a new image from a container's changes
func Commit(name string, d *daemon.Daemon, c *CommitConfig) (string, error) {
container, err := d.Get(name)
if err != nil {
return "", err
}
if c.Config == nil {
c.Config = &runconfig.Config{}
}
newConfig, err := BuildFromConfig(d, c.Config, c.Changes)
if err != nil {
return "", err
@@ -230,10 +292,64 @@ func Commit(d *daemon.Daemon, name string, c *daemon.ContainerCommitConfig) (str
return "", err
}
img, err := d.Commit(container, c.Repo, c.Tag, c.Comment, c.Author, c.Pause, newConfig)
commitCfg := &daemon.ContainerCommitConfig{
Pause: c.Pause,
Repo: c.Repo,
Tag: c.Tag,
Author: c.Author,
Comment: c.Comment,
Config: newConfig,
}
img, err := d.Commit(container, commitCfg)
if err != nil {
return "", err
}
return img.ID, nil
}
// inspectResponse looks into the http response data at r to determine whether its
// content-type is on the list of acceptable content types for remote build contexts.
// This function returns:
// - a string representation of the detected content-type
// - an io.Reader for the response body
// - an error value which will be non-nil either when something goes wrong while
// reading bytes from r or when the detected content-type is not acceptable.
func inspectResponse(ct string, r io.ReadCloser, clen int) (string, io.ReadCloser, error) {
plen := clen
if plen <= 0 || plen > maxPreambleLength {
plen = maxPreambleLength
}
preamble := make([]byte, plen, plen)
rlen, err := r.Read(preamble)
if rlen == 0 {
return ct, r, errors.New("Empty response")
}
if err != nil && err != io.EOF {
return ct, r, err
}
preambleR := bytes.NewReader(preamble)
bodyReader := ioutil.NopCloser(io.MultiReader(preambleR, r))
// Some web servers will use application/octet-stream as the default
// content type for files without an extension (e.g. 'Dockerfile')
// so if we receive this value we better check for text content
contentType := ct
if len(ct) == 0 || ct == httputils.MimeTypes.OctetStream {
contentType, _, err = httputils.DetectContentType(preamble)
if err != nil {
return contentType, bodyReader, err
}
}
contentType = selectAcceptableMIME(contentType)
var cterr error
if len(contentType) == 0 {
cterr = fmt.Errorf("unsupported Content-Type %q", ct)
contentType = ct
}
return contentType, bodyReader, cterr
}

113
builder/job_test.go Normal file
View File

@@ -0,0 +1,113 @@
package builder
import (
"bytes"
"io/ioutil"
"testing"
)
var textPlainDockerfile = "FROM busybox"
var binaryContext = []byte{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00} //xz magic
func TestInspectEmptyResponse(t *testing.T) {
ct := "application/octet-stream"
br := ioutil.NopCloser(bytes.NewReader([]byte("")))
contentType, bReader, err := inspectResponse(ct, br, 0)
if err == nil {
t.Fatalf("Should have generated an error for an empty response")
}
if contentType != "application/octet-stream" {
t.Fatalf("Content type should be 'application/octet-stream' but is %q", contentType)
}
body, err := ioutil.ReadAll(bReader)
if err != nil {
t.Fatal(err)
}
if len(body) != 0 {
t.Fatal("response body should remain empty")
}
}
func TestInspectResponseBinary(t *testing.T) {
ct := "application/octet-stream"
br := ioutil.NopCloser(bytes.NewReader(binaryContext))
contentType, bReader, err := inspectResponse(ct, br, len(binaryContext))
if err != nil {
t.Fatal(err)
}
if contentType != "application/octet-stream" {
t.Fatalf("Content type should be 'application/octet-stream' but is %q", contentType)
}
body, err := ioutil.ReadAll(bReader)
if err != nil {
t.Fatal(err)
}
if len(body) != len(binaryContext) {
t.Fatalf("Wrong response size %d, should be == len(binaryContext)", len(body))
}
for i := range body {
if body[i] != binaryContext[i] {
t.Fatalf("Corrupted response body at byte index %d", i)
}
}
}
func TestResponseUnsupportedContentType(t *testing.T) {
content := []byte(textPlainDockerfile)
ct := "application/json"
br := ioutil.NopCloser(bytes.NewReader(content))
contentType, bReader, err := inspectResponse(ct, br, len(textPlainDockerfile))
if err == nil {
t.Fatal("Should have returned an error on content-type 'application/json'")
}
if contentType != ct {
t.Fatalf("Should not have altered content-type: orig: %s, altered: %s", ct, contentType)
}
body, err := ioutil.ReadAll(bReader)
if err != nil {
t.Fatal(err)
}
if string(body) != textPlainDockerfile {
t.Fatalf("Corrupted response body %s", body)
}
}
func TestInspectResponseTextSimple(t *testing.T) {
content := []byte(textPlainDockerfile)
ct := "text/plain"
br := ioutil.NopCloser(bytes.NewReader(content))
contentType, bReader, err := inspectResponse(ct, br, len(content))
if err != nil {
t.Fatal(err)
}
if contentType != "text/plain" {
t.Fatalf("Content type should be 'text/plain' but is %q", contentType)
}
body, err := ioutil.ReadAll(bReader)
if err != nil {
t.Fatal(err)
}
if string(body) != textPlainDockerfile {
t.Fatalf("Corrupted response body %s", body)
}
}
func TestInspectResponseEmptyContentType(t *testing.T) {
content := []byte(textPlainDockerfile)
br := ioutil.NopCloser(bytes.NewReader(content))
contentType, bodyReader, err := inspectResponse("", br, len(content))
if err != nil {
t.Fatal(err)
}
if contentType != "text/plain" {
t.Fatalf("Content type should be 'text/plain' but is %q", contentType)
}
body, err := ioutil.ReadAll(bodyReader)
if err != nil {
t.Fatal(err)
}
if string(body) != textPlainDockerfile {
t.Fatalf("Corrupted response body %s", body)
}
}

View File

@@ -151,7 +151,7 @@ func parseNameVal(rest string, key string) (*Node, map[string]bool, error) {
if !strings.Contains(words[0], "=") {
node := &Node{}
rootnode = node
strs := TOKEN_WHITESPACE.Split(rest, 2)
strs := tokenWhitespace.Split(rest, 2)
if len(strs) < 2 {
return nil, nil, fmt.Errorf(key + " must have two arguments")
@@ -205,7 +205,7 @@ func parseStringsWhitespaceDelimited(rest string) (*Node, map[string]bool, error
node := &Node{}
rootnode := node
prevnode := node
for _, str := range TOKEN_WHITESPACE.Split(rest, -1) { // use regexp
for _, str := range tokenWhitespace.Split(rest, -1) { // use regexp
prevnode = node
node.Value = str
node.Next = &Node{}
@@ -232,13 +232,13 @@ func parseString(rest string) (*Node, map[string]bool, error) {
// parseJSON converts JSON arrays to an AST.
func parseJSON(rest string) (*Node, map[string]bool, error) {
var myJson []interface{}
if err := json.NewDecoder(strings.NewReader(rest)).Decode(&myJson); err != nil {
var myJSON []interface{}
if err := json.NewDecoder(strings.NewReader(rest)).Decode(&myJSON); err != nil {
return nil, nil, err
}
var top, prev *Node
for _, str := range myJson {
for _, str := range myJSON {
s, ok := str.(string)
if !ok {
return nil, nil, errDockerfileNotStringArray

View File

@@ -1,4 +1,4 @@
// This package implements a parser and parse tree dumper for Dockerfiles.
// Package parser implements a parser and parse tree dumper for Dockerfiles.
package parser
import (
@@ -33,10 +33,10 @@ type Node struct {
}
var (
dispatch map[string]func(string) (*Node, map[string]bool, error)
TOKEN_WHITESPACE = regexp.MustCompile(`[\t\v\f\r ]+`)
TOKEN_LINE_CONTINUATION = regexp.MustCompile(`\\[ \t]*$`)
TOKEN_COMMENT = regexp.MustCompile(`^#.*$`)
dispatch map[string]func(string) (*Node, map[string]bool, error)
tokenWhitespace = regexp.MustCompile(`[\t\v\f\r ]+`)
tokenLineContinuation = regexp.MustCompile(`\\[ \t]*$`)
tokenComment = regexp.MustCompile(`^#.*$`)
)
func init() {
@@ -70,8 +70,8 @@ func parseLine(line string) (string, *Node, error) {
return "", nil, nil
}
if TOKEN_LINE_CONTINUATION.MatchString(line) {
line = TOKEN_LINE_CONTINUATION.ReplaceAllString(line, "")
if tokenLineContinuation.MatchString(line) {
line = tokenLineContinuation.ReplaceAllString(line, "")
return line, nil, nil
}
@@ -96,8 +96,8 @@ func parseLine(line string) (string, *Node, error) {
return "", node, nil
}
// The main parse routine. Handles an io.ReadWriteCloser and returns the root
// of the AST.
// Parse is the main parse routine.
// It handles an io.ReadWriteCloser and returns the root of the AST.
func Parse(rwc io.Reader) (*Node, error) {
root := &Node{}
scanner := bufio.NewScanner(rwc)

View File

@@ -19,7 +19,7 @@
# -e GPG_PASSPHRASE=gloubiboulga \
# docker hack/release.sh
#
# Note: Apparmor used to mess with privileged mode, but this is no longer
# Note: AppArmor used to mess with privileged mode, but this is no longer
# the case. Therefore, you don't have to disable it anymore.
#

View File

@@ -7,8 +7,8 @@ import (
"unicode"
)
// dumps the AST defined by `node` as a list of sexps. Returns a string
// suitable for printing.
// Dump dumps the AST defined by `node` as a list of sexps.
// Returns a string suitable for printing.
func (node *Node) Dump() string {
str := ""
str += node.Value
@@ -59,7 +59,7 @@ func splitCommand(line string) (string, []string, string, error) {
var flags []string
// Make sure we get the same results irrespective of leading/trailing spaces
cmdline := TOKEN_WHITESPACE.Split(strings.TrimSpace(line), 2)
cmdline := tokenWhitespace.Split(strings.TrimSpace(line), 2)
cmd := strings.ToLower(cmdline[0])
if len(cmdline) == 2 {
@@ -77,8 +77,8 @@ func splitCommand(line string) (string, []string, string, error) {
// this function.
func stripComments(line string) string {
// string is already trimmed at this point
if TOKEN_COMMENT.MatchString(line) {
return TOKEN_COMMENT.ReplaceAllString(line, "")
if tokenComment.MatchString(line) {
return tokenComment.ReplaceAllString(line, "")
}
return line

View File

@@ -18,6 +18,8 @@ type shellWord struct {
pos int
}
// ProcessWord will use the 'env' list of environment variables,
// and replace any env var references in 'word'.
func ProcessWord(word string, env []string) (string, error) {
sw := &shellWord{
word: word,

View File

@@ -1,10 +1,19 @@
package builder
import (
"regexp"
"strings"
)
func handleJsonArgs(args []string, attributes map[string]bool) []string {
const acceptableRemoteMIME = `(?:application/(?:(?:x\-)?tar|octet\-stream|((?:x\-)?(?:gzip|bzip2?|xz)))|(?:text/plain))`
var mimeRe = regexp.MustCompile(acceptableRemoteMIME)
func selectAcceptableMIME(ct string) string {
return mimeRe.FindString(ct)
}
func handleJSONArgs(args []string, attributes map[string]bool) []string {
if len(args) == 0 {
return []string{}
}

41
builder/support_test.go Normal file
View File

@@ -0,0 +1,41 @@
package builder
import (
"fmt"
"testing"
)
func TestSelectAcceptableMIME(t *testing.T) {
validMimeStrings := []string{
"application/x-bzip2",
"application/bzip2",
"application/gzip",
"application/x-gzip",
"application/x-xz",
"application/xz",
"application/tar",
"application/x-tar",
"application/octet-stream",
"text/plain",
}
invalidMimeStrings := []string{
"",
"application/octet",
"application/json",
}
for _, m := range invalidMimeStrings {
if len(selectAcceptableMIME(m)) > 0 {
err := fmt.Errorf("Should not have accepted %q", m)
t.Fatal(err)
}
}
for _, m := range validMimeStrings {
if str := selectAcceptableMIME(m); str == "" {
err := fmt.Errorf("Should have accepted %q", m)
t.Fatal(err)
}
}
}

200
cli/cli.go Normal file
View File

@@ -0,0 +1,200 @@
package cli
import (
"errors"
"fmt"
"io"
"os"
"reflect"
"strings"
flag "github.com/docker/docker/pkg/mflag"
)
// Cli represents a command line interface.
type Cli struct {
Stderr io.Writer
handlers []Handler
Usage func()
}
// Handler holds the different commands Cli will call
// It should have methods with names starting with `Cmd` like:
// func (h myHandler) CmdFoo(args ...string) error
type Handler interface{}
// Initializer can be optionally implemented by a Handler to
// initialize before each call to one of its commands.
type Initializer interface {
Initialize() error
}
// New instantiates a ready-to-use Cli.
func New(handlers ...Handler) *Cli {
// make the generic Cli object the first cli handler
// in order to handle `docker help` appropriately
cli := new(Cli)
cli.handlers = append([]Handler{cli}, handlers...)
return cli
}
// initErr is an error returned upon initialization of a handler implementing Initializer.
type initErr struct{ error }
func (err initErr) Error() string {
return err.Error()
}
func (cli *Cli) command(args ...string) (func(...string) error, error) {
for _, c := range cli.handlers {
if c == nil {
continue
}
camelArgs := make([]string, len(args))
for i, s := range args {
if len(s) == 0 {
return nil, errors.New("empty command")
}
camelArgs[i] = strings.ToUpper(s[:1]) + strings.ToLower(s[1:])
}
methodName := "Cmd" + strings.Join(camelArgs, "")
method := reflect.ValueOf(c).MethodByName(methodName)
if method.IsValid() {
if c, ok := c.(Initializer); ok {
if err := c.Initialize(); err != nil {
return nil, initErr{err}
}
}
return method.Interface().(func(...string) error), nil
}
}
return nil, errors.New("command not found")
}
// Run executes the specified command.
func (cli *Cli) Run(args ...string) error {
if len(args) > 1 {
command, err := cli.command(args[:2]...)
switch err := err.(type) {
case nil:
return command(args[2:]...)
case initErr:
return err.error
}
}
if len(args) > 0 {
command, err := cli.command(args[0])
switch err := err.(type) {
case nil:
return command(args[1:]...)
case initErr:
return err.error
}
cli.noSuchCommand(args[0])
}
return cli.CmdHelp()
}
func (cli *Cli) noSuchCommand(command string) {
if cli.Stderr == nil {
cli.Stderr = os.Stderr
}
fmt.Fprintf(cli.Stderr, "docker: '%s' is not a docker command.\nSee 'docker --help'.\n", command)
os.Exit(1)
}
// CmdHelp displays information on a Docker command.
//
// If more than one command is specified, information is only shown for the first command.
//
// Usage: docker help COMMAND or docker COMMAND --help
func (cli *Cli) CmdHelp(args ...string) error {
if len(args) > 1 {
command, err := cli.command(args[:2]...)
switch err := err.(type) {
case nil:
command("--help")
return nil
case initErr:
return err.error
}
}
if len(args) > 0 {
command, err := cli.command(args[0])
switch err := err.(type) {
case nil:
command("--help")
return nil
case initErr:
return err.error
}
cli.noSuchCommand(args[0])
}
if cli.Usage == nil {
flag.Usage()
} else {
cli.Usage()
}
return nil
}
// Subcmd is a subcommand of the main "docker" command.
// A subcommand represents an action that can be performed
// from the Docker command line client.
//
// To see all available subcommands, run "docker --help".
func Subcmd(name string, synopses []string, description string, exitOnError bool) *flag.FlagSet {
var errorHandling flag.ErrorHandling
if exitOnError {
errorHandling = flag.ExitOnError
} else {
errorHandling = flag.ContinueOnError
}
flags := flag.NewFlagSet(name, errorHandling)
flags.Usage = func() {
flags.ShortUsage()
flags.PrintDefaults()
}
flags.ShortUsage = func() {
options := ""
if flags.FlagCountUndeprecated() > 0 {
options = " [OPTIONS]"
}
if len(synopses) == 0 {
synopses = []string{""}
}
// Allow for multiple command usage synopses.
for i, synopsis := range synopses {
lead := "\t"
if i == 0 {
// First line needs the word 'Usage'.
lead = "Usage:\t"
}
if synopsis != "" {
synopsis = " " + synopsis
}
fmt.Fprintf(flags.Out(), "\n%sdocker %s%s%s", lead, name, options, synopsis)
}
fmt.Fprintf(flags.Out(), "\n\n%s\n", description)
}
return flags
}
// An StatusError reports an unsuccessful exit by a command.
type StatusError struct {
Status string
StatusCode int
}
func (e StatusError) Error() string {
return fmt.Sprintf("Status: %s, Code: %d", e.Status, e.StatusCode)
}

12
cli/client.go Normal file
View File

@@ -0,0 +1,12 @@
package cli
import flag "github.com/docker/docker/pkg/mflag"
// ClientFlags represents flags for the docker client.
type ClientFlags struct {
FlagSet *flag.FlagSet
Common *CommonFlags
PostParse func()
ConfigDir string
}

20
cli/common.go Normal file
View File

@@ -0,0 +1,20 @@
package cli
import (
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/tlsconfig"
)
// CommonFlags represents flags that are common to both the client and the daemon.
type CommonFlags struct {
FlagSet *flag.FlagSet
PostParse func()
Debug bool
Hosts []string
LogLevel string
TLS bool
TLSVerify bool
TLSOptions *tlsconfig.Options
TrustKey string
}

View File

@@ -3,7 +3,6 @@ package cliconfig
import (
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
@@ -11,24 +10,41 @@ import (
"strings"
"github.com/docker/docker/pkg/homedir"
"github.com/docker/docker/pkg/system"
)
const (
// Where we store the config file
CONFIGFILE = "config.json"
OLD_CONFIGFILE = ".dockercfg"
// ConfigFile is the name of config file
ConfigFileName = "config.json"
oldConfigfile = ".dockercfg"
// This constant is only used for really old config files when the
// URL wasn't saved as part of the config file and it was just
// assumed to be this value.
DEFAULT_INDEXSERVER = "https://index.docker.io/v1/"
defaultIndexserver = "https://index.docker.io/v1/"
)
var (
ErrConfigFileMissing = errors.New("The Auth config file is missing")
configDir = os.Getenv("DOCKER_CONFIG")
)
// Registry Auth Info
func init() {
if configDir == "" {
configDir = filepath.Join(homedir.Get(), ".docker")
}
}
// ConfigDir returns the directory the configuration file is stored in
func ConfigDir() string {
return configDir
}
// SetConfigDir sets the directory the configuration file is stored in
func SetConfigDir(dir string) {
configDir = dir
}
// AuthConfig contains authorization information for connecting to a Registry
type AuthConfig struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
@@ -37,31 +53,34 @@ type AuthConfig struct {
ServerAddress string `json:"serveraddress,omitempty"`
}
// ~/.docker/config.json file info
// ConfigFile ~/.docker/config.json file info
type ConfigFile struct {
AuthConfigs map[string]AuthConfig `json:"auths"`
HttpHeaders map[string]string `json:"HttpHeaders,omitempty"`
HTTPHeaders map[string]string `json:"HttpHeaders,omitempty"`
PsFormat string `json:"psFormat,omitempty"`
filename string // Note: not serialized - for internal use only
}
// NewConfigFile initilizes an empty configuration file for the given filename 'fn'
func NewConfigFile(fn string) *ConfigFile {
return &ConfigFile{
AuthConfigs: make(map[string]AuthConfig),
HttpHeaders: make(map[string]string),
HTTPHeaders: make(map[string]string),
filename: fn,
}
}
// load up the auth config information and return values
// Load reads the configuration files in the given directory, and sets up
// the auth config information and return values.
// FIXME: use the internal golang config parser
func Load(configDir string) (*ConfigFile, error) {
if configDir == "" {
configDir = filepath.Join(homedir.Get(), ".docker")
configDir = ConfigDir()
}
configFile := ConfigFile{
AuthConfigs: make(map[string]AuthConfig),
filename: filepath.Join(configDir, CONFIGFILE),
filename: filepath.Join(configDir, ConfigFileName),
}
// Try happy path first - latest config file
@@ -94,8 +113,7 @@ func Load(configDir string) (*ConfigFile, error) {
}
// Can't find latest config file so check for the old one
confFile := filepath.Join(homedir.Get(), OLD_CONFIGFILE)
confFile := filepath.Join(homedir.Get(), oldConfigfile)
if _, err := os.Stat(confFile); err != nil {
return &configFile, nil //missing file is not an error
}
@@ -124,8 +142,8 @@ func Load(configDir string) (*ConfigFile, error) {
return &configFile, fmt.Errorf("Invalid Auth config file")
}
authConfig.Email = origEmail[1]
authConfig.ServerAddress = DEFAULT_INDEXSERVER
configFile.AuthConfigs[DEFAULT_INDEXSERVER] = authConfig
authConfig.ServerAddress = defaultIndexserver
configFile.AuthConfigs[defaultIndexserver] = authConfig
} else {
for k, authConfig := range configFile.AuthConfigs {
authConfig.Username, authConfig.Password, err = DecodeAuth(authConfig.Auth)
@@ -140,12 +158,13 @@ func Load(configDir string) (*ConfigFile, error) {
return &configFile, nil
}
// Save encodes and writes out all the authorization information
func (configFile *ConfigFile) Save() error {
// Encode sensitive data into a new/temp struct
tmpAuthConfigs := make(map[string]AuthConfig, len(configFile.AuthConfigs))
for k, authConfig := range configFile.AuthConfigs {
authCopy := authConfig
// encode and save the authstring, while blanking out the original fields
authCopy.Auth = EncodeAuth(&authCopy)
authCopy.Username = ""
authCopy.Password = ""
@@ -162,7 +181,7 @@ func (configFile *ConfigFile) Save() error {
return err
}
if err := os.MkdirAll(filepath.Dir(configFile.filename), 0700); err != nil {
if err := system.MkdirAll(filepath.Dir(configFile.filename), 0700); err != nil {
return err
}
@@ -173,11 +192,12 @@ func (configFile *ConfigFile) Save() error {
return nil
}
func (config *ConfigFile) Filename() string {
return config.filename
// Filename returns the name of the configuration file
func (configFile *ConfigFile) Filename() string {
return configFile.filename
}
// create a base64 encoded auth string to store in config
// EncodeAuth creates a base64 encoded string to containing authorization information
func EncodeAuth(authConfig *AuthConfig) string {
authStr := authConfig.Username + ":" + authConfig.Password
msg := []byte(authStr)
@@ -186,7 +206,7 @@ func EncodeAuth(authConfig *AuthConfig) string {
return string(encoded)
}
// decode the auth string
// DecodeAuth decodes a base64 encoded string and returns username and password
func DecodeAuth(authStr string) (string, string, error) {
decLen := base64.StdEncoding.DecodedLen(len(authStr))
decoded := make([]byte, decLen)

View File

@@ -25,7 +25,7 @@ func TestMissingFile(t *testing.T) {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))
if !strings.Contains(string(buf), `"auths":`) {
t.Fatalf("Should have save in new form: %s", string(buf))
}
@@ -47,7 +47,7 @@ func TestSaveFileToDirs(t *testing.T) {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))
if !strings.Contains(string(buf), `"auths":`) {
t.Fatalf("Should have save in new form: %s", string(buf))
}
@@ -55,7 +55,7 @@ func TestSaveFileToDirs(t *testing.T) {
func TestEmptyFile(t *testing.T) {
tmpHome, _ := ioutil.TempDir("", "config-test")
fn := filepath.Join(tmpHome, CONFIGFILE)
fn := filepath.Join(tmpHome, ConfigFileName)
ioutil.WriteFile(fn, []byte(""), 0600)
_, err := Load(tmpHome)
@@ -66,7 +66,7 @@ func TestEmptyFile(t *testing.T) {
func TestEmptyJson(t *testing.T) {
tmpHome, _ := ioutil.TempDir("", "config-test")
fn := filepath.Join(tmpHome, CONFIGFILE)
fn := filepath.Join(tmpHome, ConfigFileName)
ioutil.WriteFile(fn, []byte("{}"), 0600)
config, err := Load(tmpHome)
@@ -80,7 +80,7 @@ func TestEmptyJson(t *testing.T) {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))
if !strings.Contains(string(buf), `"auths":`) {
t.Fatalf("Should have save in new form: %s", string(buf))
}
@@ -100,7 +100,7 @@ func TestOldJson(t *testing.T) {
defer func() { os.Setenv(homeKey, homeVal) }()
os.Setenv(homeKey, tmpHome)
fn := filepath.Join(tmpHome, OLD_CONFIGFILE)
fn := filepath.Join(tmpHome, oldConfigfile)
js := `{"https://index.docker.io/v1/":{"auth":"am9lam9lOmhlbGxv","email":"user@example.com"}}`
ioutil.WriteFile(fn, []byte(js), 0600)
@@ -120,7 +120,7 @@ func TestOldJson(t *testing.T) {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))
if !strings.Contains(string(buf), `"auths":`) ||
!strings.Contains(string(buf), "user@example.com") {
t.Fatalf("Should have save in new form: %s", string(buf))
@@ -129,7 +129,7 @@ func TestOldJson(t *testing.T) {
func TestNewJson(t *testing.T) {
tmpHome, _ := ioutil.TempDir("", "config-test")
fn := filepath.Join(tmpHome, CONFIGFILE)
fn := filepath.Join(tmpHome, ConfigFileName)
js := ` { "auths": { "https://index.docker.io/v1/": { "auth": "am9lam9lOmhlbGxv", "email": "user@example.com" } } }`
ioutil.WriteFile(fn, []byte(js), 0600)
@@ -149,9 +149,40 @@ func TestNewJson(t *testing.T) {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))
if !strings.Contains(string(buf), `"auths":`) ||
!strings.Contains(string(buf), "user@example.com") {
t.Fatalf("Should have save in new form: %s", string(buf))
}
}
func TestJsonWithPsFormat(t *testing.T) {
tmpHome, _ := ioutil.TempDir("", "config-test")
fn := filepath.Join(tmpHome, ConfigFileName)
js := `{
"auths": { "https://index.docker.io/v1/": { "auth": "am9lam9lOmhlbGxv", "email": "user@example.com" } },
"psFormat": "table {{.ID}}\\t{{.Label \"com.docker.label.cpu\"}}"
}`
ioutil.WriteFile(fn, []byte(js), 0600)
config, err := Load(tmpHome)
if err != nil {
t.Fatalf("Failed loading on empty json file: %q", err)
}
if config.PsFormat != `table {{.ID}}\t{{.Label "com.docker.label.cpu"}}` {
t.Fatalf("Unknown ps format: %s\n", config.PsFormat)
}
// Now save it and make sure it shows up in new form
err = config.Save()
if err != nil {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, ConfigFileName))
if !strings.Contains(string(buf), `"psFormat":`) ||
!strings.Contains(string(buf), "{{.ID}}") {
t.Fatalf("Should have save in new form: %s", string(buf))
}
}

View File

@@ -0,0 +1,151 @@
@{DOCKER_GRAPH_PATH}=/var/lib/docker
profile /usr/bin/docker (attach_disconnected, complain) {
# Prevent following links to these files during container setup.
deny /etc/** mkl,
deny /dev/** kl,
deny /sys/** mkl,
deny /proc/** mkl,
mount -> @{DOCKER_GRAPH_PATH}/**,
mount -> /,
mount -> /proc/**,
mount -> /sys/**,
mount -> /run/docker/netns/**,
umount,
pivot_root,
signal (receive) peer=@{profile_name},
signal (receive) peer=unconfined,
signal (send),
ipc rw,
network,
capability,
owner /** rw,
/var/lib/docker/** rwl,
# For non-root client use:
/dev/urandom r,
/run/docker.sock rw,
/proc/** r,
/sys/kernel/mm/hugepages/ r,
/etc/localtime r,
ptrace peer=@{profile_name},
ptrace (read) peer=docker-default,
deny ptrace (trace) peer=docker-default,
deny ptrace peer=/usr/bin/docker///bin/ps,
/usr/bin/docker pix,
/sbin/xtables-multi rCx,
/sbin/iptables rCx,
/sbin/modprobe rCx,
/sbin/auplink rCx,
/bin/kmod rCx,
/usr/bin/xz rCx,
/bin/ps rCx,
/bin/cat rCx,
/sbin/zfs rCx,
# Transitions
change_profile -> docker-*,
change_profile -> unconfined,
profile /bin/cat (complain) {
/etc/ld.so.cache r,
/lib/** r,
/dev/null rw,
/proc r,
/bin/cat mr,
# For reading in 'docker stats':
/proc/[0-9]*/net/dev r,
}
profile /bin/ps (complain) {
/etc/ld.so.cache r,
/etc/localtime r,
/etc/passwd r,
/etc/nsswitch.conf r,
/lib/** r,
/proc/[0-9]*/** r,
/dev/null rw,
/bin/ps mr,
# We don't need ptrace so we'll deny and ignore the error.
deny ptrace (read, trace),
# Quiet dac_override denials
deny capability dac_override,
deny capability dac_read_search,
deny capability sys_ptrace,
/dev/tty r,
/proc/stat r,
/proc/cpuinfo r,
/proc/meminfo r,
/proc/uptime r,
/sys/devices/system/cpu/online r,
/proc/sys/kernel/pid_max r,
/proc/ r,
/proc/tty/drivers r,
}
profile /sbin/iptables (complain) {
signal (receive) peer=/usr/bin/docker,
capability net_admin,
}
profile /sbin/auplink flags=(attach_disconnected, complain) {
signal (receive) peer=/usr/bin/docker,
capability sys_admin,
capability dac_override,
@{DOCKER_GRAPH_PATH}/aufs/** rw,
@{DOCKER_GRAPH_PATH}/tmp/** rw,
# For user namespaces:
@{DOCKER_GRAPH_PATH}/[0-9]*.[0-9]*/** rw,
/sys/fs/aufs/** r,
/lib/** r,
/apparmor/.null r,
/dev/null rw,
/etc/ld.so.cache r,
/sbin/auplink rm,
/proc/fs/aufs/** rw,
/proc/[0-9]*/mounts rw,
}
profile /sbin/modprobe /bin/kmod (complain) {
signal (receive) peer=/usr/bin/docker,
capability sys_module,
/etc/ld.so.cache r,
/lib/** r,
/dev/null rw,
/apparmor/.null rw,
/sbin/modprobe rm,
/bin/kmod rm,
/proc/cmdline r,
/sys/module/** r,
/etc/modprobe.d{/,/**} r,
}
# xz works via pipes, so we do not need access to the filesystem.
profile /usr/bin/xz (complain) {
signal (receive) peer=/usr/bin/docker,
/etc/ld.so.cache r,
/lib/** r,
/usr/bin/xz rm,
deny /proc/** rw,
deny /sys/** rw,
}
profile /sbin/xtables-multi (attach_disconnected, complain) {
/etc/ld.so.cache r,
/lib/** r,
/sbin/xtables-multi rm,
/apparmor/.null w,
/dev/null rw,
capability net_raw,
capability net_admin,
network raw,
}
profile /sbin/zfs (attach_disconnected, complain) {
file,
capability,
}
}

View File

@@ -41,6 +41,8 @@ for version in "${versions[@]}"; do
echo >> "$version/Dockerfile"
extraBuildTags=
# this list is sorted alphabetically; please keep it that way
packages=(
bash-completion # for bash-completion debhelper integration
@@ -54,6 +56,23 @@ for version in "${versions[@]}"; do
libdevmapper-dev # for "libdevmapper.h"
libsqlite3-dev # for "sqlite3.h"
)
if [ "$suite" = 'precise' ]; then
# precise has a few package issues
# - dh-systemd doesn't exist at all
packages=( "${packages[@]/dh-systemd}" )
# - libdevmapper-dev is missing critical structs (too old)
packages=( "${packages[@]/libdevmapper-dev}" )
extraBuildTags+=' exclude_graphdriver_devicemapper'
# - btrfs-tools is missing "ioctl.h" (too old), so it's useless
# (since kernels on precise are old too, just skip btrfs entirely)
packages=( "${packages[@]/btrfs-tools}" )
extraBuildTags+=' exclude_graphdriver_btrfs'
fi
echo "RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile"
echo >> "$version/Dockerfile"
@@ -65,5 +84,5 @@ for version in "${versions[@]}"; do
echo >> "$version/Dockerfile"
echo 'ENV AUTO_GOPATH 1' >> "$version/Dockerfile"
awk '$1 == "ENV" && $2 == "DOCKER_BUILDTAGS" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
awk '$1 == "ENV" && $2 == "DOCKER_BUILDTAGS" { print $0 "'"$extraBuildTags"'"; exit }' ../../../Dockerfile >> "$version/Dockerfile"
done

View File

@@ -0,0 +1,14 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM ubuntu:precise
RUN apt-get update && apt-get install -y bash-completion build-essential curl ca-certificates debhelper git libapparmor-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS apparmor selinux exclude_graphdriver_devicemapper exclude_graphdriver_btrfs

View File

@@ -2,7 +2,7 @@
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM ubuntu-debootstrap:vivid
FROM ubuntu:trusty
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*

View File

@@ -2,7 +2,7 @@
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM ubuntu-debootstrap:trusty
FROM ubuntu:vivid
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*

View File

@@ -2,7 +2,7 @@
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM ubuntu-debootstrap:utopic
FROM ubuntu:wily
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*

Some files were not shown because too many files have changed in this diff Show More