Compare commits

...

520 Commits

Author SHA1 Message Date
Victor Vieux
d84a070e47 Bump version to v1.1.2
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-23 00:29:56 +00:00
Michael Crosby
4e12484ea1 Copy values out of hostConfig
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: vieux)
2014-07-23 00:20:11 +00:00
Michael Crosby
2c185e25c2 Always mark as stopped for non running containers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: vieux)
2014-07-23 00:20:04 +00:00
Tianon Gravi
21341e9e13 Add a conditional to contrib/init/sysvinit-debian/docker for Dash vs Bash support
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)

Docker-DCO-1.1-Signed-off-by: Tianon Gravi <admwiggin@gmail.com> (github: vieux)
2014-07-23 00:19:24 +00:00
Alexandr Morozov
699bc47137 Set state running before dumping to disk
Fixes #4766
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Conflicts:
	daemon/container.go

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: vieux)
2014-07-23 00:18:41 +00:00
Victor Vieux
ecd20a96df Merge pull request #6915 from vieux/bump_v1.1.1
Bump v1.1.1
2014-07-09 12:16:22 -07:00
Victor Vieux
dc62f3cdcc Bump version to v1.1.1
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-09 00:59:54 +00:00
Tibor Vass
699556e661 Tests for ADD tar
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)

Conflicts:
	integration-cli/docker_cli_build_test.go

Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: vieux)
2014-07-08 21:32:18 +00:00
Michael Crosby
94c27842d8 Revert "improve untar when using files instead of directories. Specifies behavior on non-existant targets."
This reverts commit 1c8d3106df.

Conflicts:
	archive/archive_test.go

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: vieux)
2014-07-08 21:31:11 +00:00
Michael Crosby
44456ba065 Revert "allow overwrite in untar"
This reverts commit 5a3d774e56.

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: vieux)
2014-07-08 21:30:52 +00:00
Victor Vieux
4c52272a2d Merge pull request #6818 from vieux/bump_v1.1.0
Bump v1.1.0
2014-07-03 10:57:44 -07:00
Victor Vieux
79812e3646 Bump version to v1.1.0
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-03 01:15:11 +00:00
Sven Dowideit
6eda9f3207 Merge pull request #6825 from SvenDowideit/fix-man-page-merge-mess
missed these merge conflicts when manually rebasing too many files
2014-07-03 11:12:13 +10:00
SvenDowideit
f8d9ecfb2c missed these merge conflicts when manually rebasing too many files
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-07-03 11:07:42 +10:00
Sven Dowideit
9fe95f1c5b Merge pull request #6824 from fredlf/1-1_release_notes
Added Release Notes
2014-07-03 10:45:11 +10:00
Fred Lifton
c3f4972f6d Corrected version number to 3 digits.
Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)
2014-07-02 17:41:52 -07:00
Sven Dowideit
65e4b57fda Merge pull request #6819 from vieux/update_release_checklist_and_gitcommit
update release checklist and .gitignore
2014-07-03 10:36:52 +10:00
Fred Lifton
f746a48fe6 Merge pull request #6807 from SvenDowideit/convert-more-docker.io-to-docker.com
some docker.io -. docker.com conversions
2014-07-02 17:34:31 -07:00
SvenDowideit
fa29b1f062 I'm going to wish I didn't do this
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-07-03 10:31:56 +10:00
Fred Lifton
2c32c195d9 Merge pull request #6790 from SvenDowideit/pr_out_update_cli_md
update cli.md
2014-07-02 17:24:53 -07:00
SvenDowideit
b07f193822 Update cli.md and man pages to match current cli
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-07-03 10:22:20 +10:00
James Turnbull
b59754bcb3 Fixed numerous inconsistencies in command help text
* Replaced docker with Docker.
* Consistently used STDIN, STDOUT, STDERR.
* Consistently used TTY.
* Fixed some grammar and spelling issues.
* Fixed references to the index.

Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)

Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: SvenDowideit)
2014-07-03 10:22:09 +10:00
Fred Lifton
d946cae364 Added Release Notes
Release notes for v.1.1 have been added to the docs index.md page. Made some revisions to
other content to make it shorter.

Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)
2014-07-02 16:33:13 -07:00
Victor Vieux
170ba7f8fe update release checklist and .gitignore
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-02 18:54:14 +00:00
Victor Vieux
8ea3589287 Merge pull request #6808 from vieux/pr_6806
Add backwards READ compatibility for the old libcontainer API
2014-07-02 10:51:27 -07:00
Tibor Vass
f357b18ee3 Merge pull request #6780 from unclejack/tweak_cli_integration_tests
Tweak cli integration tests
2014-07-02 13:16:26 -04:00
unclejack
deb57c5144 Merge pull request #6763 from folieadrien/master
Migrate TestGetImagesHistory into unit and CLI test
2014-07-02 19:44:21 +03:00
Tianon Gravi
292483531f Merge pull request #6814 from tianon/more-init-ulimit
Add NOFILE and NPROC ulimit settings to OpenRC and SysVinit
2014-07-02 10:08:11 -06:00
unclejack
dad4768037 integcli: add & use pullImageIfNotExist for pulls
This speeds up the tag cli integration tests by about 20 seconds.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-07-02 18:45:11 +03:00
Tianon Gravi
bae79c3e72 Add NOFILE and NPROC ulimit settings to the SysV init script
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-07-02 09:38:19 -06:00
Tianon Gravi
7abe70c0b1 Add NOFILE and NPROC ulimit settings to the OpenRC init script
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-07-02 09:36:57 -06:00
Victor Vieux
d403936818 fix compilation and panic
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-02 00:54:08 +00:00
Tibor Vass
cccb64e863 Add backwards READ compatibility for the old libcontainer API
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-07-02 00:19:05 +00:00
Fred Lifton
5ff18b8155 Merge pull request #6789 from SvenDowideit/pr_out_expand_to_used_b2d_vm_on_any_of_the_platforms
expand to 'used b2d vm on any of the platforms'
2014-07-01 16:09:38 -07:00
Tibor Vass
b0824edc7c Merge pull request #6748 from LK4D4/increase_max_patricia_prefix
Increase max patricia prefix
2014-07-01 19:03:30 -04:00
Fred Lifton
96e2bfe28a Merge pull request #6781 from anweiss/6738-dscarticle
Add Article for PowerShell DSC
2014-07-01 15:48:19 -07:00
James Turnbull
a52d90a100 Merge pull request #6788 from SvenDowideit/remote-bang-from-hello-world
removing the exclaimation mark from our hello-world examples, some users...
2014-07-01 18:10:17 -04:00
Sven Dowideit
a09f99b8b0 Lowercase world, because its not important.
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
2014-07-01 15:07:48 -07:00
SvenDowideit
3091d9a31e removing the exclaimation mark from our hello-world examples, some users get trapped by the shell
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-07-01 15:07:48 -07:00
Sven Dowideit
91c4fbb7bf convert OSX into OS X
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
2014-07-01 15:00:34 -07:00
SvenDowideit
84990731f7 expand to 'used b2d vm on any of the platforms'
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-07-01 15:00:34 -07:00
Tom Maaswinkel
fc4c0d9de4 Update usingdocker.md
boot2docker on windows also uses an IP of its own.

Docker-DCO-1.1-Signed-off-by: Tom Maaswinkel <tom.maaswinkel@12wiki.eu> (github: SvenDowideit)
2014-07-01 15:00:34 -07:00
Victor Vieux
49d49ac98f Merge pull request #6803 from vieux/pr_6176
Implement tail for docker logs
2014-07-01 14:59:37 -07:00
Victor Vieux
e06d533cc2 update docs
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-01 21:59:08 +00:00
Andrew Weiss
5c344dca4b add DSC article
Docker-DCO-1.1-Signed-off-by: Andrew Weiss <andrew.weiss@outlook.com> (github: anweiss)
2014-07-01 17:32:55 -04:00
Tibor Vass
1822bf730e Merge pull request #6798 from tiborvass/docs-dockerignore
More docs for dockerignore
2014-07-01 17:23:00 -04:00
Alexandr Morozov
1dc0caf9c0 Implement tail for docker logs
Fixes #4330
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-07-01 23:44:12 +04:00
Tibor Vass
c21c55e0b6 more docs for dockerignore
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-07-01 15:11:18 -04:00
Victor Vieux
cdc62c778f Merge pull request #6787 from vieux/pause_commit2
Pause/freeze containers during commit
2014-07-01 10:11:18 -07:00
Victor Vieux
957c510d72 updated docs & tests
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-01 17:10:00 +00:00
unclejack
c41c00cab4 Merge pull request #6785 from tiborvass/use_new_libcontainer_state_api
Use new libcontainer.State API
2014-07-01 19:44:07 +03:00
James Turnbull
6ac20416c8 Merge pull request #6796 from jpetazzo/bundled-vs-packaged
Add FAQ entry about bundled vs packaged libraries
2014-07-01 11:11:48 -04:00
Jérôme Petazzoni
ae1ff4dea3 Add FAQ entry about bundled vs packaged libraries
Docker-DCO-1.1-Signed-off-by: Jérôme Petazzoni <jerome@docker.com> (github: jpetazzo)
2014-07-01 07:47:59 -07:00
Solomon Hykes
bc33ce0d8f Merge pull request #6366 from proppy/add-proppy-server
api/MAINTAINERS: add proppy for server/
2014-06-30 17:44:02 -07:00
Eric Windisch
17d870bed5 Pause/freeze containers during commit
Initiates a pause before committing a container,
adds a pause option to the commit command, defaulting to 'true'.

Fixes bug: #6267
Fixes bug: #3675

Docker-DCO-1.1-Signed-off-by: Eric Windisch <ewindisch@docker.com> (github: ewindisch)
2014-07-01 00:30:21 +00:00
Sven Dowideit
3f18afc94c Merge pull request #6764 from SvenDowideit/pr_out_blindly_make_all_uses_of_e_g_into_e_g_
blindly make all uses of e\.?g\.? into e.g.,
2014-07-01 09:57:39 +10:00
SvenDowideit
fde10cf87b blindly make all uses of e\.?g\.? into e.g.,
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-07-01 09:55:19 +10:00
Christian Berendt
b44e13ae02 Fixed typographical erros in the documentation
Used the RETF rules provided by Wikipedia to fix some typographical
errors in the Markdown files of the documentation with the following
script:

https://github.com/openstack/openstack-doc-tools/tree/master/cleanup/retf

Docker-DCO-1.1-Signed-off-by: Christian Berendt <berendt@b1-systems.de> (github: berendt)

Docker-DCO-1.1-Signed-off-by: Christian Berendt <berendt@b1-systems.de> (github: SvenDowideit)
2014-07-01 09:54:20 +10:00
Victor Vieux
e6d9c097b2 Merge pull request #6749 from LK4D4/update_gorilla_context
Update gorilla/context
2014-06-30 16:52:34 -07:00
Tibor Vass
262d45e0fe Use new libcontainer.State API
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-30 18:27:15 -04:00
Tianon Gravi
ff45a3cbac Merge pull request #6784 from tianon/NikolaMandic-master
Update contrib/mkimage-arch.sh to remove use of "expect" since the output of pacstrap has changed
2014-06-30 16:04:09 -06:00
Tianon Gravi
75b3b382ca Merge branch 'master' of https://github.com/NikolaMandic/docker into NikolaMandic-master
* 'master' of https://github.com/NikolaMandic/docker:
  removed expect from mkimage-arch since it was not working

Conflicts:
	contrib/mkimage-arch.sh

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-30 15:52:04 -06:00
unclejack
63e28cc363 make TestRemoveContainerRunning handle signals
This lowers the test execution time by about 5 seconds.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-06-30 22:25:50 +03:00
unclejack
eb1e8e884d integration cli: add imageExists to docker utils
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-06-30 22:22:29 +03:00
Tibor Vass
36c78c9172 Merge pull request #6742 from vieux/remove_deprecate_syntax
remove deprecated syntax for docker commit
2014-06-30 10:41:07 -04:00
Tibor Vass
fef1e0a708 Merge pull request #6682 from erikh/6476-persistent_port_allocation
fix persistent port allocation
2014-06-30 10:14:17 -04:00
James Turnbull
7128353be5 Merge pull request #6766 from jamtur01/clirun
Formatting and consistency fixes to CLI and RUN references
2014-06-30 08:21:57 -04:00
Sven Dowideit
8d1cc68673 Merge pull request #6765 from SvenDowideit/pr_out_use_the_official_image_for_now_there_s_an_opensuse_image_on_its_way
use the official  image for now - there's an opensuse image on its way
2014-06-30 20:00:12 +10:00
Sven Dowideit
753ff36cc3 Merge pull request #6768 from SvenDowideit/add-1.13-api-to-docs-menu
Add the 1.13 API docs to the menu
2014-06-30 19:59:39 +10:00
Adrien Folie
c2699d8d89 Add missing test for full coverage
Docker-DCO-1.1-Signed-off-by: Adrien Folie <folie.adrien@gmail.com> (github: folieadrien)
2014-06-30 09:36:46 +00:00
SvenDowideit
26332fe339 Add the 1.13 API docs to the menu
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-30 14:19:16 +10:00
Sven Dowideit
b4df555d27 Merge pull request #6544 from mheon/sigproxy_docs
Update --sig-proxy documentation
2014-06-30 13:16:38 +10:00
James Turnbull
8c765ae68a Formatting and consistency fixes to CLI and RUN references
* Removed double backticks.
* Reformatted paragraphs.
* Fixed consistent STDOUT/STDIN/STDERR references.
* Fixed several broken URLs.
* Fixed backtick mismatches.

Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-06-29 22:25:12 -04:00
SvenDowideit
24bf8faa99 use the official image for now - there's an opensuse image on its way
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-30 11:46:09 +10:00
Sven Dowideit
0757a5663a Merge pull request #6631 from SvenDowideit/add-versioning-to-docs-output
Add versioning to docs output
2014-06-30 11:38:04 +10:00
James Turnbull
860d8e9271 Merge pull request #6761 from fgrehm/patch-1
Remove extra "Docker" from docs index
2014-06-29 20:14:16 -04:00
Adrien Folie
9a2771eac2 Migrate TestGetImagesHistory into unit and CLI test
Docker-DCO-1.1-Signed-off-by: Adrien Folie <folie.adrien@gmail.com> (github: folieadrien)
2014-06-30 01:31:16 +02:00
Fabio Rehm
3be683a0bb Remove extra "Docker" from docs index 2014-06-29 19:45:08 -03:00
Sven Dowideit
2075ef029e Merge pull request #6747 from softprops/master
added linkage to tugboat, a scala client library
2014-06-29 16:21:32 +10:00
doug tangren
5c0819a046 added linkage to tugboat, a scala client
Docker-DCO-1.1-Signed-off-by: Doug Tangren <d.tangren@gmail.com> (github: softprops)
2014-06-28 23:21:40 -04:00
Sven Dowideit
7362a09cd9 Merge pull request #6752 from mchelen/patch-5
fix typo
2014-06-29 08:29:12 +10:00
Sven Dowideit
525d41118e Merge pull request #6751 from mchelen/patch-3
missing `sudo`
2014-06-29 08:28:46 +10:00
Mike Chelen
0d2656ce6e fix typo 2014-06-28 12:26:36 -04:00
Mike Chelen
4a5f09387e missing sudo 2014-06-28 12:01:16 -04:00
LK4D4
ea464ea212 Update gorilla/context
Race condition was fixed recently
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-28 12:38:29 +04:00
LK4D4
095cb7a818 Increase patricia.MaxPrefixPerNode
It allows to avoid redundant prefix splits
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-28 12:27:44 +04:00
LK4D4
2edfb1e696 Update go-patricia to v1.0.1
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-28 12:20:31 +04:00
Sven Dowideit
4a9dc8d73d Merge pull request #6741 from fredlf/suse-install-fix
Changed add to group command to include -a (append) flag, for safety. In...
2014-06-28 10:43:11 +10:00
Victor Vieux
1960da1dd0 Merge pull request #6713 from vieux/order_flag
sort flags with the same name in a consistent order
2014-06-27 17:10:55 -07:00
Victor Vieux
a0b2290713 remove deprecated syntax for docker commit
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-27 23:09:41 +00:00
Erik Hollensbe
2cdcfc0c57 portmapper: unit tests for remap problem
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-06-27 15:57:31 -07:00
Fred Lifton
ff20637499 Merge pull request #6680 from mheon/cgroup_memory
Update docker-run manpage
2014-06-27 14:39:03 -07:00
Fred Lifton
018f887fe1 Merge pull request #6731 from mchelen/patch-2
Update dockerimages.md
2014-06-27 14:37:12 -07:00
Fred Lifton
74a34bb1fe Merge pull request #6678 from mheon/fix_man_generate
Path fixes in md2man script and README
2014-06-27 14:29:36 -07:00
Michael Crosby
e5d3aa2765 Merge pull request #6740 from tiborvass/untar_allow_overwrite
Allow overwrite in archive.Untar
2014-06-27 14:15:47 -07:00
Tibor Vass
5a3d774e56 allow overwrite in untar
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-27 17:03:51 -04:00
Michael Crosby
680adb98e1 Merge pull request #6232 from LK4D4/wait_functions_for_state
Wait functions for state
2014-06-27 13:33:13 -07:00
Michael Crosby
3aa75210c4 Merge pull request #6721 from LK4D4/integration_test_on_links
Integration cli tests on Links in inspect
2014-06-27 13:29:13 -07:00
Fred Lifton
0acec44374 Changed add to group command to include -a (append) flag, for safety. In response to customer email.
Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)
2014-06-27 12:45:55 -07:00
Alexandr Morozov
08182da5d8 Integration cli tests on Links in inspect
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-27 22:44:13 +04:00
Michael Crosby
3a50675a68 Merge pull request #6735 from unclejack/add_test_pr-6701
Add test for PR 6701
2014-06-27 11:05:18 -07:00
Michael Crosby
ade6bd7785 Merge pull request #6234 from jzupka/fix_check_default_ip
Adds check if default ip address is correct format.
2014-06-27 10:53:15 -07:00
Erik Hollensbe
e77729c2e0 Use last allocated port logic in port allocator
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-06-27 10:51:26 -07:00
Erik Hollensbe
ffd68badc0 Make ErrPortAlreadyAllocated an error interface with a few extras,
adjust tests to fit.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-06-27 10:51:25 -07:00
Arnaud Porterie
dafddf461e Restrict portallocator to Docker allocated ports
Port allocation status is stored in a global map: a port detected in use will remain as such for the lifetime of the daemon. Change the behavior to only mark as allocated ports which are claimed by Docker itself (which we can trust to properly remove from the allocation map once released). Ports allocated by other applications will always be retried to account for the eventually of the port having been released.

Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <icecrime@gmail.com> (github: icecrime)
2014-06-27 10:51:25 -07:00
unclejack
38b005ec69 integcli: add test to ensure -v /:/ isn't allowed
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-06-27 19:51:24 +03:00
unclejack
a1b6f350e8 correct typo - desination -> destination
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-06-27 19:49:40 +03:00
unclejack
510f1ba438 Merge pull request #6701 from crosbymichael/mount-root
Allow / as source of -v
2014-06-27 19:03:21 +03:00
Mike Chelen
815279c240 Update dockerimages.md
fix typo
2014-06-27 11:09:09 -04:00
Matthew Heon
4361366783 Document memory limit sizing in manpages
The -m flag permits the setting of a memory limit when running a Docker
container. The actual limit set must be a multiple of page size on Linux, so
whatever number the uses passes in will be rounded up if needed. Document this
behavior to prevent confusion. Also fixed several small formatting and grammar
issues in the docker run manpage.

Docker-DCO-1.1-Signed-off-by: Matthew Heon <mheon@redhat.com> (github: mheon)
2014-06-27 10:07:50 -04:00
Tianon Gravi
9b9d698081 Merge pull request #6729 from vincentbernat/fix/mkimage-use-var-tmp
Update mkimage scripts to use /var/tmp by default instead of /tmp
2014-06-27 08:04:05 -06:00
Jiří Župka
2fcbfb5a66 Adds check if default ip address is correct format.
It avoids hidden error when ports are redirected from
container to host using -p host_port:guest_port.

Docker-DCO-1.1-Signed-off-by: Jiří Župka <jzupka@redhat.com> (github: jzupka)
2014-06-27 15:55:20 +02:00
Vincent Bernat
287e604a8f mkimage: use /var/tmp by default instead of /tmp
Additionally, this can be overridden by setting the TMPDIR variable,
like this was already the case for the generic `mkimage.sh` script.

As explained in #6456, the rationale to use `/var/tmp` instead of `/tmp`
is that `/tmp` is often a small tmpfs filesystem with more restricted
rights.

Docker-DCO-1.1-Signed-off-by: Vincent Bernat <vincent@bernat.im> (github: vincentbernat)
2014-06-27 14:43:12 +02:00
Alexandr Morozov
57d86a5619 Use State waiting functions
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-27 15:07:40 +04:00
Alexandr Morozov
47065b9045 State refactoring and add waiting functions
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-27 15:05:48 +04:00
Sven Dowideit
a7722d752d Merge pull request #6718 from mchelen/patch-1
Update dockerizing.md
2014-06-27 17:38:54 +10:00
Mike Chelen
0bfa14a70a Update dockerizing.md
fix typo
2014-06-27 02:34:47 -04:00
James Turnbull
bc8d618cde Merge pull request #6716 from leeplay/master
Update nodejs_web_app.md
2014-06-26 23:21:36 -07:00
James Turnbull
b074e9b01d Merge pull request #6676 from berendt/opensuse_import_public_gpg_key
Import public GPG key after adding the openSUSE repository
2014-06-26 23:21:10 -07:00
James Turnbull
debbb26291 Merge pull request #6712 from SvenDowideit/pr_out_remove_superfluous_reptition_from_usingdocker_md
Remove superfluous reptition from usingdocker.md
2014-06-26 23:20:51 -07:00
leeplay
15ea1ca1f0 Update nodejs_web_app.md
Docker-DCO-1.1-Signed-off-by: Hyeongkyu Lee <hyeongkyu.lee@navercorp.com> (github: leeplay)
2014-06-27 11:39:58 +09:00
Jonathan Boulle
d14cfc8d43 sort flags with the same name in a consistent order
Docker-DCO-1.1-Signed-off-by: Jonathan Boulle <jonathanboulle@gmail.com> (github: jonboulle)
2014-06-27 01:46:59 +00:00
Paul Weaver
748aaf3530 Remove superfluous reptition from usingdocker.md
Clarify wording about default docker ps options

Fix typo in dockerlinks.md

Docker-DCO-1.1-Signed-off-by: Paul Weaver <pauweave@cisco.com> (github: ch3pjw)
2014-06-27 11:43:29 +10:00
Sven Dowideit
425ab3da5e Merge pull request #6709 from SvenDowideit/show-my-orgs
Show the user's orgs, not-Sam's email
2014-06-27 11:38:52 +10:00
Sven Dowideit
5cabfd1526 Merge pull request #6694 from leeplay/examples
Update examples/nodejs_web_app
2014-06-27 11:27:02 +10:00
Tibor Vass
67f6b0fd43 Merge pull request #6703 from crosbymichael/update-libcontainer-dep
Update libcontainer to 53cfe0a1eba9145bf5329abb
2014-06-26 21:20:59 -04:00
SvenDowideit
e817681581 Yes, ok, not-Sam
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-27 11:10:20 +10:00
Tibor Vass
6e3fe93148 Merge pull request #6579 from vieux/dockerignore
Rebased Dockerignore
2014-06-26 21:00:43 -04:00
Michael Crosby
e35a9a7def Merge pull request #6683 from vieux/add_links_inspect
add links to inspect for 'linking' containers
2014-06-26 17:33:02 -07:00
Victor Vieux
f7eaeae43c Merge pull request #6708 from crosbymichael/fix-bunk-test
Fix sleep command in tests
2014-06-26 17:10:58 -07:00
Michael Crosby
012091a28f Fix sleep command in tests
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 17:09:41 -07:00
Michael Crosby
c9fdb08bda Update libcontainer Context changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 16:56:39 -07:00
Michael Crosby
41e7523291 Update libcontainer to 53cfe0a1eba9145bf5329abbb52
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 16:56:39 -07:00
Michael Crosby
cab7894808 Merge pull request #6657 from unclejack/refactor_truncindex
refactor TruncIndex to use a trie & vendor deps
2014-06-26 16:53:49 -07:00
Victor Vieux
250b0d070c add doc
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-26 23:36:29 +00:00
Michael Crosby
aecdbf3471 Merge pull request #6696 from cpuguy83/remove_dup_run_tests
Remove integration tests moved to integration-cli(dups)
2014-06-26 16:29:32 -07:00
Victor Vieux
8162dc0312 fix rebase
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-26 22:51:47 +00:00
Victor Vieux
0098360726 abort on error and fix debug
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-26 22:49:08 +00:00
Victor Vieux
42ca8a064b add @tianon as maintainer of .dockerignore
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-26 22:49:08 +00:00
Travis Cline
9189db3aff Add .dockerignore support
Fixes #2224

Docker-DCO-1.1-Signed-off-by: Travis Cline <travis.cline@gmail.com> (github: tmc)
2014-06-26 22:49:08 +00:00
Travis Cline
111ab125b9 Change misnamed TarFilter to TarWithOptions
Docker-DCO-1.1-Signed-off-by: Travis Cline <travis.cline@gmail.com> (github: tmc)
2014-06-26 22:49:08 +00:00
Michael Crosby
af025f2a95 Remove api test for bind mount /
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 15:39:45 -07:00
Solomon Hykes
69ec5824c3 Merge pull request #6625 from vieux/remove_dockerscript
remove dockerscript
2014-06-26 14:56:22 -07:00
Victor Vieux
55691e5fdc add links to inspect for 'linking' containers
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-26 20:51:38 +00:00
Matthew Heon
fa3ac2d370 Fixed manpage generation script and README
Update md2man script to generate manpages inside docs/man/ directory. Update
usage documentation in the readme to point to the new docs/man path. Update
Ubuntu makefile to use new path to manpages

Docker-DCO-1.1-Signed-off-by: Matthew Heon <mheon@redhat.com> (github: mheon)
2014-06-26 15:51:26 -04:00
Tibor Vass
363b49948a Merge pull request #6693 from tianon/bash-complete-force-rm
Add bash completion for "docker rm -f" and complete on all containers instead of just stopped containers when "-f" is specified
2014-06-26 15:06:02 -04:00
Victor Vieux
56a0f49dcc Merge pull request #6640 from ostezer/commands.go-linguistics-1
docker help -> grammatical correction (pos. adj. apost.)
2014-06-26 11:59:49 -07:00
Michael Crosby
e39b8eade1 Allow / as source of -v
We discussed this at the docker plumbers meetup and for tools and
working on the system for things like boot2docker and coreos this is
needed.  You can already bypass this check so we felt it is ok to start
allowing this feature.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-26 10:50:18 -07:00
Brian Goff
7606412d53 Remove integration tests moved to integration-cli(dups)
integration/commands_test.go/TestRunHostname == integration-cli/docker_cli_run_tests.go/TestModeHostname
integration/commands_test.go/TestRunWorkdir  == integration-cli/docker_cli_run_tests.go/TestDockerRunWorkingDirectory
integration/commands_test.go/TestRunWorkdirExists  == integration-cli/docker_cli_run_tests.go/TestDockerRunWorkingDirectory
integration/commands_test.go/TestAttachstdIn == integration-cli/docker_cli_run_tests.go/TestRunStdinPipe
integration/commands_test.go/TestCmdLogs     == integration-cli/docker_cli_logs_tests.go
integration/commands_test.go/TestCmdKill     == integration-cli/docker_cli_kill_test.go

Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-06-26 12:57:12 -04:00
Tianon Gravi
9aa840c50d Merge pull request #6690 from tianon/remove-apt-lists
Update contrib/mkimage/debootstrap to remove /var/lib/apt/lists
2014-06-26 08:13:12 -06:00
unclejack
e0dad30579 refactor TruncIndex to use a trie & vendor deps
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-06-26 16:57:54 +03:00
O.S. Tezer
714c1bd8ca Anglicanisms: Grammatical correction (pos. adj. apost.)
Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
2014-06-26 08:41:58 +01:00
leeplay
6bb6e422b5 Update examples/nodejs_web_app
Docker-DCO-1.1-Signed-off-by: Hyeongkyu Lee <hyeongkyu.lee@navercorp.com> (github: leeplay)
2014-06-26 15:19:30 +09:00
Tianon Gravi
5e256799dd Add bash completion for "docker rm -f" and complete on all containers instead of just stopped containers when "-f" is specified
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-25 22:12:25 -06:00
Victor Vieux
87c5ecdd69 Merge pull request #6684 from unclejack/fix_testparserunvolumes
fix TestParseRunVolumes with Go 1.3 randomization
2014-06-25 18:54:25 -07:00
Victor Vieux
3051ffe0fa Merge pull request #6686 from SvenDowideit/commit-parens-update-6310
add missing docker commit parens (update 6310)
2014-06-25 18:30:00 -07:00
Tianon Gravi
c42b5575e5 Update contrib/mkimage/debootstrap to remove /var/lib/apt/lists (trimming at least 40MB and forcing "apt-get update" in dependent images before packages can be installed)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-25 19:07:39 -06:00
Sven Dowideit
389916bf9a Add the missing paren to the documentation for docker commit too
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
2014-06-26 11:06:45 +10:00
Trent Ogren
3fcb0d880a Add missing parenthesis in docs for -author switch
Docker-DCO-1.1-Signed-off-by: Trent Ogren <tedwardo2@gmail.com> (github: misfo)

Docker-DCO-1.1-Signed-off-by: Trent Ogren <tedwardo2@gmail.com> (github: SvenDowideit)
2014-06-26 11:06:45 +10:00
Sven Dowideit
917b7436af Merge pull request #6668 from erikh/fix-links-userguide
Add ticks to docker links userguide, was not being rendered properly.
2014-06-26 10:08:08 +10:00
Solomon Hykes
fe31ea7d0f Merge pull request #6635 from SvenDowideit/deputise-fredlf 2014-06-25 17:00:57 -07:00
Solomon Hykes
c9e647e42f Merge pull request #6218 from vieux/update_maintainers 2014-06-25 17:00:32 -07:00
James Turnbull
8eb34b2a0e Merge pull request #6626 from SvenDowideit/pr_out_updated_cloud_sdk_download_link_added_a_command_to_set_the_project
Updated Cloud SDK download link, added a command to set the project
2014-06-25 16:36:51 -07:00
James Turnbull
6b6e915b85 Merge pull request #6590 from robertbachmann/patch
Windows needs hardware virtualization
2014-06-25 16:36:30 -07:00
Tianon Gravi
5ef0fe4b53 Merge pull request #6136 from thatsamguy/add-mageia-mkimage
Add mkimage support for mageia using urpmi
2014-06-25 17:33:39 -06:00
Sven Dowideit
5f6a725332 add Docker version and branch to html header
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
2014-06-25 16:23:33 -07:00
Sven Dowideit
d3fde633bd Merge pull request #6639 from leeplay/userguide
Update dockervolumes.md
2014-06-26 09:19:34 +10:00
Tianon Gravi
02a0c7aca9 Merge pull request #6185 from jbeda/debian-init-fix
Make debian init work when called repeatedly in quick succession
2014-06-25 17:17:04 -06:00
Tibor Vass
5743151118 Merge pull request #6649 from vieux/fix_api_return_codes_start_stop
return 304 is status isn't modified in start and stop
2014-06-25 19:10:19 -04:00
Sven Dowideit
d15bc4a342 Merge pull request #6665 from leeplay/patch-1
Update dockervolumes.md
2014-06-26 08:57:14 +10:00
unclejack
f6e6cf9071 fix TestParseRunVolumes with Go 1.3 randomization
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-06-26 01:48:58 +03:00
Michael Crosby
d91b8bcf0b Merge pull request #6646 from tiborvass/fix-workdir
Fix --workdir=/
2014-06-25 15:19:51 -07:00
unclejack
94370add05 Merge pull request #6661 from tiborvass/tar_untar_file
Improve untar when using files instead of directories. Specifies behavior on non-existant targets.
2014-06-26 00:37:42 +03:00
Victor Vieux
17f6535482 Merge pull request #6664 from LK4D4/bench_on_truncindex_delete
Add benchmarks on TrucnIndex.Delete
2014-06-25 14:30:28 -07:00
Michael Crosby
7be83a0857 Merge pull request #6669 from pwaller/issue-6652
Allow re-mounting an existing mount with "remount"
2014-06-25 14:18:25 -07:00
Peter Waller
f87afda123 Allow re-mounting an existing mount with "remount"
Without this line of code, if a volume is present in /proc/mounts,
it cannot be remounted with new mount options.

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
2014-06-25 22:06:24 +01:00
Tibor Vass
b85f20cf13 Merge pull request #6666 from erikh/fix-escaping-whitespace
fix whitespace that precedes the escape in a multiline string.
2014-06-25 17:03:19 -04:00
Erik Hollensbe
03c5c1930d fix whitespace that precedes the escape in a multiline string.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-06-25 13:39:47 -07:00
Christian Berendt
f3ea94a797 Add a step to verify if Docker is working as expected
Like in the other installation guides I added a simple test
to verify that importing images and starting containers is
working.

Docker-DCO-1.1-Signed-off-by: Christian Berendt <berendt@b1-systems.de> (github: berendt)
2014-06-25 21:57:54 +02:00
Christian Berendt
0b2b3221e2 Import public GPG key after adding the openSUSE repository
Docker-DCO-1.1-Signed-off-by: Christian Berendt <berendt@b1-systems.de> (github: berendt)
2014-06-25 21:53:45 +02:00
LK4D4
04a9fe1e62 Combined AddGet benchmark
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-25 22:49:38 +04:00
Tibor Vass
baacc7006b add integration test for --workdir=/
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-25 11:02:59 -04:00
Tibor Vass
385c9b1a08 fix bug in FollowSymlinkInScope when link == root
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-25 11:02:59 -04:00
Tibor Vass
1c8d3106df improve untar when using files instead of directories. Specifies behavior on non-existant targets.
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-25 09:35:26 -04:00
Matthew Heon
be4f4599a6 Update documentation noting that SIGCHLD is not proxied.
Docker's --sig-proxy option sends all signals but one to a container. The
exception s SIGCHLD, which is deliberately ignored as it doesn't make sense to
send such a signal to a process in a container. Documentation updates will make
this less confusing if anyone does attempt to do this.

Docker-DCO-1.1-Signed-off-by: Matt Heon <mheon@redhat.com> (github: mheon)
2014-06-25 09:08:02 -04:00
Erik Hollensbe
6b29019541 Add ticks to docker links userguide, was not being rendered properly, fix spelling error in /etc/hosts
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-06-25 02:18:16 -07:00
hyeongkyu.lee
9026888b10 Update dockervolumes.md
~~~
kyu@kyu-HP-EliteBook-2570p:~/apps/docker/volume$ docker run -v /dbdata --name dbdata2 ubuntu
2014/06/25 14:17:44 Error response from daemon: No command specified
~~~
2014-06-25 14:53:59 +09:00
Alexandr Morozov
7c8445826f Add benchmarks on TrucnIndex.Delete
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-25 09:37:39 +04:00
James Turnbull
01d4fd76dd Merge pull request #6656 from andersryanc/master
Remove Docs viewport tag to fix iPhone scaling
2014-06-24 20:16:47 -07:00
Victor Vieux
b18c721555 fix tests
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-25 01:44:48 +00:00
Sven Dowideit
11902d4ccb Merge pull request #6658 from amuino/doc_pause_unpause
Document the pause and unpause commands available on API v1.12 onwards
2014-06-25 10:00:36 +10:00
Victor Vieux
c72cfa8d45 Merge pull request #6659 from vieux/pr_6248
Change floats to ints recursively on env encoding
2014-06-24 16:51:28 -07:00
LK4D4
1d3d1c5d2b Change floats to ints recursively on env encoding
Fixes #6246
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-24 23:39:26 +00:00
Michael Crosby
e899700254 Merge pull request #6651 from erikh/6002-conflicting-iptables-options
Add mutex warning when specifying -icc or -ip-forward and -iptables=false
2014-06-24 15:56:05 -07:00
Erik Hollensbe
05f293e65e Add mutex warning when specifying -icc or -ip-forward and -iptables=false
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-06-24 15:49:35 -07:00
Abel Muiño
901a47daff Document the pause and unpause commands available on API v1.12 onwards
Docker-DCO-1.1-Signed-off-by: Abel Muiño <amuino@gmail.com> (github: amuino)
2014-06-25 00:41:57 +02:00
Ryan Anderson
7b1dd54d5d Remove viewport tag to fix iPhone scaling 2014-06-24 15:16:40 -07:00
Tibor Vass
4f5e91e3b4 Merge pull request #6654 from vieux/fix_test_search
Fix search integration-cli test
2014-06-24 17:51:07 -04:00
Sven Dowideit
11ef08402a Merge pull request #6629 from SvenDowideit/move-man-pages-to-docs
move the man pages to the docs/ dir
2014-06-25 07:50:09 +10:00
Victor Vieux
6d8e95557c Merge pull request #6643 from kzys/freebsd-cp
cp's -T and --reflink=auto are only available on GNU coreutils
2014-06-24 14:29:18 -07:00
Victor Vieux
dd258553b1 Fix search integration-cli test
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-24 21:16:34 +00:00
Michael Crosby
408963ed4d Merge pull request #6650 from crosbymichael/update-libcontainer-post-refactor
Update libcontainer dep to 5210a236b92a8022a673108f347
2014-06-24 13:51:04 -07:00
unclejack
1059e166fd Merge pull request #6595 from LK4D4/env_benchmarks
Benchmarks for engine/env
2014-06-24 23:35:00 +03:00
unclejack
c4dbd4f7c0 Merge pull request #6648 from LK4D4/truncindex_bench
Truncindex benchmarks
2014-06-24 22:10:33 +03:00
Tibor Vass
f6d11c8d50 Merge pull request #6216 from gsalgado/convert-integration-tests
Convert integration/api_test:TestGetEvents into a unit test and a CLI test
2014-06-24 14:53:10 -04:00
Victor Vieux
53b036032d return 304 is status isn't modified in start and stop
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-24 18:31:56 +00:00
Michael Crosby
1dc8e2ffab Rename libcontainer.Container to libcontainer.Config
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-24 11:31:03 -07:00
Michael Crosby
cee6f4506c Update libcontainer references
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-24 11:31:03 -07:00
Michael Crosby
423a8f91d7 Update libcontainer to 5210a236b92a8022a673108f347
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-24 11:30:36 -07:00
LK4D4
01b424028e Benchmarks for engine/env
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-24 21:48:16 +04:00
LK4D4
7eb425ccd1 Improve truncindex benchmarks
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-24 21:41:51 +04:00
Victor Vieux
e23e3a1600 Merge pull request #5413 from SvenDowideit/docker-info-list-sockets
Add Sockets (-H) list to `docker -D info`.
2014-06-24 10:40:53 -07:00
LK4D4
ed032ddfd6 Move truncindex in separate package in pkg/
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-24 21:19:15 +04:00
Guilherme Salgado
1c291ccbbe Migrate TestGetEvents into a unit and a CLI test
Docker-DCO-1.1-Signed-off-by: Guilherme Salgado <gsalgado@gmail.com> (github: gsalgado)
2014-06-24 17:43:26 +02:00
Kato Kazuyoshi
733711481e cp's -T and --reflink=auto are only available on GNU coreutils
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
2014-06-24 23:58:17 +09:00
kyu
a51dc92379 Update dockervolumes.md
Docker-DCO-1.1-Signed-off-by: Hyeongkyu Lee <hyeongkyu.lee@navercorp.com> (github: leeplay)
2014-06-24 18:36:57 +09:00
James Turnbull
f1ac8962f9 Merge pull request #6633 from SvenDowideit/avoid-extra-gravatar-download
Lets not download the gravatar and then download a different one after t...
2014-06-23 23:58:15 -07:00
SvenDowideit
87d522a557 Add Fred as docs MAINTAINER
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-24 15:45:44 +10:00
SvenDowideit
c7a1bdf6c0 Lets not download the gravatar and then download a different one after the js is triggered
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-24 14:48:29 +10:00
SvenDowideit
42be6f2957 move the man pages to the docs/ dir
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-24 13:07:42 +10:00
SvenDowideit
cf513185b0 move api docs to APIv1.13
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-24 12:25:18 +10:00
Sven Dowideit
f54823bf05 Add Sockets (-H) list to docker -D info.
This will allow us to _know_ what the user's -H settings are, which may
be useful for debugging later.

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-06-24 12:25:17 +10:00
James Turnbull
664ba0c031 Merge pull request #6624 from jezenielzapanta/patch-1
Fix typo in the docs.
2014-06-23 19:20:20 -07:00
Sven Dowideit
67ba305841 Merge pull request #6623 from rogaha/fix_header_links
Fix header and About Docker links
2014-06-24 12:18:29 +10:00
Victor Vieux
d7587aa976 Merge pull request #4812 from kzys/freebsd-mount
FreeBSD support on pkg/mount
2014-06-23 17:45:25 -07:00
Victor Vieux
6a762e8594 Merge pull request #6620 from vieux/deprecate_tag_args
Remove old tag format
2014-06-23 17:24:20 -07:00
James Turnbull
28c22cb7f9 Merge pull request #6599 from SvenDowideit/6478-update-fedora
Update fedora.md
2014-06-23 17:23:00 -07:00
Manfred Zabarauskas
c5f1cb1121 Updated Cloud SDK download link, added a command to set the project
no DCO - considered a spelling fix

squashed by

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-24 09:07:10 +10:00
Victor Vieux
431a6736d2 remove dockerscript
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-23 22:52:03 +00:00
Sven Dowideit
b49cfaffa8 Merge pull request #6617 from ifraixedes/patch-1
Update dockervolumes.md
2014-06-24 08:50:27 +10:00
Victor Vieux
2d195fb6f8 Merge pull request #5715 from proppy/context-tar
allow docker build - to accept a context tar from stdin
2014-06-23 15:33:21 -07:00
Victor Vieux
14ee021885 Merge pull request #6539 from LK4D4/fix_large_frame_in_stdcopy
Fix stdcopy when reads large frame at once
2014-06-23 13:52:30 -07:00
Johan Euphrosine
edcb41451a api/client/build: allow tar as context for docker build -
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-06-23 13:34:09 -07:00
Michael Crosby
3f600c831b Merge pull request #6621 from LK4D4/move_sorter_tests_to_integration_cli
Move sorter_test from integration to integration-cli
2014-06-23 13:17:37 -07:00
Jezeniel Zapanta
cf6834d797 Fix typo in the docs.
Fix a minor typographical error inside `run.md`.
2014-06-24 03:26:22 +08:00
Roberto G. Hashioka
edf16383c6 Fix header and about Docker links 2014-06-23 18:35:15 +00:00
LK4D4
386d1ecc6e Move sorter_test from integration to integration-cli
TestServerListOrderedImagesByCreationDateAndTag was redundant and broken
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-23 22:19:52 +04:00
Victor Vieux
62b2b1bac3 Merge pull request #6532 from jonboulle/fix_capitals
be consistent in capitalization of Docker
2014-06-23 11:14:27 -07:00
Victor Vieux
8228d0e2bb Remove old tag format
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-23 17:52:03 +00:00
Victor Vieux
c32036fa9b Merge pull request #6585 from kzys/runconfig-fatalf
Fatal() doesn't take a format string like Fatalf()
2014-06-23 10:24:01 -07:00
Tianon Gravi
549e34b3d7 Merge pull request #6572 from tianon/better-debootstrap-self-documentation
Add a ton of simple improvements to contrib/mkimage/debootstrap, especially comments in the extra files put inside the image
2014-06-23 11:12:02 -06:00
Ivan Fraixedes
3ce5fde7ab Update dockervolumes.md
Missed double hyphen in `--volumes-from` option
2014-06-23 16:08:34 +01:00
Sven Dowideit
fa8f89c521 Merge pull request #6536 from dgageot/patch-2
Fix flag names
2014-06-23 15:26:08 +10:00
James Turnbull
10b8d6b8b0 Merge pull request #6583 from jamtur01/sshd
Updated SSH example to ensure it continues working
2014-06-23 01:17:35 -04:00
James Turnbull
09e694aa7d Merge pull request #6611 from SvenDowideit/remove-spurious-dollar-signs
Remove `$` leaders from examples of editing text in a file
2014-06-23 01:13:42 -04:00
SvenDowideit
4d7e28a7d7 Remove $ leaders from examples of editing text in a file
not everything that is indented is a commandline example

Closes #6591

Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-23 14:50:11 +10:00
Alexander Shopov
9559f57463 Update fedora.md
Docker-DCO-1.1-Signed-off-by: Alexander Shopov <ash@kambanaria.org> (github: alshopov)

Squashed by

Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)

replaces #6478

Docker-DCO-1.1-Signed-off-by: Alexander Shopov <ash@kambanaria.org> (github: )
2014-06-22 19:39:45 -07:00
James Turnbull
ad19e5e133 Merge pull request #6581 from fredlf/copyedit_dockerrepo
Revised and fixed links on dockerrepo.md
2014-06-22 22:17:40 -04:00
Sven Dowideit
875b0698e8 Merge pull request #6426 from tianon/fix-import-man-error
Fix contrib/man/md/docker-import.1.md warning ("macro `tar.gz,' not defined")
2014-06-23 11:48:35 +10:00
James Turnbull
22cf1586cf Merge pull request #6605 from SvenDowideit/6423-remove-b2d-ssh-passphrase-prompt
Remove mention of SSH passphrase, it was only present in v0.12
2014-06-22 20:54:22 -04:00
Sven Dowideit
1e847bff7a Remove mention of SSH passphrase, it was only present in v0.12
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
2014-06-22 17:36:02 -07:00
James Turnbull
e876067e34 Merge pull request #6598 from SvenDowideit/6394-missing-redirect
one last missing docs redirect
2014-06-22 19:06:27 -04:00
Sven Dowideit
51d032737c one last missing redirect
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
2014-06-22 16:01:21 -07:00
Robert Bachmann
ba7245f072 Windows needs hardware virtualization
VirtualBox needs hardware virtualization for
64-bit guests.

Docker-DCO-1.1-Signed-off-by: Robert Bachmann <rb@robertbachmann.at> (github: robertbachmann)
2014-06-21 23:14:23 +02:00
Kato Kazuyoshi
00469957ad Fatal() doesn't take a format string like Fatalf()
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
2014-06-21 17:32:39 +09:00
Fred Lifton
ab0fc77ebe Fixed a typo
Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)
2014-06-20 17:52:30 -07:00
Fred Lifton
c70fbae3ed Revised and fixed links on dockerrepo.md
Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)
2014-06-20 17:10:20 -07:00
Sven Dowideit
ad19f1beb7 Merge pull request #6578 from ch3pjw/documentation_fix
Fix minor typo and improve wording
2014-06-21 09:57:25 +10:00
Tianon Gravi
506ad22743 Merge pull request #6553 from tianon/disable-netgo-for-dynbinary
Disable netgo for dynbinary builds
2014-06-20 17:51:12 -06:00
Tibor Vass
d6f7725e58 Merge pull request #6529 from qwazerty/master
Fix minor typo
2014-06-20 17:37:07 -04:00
Paul Weaver
5266d6fa7b Clean up some uses on 'an' in builder docs 2014-06-20 22:36:31 +01:00
Paul Weaver
1bcc37caec Fix minor typo and improve wording 2014-06-20 22:21:18 +01:00
Jonathan Boulle
6d14e9f1ac be consistent in capitalization of Docker
Docker-DCO-1.1-Signed-off-by: Jonathan Boulle <jonathanboulle@gmail.com> (github: jonboulle)
2014-06-20 14:05:46 -07:00
unclejack
a5f5d5e8d7 Merge pull request #6571 from vbatts/vbatts-raw_json
raw json for `docker save`
2014-06-20 23:55:10 +03:00
Michael Crosby
8ee1f2a9e9 Merge pull request #6516 from LK4D4/validate_logs_params
Validate that one of streams choosen in logs on api side
2014-06-20 13:43:31 -07:00
Michael Crosby
189967a12a Merge pull request #6503 from LK4D4/verbose_parallel_error_pull_#6484
More verbose error for parallel pull
2014-06-20 13:29:51 -07:00
Vincent Batts
d3bc787bca docker save: raw json
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-20 14:38:17 -04:00
Tianon Gravi
a206186f84 Add a ton of simple improvements to contrib/mkimage/debootstrap, especially comments in the extra files put inside the image
This also adds support for squeeze-lts. :)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-20 10:11:26 -06:00
Sven Dowideit
b2eb79b7da Merge pull request #6565 from shaunol/patch-1
Update windows.md
2014-06-20 23:27:12 +10:00
Sven Dowideit
ed833bb62d Merge pull request #6568 from jokajak/patch-2
Minor typo/format fixes for dockerlinks.md
2014-06-20 23:23:03 +10:00
James Turnbull
0d63d68e33 Merge pull request #6540 from lalyos/docs-installation-mac-windows
Fix installation docs to use the new boot2docker command: ip
2014-06-20 08:02:56 -05:00
James Turnbull
a32f3b4b50 Merge pull request #6566 from jokajak/patch-1
Fix typo in networking.md
2014-06-20 07:59:35 -05:00
Josh
66bccf3064 Minor typo/format fixes
This fixes a code block typo so it renders as a code block.  Additionally synchronizes the variable prefix examples from 'DB' and 'DB1_' to 'DB_' and 'DB1_'
2014-06-20 07:49:22 -04:00
Sven Dowideit
c60cde1499 Merge pull request #6564 from financeCoding/docs-installation-google-fix
full url to GCE image
2014-06-20 21:41:35 +10:00
Josh
cbdce9912d Fix typo in networking.md
Minor typo fix
2014-06-20 07:14:56 -04:00
shaunol
db9bf744ab Update windows.md
Update Program Files path description, the default install folder is "Boot2Docker", rather than "Docker"
2014-06-20 19:23:35 +12:00
Adam Singer
4efe02b3df full url to GCE image
Docker-DCO-1.1-Signed-off-by: Adam Singer <financeCoding@gmail.com> (github: financeCoding)
2014-06-19 22:01:10 -07:00
James Turnbull
4e286a9094 Merge pull request #6548 from jamtur01/sec
Fixed #6545 - Updated Security article
2014-06-19 20:21:07 -05:00
Victor Vieux
8554841c6a Merge pull request #6563 from vieux/merge_release_v1.0.1
Merge release v1.0.1
2014-06-19 18:09:07 -07:00
Victor Vieux
49376ec448 Change version to 1.0.1-dev
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-20 01:06:48 +00:00
Victor Vieux
7030cdce59 Merge pull request #6559 from vieux/bump_v1.0.1
Bump v1.0.1
2014-06-19 18:03:54 -07:00
Victor Vieux
990021ac2b Bump version to v1.0.1
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-19 23:11:34 +00:00
Victor Vieux
41d405fa53 Merge pull request #6557 from crosbymichael/update-libcontainer-1.0.1
Update libcontainer dep to v1.0.1
2014-06-19 15:43:30 -07:00
Michael Crosby
8d06bfc12e Update libcontainer dep to v1.0.1
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-19 15:23:19 -07:00
Tianon Gravi
98ea12ac38 Merge pull request #6554 from tianon/fix-dyntest
Fix dyntest and rename it to dyntest-unit to match the test-unit rename
2014-06-19 16:04:24 -06:00
Victor Vieux
7ba8788919 Merge pull request #6527 from subhraveti/cap-whitelist
Maintain a whitelist of capabilities rather than droplist
2014-06-19 14:48:38 -07:00
James Turnbull
bf69b773ec Fixed #6545 - Updated Security article
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-06-19 16:13:20 -05:00
Tianon Gravi
986a151b8a Fix dyntest and rename it to dyntest-unit to match the test-unit rename
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-19 15:06:34 -06:00
Michael Crosby
abda245ddc Merge pull request #6493 from vieux/fix_cp_mac_os
allow utimes on mac os, only lutimes isn't supported
2014-06-19 14:00:59 -07:00
Tibor Vass
4ad5af81c8 Merge pull request #6552 from vbatts/vbatts-gh6551
sqlite-3.6.20-1 unique constraint message
2014-06-19 16:54:43 -04:00
Tianon Gravi
3f7909e996 Disable netgo for dynbinary builds
It's not necessary to use the netgo implementation for non-static builds. :)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-19 14:35:30 -06:00
Michael Crosby
707ef9618b Update close fd issues for lxc
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-19 16:02:21 -04:00
Michael Crosby
d31ae5aed8 Use libcontainer cap drop method
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-19 16:00:53 -04:00
Vincent Batts
b4857dffa8 sqlite-3.6.20-1 unique constraint message
https://github.com/dotcloud/docker/issues/6551

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-19 15:24:22 -04:00
Tianon Gravi
2eac1c4bc5 Merge pull request #6547 from tianon/update-bash-completion-for-pushing-tags
Update bash-completion to reflect ability to push single tags
2014-06-19 12:40:31 -06:00
LK4D4
d17c929659 Fix stdcopy when reads large frame at once
Fixes TestLogsContainerMuchBiggerThanPage with go 1.3(#6520)
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-19 21:42:55 +04:00
Tianon Gravi
bdf4b74b52 Update bash-completion to reflect ability to push single tags
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-19 10:11:32 -06:00
James Turnbull
346a350df4 Merge pull request #6538 from leeplay/patch-2
Update dockerlinks.md
2014-06-19 10:59:48 -05:00
unclejack
181e54bff3 Merge pull request #6451 from cyphar/6445-fix-onbuild-passing-to-grandchildren
Ensure that ONBUILD triggers aren't committed to grandchildren
2014-06-19 18:11:33 +03:00
Kevin "qwazerty" Houdebert
d7e5fdfb58 Fix minor typo
Docker-DCO-1.1-Signed-off-by: Kevin Houdebert kevin.houdebert@gmail.com (github: qwazerty)
2014-06-19 14:49:52 +02:00
James Turnbull
10eae16fa7 Updated SSH example to ensure it continues working
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-06-19 07:44:41 -05:00
James Turnbull
874698cb4a Merge pull request #6524 from behemphi/patch-1
Update dockerizing.md
2014-06-19 07:06:02 -05:00
lalyos
40966fa096 Fix installation docs to use the new boot2docker command: ip
Docker-DCO-1.1-Signed-off-by: Lajos Papp <lajos.papp@sequenceiq.com> (github: lalyos)
2014-06-19 13:00:45 +02:00
cyphar
a57298791c integration-cli: add build test for NOCACHE
This patch adds CLI integration tests to ensure that NOCACHE instructions
in Dockerfiles only apply to direct children of the original image.

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2014-06-19 20:33:17 +10:00
cyphar
7303467c77 server: buildfile: ensure that ONBUILD triggers aren't committed
This patch fixes the bug where ONBUILD triggers are committed each build
step created during the ONBUILD trigger execution, since the triggers are
only wiped *after* all ONBUILD trigger steps have been committed. This was
fixed by simply copying the ONBUILD triggers and wiping the config
*before* committing anything.

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2014-06-19 20:33:17 +10:00
hyeongkyu.lee
7b1f34d626 Update dockerlinks.md
Docker-DCO-1.1-Signed-off-by: Hyeongkyu Lee <hyeongkyu.lee@navercorp.com> (github: leeplay)
2014-06-19 18:45:31 +09:00
David Gageot
80bc06f1cf Fix flag names 2014-06-19 11:25:14 +02:00
Dinesh Subhraveti
cf331cdd6a Maintain a whitelist of capabilities rather than droplist
This fixes 6/18 vulnerability

Docker-DCO-1.1-Signed-off-by: Dinesh Subhraveti <dineshs@altiscale.com> (github: dineshs-altiscale)
2014-06-19 03:34:04 -04:00
James Turnbull
b1c114c3a7 Merge pull request #6519 from fredlf/latest-copyedits
Copy edits to dockerhub.md, fixed a broken link.
2014-06-19 01:45:20 -05:00
Tianon Gravi
b13cdb01bd Merge pull request #6427 from tianon/fix-zsh-completion-mode
Fix mode on contrib/completion/zsh/_docker (-x)
2014-06-18 23:01:07 -06:00
Tianon Gravi
f619243099 Fix mode on contrib/completion/zsh/_docker (-x)
ZSH completion scripts aren't supposed to be executable - they're sourced by ZSH and aren't run directly.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-18 22:59:20 -06:00
Boyd Hemphill
a841152069 Update dockerizing.md 2014-06-18 22:50:56 -05:00
Solomon Hykes
30313cacce Merge pull request #6363 from proppy/patch-5
MAINTAINERS: add proppy for google.md
2014-06-18 18:03:29 -07:00
Fred Lifton
8646bf4a40 Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredfl) 2014-06-18 17:50:24 -07:00
Tibor Vass
421707f638 Merge pull request #6518 from vieux/finish_remove_insert
cleanup all mentions of insert
2014-06-18 20:06:29 -04:00
Sven Dowideit
a790d3309c Merge pull request #6424 from tianon/fix-minor-md2man-bug
Fix minor bug in contrib/man/md/md2man-all.sh causing the creation of contrib/man/manREADME
2014-06-19 09:57:23 +10:00
O.S. Tezer
df217f5377 Merge pull request #6517 from ostezer/docs-styles-update
Docs styles update
2014-06-18 16:53:46 -07:00
Sven Dowideit
c60d178ad0 Merge pull request #6488 from crosbymichael/readme-security
Add security message to readme
2014-06-19 09:52:55 +10:00
Victor Vieux
b132e7b36d discard ErrNotSupportedPlatform
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-18 23:42:22 +00:00
Victor Vieux
1ca7964cdd Merge pull request #6257 from proppy/test-conntimeout
utils: add test for TimeoutConn
2014-06-18 16:23:39 -07:00
Victor Vieux
3e2a9f667f cleanup all mentions of insert
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-18 23:13:54 +00:00
Victor Vieux
7a0e599142 Merge pull request #6066 from tiborvass/5693-volumes-from-symlink-path
5693 volumes from symlink path
2014-06-18 16:10:37 -07:00
O.S. Tezer
381050b1ee Docs styling update/upgrade
Closes https://github.com/dotcloud/docker/issues/6514
Closes https://github.com/dotcloud/docker/issues/6377
Closes https://github.com/dotcloud/docker/issues/6514
Closes https://github.com/dotcloud/docker/pull/6502

Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
2014-06-18 16:09:03 -07:00
Victor Vieux
f3db32c035 Merge pull request #6505 from vdloo/master
Fixes typo in loopback device error message
2014-06-18 15:55:51 -07:00
Michael Crosby
d803523cdc Merge pull request #5559 from bmurphy1976/bmurphy1976-history-bug
Test and fix history command ordering
2014-06-18 14:34:00 -07:00
Michael Crosby
443d923f08 Merge pull request #6244 from tiborvass/fix_release_checklist
Fix documentation for release-checklist
2014-06-18 13:52:51 -07:00
Tibor Vass
586e72218c Fix documentation for release-checklist
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-18 16:45:15 -04:00
Rick van de Loo
98041d26bb Fixes typo in loopback device error message
Docker-DCO-1.1-Signed-off-by: Rick van de Loo <rickvandeloo@gmail.com> (github: vdloo)
2014-06-18 22:09:28 +02:00
Tibor Vass
48907d57ed fix bug in getRootResourcePath in previous commit
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-18 15:51:28 -04:00
cyphar
5c069940db daemon: *: updated getResourcePath and getRootResourcePath signatures
This patch updates container.getResourcePath and container.getRootResourcePath
to return the error from symlink.FollowSymlinkInScope (rather than using utils).

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)

Remove Inject to help rebase

Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)

Docker-DCO-1.1-Signed-off-by: cyphar <cyphar@cyphar.com> (github: tiborvass)
2014-06-18 15:51:28 -04:00
Tibor Vass
65d4047cb6 expose unresolved path for volumes and resolve symlink in container.getResourcePath
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-18 15:51:27 -04:00
Tibor Vass
def86d0cf4 rename TestVolumeWithSymlink to TestCreateVolumeWithSymlink and remove run_tests folder
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-18 15:51:27 -04:00
Tibor Vass
c4c92e66cd add integration test
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-06-18 15:50:39 -04:00
LK4D4
216b4c9cf6 Validate that one of streams choosen in logs on api side
Fixes #6506

There is the bug, that very hard to fix: When we return job.Errorf in
"logs" job it writes to job.Stderr, to which connected ResponseWriter and on
this write w.WriteHeader(http.StatusOK) is called. So, we get 200 on error
from "logs" job.

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-18 23:34:46 +04:00
Alexandr Morozov
3303789b4f More verbose error for parallel pull
Partially fixes #6484
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-18 23:30:52 +04:00
Victor Vieux
7c52ab7f83 Merge pull request #5878 from timthelion/docs-docker-readme
Add README.md file for the docker directory
2014-06-18 12:19:43 -07:00
Michael Crosby
40b55a4174 Merge pull request #6399 from dvberkel/master
use a numbered list for maintainers responsibility
2014-06-18 11:57:46 -07:00
Michael Crosby
f53b922f40 Merge pull request #6495 from vieux/pr_6269
Fix go vet errors
2014-06-18 11:02:17 -07:00
LK4D4
f08cd445b0 Fix go vet errors
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-18 17:39:57 +00:00
NikolaMandic
962e1186f9 removed expect from mkimage-arch since it was not working
Docker-DCO-1.1-Signed-off-by: NikolaMandic <mn080202@gmail.com> (github: NikolaMandic)
2014-06-18 19:25:51 +02:00
Michael Crosby
d9d08c5ef5 Wrap lines in security notice
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-18 10:15:51 -07:00
Tibor Vass
331ae9c0f8 Merge pull request #6487 from vbatts/vbatts-error_info
adding a little uniqueness, to wrapped errors.
2014-06-18 11:43:59 -04:00
James Turnbull
4195fc0494 Merge pull request #6497 from SvenDowideit/awscli-changes
pin awscli to 1.3.9, and then complexify the sync's to make them more li...
2014-06-18 08:46:30 -05:00
James Turnbull
ffe3ae7bfb Merge pull request #6499 from SvenDowideit/add-redirects-for-renames
compared the 0.11 sitemap to the 1.0 one and these are the differences
2014-06-18 08:43:32 -05:00
James Turnbull
2294294e19 Merge pull request #6468 from jstoja/6374-docs-apache-image
Docs: apache image on installation
2014-06-18 08:19:58 -05:00
Daan van Berkel
cc96d31252 use a numbered list for maintainers responsibility
At the moment maintainers responsibility are spelled out with a hybrid
list. I.e. an unordered list with an associated number.

In this commit I the number list proper is used.

Docker-DCO-1.1-Signed-off-by: Daan van Berkel <daan.v.berkel.1980@email.com> (github: dvberkel)
2014-06-18 14:31:26 +02:00
James Turnbull
0c5d9626b8 Merge pull request #6500 from leeplay/userguide
fixed docker port command
2014-06-18 01:25:28 -05:00
kyu
438d26b405 fixed docker port command 2014-06-18 15:01:29 +09:00
SvenDowideit
42fe9327b9 compared the 0.11 sitemap to the 1.0 one and these are the differences
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-18 15:39:30 +10:00
SvenDowideit
6b352d1cfe pin awscli to 1.3.9, and then complexify the sync's to make them more likely to complete
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-18 12:38:45 +10:00
Victor Vieux
f0ec901819 Merge pull request #6490 from icecrime/6203-artifacts_on_events_output
Avoid erasing line for non-progress messages
2014-06-17 16:26:51 -07:00
Victor Vieux
04bfa8e91f allow utimes on mac os, only lutimes isn't supported
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 23:19:42 +00:00
Tibor Vass
d0fe1147ea Merge pull request #6199 from icecrime/event_subscription_refactoring
Event subscription refactoring
2014-06-17 17:39:28 -04:00
unclejack
ec0fb311ed Merge pull request #6415 from LK4D4/increase_timeout_in_test_attach
Increase time before exit in TestMultipleAttachRestart
2014-06-18 00:36:18 +03:00
Michael Crosby
4dcf4e9bd0 Merge pull request #6320 from LK4D4/fix_stdcopy_eof
Don't exit on eof in header reading in stdcopy
2014-06-17 14:20:13 -07:00
Victor Vieux
3336bdf5b5 Merge pull request #6489 from vieux/fix_mflags_panic
prevent panic when empty flag
2014-06-17 14:04:20 -07:00
Michael Crosby
ba4ae2c46d Merge pull request #6405 from gsalgado/migrate-test-getcontainersbyname
Convert TestGetContainersByName into a unit test
2014-06-17 14:01:42 -07:00
Tibor Vass
092826152c Merge pull request #6485 from crosbymichael/update-libcontainer
Update libcontainer dependency to 77ffd49dfedbc78a
2014-06-17 16:57:35 -04:00
Victor Vieux
c7fdd51eb6 Merge pull request #6471 from LK4D4/more_buildfile_tests_to_cli
Move more buildfile tests to integration-cli
2014-06-17 13:54:55 -07:00
Victor Vieux
661a1e9026 prevent panic when empty flag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 20:45:57 +00:00
Arnaud Porterie
3807f8b708 Avoid erasing line for non-progress messages
The JSONMessage.Display methods erases the entire line by outputting the <ESC>[2K\r sequence before displaying the message content. This is not necessary for messages other than progress indicators, and introduces unwanted characters in the /events output.

Fixes #6203.

Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <icecrime@gmail.com> (github: icecrime)
2014-06-17 22:40:34 +02:00
Michael Crosby
9e2cc4fcd9 Add security message to readme
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-17 13:26:26 -07:00
Michael Crosby
698ded75b9 Update libcontainer dependency to 77ffd49dfedbc78a
Fixes #6256
Fixes #6383
Fixes #6414

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-17 13:09:36 -07:00
Vincent Batts
4902f047d3 adding a little uniqueness, to wrapped errors.
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-17 16:07:34 -04:00
Arnaud Porterie
d0c4e44863 Refactor events publishing
Events subscription (/events API endpoint) attributes pseudo-unique identifiers to incoming subscribers: originally its host, then its subscription time. This is unecessary and leads to code complexity.

Introduce a JSONMessagePublisher to provide simple pub/sub mechanism for JSONMessage, and rely on this new type to publish events to all subscribed listeners. The original logic is kept for the 'since' and 'until' parameters, and for client disconnection handling.

Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <icecrime@gmail.com> (github: icecrime)
2014-06-17 21:56:22 +02:00
Alexandr Morozov
cc42eeac21 Move TestBuildAddToSymlinkDest to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 23:44:30 +04:00
O.S. Tezer
52edbe6a23 Merge pull request #6356 from mattyw/master
fixed a broken link in the readme
2014-06-17 11:00:46 -07:00
mattyw
d4ec4d6e9b fixed a broken link in the docs
Docker-DCO-1.1-Signed-off-by: Matt Williams <lp@mattyw.net> (github: mattyw)
2014-06-17 18:36:59 +01:00
Julien Bordellier
207d7807af Now using the nginx docker image instead of the apache one. dotcloud/docker/issues/6374
Docker-DCO-1.1-Signed-off-by: Julien Bordellier <me@julienbordellier.com> (github: jstoja)
2014-06-18 00:38:04 +08:00
James Turnbull
bf9482987f Merge pull request #6470 from adelton/dns-no-hostname
The docker run --dns does not resolve hostname and having hostname in resolv.conf does not work.
2014-06-17 10:13:12 -05:00
James Turnbull
0ba7f934ee Merge pull request #6473 from leeplay/userguide
fix missing TAG for docker run
2014-06-17 06:23:06 -05:00
James Turnbull
087acccf0c Merge pull request #6469 from mariusv/patch-1
fixed Automated Build page link
2014-06-17 06:16:35 -05:00
kyu
cac97b6bd8 fix wrong command 2014-06-17 17:49:34 +09:00
Jan Pazdziora
e278082c21 The docker run --dns does not resolve hostname and having hostname in resolv.conf does not work.
Docker-DCO-1.1-Signed-off-by: Jan Pazdziora <jpazdziora@redhat.com> (github: adelton)
2014-06-17 09:40:59 +02:00
Alexandr Morozov
690711b584 Move TestBuildOnBuildForbiddenMaintainerTrigger to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 11:39:47 +04:00
Alexandr Morozov
1c8ec01c55 Move TestBuildOnBuildForbiddenFromTrigger to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 11:36:45 +04:00
Marius Voila
2ed8b22099 fixed Automated Build page link
Corrected the link in the Automated Builds page from  https://registry.hub.docker.io/builds/ to https://registry.hub.docker.com/builds/ as the *.io is not working
2014-06-17 08:24:56 +01:00
Alexandr Morozov
1e0e86360f Move TestBuildOnBuildForbiddenChainedTrigger to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 11:24:47 +04:00
Alexandr Morozov
2629e2ec23 Move TestBuildOnBuildTrigger to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 11:14:45 +04:00
Alexandr Morozov
08a10f936b Move TestBuildFailsDockerfileEmpty to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 11:06:44 +04:00
Alexandr Morozov
d3023f25f5 Move TestBuildFails to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 11:06:40 +04:00
Alexandr Morozov
f1d7ed35bd Move TestBuildInheritance to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 11:05:45 +04:00
Alexandr Morozov
62d97afaf8 Move TestBuildADDFileNotFound to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 11:05:36 +04:00
Alexandr Morozov
686786f107 Move TestForbiddenContextPath to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 10:38:45 +04:00
Alexandr Morozov
c5b82f5e8d Move TestBuildEntrypointRunCleanup to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-17 10:16:36 +04:00
Guilherme Salgado
c44c98edec Convert TestGetContainersByName into a unit test
Docker-DCO-1.1-Signed-off-by: Guilherme Salgado <gsalgado@gmail.com> (github: gsalgado)
2014-06-17 07:56:57 +02:00
O.S. Tezer
da327c8fa3 Merge pull request #6464 from SvenDowideit/pr_out_exclaimation_marks_cause_shell_pain_simplify_it_away
exclaimation marks cause shell pain - simplify it away
2014-06-16 18:13:24 -07:00
Victor Vieux
6228761f67 add a test using the flags
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 01:05:13 +00:00
Victor Vieux
614c57c521 improve test
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 00:59:51 +00:00
SvenDowideit
21849f1a21 exclaimation marks cause shell pain - simplify it away
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-17 10:49:23 +10:00
Sven Dowideit
5e8402568e Merge pull request #6462 from SvenDowideit/pr_out_fixup_small_formatting
fixup small formatting
2014-06-17 10:41:58 +10:00
SvenDowideit
7e9fbbba1c fixup small formatting
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-17 10:39:12 +10:00
Richard Harvey
2c5405f699 Updated Viewing App when on OSX
Added section to show how to get IP address and view running python app if the user is using boot2docker on OSX

Docker-DCO-1.1-Signed-off-by: Richard Harvey <richard@squarecows.com> (github: richarvey)

Docker-DCO-1.1-Signed-off-by: Richard Harvey <richard@squarecows.com> (github: SvenDowideit)
2014-06-17 10:39:11 +10:00
Sven Dowideit
b3e80c6935 Merge pull request #6438 from jamtur01/opts
Fixed DOCKER_OPTS
2014-06-17 10:16:07 +10:00
Michael Crosby
742d8bf922 Merge pull request #6417 from mrunalp/dev/system_prctl
Add helper function to make prctl system call.
2014-06-16 17:13:06 -07:00
Victor Vieux
3e4e8636c1 do not alter json in docker save
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 00:06:21 +00:00
Sven Dowideit
8f6162f17b Merge pull request #6240 from pmorie/docs
Add ApiVersion to doc example for remote API 1.12 /version
2014-06-17 09:21:21 +10:00
Sven Dowideit
d5f7b4df1b Merge pull request #6306 from mheon/fix_manpage_issue
Update documentation for docker pull
2014-06-17 09:13:29 +10:00
Sven Dowideit
95ca361df6 Merge pull request #6459 from ostezer/issue-5036-main-nav-top-level-click
Issue #5036 -> Click on nav bar goes to top level doc
2014-06-17 09:08:37 +10:00
Sven Dowideit
4e2cf53f4f Merge pull request #6449 from timthelion/host-net-docs
Document the potential insecurity of --net host
2014-06-17 09:06:27 +10:00
Victor Vieux
d671768b52 Merge pull request #6430 from LK4D4/lock_inspect
Do inspect under container lock
2014-06-16 15:31:08 -07:00
Victor Vieux
06248d745a update MAINTAINERS files
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-16 22:20:07 +00:00
James Turnbull
69a1f53e70 Merge pull request #6458 from ostezer/docs-code-block-scrolling
Issue #5279 -> Introduce horizontal scrolling to code-blocks
2014-06-16 16:14:17 -05:00
O.S. Tezer
8ae966de75 Issue #5036 -> Click on nav bar goes to top level doc
Closes issue #5036

This commit redirects the reader to top level doc upon clicking
on a main nav. menu item (eg. Installation [click] -> Mac OS X)

Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
2014-06-16 13:51:56 -07:00
Timothy
ed5054389a Document the potential insecurity of --net host
Docker-DCO-1.1-Signed-off-by: Timothy <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
2014-06-16 20:40:07 +00:00
O.S. Tezer
7a7bb43db5 Issue #5279 -> Introduce horizontal scrolling to code-blocks
Closes issue #5279

This commit re-introduces horizontal scrolling to docs' codeblocks

Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
2014-06-16 13:29:20 -07:00
Matthew Heon
03ae463c8d Updated CLI documentation for docker pull with notes on specifying URL
Docker-DCO-1.1-Signed-off-by: Matthew Heon <mheon@redhat.com> (github: mheon)
2014-06-16 15:58:05 -04:00
Tianon Gravi
a6ce867e48 Merge pull request #6425 from tianon/fix-man-page-spelling-errors
Fix several man page spelling errors
2014-06-16 13:24:10 -06:00
Matthew Heon
aab9078ff9 Updated docker pull manpage to reflect ability to specify URL of registry.
Also fixed a typo in same file.

Docker-DCO-1.1-Signed-off-by: Matthew Heon <mheon@redhat.com> (github: mheon)
2014-06-16 15:13:47 -04:00
James Turnbull
4e20407d82 Merge pull request #6304 from glyn/mac-build-no-sudo
Do not build using sudo on Mac OS X
2014-06-16 09:45:52 -04:00
Glyn Normington
1c05ddd645 Do not build using sudo on Mac OS X
Building using sudo fails on Mac OS X, but is necessary on Linux.

See https://groups.google.com/d/topic/docker-dev/1EW_pfA1t9o/discussion for discussion.

Docker-DCO-1.1-Signed-off-by: Glyn Normington <gnormington@gopivotal.com> (github: glyn)
2014-06-16 14:39:48 +01:00
Solomon Hykes
f83c873d8b Merge pull request #6448 from shykes/pr_out_guillaume_is_busy_full_time_on_his_new_business_and_no_longer_available_as_a_maintainer 2014-06-16 06:25:19 -07:00
Solomon Hykes
41d437117d Guillaume is busy full-time on his new business, and no longer available
as a maintainer.

Best of luck on your e-commerce business Guillaume, and thanks for all
the great contributions!

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-06-16 06:22:15 -07:00
James Turnbull
7085ec875f Merge pull request #6443 from catharsis/patch-1
dockervolumes: Fix a minor typo
2014-06-16 09:09:32 -04:00
Sven Dowideit
2b468dc283 Merge pull request #6437 from jamtur01/net
Fixed headers and ' characters
2014-06-16 20:19:03 +10:00
Anton Löfgren
8df0b12d82 dockervolumes: Fix a minor typo 2014-06-16 09:52:23 +02:00
James Turnbull
50d49d0db8 Merge pull request #6378 from evanderkoogh/patch-1
Linking containers added to API example
2014-06-15 20:29:50 -04:00
O.S. Tezer
50fde602a1 Merge pull request #6433 from soulshake/small-typos
Fix spelling and grammar errors; remove seemingly out-of-place words
2014-06-15 11:36:19 -07:00
James Turnbull
8ca34e4b5e Merge pull request #6440 from marcuslinke/patch-1
docker-java has moved to new location
2014-06-15 14:24:44 -04:00
marcuslinke
520163a00e docker-java has moved to new location 2014-06-15 20:16:51 +02:00
James Turnbull
0b97725340 Fixed DOCKER_OPTS
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-06-15 12:26:52 -04:00
James Turnbull
4adab34dfa Fixed headers and ' characters
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-06-15 12:15:59 -04:00
AJ Bowen
be9dcbbef5 Fix spelling and grammar errors; remove seemingly out-of-place words
Docker-DCO-1.1-Signed-off-by: AJ Bowen <aj@gandi.net> (github: soulshake)
2014-06-15 01:18:11 +02:00
Sven Dowideit
c4327f7146 Merge pull request #6431 from mika/mika/typos
Fix several typos
2014-06-15 07:51:48 +10:00
Michael Prokop
c0c58b6b46 Fix several typos
Docker-DCO-1.1-Signed-off-by: Michael Prokop <github@michael-prokop.at> (github: mika)
2014-06-14 23:16:30 +02:00
LK4D4
947405a909 Do inspect under container lock
It fixes some race conditions
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-14 21:08:23 +04:00
James Turnbull
93bf556f13 Merge pull request #6429 from mika/patch-1
Fix missing leading slash for /bin/bash executable
2014-06-14 11:07:38 -04:00
Michael Prokop
e9f1f760f2 Fix missing leading slash for /bin/bash executable 2014-06-14 15:54:27 +02:00
Tianon Gravi
e02cf69789 Fix contrib/man/md/docker-import.1.md warning ("macro `tar.gz,' not defined")
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-14 01:59:52 -06:00
Tianon Gravi
cb92c47144 Fix several man page spelling errors
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-14 01:49:51 -06:00
Tianon Gravi
d561fe6d2d Fix minor bug in contrib/man/md/md2man-all.sh causing the creation of contrib/man/manREADME
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-14 01:44:55 -06:00
O.S. Tezer
c40602b254 Merge pull request #6386 from cpuguy83/fix_link_docs
Adds info on how to get env vars from container
2014-06-13 23:12:32 -07:00
Fred Lifton
1a441d9aea Fixed whitespace errors 2014-06-13 17:08:53 -07:00
O.S. Tezer
821d3aab65 Merge pull request #6421 from nathanleclaire/doc_fix
Note user name and password in docs on boot2docker
2014-06-13 16:03:39 -07:00
Nathan LeClaire
073382a9c6 Note user name and password in docs on boot2docker
Docker-DCO-1.1-Signed-off-by: Nathan LeClaire <nathan.leclaire@docker.com> (github: nathanleclaire)
2014-06-13 15:38:45 -07:00
O.S. Tezer
77b09a6a19 Merge pull request #6416 from danielnorberg/dano/docs-spotify-client
docs: add spotify docker-client link
2014-06-13 12:08:17 -07:00
Mrunal Patel
65567e125d Add helper function to make prctl system call.
Docker-DCO-1.1-Signed-off-by: Mrunal Patel <mrunalp@gmail.com> (github: mrunalp)
2014-06-13 11:49:57 -07:00
Daniel Norberg
27b2d7ff72 docs: add spotify docker-client link
Docker-DCO-1.1-Signed-off-by: Daniel Norberg <daniel.norberg@gmail.com> (github: danielnorberg)
2014-06-13 14:20:31 -04:00
LK4D4
eb97163348 Increase time before exit in TestMultipleAttachRestart
Sometimes third attacher attaching to already stopped container.
Also I've changed prefix to attach and fixed cleanup on Fatal.
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-13 21:40:30 +04:00
James Turnbull
7b366b1f01 Merge pull request #6411 from alazaro/patch-1
Fix typo
2014-06-13 08:15:29 -07:00
Álvaro Lázaro
52e88d92f0 Fix typo 2014-06-13 15:53:42 +02:00
Michael Crosby
51b188c510 Merge pull request #6214 from LK4D4/fix_some_more_race_conditions
Fix some more race conditions
2014-06-12 15:17:10 -07:00
Tibor Vass
8091157038 Merge pull request #6391 from vieux/fix_hostname_file_net_host
fix hostname generation with --net=host
2014-06-12 14:11:26 -07:00
Michael Crosby
d871725cf2 Merge pull request #6381 from glyn/prod-ready
Remove "production ready" from the roadmap
2014-06-12 14:02:51 -07:00
Victor Vieux
f9f6379a53 Merge pull request #6360 from vieux/remove_beam
remove unused beam, will be back later as libchan
2014-06-12 13:55:53 -07:00
Victor Vieux
15243cdbde Merge pull request #6365 from vieux/allow_net_none_h
Allow --net=none and -h
2014-06-12 12:26:54 -07:00
Victor Vieux
f5979b9d0d add hostname generation with --net=host
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-12 19:20:57 +00:00
Victor Vieux
9494643bf1 add test
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-12 19:11:51 +00:00
Michael Crosby
a8d6d28be4 Merge pull request #6307 from W4RH4WK/master
restore logo for README.md
2014-06-12 10:21:10 -07:00
Brian Goff
fbf7815b25 Adds info on how to get env vars from container
Currently the docs just say "let's go into the container and look at the
env vars", but doesn't show how to do it.  It is also not currently
possible to enter the container as it is written in the doc
( container started with app.py and then somehow later on we have a
shell in the same container )

Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-06-12 09:26:55 -07:00
Glyn Normington
784a008346 Remove "production ready" from the roadmap
It's done as of v1.0.0.

Docker-DCO-1.1-Signed-off-by: Glyn Normington <gnormington@gopivotal.com> (github: glyn)
2014-06-12 14:21:20 +01:00
evanderkoogh
0bdadfe4e7 Linking containers added to API example
Linking containers was not covered in the API documentation. I looked it up in the client source code and testing it manually.
2014-06-12 17:15:14 +08:00
O.S. Tezer
dbee7dd69e Merge pull request #6372 from ostezer/docs-fix-logged-in-hdr
Docs: Fixed logged-in header username label target
2014-06-12 01:17:38 -07:00
Johan Euphrosine
338e87f6b3 api/server/MAINTAINERS: add proppy and vieux
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-06-12 00:54:35 -07:00
Tianon Gravi
3b9e8679db Merge pull request #6361 from asbjornenge/tmlang_copy
Add contribute/syntax highlight for the COPY instruction
2014-06-12 00:06:51 -07:00
Asbjørn Enge
cb47ddd968 Added highlight for the COPY instruction
Docker-DCO-1.1-Signed-off-by: Asbjorn Enge <asbjorn@hanafjedle.net> (github: asbjornenge)
2014-06-12 08:25:09 +02:00
O.S. Tezer
4ccd91f0d8 Docs: Fixed logged-in header username label target
Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
2014-06-11 18:09:43 -07:00
Michael Crosby
c99ee556d4 Merge pull request #6060 from dineshs-altiscale/maintainers
Add Dinesh Subhraveti to MAINTAINERS
2014-06-11 14:37:01 -07:00
Victor Vieux
6cb16f1c31 add tests
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-11 21:15:48 +00:00
Victor Vieux
f411f8bfc5 Allow --net=none & -h
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-11 21:07:50 +00:00
Johan Euphrosine
37115ffb00 MAINTAINERS: add proppy for google.md
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-06-11 13:55:47 -07:00
Victor Vieux
384b60b940 remove unused beam, will be back later as libchan
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-11 19:09:55 +00:00
Michael Crosby
9ac293e1a8 Merge pull request #6335 from levigross/master
Fixed up if statement
2014-06-11 11:51:57 -07:00
Michael Crosby
6c953a3059 Merge pull request #6357 from crosbymichael/vendor-libcontainer
Vendor libcontainer
2014-06-11 10:57:39 -07:00
unclejack
8f909221f5 Merge pull request #6277 from philips/remove-unneeded-time-duration
registry: remove unneeded time.Duration()
2014-06-11 20:33:22 +03:00
James Turnbull
96c03d6d92 Merge pull request #6351 from lenw/patch-1
minor spelling fix
2014-06-11 06:55:33 -07:00
James Turnbull
a092f979d4 Merge pull request #6349 from chrismckinnel/master
Fix some bullet points so they render correctly.
2014-06-11 06:54:44 -07:00
Alexandr Morozov
a1b7a35c90 Fix race in LogEvent
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-11 15:23:33 +04:00
Alexandr Morozov
fa7c8d523e Fix race in get/set HostConfig
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-11 15:23:33 +04:00
Alexandr Morozov
0b3fe55442 Fix race in contStore.List
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-11 15:23:33 +04:00
Len Weincier
db00e224c2 minor spelling fix 2014-06-11 13:16:53 +02:00
Alexandr Morozov
b1bae92534 Don't exit on eof in header reading in stdcopy
There was random lines drops in docker logs because of this
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-11 15:13:31 +04:00
chrismckinnel
a247af9c97 Fix some bullet points so they render correctly. 2014-06-11 11:44:30 +01:00
Michael Crosby
d1757c005f Use libcontainer version tag for vendor script
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-06-10 20:23:05 -07:00
Michael Crosby
8194556337 Update libcontainer imports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-06-10 19:58:15 -07:00
Michael Crosby
8a8b6d7964 Remove and vendor libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-06-10 19:49:57 -07:00
James Turnbull
4cf40c968f Merge pull request #6339 from ostezer/docs-fix-css-title-conflict
docs: Fix docs' styling conflict with common names
2014-06-10 13:40:22 -07:00
O.S. Tezer
cb40e3302e docs: Fix docs' styling conflict with common names
Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)

Closes issue #6329
2014-06-10 11:18:20 -07:00
James Turnbull
9a7bd6d95b Merge pull request #6322 from crucerucalin/master
Repaired broken links in docs/sources/faq.md
2014-06-10 08:46:42 -07:00
Sven Dowideit
9254a62cd6 Merge pull request #6315 from erikh/ubuntu-latest-install-docs
Improve documentation on Ubuntu for getting the latest release of docker.
2014-06-11 00:54:52 +10:00
Sven Dowideit
b83a171f9e Merge pull request #6300 from whatthejeff/patch-1
Avoid history expansion.
2014-06-11 00:49:29 +10:00
Tianon Gravi
5ff3a28cb4 Merge pull request #6252 from tianon/update-check-config
Update contrib/check-config.sh to check for CGROUP_FREEZER and to use /proc/mounts
2014-06-10 08:09:34 -06:00
Levi Gross
a7b60b21de Fixed up if statement
Signed-off-by: Levi Gross <levi@levigross.com>

Docker-DCO-1.1-Signed-off-by: Levi Gross <levi@levigross.com> (github: levigross)
2014-06-10 10:02:00 -04:00
Cruceru Calin-Cristian
53802d54d6 Repaired broken links
Docker-DCO-1.1-Signed-off-by: Calin Cruceru <crucerucalincristian@gmail.com> (github: crucerucalin)
2014-06-10 08:21:12 +03:00
Erik Hollensbe
7ab1a90e59 Improve documentation on Ubuntu for getting the latest release of
docker.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-06-09 18:31:46 -07:00
unclejack
fb2ac5bedb Merge pull request #6317 from crosbymichael/libcontainerdep
Move libcontainer deps into libcontainer
2014-06-10 03:16:15 +03:00
Michael Crosby
bae6a5a616 Gofmt imports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-06-09 16:01:57 -07:00
Michael Crosby
6158ccad97 Move libcontainer deps into libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-06-09 15:52:12 -07:00
Jeff Welch
052ad32a7b Avoid history expansion.
Docker-DCO-1.1-Signed-off-by: Jeff Welch <whatthejeff@gmail.com> (github: whatthejeff)
2014-06-09 17:30:34 -04:00
Alex Warhawk
cacb5c0dde restore logo for README.md
Docker-DCO-1.1-Signed-off-by: Alex Hirsch <ax.warhawk@gmail.com> (github: W4RH4WK)
2014-06-09 22:15:13 +02:00
Bryan Murphy
e827c8ff61 Add integration test for history command and fix bug where history
would occasionally be returned in the incorrect order if sequential
layers had the same created time.

Docker-DCO-1.1-Signed-off-by: Bryan Murphy <bmurphy1976@gmail.com> (github: bmurphy1976)
2014-06-09 10:45:54 -05:00
Michael Crosby
fd32fc8062 Merge pull request #6305 from crosbymichael/merge_release_v1.0.0
Merge release v1.0.0
2014-06-09 07:17:43 -07:00
Michael Crosby
faf5ef6f80 Change version to v1.0.0-dev
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-06-09 07:14:51 -07:00
Michael Crosby
07e9ac9ffe Merge branch 'release' into merge_release_v1.0.0
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-06-09 07:14:40 -07:00
Michael Crosby
d9939758e6 Merge pull request #6303 from crosbymichael/bump_v1.0.0
Bump version to v1.0.0
2014-06-09 07:12:42 -07:00
James Turnbull
5dc6339e33 Merge pull request #6302 from Costent/patch-1
Update windows.md
2014-06-09 06:14:16 -07:00
William Riancho
875d0b776d Update windows.md
Replace "OS X" by "Windows"
2014-06-09 11:23:54 +02:00
Sven Dowideit
e2fce7d612 Merge pull request #6299 from jamtur01/12link
Fixed API 1.12 links and misc other fixes
2014-06-08 18:06:27 -07:00
James Turnbull
135ced208c Merge pull request #6297 from jamtur01/hub
Updated Docker Hub documentation
2014-06-08 18:03:28 -07:00
James Turnbull
871299de0d Updated Docker Hub documentation
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-06-08 18:01:44 -07:00
James Turnbull
11fee48c2d Fixed API 1.12 links and misc other fixes
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-06-08 17:59:22 -07:00
James Turnbull
3b0ae3ec68 Merge pull request #6298 from fredlf/copyedits
Edits to Win and OSX install
2014-06-08 17:56:34 -07:00
Fred Lifton
9e2e8188ae Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredfl) 2014-06-08 17:36:49 -07:00
Fred Lifton
9bc75d008e Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredfl) 2014-06-08 17:35:49 -07:00
Sven Dowideit
a43cebf088 Merge pull request #6295 from ostezer/docs-ref-index-hub
Docs: Rename index with hub for ref. section
2014-06-08 16:47:48 -07:00
Sven Dowideit
83b446492c Merge pull request #6265 from fredlf/copyedits
Copyedits
2014-06-08 16:47:12 -07:00
Fred Lifton
4fd9cc9980 Copy edits to Understanding Docker
Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredfl)
2014-06-08 16:46:31 -07:00
O.S. Tezer
b0a46d1cb9 Docs: Rename index with hub for ref. section
Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
2014-06-08 16:34:47 -07:00
Brandon Philips
4a3b36f443 registry: remove unneeded time.Duration()
These constants don't need to use time.Duration(). Fixup this file since
it seems to be the only one using this style.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-06-08 11:04:06 -07:00
Johan Euphrosine
39320f9393 utils: add test for TimeoutConn
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-06-07 15:11:57 -07:00
Tianon Gravi
a59e1949b5 Update contrib/check-config.sh to check for CGROUP_FREEZER (which is newly required), and to use /proc/mounts for checking if we have a cgroup hierarchy instead of using /proc/$$/mountinfo (which on systemd might not list the cgroup hierarchy)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-06-07 08:43:40 -06:00
Paul Morie
92f46d233e Docs: add ApiVersion to /version for remote API 1.12
Docker-DCO-1.1-Signed-off-by: Paul Morie <pmorie@gmail.com> (github: pmorie)
2014-06-06 15:13:25 -04:00
Joe Beda
c11fadb282 Make debian init work when called quickly.
We use the start-stop-daemon pid creation mechanism in addition the intrinsic built into docker.  This means the pid file is guaranteed to be written out by the time the script exits.

See #6184.

Docker-DCO-1.1-Signed-off-by: Joe Beda <joe.github@bedafamily.com> (github: jbeda)
2014-06-03 16:57:32 -07:00
Sam Bailey
d9885abdc4 reuse the febootstrap-minimize from rinse
Docker-DCO-1.1-Signed-off-by: Sam Bailey <sam@thatsamguy.com> (github: thatsamguy)
2014-06-03 20:41:32 +10:00
Sam Bailey
05e9574cf3 add mkimage support for mageia using urpmi
Docker-DCO-1.1-Signed-off-by: Sam Bailey <sam@thatsamguy.com> (github: thatsamguy)
2014-05-31 21:37:56 +10:00
Dinesh Subhraveti
249524ec49 Add Dinesh Subhraveti to MAINTAINERS
Docker-DCO-1.1-Signed-off-by: Dinesh Subhraveti <dineshs@altiscale.com> (github: dineshs-altiscale)
2014-05-27 16:45:17 -04:00
Timothy
6854e2997e Add README.md file for the docker directory
See issue #5873

Docker-DCO-1.1-Signed-off-by: Timothy <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
2014-05-20 09:04:46 +00:00
Kato Kazuyoshi
3754fdd7ca Support FreeBSD on pkg/mount
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
2014-04-15 23:16:51 +09:00
Kato Kazuyoshi
ca7a0e6d6e FreeBSD's nullfs doesn't support file mount
FreeBSD doesn't have "bind" mount, but nullfs might be a similar feature.
However nullfs can mount only directories.

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
2014-04-15 05:40:23 +09:00
Kato Kazuyoshi
a7e181c857 Add a test for mount.GetMounts
Because mount.parseInfoFile is only available on Linux

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
2014-04-15 05:40:23 +09:00
469 changed files with 13000 additions and 9492 deletions

2
.dockerignore Normal file
View File

@@ -0,0 +1,2 @@
bundles
.gopath

1
.gitignore vendored
View File

@@ -26,3 +26,4 @@ Vagrantfile
docs/AWS_S3_BUCKET
docs/GIT_BRANCH
docs/VERSION
docs/GITCOMMIT

View File

@@ -1,5 +1,66 @@
# Changelog
## 1.1.2 (2014-07-23)
#### Runtime
+ Fix port allocation for existing containers
+ Fix containers restart on daemon restart
#### Packaging
+ Fix /etc/init.d/docker issue on Debian
## 1.1.1 (2014-07-09)
#### Builder
* Fix issue with ADD
## 1.1.0 (2014-07-03)
#### Notable features since 1.0.1
+ Add `.dockerignore` support
+ Pause containers during `docker commit`
+ Add `--tail` to `docker logs`
#### Builder
+ Allow a tar file as context for `docker build`
* Fix issue with white-spaces and multi-lines in `Dockerfiles`
#### Runtime
* Overall performance improvements
* Allow `/` as source of `docker run -v`
* Fix port allocation
* Fix bug in `docker save`
* Add links information to `docker inspect`
#### Client
* Improve command line parsing for `docker commit`
#### Remote API
* Improve status code for the `start` and `stop` endpoints
## 1.0.1 (2014-06-19)
#### Notable features since 1.0.0
* Enhance security for the LXC driver
#### Builder
* Fix `ONBUILD` instruction passed to grandchildren
#### Runtime
* Fix events subscription
* Fix /etc/hostname file with host networking
* Allow `-h` and `--net=none`
* Fix issue with hotplug devices in `--privileged`
#### Client
* Fix artifacts with events
* Fix a panic with empty flags
* Fix `docker cp` on Mac OS X
#### Miscellaneous
* Fix compilation on Mac OS X
* Fix several races
## 1.0.0 (2014-06-09)
#### Notable features since 0.12.0

View File

@@ -9,7 +9,7 @@ feels wrong or incomplete.
When reporting [issues](https://github.com/dotcloud/docker/issues)
on GitHub please include your host OS (Ubuntu 12.04, Fedora 19, etc),
the output of `uname -a` and the output of `docker version` along with
the output of `docker info`. Please include the steps required to reproduce
the output of `docker -D info`. Please include the steps required to reproduce
the problem if possible and applicable.
This information will help us review and fix your issue faster.
@@ -17,7 +17,7 @@ This information will help us review and fix your issue faster.
For instructions on setting up your development environment, please
see our dedicated [dev environment setup
docs](http://docs.docker.io/en/latest/contributing/devenvironment/).
docs](http://docs.docker.com/contributing/devenvironment/).
## Contribution guidelines
@@ -190,7 +190,7 @@ There are several exceptions to the signing requirement. Currently these are:
* Your patch fixes Markdown formatting or syntax errors in the
documentation contained in the `docs` directory.
If you have any questions, please refer to the FAQ in the [docs](http://docs.docker.io)
If you have any questions, please refer to the FAQ in the [docs](http://docs.docker.com)
### How can I become a maintainer?

View File

@@ -1,5 +1,4 @@
Solomon Hykes <solomon@docker.com> (@shykes)
Guillaume J. Charmes <guillaume@docker.com> (@creack)
Victor Vieux <vieux@docker.com> (@vieux)
Michael Crosby <michael@crosbymichael.com> (@crosbymichael)
.mailmap: Tianon Gravi <admwiggin@gmail.com> (@tianon)
@@ -7,3 +6,4 @@ Michael Crosby <michael@crosbymichael.com> (@crosbymichael)
AUTHORS: Tianon Gravi <admwiggin@gmail.com> (@tianon)
Dockerfile: Tianon Gravi <admwiggin@gmail.com> (@tianon)
Makefile: Tianon Gravi <admwiggin@gmail.com> (@tianon)
.dockerignore: Tianon Gravi <admwiggin@gmail.com> (@tianon)

View File

@@ -6,6 +6,7 @@ BINDDIR := bundles
DOCSPORT := 8000
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
DOCKER_IMAGE := docker$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_MOUNT := $(if $(BINDDIR),-v "$(CURDIR)/$(BINDDIR):/go/src/github.com/dotcloud/docker/$(BINDDIR)")
@@ -59,6 +60,7 @@ 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 build -t "$(DOCKER_DOCS_IMAGE)" docs
bundles:

View File

@@ -18,7 +18,13 @@ 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/theme/mkdocs/img/logo_compressed.png "Docker")
![Docker L](docs/theme/mkdocs/images/docker-logo-compressed.png "Docker")
## Security Disclosure
Security is very important to us. If you have any issue regarding security,
please disclose the information responsibly by sending an email to
security@docker.com and not by creating a github issue.
## Better than VMs
@@ -142,11 +148,10 @@ Docker can be installed on your local machine as well as servers - both
bare metal and virtualized. It is available as a binary on most modern
Linux systems, or as a VM on Windows, Mac and other systems.
We also offer an interactive tutorial for quickly learning the basics of
using Docker.
We also offer an [interactive tutorial](http://www.docker.com/tryit/)
for quickly learning the basics of using Docker.
For up-to-date install instructions and online tutorials, see the
[Getting Started page](http://www.docker.io/gettingstarted/).
For up-to-date install instructions, see the [Docs](http://docs.docker.com).
Usage examples
==============
@@ -155,7 +160,7 @@ Docker can be used to run short-lived commands, long-running daemons
(app servers, databases etc.), interactive shell sessions, etc.
You can find a [list of real-world
examples](http://docs.docker.io/en/latest/examples/) in the
examples](http://docs.docker.com/examples/) in the
documentation.
Under the hood

View File

@@ -1 +1 @@
1.0.0
1.1.2

View File

@@ -13,6 +13,7 @@ import (
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"strconv"
"strings"
@@ -36,6 +37,10 @@ import (
"github.com/dotcloud/docker/utils/filters"
)
const (
tarHeaderSize = 512
)
func (cli *DockerCli) CmdHelp(args ...string) error {
if len(args) > 0 {
method, exists := cli.getMethod(args[0])
@@ -51,7 +56,7 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
{"attach", "Attach to a running container"},
{"build", "Build an image from a Dockerfile"},
{"commit", "Create a new image from a container's changes"},
{"cp", "Copy files/folders from the containers filesystem to the host path"},
{"cp", "Copy files/folders from a container's filesystem to the host path"},
{"diff", "Inspect changes on a container's filesystem"},
{"events", "Get real time events from the server"},
{"export", "Stream the contents of a container as a tar archive"},
@@ -62,25 +67,25 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
{"inspect", "Return low-level information on a container"},
{"kill", "Kill a running container"},
{"load", "Load an image from a tar archive"},
{"login", "Register or Login to the docker registry server"},
{"login", "Register or log in to the Docker registry server"},
{"logs", "Fetch the logs of a container"},
{"port", "Lookup the public-facing port which is NAT-ed to PRIVATE_PORT"},
{"port", "Lookup the public-facing port that is NAT-ed to PRIVATE_PORT"},
{"pause", "Pause all processes within a container"},
{"ps", "List containers"},
{"pull", "Pull an image or a repository from the docker registry server"},
{"push", "Push an image or a repository to the docker registry server"},
{"pull", "Pull an image or a repository from a Docker registry server"},
{"push", "Push an image or a repository to a Docker registry server"},
{"restart", "Restart a running container"},
{"rm", "Remove one or more containers"},
{"rmi", "Remove one or more images"},
{"run", "Run a command in a new container"},
{"save", "Save an image to a tar archive"},
{"search", "Search for an image in the docker index"},
{"search", "Search for an image on the Docker Hub"},
{"start", "Start a stopped container"},
{"stop", "Stop a running container"},
{"tag", "Tag an image into a repository"},
{"top", "Lookup the running processes of a container"},
{"unpause", "Unpause a paused container"},
{"version", "Show the docker version information"},
{"version", "Show the Docker version information"},
{"wait", "Block until a container stops, then print its exit code"},
} {
help += fmt.Sprintf(" %-10.10s%s\n", command[0], command[1])
@@ -89,25 +94,6 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
return nil
}
// FIXME: 'insert' is deprecated.
func (cli *DockerCli) CmdInsert(args ...string) error {
fmt.Fprintf(os.Stderr, "Warning: '%s' is deprecated and will be removed in a future version. Please use 'docker build' and 'ADD' instead.\n")
cmd := cli.Subcmd("insert", "IMAGE URL PATH", "Insert a file from URL in the IMAGE at PATH")
if err := cmd.Parse(args); err != nil {
return nil
}
if cmd.NArg() != 3 {
cmd.Usage()
return nil
}
v := url.Values{}
v.Set("url", cmd.Arg(1))
v.Set("path", cmd.Arg(2))
return cli.stream("POST", "/images/"+cmd.Arg(0)+"/insert?"+v.Encode(), nil, cli.out, nil)
}
func (cli *DockerCli) CmdBuild(args ...string) error {
cmd := cli.Subcmd("build", "[OPTIONS] PATH | URL | -", "Build a new image from the source code at PATH")
tag := cmd.String([]string{"t", "-tag"}, "", "Repository name (and optionally a tag) to be applied to the resulting image in case of success")
@@ -132,13 +118,22 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
_, err = exec.LookPath("git")
hasGit := err == nil
if cmd.Arg(0) == "-" {
// As a special case, 'docker build -' will build from an empty context with the
// contents of stdin as a Dockerfile
dockerfile, err := ioutil.ReadAll(cli.in)
if err != nil {
return err
// 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)
}
context, err = archive.Generate("Dockerfile", string(dockerfile))
} else {
context = ioutil.NopCloser(buf)
}
context, err = archive.Generate("Dockerfile", string(dockerfile))
} else if utils.IsURL(cmd.Arg(0)) && (!utils.IsGIT(cmd.Arg(0)) || !hasGit) {
isRemote = true
} else {
@@ -169,7 +164,25 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
if err = utils.ValidateContextDirectory(root); err != nil {
return fmt.Errorf("Error checking context is accessible: '%s'. Please check permissions and try again.", err)
}
context, err = archive.Tar(root, archive.Uncompressed)
options := &archive.TarOptions{
Compression: archive.Uncompressed,
}
if ignore, err := ioutil.ReadFile(path.Join(root, ".dockerignore")); err != nil && !os.IsNotExist(err) {
return fmt.Errorf("Error reading .dockerignore: '%s'", err)
} else if err == nil {
for _, pattern := range strings.Split(string(ignore), "\n") {
ok, err := filepath.Match(pattern, "Dockerfile")
if err != nil {
utils.Errorf("Bad .dockerignore pattern: '%s', error: %s", pattern, err)
continue
}
if ok {
return fmt.Errorf("Dockerfile was excluded by .dockerignore pattern '%s'", pattern)
}
options.Excludes = append(options.Excludes, pattern)
}
}
context, err = archive.TarWithOptions(root, options)
}
var body io.Reader
// Setup an upload progress bar
@@ -235,7 +248,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
// 'docker login': login / register a user to registry service.
func (cli *DockerCli) CmdLogin(args ...string) error {
cmd := cli.Subcmd("login", "[OPTIONS] [SERVER]", "Register or Login to a docker registry server, if no server is specified \""+registry.IndexServerAddress()+"\" is the default.")
cmd := cli.Subcmd("login", "[OPTIONS] [SERVER]", "Register or log in to a Docker registry server, if no server is specified \""+registry.IndexServerAddress()+"\" is the default.")
var username, password, email string
@@ -361,7 +374,7 @@ func (cli *DockerCli) CmdWait(args ...string) error {
// 'docker version': show version information
func (cli *DockerCli) CmdVersion(args ...string) error {
cmd := cli.Subcmd("version", "", "Show the docker version information.")
cmd := cli.Subcmd("version", "", "Show the Docker version information.")
if err := cmd.Parse(args); err != nil {
return nil
}
@@ -458,6 +471,9 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
if initPath := remoteInfo.Get("InitPath"); initPath != "" {
fmt.Fprintf(cli.out, "Init Path: %s\n", initPath)
}
if len(remoteInfo.GetList("Sockets")) != 0 {
fmt.Fprintf(cli.out, "Sockets: %v\n", remoteInfo.GetList("Sockets"))
}
}
if len(remoteInfo.GetList("IndexServerAddress")) != 0 {
@@ -481,8 +497,8 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
}
func (cli *DockerCli) CmdStop(args ...string) error {
cmd := cli.Subcmd("stop", "[OPTIONS] CONTAINER [CONTAINER...]", "Stop a running container (Send SIGTERM, and then SIGKILL after grace period)")
nSeconds := cmd.Int([]string{"t", "-time"}, 10, "Number of seconds to wait for the container to stop before killing it.")
cmd := cli.Subcmd("stop", "[OPTIONS] CONTAINER [CONTAINER...]", "Stop a running container by sending SIGTERM and then SIGKILL after a grace period")
nSeconds := cmd.Int([]string{"t", "-time"}, 10, "Number of seconds to wait for the container to stop before killing it. Default is 10 seconds.")
if err := cmd.Parse(args); err != nil {
return nil
}
@@ -509,7 +525,7 @@ func (cli *DockerCli) CmdStop(args ...string) error {
func (cli *DockerCli) CmdRestart(args ...string) error {
cmd := cli.Subcmd("restart", "[OPTIONS] CONTAINER [CONTAINER...]", "Restart a running container")
nSeconds := cmd.Int([]string{"t", "-time"}, 10, "Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default=10")
nSeconds := cmd.Int([]string{"t", "-time"}, 10, "Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default is 10 seconds.")
if err := cmd.Parse(args); err != nil {
return nil
}
@@ -566,8 +582,8 @@ func (cli *DockerCli) CmdStart(args ...string) error {
tty bool
cmd = cli.Subcmd("start", "CONTAINER [CONTAINER...]", "Restart a stopped container")
attach = cmd.Bool([]string{"a", "-attach"}, false, "Attach container's stdout/stderr and forward all signals to the process")
openStdin = cmd.Bool([]string{"i", "-interactive"}, false, "Attach container's stdin")
attach = cmd.Bool([]string{"a", "-attach"}, false, "Attach container's STDOUT and STDERR and forward all signals to the process")
openStdin = cmd.Bool([]string{"i", "-interactive"}, false, "Attach container's STDIN")
)
if err := cmd.Parse(args); err != nil {
@@ -698,7 +714,7 @@ func (cli *DockerCli) CmdPause(args ...string) error {
}
func (cli *DockerCli) CmdInspect(args ...string) error {
cmd := cli.Subcmd("inspect", "CONTAINER|IMAGE [CONTAINER|IMAGE...]", "Return low-level information on a container/image")
cmd := cli.Subcmd("inspect", "CONTAINER|IMAGE [CONTAINER|IMAGE...]", "Return low-level information on a container or image")
tmplStr := cmd.String([]string{"f", "#format", "-format"}, "", "Format the output using the given go template.")
if err := cmd.Parse(args); err != nil {
return nil
@@ -778,7 +794,7 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
}
func (cli *DockerCli) CmdTop(args ...string) error {
cmd := cli.Subcmd("top", "CONTAINER [ps OPTIONS]", "Lookup the running processes of a container")
cmd := cli.Subcmd("top", "CONTAINER [ps OPTIONS]", "Display the running processes of a container")
if err := cmd.Parse(args); err != nil {
return nil
}
@@ -813,7 +829,7 @@ func (cli *DockerCli) CmdTop(args ...string) error {
}
func (cli *DockerCli) CmdPort(args ...string) error {
cmd := cli.Subcmd("port", "CONTAINER PRIVATE_PORT", "Lookup the public-facing port which is NAT-ed to PRIVATE_PORT")
cmd := cli.Subcmd("port", "CONTAINER PRIVATE_PORT", "Lookup the public-facing port that is NAT-ed to PRIVATE_PORT")
if err := cmd.Parse(args); err != nil {
return nil
}
@@ -861,7 +877,7 @@ func (cli *DockerCli) CmdPort(args ...string) error {
func (cli *DockerCli) CmdRmi(args ...string) error {
var (
cmd = cli.Subcmd("rmi", "IMAGE [IMAGE...]", "Remove one or more images")
force = cmd.Bool([]string{"f", "-force"}, false, "Force")
force = cmd.Bool([]string{"f", "-force"}, false, "Force removal of the image")
noprune = cmd.Bool([]string{"-no-prune"}, false, "Do not delete untagged parents")
)
if err := cmd.Parse(args); err != nil {
@@ -964,7 +980,7 @@ func (cli *DockerCli) CmdHistory(args ...string) error {
func (cli *DockerCli) CmdRm(args ...string) error {
cmd := cli.Subcmd("rm", "[OPTIONS] CONTAINER [CONTAINER...]", "Remove one or more containers")
v := cmd.Bool([]string{"v", "-volumes"}, false, "Remove the volumes associated to the container")
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 and not the underlying container")
force := cmd.Bool([]string{"f", "-force"}, false, "Force removal of running container")
@@ -1001,7 +1017,7 @@ func (cli *DockerCli) CmdRm(args ...string) error {
// 'docker kill NAME' kills a running container
func (cli *DockerCli) CmdKill(args ...string) error {
cmd := cli.Subcmd("kill", "[OPTIONS] CONTAINER [CONTAINER...]", "Kill a running container (send SIGKILL, or specified signal)")
cmd := cli.Subcmd("kill", "[OPTIONS] CONTAINER [CONTAINER...]", "Kill a running container using SIGKILL or a specified signal")
signal := cmd.String([]string{"s", "-signal"}, "KILL", "Signal to send to the container")
if err := cmd.Parse(args); err != nil {
@@ -1133,7 +1149,7 @@ func (cli *DockerCli) CmdPush(args ...string) error {
func (cli *DockerCli) CmdPull(args ...string) error {
cmd := cli.Subcmd("pull", "NAME[:TAG]", "Pull an image or a repository from the registry")
tag := cmd.String([]string{"#t", "#-tag"}, "", "Download tagged image in repository")
tag := cmd.String([]string{"#t", "#-tag"}, "", "Download tagged image in a repository")
if err := cmd.Parse(args); err != nil {
return nil
}
@@ -1522,25 +1538,21 @@ func (cli *DockerCli) CmdPs(args ...string) error {
func (cli *DockerCli) CmdCommit(args ...string) error {
cmd := cli.Subcmd("commit", "[OPTIONS] CONTAINER [REPOSITORY[:TAG]]", "Create a new image from a container's changes")
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 (eg. \"John Hannibal Smith <hannibal@a-team.com>\"")
flAuthor := cmd.String([]string{"a", "#author", "-author"}, "", "Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")")
// FIXME: --run is deprecated, it will be replaced with inline Dockerfile commands.
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")
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")
if err := cmd.Parse(args); err != nil {
return nil
}
var name, repository, tag string
if cmd.NArg() == 3 {
fmt.Fprintf(cli.err, "[DEPRECATED] The format 'CONTAINER [REPOSITORY [TAG]]' as been deprecated. Please use CONTAINER [REPOSITORY[:TAG]]\n")
name, repository, tag = cmd.Arg(0), cmd.Arg(1), cmd.Arg(2)
} else {
name = cmd.Arg(0)
var (
name = cmd.Arg(0)
repository, tag = utils.ParseRepositoryTag(cmd.Arg(1))
}
)
if name == "" {
if name == "" || len(cmd.Args()) > 2 {
cmd.Usage()
return nil
}
@@ -1558,6 +1570,11 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
v.Set("tag", tag)
v.Set("comment", *flComment)
v.Set("author", *flAuthor)
if *flPause != true {
v.Set("pause", "0")
}
var (
config *runconfig.Config
env engine.Env
@@ -1676,6 +1693,7 @@ func (cli *DockerCli) CmdLogs(args ...string) error {
cmd = cli.Subcmd("logs", "CONTAINER", "Fetch the logs of a container")
follow = cmd.Bool([]string{"f", "-follow"}, false, "Follow log output")
times = cmd.Bool([]string{"t", "-timestamps"}, false, "Show timestamps")
tail = cmd.String([]string{"-tail"}, "all", "Output the specified number of lines at the end of logs (defaults to all logs)")
)
if err := cmd.Parse(args); err != nil {
@@ -1709,6 +1727,7 @@ func (cli *DockerCli) CmdLogs(args ...string) error {
if *follow {
v.Set("follow", "1")
}
v.Set("tail", *tail)
return cli.streamHelper("GET", "/containers/"+name+"/logs?"+v.Encode(), env.GetSubEnv("Config").GetBool("Tty"), nil, cli.out, cli.err, nil)
}
@@ -1716,8 +1735,8 @@ func (cli *DockerCli) CmdLogs(args ...string) error {
func (cli *DockerCli) CmdAttach(args ...string) error {
var (
cmd = cli.Subcmd("attach", "[OPTIONS] CONTAINER", "Attach to a running container")
noStdin = cmd.Bool([]string{"#nostdin", "-no-stdin"}, false, "Do not attach stdin")
proxy = cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxify all received signal to the process (even in non-tty mode)")
noStdin = cmd.Bool([]string{"#nostdin", "-no-stdin"}, false, "Do not attach STDIN")
proxy = cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxify all received signals to the process (even in non-TTY mode). SIGCHLD is not proxied.")
)
if err := cmd.Parse(args); err != nil {
@@ -1788,11 +1807,11 @@ func (cli *DockerCli) CmdAttach(args ...string) error {
}
func (cli *DockerCli) CmdSearch(args ...string) error {
cmd := cli.Subcmd("search", "TERM", "Search the docker index for images")
cmd := cli.Subcmd("search", "TERM", "Search the Docker Hub for images")
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")
stars := cmd.Int([]string{"s", "#stars", "-stars"}, 0, "Only displays with at least xxx stars")
stars := cmd.Int([]string{"s", "#stars", "-stars"}, 0, "Only displays with at least x stars")
if err := cmd.Parse(args); err != nil {
return nil
}
@@ -1848,21 +1867,15 @@ func (cli *DockerCli) CmdTag(args ...string) error {
if err := cmd.Parse(args); err != nil {
return nil
}
if cmd.NArg() != 2 && cmd.NArg() != 3 {
if cmd.NArg() != 2 {
cmd.Usage()
return nil
}
var repository, tag string
if cmd.NArg() == 3 {
fmt.Fprintf(cli.err, "[DEPRECATED] The format 'IMAGE [REPOSITORY [TAG]]' as been deprecated. Please use IMAGE [REGISTRYHOST/][USERNAME/]NAME[:TAG]]\n")
repository, tag = cmd.Arg(1), cmd.Arg(2)
} else {
var (
repository, tag = utils.ParseRepositoryTag(cmd.Arg(1))
}
v := url.Values{}
v = url.Values{}
)
//Check if the given image name can be resolved
if _, _, err := registry.ResolveRepositoryName(repository); err != nil {
@@ -1925,7 +1938,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
}
if cidFileInfo.Size() == 0 {
if err := os.Remove(hostConfig.ContainerIDFile); err != nil {
fmt.Printf("failed to remove CID file '%s': %s \n", hostConfig.ContainerIDFile, err)
fmt.Printf("failed to remove Container ID file '%s': %s \n", hostConfig.ContainerIDFile, err)
}
}
}()
@@ -2175,7 +2188,7 @@ func (cli *DockerCli) CmdCp(args ...string) error {
}
func (cli *DockerCli) CmdSave(args ...string) error {
cmd := cli.Subcmd("save", "IMAGE", "Save an image to a tar archive (streamed to stdout by default)")
cmd := cli.Subcmd("save", "IMAGE", "Save an image to a tar archive (streamed to STDOUT by default)")
outfile := cmd.String([]string{"o", "-output"}, "", "Write to an file, instead of STDOUT")
if err := cmd.Parse(args); err != nil {

View File

@@ -105,7 +105,7 @@ func (cli *DockerCli) call(method, path string, data interface{}, passAuthInfo b
if len(body) == 0 {
return nil, resp.StatusCode, fmt.Errorf("Error: request returned %s for API route and version %s, check if the server supports the requested API version", http.StatusText(resp.StatusCode), req.URL)
}
return nil, resp.StatusCode, fmt.Errorf("Error: %s", bytes.TrimSpace(body))
return nil, resp.StatusCode, fmt.Errorf("Error response from daemon: %s", bytes.TrimSpace(body))
}
return resp.Body, resp.StatusCode, nil
}

View File

@@ -11,7 +11,7 @@ import (
)
const (
APIVERSION version.Version = "1.12"
APIVERSION version.Version = "1.13"
DEFAULTHTTPHOST = "127.0.0.1"
DEFAULTUNIXSOCKET = "/var/run/docker.sock"
)

2
api/server/MAINTAINERS Normal file
View File

@@ -0,0 +1,2 @@
Victor Vieux <vieux@docker.com> (@vieux)
Johan Euphrosine <proppy@google.com> (@proppy)

View File

@@ -370,13 +370,24 @@ func getContainersLogs(eng *engine.Engine, version version.Version, w http.Respo
}
var (
job = eng.Job("container_inspect", vars["name"])
c, err = job.Stdout.AddEnv()
inspectJob = eng.Job("container_inspect", vars["name"])
logsJob = eng.Job("logs", vars["name"])
c, err = inspectJob.Stdout.AddEnv()
)
if err != nil {
return err
}
if err = job.Run(); err != nil {
logsJob.Setenv("follow", r.Form.Get("follow"))
logsJob.Setenv("tail", r.Form.Get("tail"))
logsJob.Setenv("stdout", r.Form.Get("stdout"))
logsJob.Setenv("stderr", r.Form.Get("stderr"))
logsJob.Setenv("timestamps", r.Form.Get("timestamps"))
// Validate args here, because we can't return not StatusOK after job.Run() call
stdout, stderr := logsJob.GetenvBool("stdout"), logsJob.GetenvBool("stderr")
if !(stdout || stderr) {
return fmt.Errorf("Bad parameters: you must choose at least one stream")
}
if err = inspectJob.Run(); err != nil {
return err
}
@@ -390,15 +401,10 @@ func getContainersLogs(eng *engine.Engine, version version.Version, w http.Respo
errStream = outStream
}
job = eng.Job("logs", vars["name"])
job.Setenv("follow", r.Form.Get("follow"))
job.Setenv("stdout", r.Form.Get("stdout"))
job.Setenv("stderr", r.Form.Get("stderr"))
job.Setenv("timestamps", r.Form.Get("timestamps"))
job.Stdout.Add(outStream)
job.Stderr.Set(errStream)
if err := job.Run(); err != nil {
fmt.Fprintf(outStream, "Error: %s\n", err)
logsJob.Stdout.Add(outStream)
logsJob.Stderr.Set(errStream)
if err := logsJob.Run(); err != nil {
fmt.Fprintf(outStream, "Error running logs job: %s\n", err)
}
return nil
}
@@ -434,6 +440,12 @@ func postCommit(eng *engine.Engine, version version.Version, w http.ResponseWrit
utils.Errorf("%s", err)
}
if r.FormValue("pause") == "" && version.GreaterThanOrEqualTo("1.13") {
job.Setenv("pause", "1")
} else {
job.Setenv("pause", r.FormValue("pause"))
}
job.Setenv("repo", r.Form.Get("repo"))
job.Setenv("tag", r.Form.Get("tag"))
job.Setenv("author", r.Form.Get("author"))
@@ -688,8 +700,11 @@ func postContainersStart(eng *engine.Engine, version version.Version, w http.Res
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
job := eng.Job("start", name)
var (
name = vars["name"]
job = eng.Job("start", name)
)
// allow a nil body for backwards compatibility
if r.Body != nil {
if api.MatchesContentType(r.Header.Get("Content-Type"), "application/json") {
@@ -699,6 +714,10 @@ func postContainersStart(eng *engine.Engine, version version.Version, w http.Res
}
}
if err := job.Run(); err != nil {
if err.Error() == "Container already started" {
w.WriteHeader(http.StatusNotModified)
return nil
}
return err
}
w.WriteHeader(http.StatusNoContent)
@@ -715,6 +734,10 @@ func postContainersStop(eng *engine.Engine, version version.Version, w http.Resp
job := eng.Job("stop", vars["name"])
job.Setenv("t", r.Form.Get("t"))
if err := job.Run(); err != nil {
if err.Error() == "Container already stopped" {
w.WriteHeader(http.StatusNotModified)
return nil
}
return err
}
w.WriteHeader(http.StatusNoContent)
@@ -811,7 +834,7 @@ func postContainersAttach(eng *engine.Engine, version version.Version, w http.Re
job.Stdout.Add(outStream)
job.Stderr.Set(errStream)
if err := job.Run(); err != nil {
fmt.Fprintf(outStream, "Error: %s\n", err)
fmt.Fprintf(outStream, "Error attaching: %s\n", err)
}
return nil
@@ -841,7 +864,7 @@ func wsContainersAttach(eng *engine.Engine, version version.Version, w http.Resp
job.Stdout.Add(ws)
job.Stderr.Set(ws)
if err := job.Run(); err != nil {
utils.Errorf("Error: %s", err)
utils.Errorf("Error attaching websocket: %s", err)
}
})
h.ServeHTTP(w, r)
@@ -855,7 +878,7 @@ func getContainersByName(eng *engine.Engine, version version.Version, w http.Res
}
var job = eng.Job("container_inspect", vars["name"])
if version.LessThan("1.12") {
job.SetenvBool("dirty", true)
job.SetenvBool("raw", true)
}
streamJSON(job, w, false)
return job.Run()
@@ -867,7 +890,7 @@ func getImagesByName(eng *engine.Engine, version version.Version, w http.Respons
}
var job = eng.Job("image_inspect", vars["name"])
if version.LessThan("1.12") {
job.SetenvBool("dirty", true)
job.SetenvBool("raw", true)
}
streamJSON(job, w, false)
return job.Run()
@@ -1022,7 +1045,7 @@ func makeHttpHandler(eng *engine.Engine, logging bool, localMethod string, local
}
if err := handlerFunc(eng, version, w, r, mux.Vars(r)); err != nil {
utils.Errorf("Error: %s", err)
utils.Errorf("Error making handler: %s", err)
httpError(w, err)
}
}

View File

@@ -4,12 +4,14 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/dotcloud/docker/api"
"github.com/dotcloud/docker/engine"
"io"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/dotcloud/docker/api"
"github.com/dotcloud/docker/engine"
)
func TestGetBoolParam(t *testing.T) {
@@ -114,6 +116,209 @@ func TestGetInfo(t *testing.T) {
}
}
func TestGetContainersByName(t *testing.T) {
eng := engine.New()
name := "container_name"
var called bool
eng.Register("container_inspect", func(job *engine.Job) engine.Status {
called = true
if job.Args[0] != name {
t.Fatalf("name != '%s': %#v", name, job.Args[0])
}
if api.APIVERSION.LessThan("1.12") && !job.GetenvBool("dirty") {
t.Fatal("dirty env variable not set")
} else if api.APIVERSION.GreaterThanOrEqualTo("1.12") && job.GetenvBool("dirty") {
t.Fatal("dirty env variable set when it shouldn't")
}
v := &engine.Env{}
v.SetBool("dirty", true)
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/containers/"+name+"/json", nil, eng, t)
if !called {
t.Fatal("handler was not called")
}
if r.HeaderMap.Get("Content-Type") != "application/json" {
t.Fatalf("%#v\n", r)
}
var stdoutJson interface{}
if err := json.Unmarshal(r.Body.Bytes(), &stdoutJson); err != nil {
t.Fatalf("%#v", err)
}
if stdoutJson.(map[string]interface{})["dirty"].(float64) != 1 {
t.Fatalf("%#v", stdoutJson)
}
}
func TestGetEvents(t *testing.T) {
eng := engine.New()
var called bool
eng.Register("events", func(job *engine.Job) engine.Status {
called = true
since := job.Getenv("since")
if since != "1" {
t.Fatalf("'since' should be 1, found %#v instead", since)
}
until := job.Getenv("until")
if until != "0" {
t.Fatalf("'until' should be 0, found %#v instead", until)
}
v := &engine.Env{}
v.Set("since", since)
v.Set("until", until)
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/events?since=1&until=0", nil, eng, t)
if !called {
t.Fatal("handler was not called")
}
if r.HeaderMap.Get("Content-Type") != "application/json" {
t.Fatalf("%#v\n", r)
}
var stdout_json struct {
Since int
Until int
}
if err := json.Unmarshal(r.Body.Bytes(), &stdout_json); err != nil {
t.Fatalf("%#v", err)
}
if stdout_json.Since != 1 {
t.Fatalf("since != 1: %#v", stdout_json.Since)
}
if stdout_json.Until != 0 {
t.Fatalf("until != 0: %#v", stdout_json.Until)
}
}
func TestLogs(t *testing.T) {
eng := engine.New()
var inspect bool
var logs bool
eng.Register("container_inspect", func(job *engine.Job) engine.Status {
inspect = true
if len(job.Args) == 0 {
t.Fatal("Job arguments is empty")
}
if job.Args[0] != "test" {
t.Fatalf("Container name %s, must be test", job.Args[0])
}
return engine.StatusOK
})
expected := "logs"
eng.Register("logs", func(job *engine.Job) engine.Status {
logs = true
if len(job.Args) == 0 {
t.Fatal("Job arguments is empty")
}
if job.Args[0] != "test" {
t.Fatalf("Container name %s, must be test", job.Args[0])
}
follow := job.Getenv("follow")
if follow != "1" {
t.Fatalf("follow: %s, must be 1", follow)
}
stdout := job.Getenv("stdout")
if stdout != "1" {
t.Fatalf("stdout %s, must be 1", stdout)
}
stderr := job.Getenv("stderr")
if stderr != "" {
t.Fatalf("stderr %s, must be empty", stderr)
}
timestamps := job.Getenv("timestamps")
if timestamps != "1" {
t.Fatalf("timestamps %s, must be 1", timestamps)
}
job.Stdout.Write([]byte(expected))
return engine.StatusOK
})
r := serveRequest("GET", "/containers/test/logs?follow=1&stdout=1&timestamps=1", nil, eng, t)
if r.Code != http.StatusOK {
t.Fatalf("Got status %d, expected %d", r.Code, http.StatusOK)
}
if !inspect {
t.Fatal("container_inspect job was not called")
}
if !logs {
t.Fatal("logs job was not called")
}
res := r.Body.String()
if res != expected {
t.Fatalf("Output %s, expected %s", res, expected)
}
}
func TestLogsNoStreams(t *testing.T) {
eng := engine.New()
var inspect bool
var logs bool
eng.Register("container_inspect", func(job *engine.Job) engine.Status {
inspect = true
if len(job.Args) == 0 {
t.Fatal("Job arguments is empty")
}
if job.Args[0] != "test" {
t.Fatalf("Container name %s, must be test", job.Args[0])
}
return engine.StatusOK
})
eng.Register("logs", func(job *engine.Job) engine.Status {
logs = true
return engine.StatusOK
})
r := serveRequest("GET", "/containers/test/logs", nil, eng, t)
if r.Code != http.StatusBadRequest {
t.Fatalf("Got status %d, expected %d", r.Code, http.StatusBadRequest)
}
if inspect {
t.Fatal("container_inspect job was called, but it shouldn't")
}
if logs {
t.Fatal("logs job was called, but it shouldn't")
}
res := strings.TrimSpace(r.Body.String())
expected := "Bad parameters: you must choose at least one stream"
if !strings.Contains(res, expected) {
t.Fatalf("Output %s, expected %s in it", res, expected)
}
}
func TestGetImagesHistory(t *testing.T) {
eng := engine.New()
imageName := "docker-test-image"
var called bool
eng.Register("history", func(job *engine.Job) engine.Status {
called = true
if len(job.Args) == 0 {
t.Fatal("Job arguments is empty")
}
if job.Args[0] != imageName {
t.Fatalf("name != '%s': %#v", imageName, job.Args[0])
}
v := &engine.Env{}
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/images/"+imageName+"/history", nil, eng, t)
if !called {
t.Fatalf("handler was not called")
}
if r.Code != http.StatusOK {
t.Fatalf("Got status %d, expected %d", r.Code, http.StatusOK)
}
if r.HeaderMap.Get("Content-Type") != "application/json" {
t.Fatalf("%#v\n", r)
}
}
func serveRequest(method, target string, body io.Reader, eng *engine.Engine, t *testing.T) *httptest.ResponseRecorder {
r := httptest.NewRecorder()
req, err := http.NewRequest(method, target, body)

View File

@@ -27,6 +27,7 @@ type (
Compression int
TarOptions struct {
Includes []string
Excludes []string
Compression Compression
NoLchown bool
}
@@ -43,6 +44,16 @@ const (
Xz
)
func IsArchive(header []byte) bool {
compression := DetectCompression(header)
if compression != Uncompressed {
return true
}
r := tar.NewReader(bytes.NewBuffer(header))
_, err := r.Next()
return err == nil
}
func DetectCompression(source []byte) Compression {
for compression, m := range map[Compression][]byte{
Bzip2: {0x42, 0x5A, 0x68},
@@ -262,11 +273,11 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, L
ts := []syscall.Timespec{timeToTimespec(hdr.AccessTime), timeToTimespec(hdr.ModTime)}
// syscall.UtimesNano doesn't support a NOFOLLOW flag atm, and
if hdr.Typeflag != tar.TypeSymlink {
if err := system.UtimesNano(path, ts); err != nil {
if err := system.UtimesNano(path, ts); err != nil && err != system.ErrNotSupportedPlatform {
return err
}
} else {
if err := system.LUtimesNano(path, ts); err != nil {
if err := system.LUtimesNano(path, ts); err != nil && err != system.ErrNotSupportedPlatform {
return err
}
}
@@ -276,7 +287,7 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, L
// Tar creates an archive from the directory at `path`, and returns it as a
// stream of bytes.
func Tar(path string, compression Compression) (io.ReadCloser, error) {
return TarFilter(path, &TarOptions{Compression: compression})
return TarWithOptions(path, &TarOptions{Compression: compression})
}
func escapeName(name string) string {
@@ -295,12 +306,9 @@ func escapeName(name string) string {
return string(escaped)
}
// TarFilter creates an archive from the directory at `srcPath` with `options`, and returns it as a
// stream of bytes.
//
// Files are included according to `options.Includes`, default to including all files.
// Stream is compressed according to `options.Compression', default to Uncompressed.
func TarFilter(srcPath string, options *TarOptions) (io.ReadCloser, error) {
// TarWithOptions creates an archive from the directory at `path`, only including files whose relative
// paths are included in `options.Includes` (if non-nil) or not in `options.Excludes`.
func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) {
pipeReader, pipeWriter := io.Pipe()
compressWriter, err := CompressStream(pipeWriter, options.Compression)
@@ -332,6 +340,21 @@ func TarFilter(srcPath string, options *TarOptions) (io.ReadCloser, error) {
return nil
}
for _, exclude := range options.Excludes {
matched, err := filepath.Match(exclude, relFilePath)
if err != nil {
utils.Errorf("Error matching: %s (pattern: %s)", relFilePath, exclude)
return err
}
if matched {
utils.Debugf("Skipping excluded path: %s", relFilePath)
if f.IsDir() {
return filepath.SkipDir
}
return nil
}
}
if err := addTarFile(filePath, relFilePath, tw); err != nil {
utils.Debugf("Can't add file %s to tar: %s\n", srcPath, err)
}
@@ -443,7 +466,7 @@ func Untar(archive io.Reader, dest string, options *TarOptions) error {
// TarUntar aborts and returns the error.
func TarUntar(src string, dst string) error {
utils.Debugf("TarUntar(%s %s)", src, dst)
archive, err := TarFilter(src, &TarOptions{Compression: Uncompressed})
archive, err := TarWithOptions(src, &TarOptions{Compression: Uncompressed})
if err != nil {
return err
}

View File

@@ -63,8 +63,8 @@ func TestCmdStreamGood(t *testing.T) {
}
}
func tarUntar(t *testing.T, origin string, compression Compression) error {
archive, err := Tar(origin, compression)
func tarUntar(t *testing.T, origin string, options *TarOptions) ([]Change, error) {
archive, err := TarWithOptions(origin, options)
if err != nil {
t.Fatal(err)
}
@@ -72,37 +72,29 @@ func tarUntar(t *testing.T, origin string, compression Compression) error {
buf := make([]byte, 10)
if _, err := archive.Read(buf); err != nil {
return err
return nil, err
}
wrap := io.MultiReader(bytes.NewReader(buf), archive)
detectedCompression := DetectCompression(buf)
compression := options.Compression
if detectedCompression.Extension() != compression.Extension() {
return fmt.Errorf("Wrong compression detected. Actual compression: %s, found %s", compression.Extension(), detectedCompression.Extension())
return nil, fmt.Errorf("Wrong compression detected. Actual compression: %s, found %s", compression.Extension(), detectedCompression.Extension())
}
tmp, err := ioutil.TempDir("", "docker-test-untar")
if err != nil {
return err
return nil, err
}
defer os.RemoveAll(tmp)
if err := Untar(wrap, tmp, nil); err != nil {
return err
return nil, err
}
if _, err := os.Stat(tmp); err != nil {
return err
return nil, err
}
changes, err := ChangesDirs(origin, tmp)
if err != nil {
return err
}
if len(changes) != 0 {
t.Fatalf("Unexpected differences after tarUntar: %v", changes)
}
return nil
return ChangesDirs(origin, tmp)
}
func TestTarUntar(t *testing.T) {
@@ -122,9 +114,49 @@ func TestTarUntar(t *testing.T) {
Uncompressed,
Gzip,
} {
if err := tarUntar(t, origin, c); err != nil {
changes, err := tarUntar(t, origin, &TarOptions{
Compression: c,
})
if err != nil {
t.Fatalf("Error tar/untar for compression %s: %s", c.Extension(), err)
}
if len(changes) != 0 {
t.Fatalf("Unexpected differences after tarUntar: %v", changes)
}
}
}
func TestTarWithOptions(t *testing.T) {
origin, err := ioutil.TempDir("", "docker-test-untar-origin")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(origin)
if err := ioutil.WriteFile(path.Join(origin, "1"), []byte("hello world"), 0700); err != nil {
t.Fatal(err)
}
if err := ioutil.WriteFile(path.Join(origin, "2"), []byte("welcome!"), 0700); err != nil {
t.Fatal(err)
}
cases := []struct {
opts *TarOptions
numChanges int
}{
{&TarOptions{Includes: []string{"1"}}, 1},
{&TarOptions{Excludes: []string{"2"}}, 1},
}
for _, testCase := range cases {
changes, err := tarUntar(t, origin, testCase.opts)
if err != nil {
t.Fatalf("Error tar/untar when testing inclusion/exclusion: %s", err)
}
if len(changes) != testCase.numChanges {
t.Errorf("Expected %d changes, got %d for %+v:",
testCase.numChanges, len(changes), testCase.opts)
}
}
}
@@ -164,6 +196,6 @@ func TestUntarUstarGnuConflict(t *testing.T) {
}
}
if !found {
t.Fatal("%s not found in the archive", "root/.cpanm/work/1395823785.24209/Plack-1.0030/blib/man3/Plack::Middleware::LighttpdScriptNameFix.3pm")
t.Fatalf("%s not found in the archive", "root/.cpanm/work/1395823785.24209/Plack-1.0030/blib/man3/Plack::Middleware::LighttpdScriptNameFix.3pm")
}
}

View File

@@ -100,7 +100,7 @@ echo
echo 'Generally Necessary:'
echo -n '- '
cgroupSubsystemDir="$(awk '/[, ](cpu|cpuacct|cpuset|devices|freezer|memory)([, ]|$)/ && $8 == "cgroup" { print $5 }' /proc/$$/mountinfo | head -n1)"
cgroupSubsystemDir="$(awk '/[, ](cpu|cpuacct|cpuset|devices|freezer|memory)[, ]/ && $3 == "cgroup" { print $2 }' /proc/mounts | head -n1)"
cgroupDir="$(dirname "$cgroupSubsystemDir")"
if [ -d "$cgroupDir/cpu" -o -d "$cgroupDir/cpuacct" -o -d "$cgroupDir/cpuset" -o -d "$cgroupDir/devices" -o -d "$cgroupDir/freezer" -o -d "$cgroupDir/memory" ]; then
echo "$(wrap_good 'cgroup hierarchy' 'properly mounted') [$cgroupDir]"
@@ -116,7 +116,7 @@ fi
flags=(
NAMESPACES {NET,PID,IPC,UTS}_NS
DEVPTS_MULTIPLE_INSTANCES
CGROUPS CGROUP_CPUACCT CGROUP_DEVICE CGROUP_SCHED
CGROUPS CGROUP_CPUACCT CGROUP_DEVICE CGROUP_FREEZER CGROUP_SCHED
MACVLAN VETH BRIDGE
NF_NAT_IPV4 IP_NF_TARGET_MASQUERADE
NETFILTER_XT_MATCH_{ADDRTYPE,CONNTRACK}

View File

@@ -309,14 +309,6 @@ _docker_info()
return
}
_docker_insert()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags_and_ids
fi
}
_docker_inspect()
{
case "$prev" in
@@ -393,7 +385,7 @@ _docker_ps()
{
case "$prev" in
--since|--before)
__docker_containers_all
__docker_containers_all
;;
-n)
return
@@ -438,9 +430,7 @@ _docker_push()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_image_repos
# TODO replace this with __docker_image_repos_and_tags
# see https://github.com/dotcloud/docker/issues/3411
__docker_image_repos_and_tags
fi
}
@@ -468,10 +458,21 @@ _docker_rm()
{
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-v --volumes -l --link" -- "$cur" ) )
COMPREPLY=( $( compgen -W "-f --force -l --link -v --volumes" -- "$cur" ) )
return
;;
*)
local force=
for arg in "${COMP_WORDS[@]}"; do
case "$arg" in
-f|--force)
__docker_containers_all
return
;;
esac
done
__docker_containers_stopped
return
;;
esac
}

View File

@@ -79,13 +79,13 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from build' -s t -l tag -d '
# commit
complete -c docker -f -n '__fish_docker_no_subcommand' -a commit -d "Create a new image from a container's changes"
complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s a -l author -d 'Author (eg. "John Hannibal Smith <hannibal@a-team.com>"'
complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s a -l author -d 'Author (e.g., "John Hannibal Smith <hannibal@a-team.com>"'
complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -s m -l message -d 'Commit message'
complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -l run -d 'Config automatically applied when the image is run. (ex: -run=\'{"Cmd": ["cat", "/world"], "PortSpecs": ["22"]}\')'
complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -a '(__fish_print_docker_containers all)' -d "Container"
# cp
complete -c docker -f -n '__fish_docker_no_subcommand' -a cp -d 'Copy files/folders from the containers filesystem to the host path'
complete -c docker -f -n '__fish_docker_no_subcommand' -a cp -d 'Copy files/folders from a container's filesystem to the host path'
# diff
complete -c docker -f -n '__fish_docker_no_subcommand' -a diff -d "Inspect changes on a container's filesystem"
@@ -120,10 +120,6 @@ complete -c docker -f -n '__fish_docker_no_subcommand' -a import -d 'Create a ne
# info
complete -c docker -f -n '__fish_docker_no_subcommand' -a info -d 'Display system-wide information'
# insert
complete -c docker -f -n '__fish_docker_no_subcommand' -a insert -d 'Insert a file in an image'
complete -c docker -A -f -n '__fish_seen_subcommand_from insert' -a '(__fish_print_docker_images)' -d "Image"
# inspect
complete -c docker -f -n '__fish_docker_no_subcommand' -a inspect -d 'Return low-level information on a container'
complete -c docker -A -f -n '__fish_seen_subcommand_from inspect' -s f -l format -d 'Format the output using the given go template.'

7
contrib/completion/zsh/_docker Executable file → Normal file
View File

@@ -1,6 +1,6 @@
#compdef docker
#
# zsh completion for docker (http://docker.io)
# zsh completion for docker (http://docker.com)
#
# version: 0.2.2
# author: Felix Riedel
@@ -139,11 +139,6 @@ __docker_subcommand () {
(history)
_arguments ':images:__docker_images'
;;
(insert)
_arguments '1:containers:__docker_containers' \
'2:URL:(http:// file://)' \
'3:file:_files'
;;
(kill)
_arguments '*:containers:__docker_runningcontainers'
;;

View File

@@ -11,6 +11,9 @@ DOCKER_OPTS=${DOCKER_OPTS:-}
start() {
checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
ulimit -n 1048576
ulimit -u 1048576
ebegin "Starting docker daemon"
start-stop-daemon --start --background \
--exec "$DOCKER_BINARY" \

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
Documentation=http://docs.docker.com
After=network.target
[Service]

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
Documentation=http://docs.docker.com
After=network.target
[Service]

View File

@@ -22,7 +22,10 @@ BASE=$(basename $0)
# modify these in /etc/default/$BASE (/etc/default/docker)
DOCKER=/usr/bin/$BASE
# This is the pid file managed by docker itself
DOCKER_PIDFILE=/var/run/$BASE.pid
# This is the pid file created/managed by start-stop-daemon
DOCKER_SSD_PIDFILE=/var/run/$BASE-ssd.pid
DOCKER_LOGFILE=/var/log/$BASE.log
DOCKER_OPTS=
DOCKER_DESC="Docker"
@@ -85,11 +88,19 @@ case "$1" in
touch "$DOCKER_LOGFILE"
chgrp docker "$DOCKER_LOGFILE"
ulimit -n 1048576
if [ "$BASH" ]; then
ulimit -u 1048576
else
ulimit -p 1048576
fi
log_begin_msg "Starting $DOCKER_DESC: $BASE"
start-stop-daemon --start --background \
--no-close \
--exec "$DOCKER" \
--pidfile "$DOCKER_PIDFILE" \
--pidfile "$DOCKER_SSD_PIDFILE" \
--make-pidfile \
-- \
-d -p "$DOCKER_PIDFILE" \
$DOCKER_OPTS \
@@ -100,13 +111,13 @@ case "$1" in
stop)
fail_unless_root
log_begin_msg "Stopping $DOCKER_DESC: $BASE"
start-stop-daemon --stop --pidfile "$DOCKER_PIDFILE"
start-stop-daemon --stop --pidfile "$DOCKER_SSD_PIDFILE"
log_end_msg $?
;;
restart)
fail_unless_root
docker_pid=`cat "$DOCKER_PIDFILE" 2>/dev/null`
docker_pid=`cat "$DOCKER_SSD_PIDFILE" 2>/dev/null`
[ -n "$docker_pid" ] \
&& ps -p $docker_pid > /dev/null 2>&1 \
&& $0 stop
@@ -119,7 +130,7 @@ case "$1" in
;;
status)
status_of_proc -p "$DOCKER_PIDFILE" "$DOCKER" docker
status_of_proc -p "$DOCKER_SSD_PIDFILE" "$DOCKER" docker
;;
*)

View File

@@ -2,10 +2,10 @@
#
# /etc/rc.d/init.d/docker
#
# Daemon for docker.io
# Daemon for docker.com
#
# chkconfig: 2345 95 95
# description: Daemon for docker.io
# description: Daemon for docker.com
### BEGIN INIT INFO
# Provides: docker
@@ -16,7 +16,7 @@
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop docker
# Description: Daemon for docker.io
# Description: Daemon for docker.com
### END INIT INFO
# Source function library.

View File

@@ -1,2 +0,0 @@
# these are generated by the md/md2man-all.sh script
man*

View File

@@ -1,21 +0,0 @@
% DOCKER(1) Docker User Manuals
% William Henry
% APRIL 2014
# NAME
docker-kill - Kill a running container (send SIGKILL, or specified signal)
# SYNOPSIS
**docker kill** **--signal**[=*"KILL"*] CONTAINER [CONTAINER...]
# DESCRIPTION
The main process inside each container specified will be sent SIGKILL,
or any signal specified with option --signal.
# OPTIONS
**-s**, **--signal**=*"KILL"*
Signal to send to the container
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

View File

@@ -1,15 +0,0 @@
% DOCKER(1) Docker User Manuals
% William Henry
% APRIL 2014
# NAME
docker-port - Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
# SYNOPSIS
**docker port** CONTAINER PRIVATE_PORT
# DESCRIPTION
Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

View File

@@ -1,21 +0,0 @@
% DOCKER(1) Docker User Manuals
% William Henry
% APRIL 2014
# NAME
docker-restart - Restart a running container
# SYNOPSIS
**docker restart** [**-t**|**--time**[=*10*]] CONTAINER [CONTAINER...]
# DESCRIPTION
Restart each container listed.
# OPTIONS
**-t**, **--time**=NUM
Number of seconds to try to stop for before killing the container. Once
killed it will then be restarted. Default=10
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

View File

@@ -1,29 +0,0 @@
% DOCKER(1) Docker User Manuals
% William Henry
% APRIL 2014
# NAME
docker-start - Restart a stopped container
# SYNOPSIS
**docker start** [**a**|**--attach**[=*false*]] [**-i**|**--interactive**
[=*true*] CONTAINER [CONTAINER...]
# DESCRIPTION
Start a stopped container.
# OPTION
**-a**, **--attach**=*true*|*false*
When true attach to container's stdout/stderr and forward all signals to
the process
**-i**, **--interactive**=*true*|*false*
When true attach to container's stdin
# NOTES
If run on a started container, start takes no action and succeeds
unconditionally.
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

View File

@@ -1,22 +0,0 @@
% DOCKER(1) Docker User Manuals
% William Henry
% APRIL 2014
# NAME
docker-stop - Stop a running container
grace period)
# SYNOPSIS
**docker stop** [**-t**|**--time**[=*10*]] CONTAINER [CONTAINER...]
# DESCRIPTION
Stop a running container (Send SIGTERM, and then SIGKILL after
grace period)
# OPTIONS
**-t**, **--time**=NUM
Wait NUM number of seconds for the container to stop before killing it.
The default is 10 seconds.
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
based on docker.io source material and internal work.

View File

@@ -1,56 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker-attach.1
.\"
.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker"
.SH NAME
docker-attach \- Attach to a running container
.SH SYNOPSIS
.B docker attach
\fB--no-stdin\fR[=\fIfalse\fR]
\fB--sig-proxy\fR[=\fItrue\fR]
container
.SH DESCRIPTION
If you \fBdocker run\fR a container in detached mode (\fB-d\fR), you can reattach to the detached container with \fBdocker attach\fR using the container's ID or name.
.sp
You can detach from the container again (and leave it running) with CTRL-c (for a quiet exit) or CTRL-\ to get a stacktrace of the Docker client when it quits. When you detach from the container the exit code will be returned to the client.
.SH "OPTIONS"
.TP
.B --no-stdin=\fItrue\fR|\fIfalse\fR:
When set to true, do not attach to stdin. The default is \fIfalse\fR.
.TP
.B --sig-proxy=\fItrue\fR|\fIfalse\fR:
When set to true, proxify all received signal to the process (even in non-tty mode). The default is \fItrue\fR.
.sp
.SH EXAMPLES
.sp
.PP
.B Attaching to a container
.TP
In this example the top command is run inside a container, from an image called fedora, in detached mode. The ID from the container is passed into the \fBdocker attach\fR command:
.sp
.nf
.RS
# ID=$(sudo docker run -d fedora /usr/bin/top -b)
# sudo docker attach $ID
top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 373572k total, 355560k used, 18012k free, 27872k buffers
Swap: 786428k total, 0k used, 786428k free, 221740k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top
top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 373572k total, 355244k used, 18328k free, 27872k buffers
Swap: 786428k total, 0k used, 786428k free, 221776k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top
.RE
.fi
.sp
.SH HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,65 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker-build.1
.\"
.TH "DOCKER" "1" "MARCH 2014" "0.1" "Docker"
.SH NAME
docker-build \- Build an image from a Dockerfile source at PATH
.SH SYNOPSIS
.B docker build
[\fB--no-cache\fR[=\fIfalse\fR]
[\fB-q\fR|\fB--quiet\fR[=\fIfalse\fR]
[\fB--rm\fR[=\fitrue\fR]]
[\fB-t\fR|\fB--tag\fR=\fItag\fR]
PATH | URL | -
.SH DESCRIPTION
This will read the Dockerfile from the directory specified in \fBPATH\fR. It also sends any other files and directories found in the current directory to the Docker daemon. The contents of this directory would be used by ADD command found within the Dockerfile.
Warning, this will send a lot of data to the Docker daemon if the current directory contains a lot of data.
If the absolute path is provided instead of ., only the files and directories required by the ADD commands from the Dockerfile will be added to the context and transferred to the Docker daemon.
.sp
When a single Dockerfile is given as URL, then no context is set. When a Git repository is set as URL, the repository is used as context.
.SH "OPTIONS"
.TP
.B -q, --quiet=\fItrue\fR|\fIfalse\fR:
When set to true, suppress verbose build output. Default is \fIfalse\fR.
.TP
.B --rm=\fItrue\fr|\fIfalse\fR:
When true, remove intermediate containers that are created during the build process. The default is true.
.TP
.B -t, --tag=\fItag\fR:
Tag to be applied to the resulting image on successful completion of the build.
.TP
.B --no-cache=\fItrue\fR|\fIfalse\fR
When set to true, do not use a cache when building the image. The default is \fIfalse\fR.
.sp
.SH EXAMPLES
.sp
.sp
.B Building an image from current directory
.TP
USing a Dockerfile, Docker images are built using the build command:
.sp
.RS
docker build .
.RE
.sp
If, for some reasone, you do not what to remove the intermediate containers created during the build you must set--rm=false.
.sp
.RS
docker build --rm=false .
.sp
.RE
.sp
A good practice is to make a subdirectory with a related name and create the Dockerfile in that directory. E.g. a directory called mongo may contain a Dockerfile for a MongoDB image, or a directory called httpd may contain an Dockerfile for an Apache web server.
.sp
It is also good practice to add the files required for the image to the subdirectory. These files will be then specified with the `ADD` instruction in the Dockerfile. Note: if you include a tar file, which is good practice, then Docker will automatically extract the contents of the tar file specified in the `ADD` instruction into the specified target.
.sp
.B Building an image container using a URL
.TP
This will clone the Github repository and use it as context. The Dockerfile at the root of the repository is used as Dockerfile. This only works if the Github repository is a dedicated repository. Note that you can specify an arbitrary Git repository by using the git:// schema.
.sp
.RS
docker build github.com/scollier/Fedora-Dockerfiles/tree/master/apache
.RE
.sp
.SH HISTORY
March 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,84 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker-images.1
.\"
.TH "DOCKER" "1" "April 2014" "0.1" "Docker"
.SH NAME
docker-images \- List the images in the local repository
.SH SYNOPSIS
.B docker images
[\fB-a\fR|\fB--all\fR=\fIfalse\fR]
[\fB--no-trunc\fR[=\fIfalse\fR]
[\fB-q\fR|\fB--quiet\fR[=\fIfalse\fR]
[\fB-t\fR|\fB--tree\fR=\fIfalse\fR]
[\fB-v\fR|\fB--viz\fR=\fIfalse\fR]
[NAME]
.SH DESCRIPTION
This command lists the images stored in the local Docker repository.
.sp
By default, intermediate images, used during builds, are not listed. Some of the output, e.g. image ID, is truncated, for space reasons. However the truncated image ID, and often the first few characters, are enough to be used in other Docker commands that use the image ID. The output includes repository, tag, image ID, date created and the virtual size.
.sp
The title REPOSITORY for the first title may seem confusing. It is essentially the image name. However, because you can tag a specific image, and multiple tags (image instances) can be associated with a single name, the name is really a repository for all tagged images of the same name.
.SH "OPTIONS"
.TP
.B -a, --all=\fItrue\fR|\fIfalse\fR:
When set to true, also include all intermediate images in the list. The default is false.
.TP
.B --no-trunc=\fItrue\fR|\fIfalse\fR:
When set to true, list the full image ID and not the truncated ID. The default is false.
.TP
.B -q, --quiet=\fItrue\fR|\fIfalse\fR:
When set to true, list the complete image ID as part of the output. The default is false.
.TP
.B -t, --tree=\fItrue\fR|\fIfalse\fR:
When set to true, list the images in a tree dependency tree (hierarchy) format. The default is false.
.TP
.B -v, --viz=\fItrue\fR|\fIfalse\fR
When set to true, list the graph in graphviz format. The default is \fIfalse\fR.
.sp
.SH EXAMPLES
.sp
.B Listing the images
.TP
To list the images in a local repository (not the registry) run:
.sp
.RS
docker images
.RE
.sp
The list will contain the image repository name, a tag for the image, and an image ID, when it was created and its virtual size. Columns: REPOSITORY, TAG, IMAGE ID, CREATED, and VIRTUAL SIZE.
.sp
To get a verbose list of images which contains all the intermediate images used in builds use \fB-a\fR:
.sp
.RS
docker images -a
.RE
.sp
.B List images dependency tree hierarchy
.TP
To list the images in the local repository (not the registry) in a dependency tree format then use the \fB-t\fR|\fB--tree=true\fR option.
.sp
.RS
docker images -t
.RE
.sp
This displays a staggered hierarchy tree where the less indented image is the oldest with dependent image layers branching inward (to the right) on subsequent lines. The newest or top level image layer is listed last in any tree branch.
.sp
.B List images in GraphViz format
.TP
To display the list in a format consumable by a GraphViz tools run with \fB-v\fR|\fB--viz=true\fR. For example to produce a .png graph file of the hierarchy use:
.sp
.RS
docker images --viz | dot -Tpng -o docker.png
.sp
.RE
.sp
.B Listing only the shortened image IDs
.TP
Listing just the shortened image IDs. This can be useful for some automated tools.
.sp
.RS
docker images -q
.RE
.sp
.SH HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,39 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker-info.1
.\"
.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker"
.SH NAME
docker-info \- Display system wide information
.SH SYNOPSIS
.B docker info
.SH DESCRIPTION
This command displays system wide information regarding the Docker installation. Information displayed includes the number of containers and images, pool name, data file, metadata file, data space used, total data space, metadata space used, total metadata space, execution driver, and the kernel version.
.sp
The data file is where the images are stored and the metadata file is where the meta data regarding those images are stored. When run for the first time Docker allocates a certain amount of data space and meta data space from the space available on the volume where /var/lib/docker is mounted.
.SH "OPTIONS"
There are no available options.
.sp
.SH EXAMPLES
.sp
.B Display Docker system information
.TP
Here is a sample output:
.sp
.RS
# docker info
Containers: 18
Images: 95
Storage Driver: devicemapper
Pool Name: docker-8:1-170408448-pool
Data file: /var/lib/docker/devicemapper/devicemapper/data
Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
Data Space Used: 9946.3 Mb
Data Space Total: 102400.0 Mb
Metadata Space Used: 9.9 Mb
Metadata Space Total: 2048.0 Mb
Execution Driver: native-0.1
Kernel Version: 3.10.0-116.el7.x86_64
.RE
.sp
.SH HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,237 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker-inspect.1
.\"
.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker"
.SH NAME
docker-inspect \- Return low-level information on a container/image
.SH SYNOPSIS
.B docker inspect
[\fB-f\fR|\fB--format\fR=""
CONTAINER|IMAGE [CONTAINER|IMAGE...]
.SH DESCRIPTION
This displays all the information available in Docker for a given container or image. By default, this will render all results in a JSON array. If a format is specified, the given template will be executed for each result.
.SH "OPTIONS"
.TP
.B -f, --format="":
The text/template package of Go describes all the details of the format. See examples section
.SH EXAMPLES
.sp
.PP
.B Getting information on a container
.TP
To get information on a container use it's ID or instance name
.sp
.fi
.RS
#docker inspect 1eb5fabf5a03
[{
"ID": "1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b",
"Created": "2014-04-04T21:33:52.02361335Z",
"Path": "/usr/sbin/nginx",
"Args": [],
"Config": {
"Hostname": "1eb5fabf5a03",
"Domainname": "",
"User": "",
"Memory": 0,
"MemorySwap": 0,
"CpuShares": 0,
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": {
"80/tcp": {}
},
"Tty": true,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/usr/sbin/nginx"
],
"Dns": null,
"DnsSearch": null,
"Image": "summit/nginx",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": "",
"Entrypoint": null,
"NetworkDisabled": false,
"OnBuild": null,
"Context": {
"mount_label": "system_u:object_r:svirt_sandbox_file_t:s0:c0,c650",
"process_label": "system_u:system_r:svirt_lxc_net_t:s0:c0,c650"
}
},
"State": {
"Running": true,
"Pid": 858,
"ExitCode": 0,
"StartedAt": "2014-04-04T21:33:54.16259207Z",
"FinishedAt": "0001-01-01T00:00:00Z",
"Ghost": false
},
"Image": "df53773a4390e25936f9fd3739e0c0e60a62d024ea7b669282b27e65ae8458e6",
"NetworkSettings": {
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"Gateway": "172.17.42.1",
"Bridge": "docker0",
"PortMapping": null,
"Ports": {
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "80"
}
]
}
},
"ResolvConfPath": "/etc/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hostname",
"HostsPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/hosts",
"Name": "/ecstatic_ptolemy",
"Driver": "devicemapper",
"ExecDriver": "native-0.1",
"Volumes": {},
"VolumesRW": {},
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LxcConf": [],
"Privileged": false,
"PortBindings": {
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "80"
}
]
},
"Links": null,
"PublishAllPorts": false,
"DriverOptions": {
"lxc": null
},
"CliAddress": ""
}
.RE
.nf
.sp
.B Getting the IP address of a container instance
.TP
To get the IP address of a container use:
.sp
.fi
.RS
# docker inspect --format='{{.NetworkSettings.IPAddress}}' 1eb5fabf5a03
172.17.0.2
.RE
.nf
.sp
.B Listing all port bindings
.TP
One can loop over arrays and maps in the results to produce simple text output:
.sp
.fi
.RS
# docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' 1eb5fabf5a03
80/tcp -> 80
.RE
.nf
.sp
.B Getting information on an image
.TP
Use an image's ID or name (e.g. repository/name[:tag]) to get information on it.
.sp
.fi
.RS
docker inspect 58394af37342
[{
"id": "58394af373423902a1b97f209a31e3777932d9321ef10e64feaaa7b4df609cf9",
"parent": "8abc22fbb04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db",
"created": "2014-02-03T16:10:40.500814677Z",
"container": "f718f19a28a5147da49313c54620306243734bafa63c76942ef6f8c4b4113bc5",
"container_config": {
"Hostname": "88807319f25e",
"Domainname": "",
"User": "",
"Memory": 0,
"MemorySwap": 0,
"CpuShares": 0,
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": null,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) ADD fedora-20-medium.tar.xz in /"
],
"Dns": null,
"DnsSearch": null,
"Image": "8abc22fbb04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": "",
"Entrypoint": null,
"NetworkDisabled": false,
"OnBuild": null,
"Context": null
},
"docker_version": "0.6.3",
"author": "Lokesh Mandvekar \u003clsm5@redhat.com\u003e - ./buildcontainers.sh",
"config": {
"Hostname": "88807319f25e",
"Domainname": "",
"User": "",
"Memory": 0,
"MemorySwap": 0,
"CpuShares": 0,
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": null,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": null,
"Dns": null,
"DnsSearch": null,
"Image": "8abc22fbb04266308ff408ca61cb8f6f4244a59308f7efc64e54b08b496c58db",
"Volumes": null,
"VolumesFrom": "",
"WorkingDir": "",
"Entrypoint": null,
"NetworkDisabled": false,
"OnBuild": null,
"Context": null
},
"architecture": "x86_64",
"Size": 385520098
}]
.RE
.nf
.sp
.SH HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,45 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker-rm.1
.\"
.TH "DOCKER" "1" "MARCH 2014" "0.1" "Docker"
.SH NAME
docker-rm \- Remove one or more containers.
.SH SYNOPSIS
.B docker rm
[\fB-f\fR|\fB--force\fR[=\fIfalse\fR]
[\fB-l\fR|\fB--link\fR[=\fIfalse\fR]
[\fB-v\fR|\fB--volumes\fR[=\fIfalse\fR]
CONTAINER [CONTAINER...]
.SH DESCRIPTION
This will remove one or more containers from the host node. The container name or ID can be used. This does not remove images. You cannot remove a running container unless you use the \fB-f\fR option. To see all containers on a host use the \fBdocker ps -a\fR command.
.SH "OPTIONS"
.TP
.B -f, --force=\fItrue\fR|\fIfalse\fR:
When set to true, force the removal of the container. The default is \fIfalse\fR.
.TP
.B -l, --link=\fItrue\fR|\fIfalse\fR:
When set to true, remove the specified link and not the underlying container. The default is \fIfalse\fR.
.TP
.B -v, --volumes=\fItrue\fR|\fIfalse\fR:
When set to true, remove the volumes associated to the container. The default is \fIfalse\fR.
.SH EXAMPLES
.sp
.PP
.B Removing a container using its ID
.TP
To remove a container using its ID, find either from a \fBdocker ps -a\fR command, or use the ID returned from the \fBdocker run\fR command, or retrieve it from a file used to store it using the \fBdocker run --cidfile\fR:
.sp
.RS
docker rm abebf7571666
.RE
.sp
.B Removing a container using the container name:
.TP
The name of the container can be found using the \fBdocker ps -a\fR command. The use that name as follows:
.sp
.RS
docker rm hopeful_morse
.RE
.sp
.SH HISTORY
March 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,50 +0,0 @@
DOCKER "1" "APRIL 2014" "0.1" "Docker"
=======================================
NAME
----
docker-rm - Remove one or more containers.
SYNOPSIS
--------
`docker rm` [`-f`|`--force`[=*false*] [`-l`|`--link`[=*false*] [`-v`|`--volumes`[=*false*]
CONTAINER [CONTAINER...]
DESCRIPTION
-----------
`docker rm` will remove one or more containers from the host node. The container name or ID can be used. This does not remove images. You cannot remove a running container unless you use the \fB-f\fR option. To see all containers on a host use the `docker ps -a` command.
OPTIONS
-------
`-f`, `--force`=*true*|*false*:
When set to true, force the removal of the container. The default is *false*.
`-l`, `--link`=*true*|*false*:
When set to true, remove the specified link and not the underlying container. The default is *false*.
`-v`, `--volumes`=*true*|*false*:
When set to true, remove the volumes associated to the container. The default is *false*.
EXAMPLES
--------
##Removing a container using its ID##
To remove a container using its ID, find either from a `docker ps -a` command, or use the ID returned from the `docker run` command, or retrieve it from a file used to store it using the `docker run --cidfile`:
docker rm abebf7571666
##Removing a container using the container name##
The name of the container can be found using the \fBdocker ps -a\fR command. The use that name as follows:
docker rm hopeful_morse
HISTORY
-------
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,29 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker-run.1
.\"
.TH "DOCKER" "1" "MARCH 2014" "0.1" "Docker"
.SH NAME
docker-rmi \- Remove one or more images.
.SH SYNOPSIS
.B docker rmi
[\fB-f\fR|\fB--force\fR[=\fIfalse\fR]
IMAGE [IMAGE...]
.SH DESCRIPTION
This will remove one or more images from the host node. This does not remove images from a registry. You cannot remove an image of a running container unless you use the \fB-f\fR option. To see all images on a host use the \fBdocker images\fR command.
.SH "OPTIONS"
.TP
.B -f, --force=\fItrue\fR|\fIfalse\fR:
When set to true, force the removal of the image. The default is \fIfalse\fR.
.SH EXAMPLES
.sp
.PP
.B Removing an image
.TP
Here is an example of removing and image:
.sp
.RS
docker rmi fedora/httpd
.RE
.sp
.SH HISTORY
March 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,277 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker-run.1
.\"
.TH "DOCKER" "1" "MARCH 2014" "0.1" "Docker"
.SH NAME
docker-run \- Run a process in an isolated container
.SH SYNOPSIS
.B docker run
[\fB-a\fR|\fB--attach\fR[=]] [\fB-c\fR|\fB--cpu-shares\fR[=0] [\fB-m\fR|\fB--memory\fR=\fImemory-limit\fR]
[\fB--cidfile\fR=\fIfile\fR] [\fB-d\fR|\fB--detach\fR[=\fIfalse\fR]] [\fB--dns\fR=\fIIP-address\fR]
[\fB--name\fR=\fIname\fR] [\fB-u\fR|\fB--user\fR=\fIusername\fR|\fIuid\fR]
[\fB--link\fR=\fIname\fR:\fIalias\fR]
[\fB-e\fR|\fB--env\fR=\fIenvironment\fR] [\fB--entrypoint\fR=\fIcommand\fR]
[\fB--expose\fR=\fIport\fR] [\fB-P\fR|\fB--publish-all\fR[=\fIfalse\fR]]
[\fB-p\fR|\fB--publish\fR=\fIport-mappping\fR] [\fB-h\fR|\fB--hostname\fR=\fIhostname\fR]
[\fB--rm\fR[=\fIfalse\fR]] [\fB--priviledged\fR[=\fIfalse\fR]
[\fB-i\fR|\fB--interactive\fR[=\fIfalse\fR]
[\fB-t\fR|\fB--tty\fR[=\fIfalse\fR]] [\fB--lxc-conf\fR=\fIoptions\fR]
[\fB-n\fR|\fB--networking\fR[=\fItrue\fR]]
[\fB-v\fR|\fB--volume\fR=\fIvolume\fR] [\fB--volumes-from\fR=\fIcontainer-id\fR]
[\fB-w\fR|\fB--workdir\fR=\fIdirectory\fR] [\fB--sig-proxy\fR[=\fItrue\fR]]
IMAGE [COMMAND] [ARG...]
.SH DESCRIPTION
.PP
Run a process in a new container. \fBdocker run\fR starts a process with its own file system, its own networking, and its own isolated process tree. The \fIIMAGE\fR which starts the process may define defaults related to the process that will be run in the container, the networking to expose, and more, but \fBdocker run\fR gives final control to the operator or administrator who starts the container from the image. For that reason \fBdocker run\fR has more options than any other docker command.
If the \fIIMAGE\fR is not already loaded then \fBdocker run\fR will pull the \fIIMAGE\fR, and all image dependencies, from the repository in the same way running \fBdocker pull\fR \fIIMAGE\fR, before it starts the container from that image.
.SH "OPTIONS"
.TP
.B -a, --attach=\fIstdin\fR|\fIstdout\fR|\fIstderr\fR:
Attach to stdin, stdout or stderr. In foreground mode (the default when -d is not specified), \fBdocker run\fR can start the process in the container and attach the console to the processs standard input, output, and standard error. It can even pretend to be a TTY (this is what most commandline executables expect) and pass along signals. The \fB-a\fR option can be set for each of stdin, stdout, and stderr.
.TP
.B -c, --cpu-shares=0:
CPU shares in relative weight. You can increase the priority of a container with the -c option. By default, all containers run at the same priority and get the same proportion of CPU cycles, but you can tell the kernel to give more shares of CPU time to one or more containers when you start them via \fBdocker run\fR.
.TP
.B -m, --memory=\fImemory-limit\fR:
Allows you to constrain the memory available to a container. If the host supports swap memory, then the -m memory setting can be larger than physical RAM. If a limit of 0 is specified, the container's memory is not limited. The memory limit format: <number><optional unit>, where unit = b, k, m or g.
.TP
.B --cidfile=\fIfile\fR:
Write the container ID to the file specified.
.TP
.B -d, --detach=\fItrue\fR|\fIfalse\fR:
Detached mode. This runs the container in the background. It outputs the new container's id and and error messages. At any time you can run \fBdocker ps\fR in the other shell to view a list of the running containers. You can reattach to a detached container with \fBdocker attach\fR. If you choose to run a container in the detached mode, then you cannot use the -rm option.
.TP
.B --dns=\fIIP-address\fR:
Set custom DNS servers. This option can be used to override the DNS configuration passed to the container. Typically this is necessary when the host DNS configuration is invalid for the container (eg. 127.0.0.1). When this is the case the \fB-dns\fR flags is necessary for every run.
.TP
.B -e, --env=\fIenvironment\fR:
Set environment variables. This option allows you to specify arbitrary environment variables that are available for the process that will be launched inside of the container.
.TP
.B --entrypoint=\ficommand\fR:
This option allows you to overwrite the default entrypoint of the image that is set in the Dockerfile. The ENTRYPOINT of an image is similar to a COMMAND because it specifies what executable to run when the container starts, but it is (purposely) more difficult to override. The ENTRYPOINT gives a container its default nature or behavior, so that when you set an ENTRYPOINT you can run the container as if it were that binary, complete with default options, and you can pass in more options via the COMMAND. But, sometimes an operator may want to run something else inside the container, so you can override the default ENTRYPOINT at runtime by using a \fB--entrypoint\fR and a string to specify the new ENTRYPOINT.
.TP
.B --expose=\fIport\fR:
Expose a port from the container without publishing it to your host. A containers port can be exposed to other containers in three ways: 1) The developer can expose the port using the EXPOSE parameter of the Dockerfile, 2) the operator can use the \fB--expose\fR option with \fBdocker run\fR, or 3) the container can be started with the \fB--link\fR.
.TP
.B -P, --publish-all=\fItrue\fR|\fIfalse\fR:
When set to true publish all exposed ports to the host interfaces. The default is false. If the operator uses -P (or -p) then Docker will make the exposed port accessible on the host and the ports will be available to any client that can reach the host. To find the map between the host ports and the exposed ports, use \fBdocker port\fR.
.TP
.B -p, --publish=[]:
Publish a container's port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use 'docker port' to see the actual mapping)
.TP
.B -h , --hostname=\fIhostname\fR:
Sets the container host name that is available inside the container.
.TP
.B -i , --interactive=\fItrue\fR|\fIfalse\fR:
When set to true, keep stdin open even if not attached. The default is false.
.TP
.B --link=\fIname\fR:\fIalias\fR:
Add link to another container. The format is name:alias. If the operator uses \fB--link\fR when starting the new client container, then the client container can access the exposed port via a private networking interface. Docker will set some environment variables in the client container to help indicate which interface and port to use.
.TP
.B -n, --networking=\fItrue\fR|\fIfalse\fR:
By default, all containers have networking enabled (true) and can make outgoing connections. The operator can disable networking with \fB--networking\fR to false. This disables all incoming and outgoing networking. In cases like this, I/O can only be performed through files or by using STDIN/STDOUT.
Also by default, the container will use the same DNS servers as the host. but you canThe operator may override this with \fB-dns\fR.
.TP
.B --name=\fIname\fR:
Assign a name to the container. The operator can identify a container in three ways:
.sp
.nf
UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”)
UUID short identifier (“f78375b1c487”)
Name (“jonah”)
.fi
.sp
The UUID identifiers come from the Docker daemon, and if a name is not assigned to the container with \fB--name\fR then the daemon will also generate a random string name. The name is useful when defining links (see \fB--link\fR) (or any other place you need to identify a container). This works for both background and foreground Docker containers.
.TP
.B --privileged=\fItrue\fR|\fIfalse\fR:
Give extended privileges to this container. By default, Docker containers are “unprivileged” (=false) and cannot, for example, run a Docker daemon inside the Docker container. This is because by default a container is not allowed to access any devices. A “privileged” container is given access to all devices.
When the operator executes \fBdocker run -privileged\fR, Docker will enable access to all devices on the host as well as set some configuration in AppArmor (\fB???\fR) to allow the container nearly all the same access to the host as processes running outside of a container on the host.
.TP
.B --rm=\fItrue\fR|\fIfalse\fR:
If set to \fItrue\fR the container is automatically removed when it exits. The default is \fIfalse\fR. This option is incompatible with \fB-d\fR.
.TP
.B --sig-proxy=\fItrue\fR|\fIfalse\fR:
When set to true, proxify all received signals to the process (even in non-tty mode). The default is true.
.TP
.B -t, --tty=\fItrue\fR|\fIfalse\fR:
When set to true Docker can allocate a pseudo-tty and attach to the standard input of any container. This can be used, for example, to run a throwaway interactive shell. The default is value is false.
.TP
.B -u, --user=\fIusername\fR,\fRuid\fR:
Set a username or UID for the container.
.TP
.B -v, --volume=\fIvolume\fR:
Bind mount a volume to the container. The \fB-v\fR option can be used one or more times to add one or more mounts to a container. These mounts can then be used in other containers using the \fB--volumes-from\fR option. See examples.
.TP
.B --volumes-from=\fIcontainer-id\fR:
Will mount volumes from the specified container identified by container-id. Once a volume is mounted in a one container it can be shared with other containers using the \fB--volumes-from\fR option when running those other containers. The volumes can be shared even if the original container with the mount is not running.
.TP
.B -w, --workdir=\fIdirectory\fR:
Working directory inside the container. The default working directory for running binaries within a container is the root directory (/). The developer can set a different default with the Dockerfile WORKDIR instruction. The operator can override the working directory by using the \fB-w\fR option.
.TP
.B IMAGE:
The image name or ID.
.TP
.B COMMAND:
The command or program to run inside the image.
.TP
.B ARG:
The arguments for the command to be run in the container.
.SH EXAMPLES
.sp
.sp
.B Exposing log messages from the container to the host's log
.TP
If you want messages that are logged in your container to show up in the host's syslog/journal then you should bind mount the /var/log directory as follows.
.sp
.RS
docker run -v /dev/log:/dev/log -i -t fedora /bin/bash
.RE
.sp
From inside the container you can test this by sending a message to the log.
.sp
.RS
logger "Hello from my container"
.sp
.RE
Then exit and check the journal.
.RS
.sp
exit
.sp
journalctl -b | grep hello
.RE
.sp
This should list the message sent to logger.
.sp
.B Attaching to one or more from STDIN, STDOUT, STDERR
.TP
If you do not specify -a then Docker will attach everything (stdin,stdout,stderr). You can specify to which of the three standard streams (stdin, stdout, stderr) youd like to connect instead, as in:
.sp
.RS
docker run -a stdin -a stdout -i -t fedora /bin/bash
.RE
.sp
.B Linking Containers
.TP
The link feature allows multiple containers to communicate with each other. For example, a container whose Dockerfile has exposed port 80 can be run and named as follows:
.sp
.RS
docker run --name=link-test -d -i -t fedora/httpd
.RE
.sp
.TP
A second container, in this case called linker, can communicate with the httpd container, named link-test, by running with the \fB--link=<name>:<alias>\fR
.sp
.RS
docker run -t -i --link=link-test:lt --name=linker fedora /bin/bash
.RE
.sp
.TP
Now the container linker is linked to container link-test with the alias lt. Running the \fBenv\fR command in the linker container shows environment variables with the LT (alias) context (\fBLT_\fR)
.sp
.nf
.RS
# env
HOSTNAME=668231cb0978
TERM=xterm
LT_PORT_80_TCP=tcp://172.17.0.3:80
LT_PORT_80_TCP_PORT=80
LT_PORT_80_TCP_PROTO=tcp
LT_PORT=tcp://172.17.0.3:80
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
LT_NAME=/linker/lt
SHLVL=1
HOME=/
LT_PORT_80_TCP_ADDR=172.17.0.3
_=/usr/bin/env
.RE
.fi
.sp
.TP
When linking two containers Docker will use the exposed ports of the container to create a secure tunnel for the parent to access.
.TP
.sp
.B Mapping Ports for External Usage
.TP
The exposed port of an application can be mapped to a host port using the \fB-p\fR flag. For example a httpd port 80 can be mapped to the host port 8080 using the following:
.sp
.RS
docker run -p 8080:80 -d -i -t fedora/httpd
.RE
.sp
.TP
.B Creating and Mounting a Data Volume Container
.TP
Many applications require the sharing of persistent data across several containers. Docker allows you to create a Data Volume Container that other containers can mount from. For example, create a named container that contains directories /var/volume1 and /tmp/volume2. The image will need to contain these directories so a couple of RUN mkdir instructions might be required for you fedora-data image:
.sp
.RS
docker run --name=data -v /var/volume1 -v /tmp/volume2 -i -t fedora-data true
.sp
docker run --volumes-from=data --name=fedora-container1 -i -t fedora bash
.RE
.sp
.TP
Multiple --volumes-from parameters will bring together multiple data volumes from multiple containers. And it's possible to mount the volumes that came from the DATA container in yet another container via the fedora-container1 intermidiery container, allowing to abstract the actual data source from users of that data:
.sp
.RS
docker run --volumes-from=fedora-container1 --name=fedora-container2 -i -t fedora bash
.RE
.TP
.sp
.B Mounting External Volumes
.TP
To mount a host directory as a container volume, specify the absolute path to the directory and the absolute path for the container directory separated by a colon:
.sp
.RS
docker run -v /var/db:/data1 -i -t fedora bash
.RE
.sp
.TP
When using SELinux, be aware that the host has no knowledge of container SELinux policy. Therefore, in the above example, if SELinux policy is enforced, the /var/db directory is not writable to the container. A "Permission Denied" message will occur and an avc: message in the host's syslog.
.sp
.TP
To work around this, at time of writing this man page, the following command needs to be run in order for the proper SELinux policy type label to be attached to the host directory:
.sp
.RS
chcon -Rt svirt_sandbox_file_t /var/db
.RE
.sp
.TP
Now, writing to the /data1 volume in the container will be allowed and the changes will also be reflected on the host in /var/db.
.sp
.SH HISTORY
March 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,49 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker-tag.1
.\"
.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker"
.SH NAME
docker-tag \- Tag an image in the repository
.SH SYNOPSIS
.B docker tag
[\fB-f\fR|\fB--force\fR[=\fIfalse\fR]
\fBIMAGE\fR [REGISTRYHOST/][USERNAME/]NAME[:TAG]
.SH DESCRIPTION
This will tag an image in the repository.
.SH "OPTIONS"
.TP
.B -f, --force=\fItrue\fR|\fIfalse\fR:
When set to true, force the tag name. The default is \fIfalse\fR.
.TP
.B REGISTRYHOST:
The hostname of the registry if required. This may also include the port separated by a ':'
.TP
.B USERNAME:
The username or other qualifying identifier for the image.
.TP
.B NAME:
The image name.
.TP
.B TAG:
The tag you are assigning to the image.
.SH EXAMPLES
.sp
.PP
.B Tagging an image
.TP
Here is an example where an image is tagged with the tag 'Version-1.0' :
.sp
.RS
docker tag 0e5574283393 fedora/httpd:Version-1.0
.RE
.sp
.B Tagging an image for an internal repository
.TP
To push an image to an internal Registry and not the default docker.io based registry you must tag it with the registry hostname and port (if needed).
.sp
.RS
docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0
.RE
.sp
.SH HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -1,172 +0,0 @@
.\" Process this file with
.\" nroff -man -Tascii docker.1
.\"
.TH "DOCKER" "1" "APRIL 2014" "0.1" "Docker"
.SH NAME
docker \- Docker image and container command line interface
.SH SYNOPSIS
.B docker [OPTIONS] [COMMAND] [arg...]
.SH DESCRIPTION
\fBdocker\fR has two distinct functions. It is used for starting the Docker daemon and to run the CLI (i.e., to command the daemon to manage images, containers etc.) So \fBdocker\fR is both a server as deamon and a client to the daemon through the CLI.
.sp
To run the Docker deamon you do not specify any of the commands listed below but must specify the \fB-d\fR option. The other options listed below are for the daemon only.
.sp
The Docker CLI has over 30 commands. The commands are listed below and each has its own man page which explain usage and arguements.
.sp
To see the man page for a command run \fBman docker <command>\fR.
.SH "OPTIONS"
.B \-D=false:
Enable debug mode
.TP
.B\-H=[unix:///var/run/docker.sock]: tcp://[host[:port]] to bind or unix://[/path/to/socket] to use.
When host=[0.0.0.0], port=[2375] or path
=[/var/run/docker.sock] is omitted, default values are used.
.TP
.B \-\-api-enable-cors=false
Enable CORS headers in the remote API
.TP
.B \-b=""
Attach containers to a pre\-existing network bridge; use 'none' to disable container networking
.TP
.B \-\-bip=""
Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \-b
.TP
.B \-d=false
Enable daemon mode
.TP
.B \-\-dns=""
Force Docker to use specific DNS servers
.TP
.B \-g="/var/lib/docker"
Path to use as the root of the Docker runtime
.TP
.B \-\-icc=true
Enable inter\-container communication
.TP
.B \-\-ip="0.0.0.0"
Default IP address to use when binding container ports
.TP
.B \-\-iptables=true
Disable Docker's addition of iptables rules
.TP
.B \-\-mtu=1500
Set the containers network mtu
.TP
.B \-p="/var/run/docker.pid"
Path to use for daemon PID file
.TP
.B \-r=true
Restart previously running containers
.TP
.B \-s=""
Force the Docker runtime to use a specific storage driver
.TP
.B \-v=false
Print version information and quit
.SH "COMMANDS"
.TP
.B attach
Attach to a running container
.TP
.B build
Build an image from a Dockerfile
.TP
.B commit
Create a new image from a container's changes
.TP
.B cp
Copy files/folders from the containers filesystem to the host at path
.TP
.B diff
Inspect changes on a container's filesystem
.TP
.B events
Get real time events from the server
.TP
.B export
Stream the contents of a container as a tar archive
.TP
.B history
Show the history of an image
.TP
.B images
List images
.TP
.B import
Create a new filesystem image from the contents of a tarball
.TP
.B info
Display system-wide information
.TP
.B insert
Insert a file in an image
.TP
.B inspect
Return low-level information on a container
.TP
.B kill
Kill a running container (which includes the wrapper process and everything inside it)
.TP
.B load
Load an image from a tar archive
.TP
.B login
Register or Login to a Docker registry server
.TP
.B logs
Fetch the logs of a container
.TP
.B port
Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
.TP
.B ps
List containers
.TP
.B pull
Pull an image or a repository from a Docker registry server
.TP
.B push
Push an image or a repository to a Docker registry server
.TP
.B restart
Restart a running container
.TP
.B rm
Remove one or more containers
.TP
.B rmi
Remove one or more images
.TP
.B run
Run a command in a new container
.TP
.B save
Save an image to a tar archive
.TP
.B search
Search for an image in the Docker index
.TP
.B start
Start a stopped container
.TP
.B stop
Stop a running container
.TP
.B tag
Tag an image into a repository
.TP
.B top
Lookup the running processes of a container
.TP
.B version
Show the Docker version information
.TP
.B wait
Block until a container stops, then print its exit code
.SH EXAMPLES
.sp
For specific examples please see the man page for the specific Docker command.
.sp
.SH HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on dockier.io source material and internal work.

View File

@@ -13,8 +13,8 @@ usage() {
}
tmp() {
TMP=$(mktemp -d /tmp/alpine-docker-XXXXXXXXXX)
ROOTFS=$(mktemp -d /tmp/alpine-docker-rootfs-XXXXXXXXXX)
TMP=$(mktemp -d ${TMPDIR:-/var/tmp}/alpine-docker-XXXXXXXXXX)
ROOTFS=$(mktemp -d ${TMPDIR:-/var/tmp}/alpine-docker-rootfs-XXXXXXXXXX)
trap "rm -rf $TMP $ROOTFS" EXIT TERM INT
}

View File

@@ -9,31 +9,13 @@ hash pacstrap &>/dev/null || {
exit 1
}
hash expect &>/dev/null || {
echo "Could not find expect. Run pacman -S expect"
exit 1
}
ROOTFS=$(mktemp -d /tmp/rootfs-archlinux-XXXXXXXXXX)
ROOTFS=$(mktemp -d ${TMPDIR:-/var/tmp}/rootfs-archlinux-XXXXXXXXXX)
chmod 755 $ROOTFS
# packages to ignore for space savings
PKGIGNORE=linux,jfsutils,lvm2,cryptsetup,groff,man-db,man-pages,mdadm,pciutils,pcmciautils,reiserfsprogs,s-nail,xfsprogs
expect <<EOF
set timeout 60
set send_slow {1 1}
spawn pacstrap -C ./mkimage-arch-pacman.conf -c -d -G -i $ROOTFS base haveged --ignore $PKGIGNORE
expect {
"Install anyway?" { send n\r; exp_continue }
"(default=all)" { send \r; exp_continue }
"Proceed with installation?" { send "\r"; exp_continue }
"skip the above package" {send "y\r"; exp_continue }
"checking" { exp_continue }
"loading" { exp_continue }
"installing" { exp_continue }
}
EOF
pacstrap -C ./mkimage-arch-pacman.conf -c -d -G -i $ROOTFS base haveged --ignore $PKGIGNORE
arch-chroot $ROOTFS /bin/sh -c "haveged -w 1024; pacman-key --init; pkill haveged; pacman -Rs --noconfirm haveged; pacman-key --populate archlinux"
arch-chroot $ROOTFS /bin/sh -c "ln -s /usr/share/zoneinfo/UTC /etc/localtime"

View File

@@ -14,7 +14,7 @@ BUSYBOX=$(which busybox)
}
set -e
ROOTFS=/tmp/rootfs-busybox-$$-$RANDOM
ROOTFS=${TMPDIR:-/var/tmp}/rootfs-busybox-$$-$RANDOM
mkdir $ROOTFS
cd $ROOTFS

View File

@@ -14,9 +14,9 @@ die () {
ISO=${1}
ROOTFS=$(mktemp -d /tmp/rootfs-crux-XXXXXXXXXX)
CRUX=$(mktemp -d /tmp/crux-XXXXXXXXXX)
TMP=$(mktemp -d /tmp/XXXXXXXXXX)
ROOTFS=$(mktemp -d ${TMPDIR:-/var/tmp}/rootfs-crux-XXXXXXXXXX)
CRUX=$(mktemp -d ${TMPDIR:-/var/tmp}/crux-XXXXXXXXXX)
TMP=$(mktemp -d ${TMPDIR:-/var/tmp}/XXXXXXXXXX)
VERSION=$(basename --suffix=.iso $ISO | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')

View File

@@ -118,7 +118,7 @@ fi
# will be filled in later, if [ -z "$skipDetection" ]
lsbDist=''
target="/tmp/docker-rootfs-debootstrap-$suite-$$-$RANDOM"
target="${TMPDIR:-/var/tmp}/docker-rootfs-debootstrap-$suite-$$-$RANDOM"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
returnTo="$(pwd -P)"

View File

@@ -39,7 +39,7 @@ if [ ! "$repo" ] || [ ! "$distro" ]; then
exit 1
fi
target="/tmp/docker-rootfs-rinse-$distro-$$-$RANDOM"
target="${TMPDIR:-/var/tmp}/docker-rootfs-rinse-$distro-$$-$RANDOM"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
returnTo="$(pwd -P)"

View File

@@ -15,7 +15,7 @@ SOCAT=$(which socat)
shopt -s extglob
set -ex
ROOTFS=`mktemp -d /tmp/rootfs-busybox.XXXXXXXXXX`
ROOTFS=`mktemp -d ${TMPDIR:-/var/tmp}/rootfs-busybox.XXXXXXXXXX`
trap "rm -rf $ROOTFS" INT QUIT TERM
cd $ROOTFS

View File

@@ -6,9 +6,11 @@ mkimg="$(basename "$0")"
usage() {
echo >&2 "usage: $mkimg [-d dir] [-t tag] script [script-args]"
echo >&2 " ie: $mkimg -t someuser/debian debootstrap --variant=minbase jessie"
echo >&2 " $mkimg -t someuser/ubuntu debootstrap --include=ubuntu-minimal trusty"
echo >&2 " $mkimg -t someuser/ubuntu debootstrap --include=ubuntu-minimal --components main,universe trusty"
echo >&2 " $mkimg -t someuser/busybox busybox-static"
echo >&2 " $mkimg -t someuser/centos:5 rinse --distribution centos-5"
echo >&2 " $mkimg -t someuser/mageia:4 mageia-urpmi --version=4"
echo >&2 " $mkimg -t someuser/mageia:4 mageia-urpmi --version=4 --mirror=http://somemirror/"
exit 1
}
@@ -48,7 +50,7 @@ fi
delDir=
if [ -z "$dir" ]; then
dir="$(mktemp -d ${TMPDIR:-/tmp}/docker-mkimage.XXXXXXXXXX)"
dir="$(mktemp -d ${TMPDIR:-/var/tmp}/docker-mkimage.XXXXXXXXXX)"
delDir=1
fi

View File

@@ -13,7 +13,7 @@ shift
# docs
rm -rf usr/share/{man,doc,info,gnome/help}
# cracklib
#rm -rf usr/share/cracklib
rm -rf usr/share/cracklib
# i18n
rm -rf usr/share/i18n
# yum cache

View File

@@ -23,9 +23,14 @@ shift
# now for some Docker-specific tweaks
# prevent init scripts from running during install/update
echo >&2 "+ cat > '$rootfsDir/usr/sbin/policy-rc.d'"
echo >&2 "+ echo exit 101 > '$rootfsDir/usr/sbin/policy-rc.d'"
cat > "$rootfsDir/usr/sbin/policy-rc.d" <<'EOF'
#!/bin/sh
# For most Docker users, "apt-get install" only happens during "docker build",
# where starting services doesn't work and often fails in humorous ways. This
# prevents those failures by stopping the services from attempting to start.
exit 101
EOF
chmod +x "$rootfsDir/usr/sbin/policy-rc.d"
@@ -34,17 +39,25 @@ chmod +x "$rootfsDir/usr/sbin/policy-rc.d"
(
set -x
chroot "$rootfsDir" dpkg-divert --local --rename --add /sbin/initctl
ln -sf /bin/true "$rootfsDir/sbin/initctl"
cp -a "$rootfsDir/usr/sbin/policy-rc.d" "$rootfsDir/sbin/initctl"
sed -i 's/^exit.*/exit 0/' "$rootfsDir/sbin/initctl"
)
# shrink the image, since apt makes us fat (wheezy: ~157.5MB vs ~120MB)
# shrink a little, since apt makes us cache-fat (wheezy: ~157.5MB vs ~120MB)
( set -x; chroot "$rootfsDir" apt-get clean )
# Ubuntu 10.04 sucks... :)
if strings "$rootfsDir/usr/bin/dpkg" | grep -q unsafe-io; then
# force dpkg not to call sync() after package extraction (speeding up installs)
echo >&2 "+ echo force-unsafe-io > '$rootfsDir/etc/dpkg/dpkg.cfg.d/docker-apt-speedup'"
echo 'force-unsafe-io' > "$rootfsDir/etc/dpkg/dpkg.cfg.d/docker-apt-speedup"
cat > "$rootfsDir/etc/dpkg/dpkg.cfg.d/docker-apt-speedup" <<-'EOF'
# For most Docker users, package installs happen during "docker build", which
# doesn't survive power loss and gets restarted clean afterwards anyhow, so
# this minor tweak gives us a nice speedup (much nicer on spinning disks,
# obviously).
force-unsafe-io
EOF
fi
if [ -d "$rootfsDir/etc/apt/apt.conf.d" ]; then
@@ -52,16 +65,36 @@ if [ -d "$rootfsDir/etc/apt/apt.conf.d" ]; then
aptGetClean='"rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true";'
echo >&2 "+ cat > '$rootfsDir/etc/apt/apt.conf.d/docker-clean'"
cat > "$rootfsDir/etc/apt/apt.conf.d/docker-clean" <<-EOF
# Since for most Docker users, package installs happen in "docker build" steps,
# they essentially become individual layers due to the way Docker handles
# layering, especially using CoW filesystems. What this means for us is that
# the caches that APT keeps end up just wasting space in those layers, making
# our layers unnecessarily large (especially since we'll normally never use
# these caches again and will instead just "docker build" again and make a brand
# new image).
# Ideally, these would just be invoking "apt-get clean", but in our testing,
# that ended up being cyclic and we got stuck on APT's lock, so we get this fun
# creation that's essentially just "apt-get clean".
DPkg::Post-Invoke { ${aptGetClean} };
APT::Update::Post-Invoke { ${aptGetClean} };
Dir::Cache::pkgcache "";
Dir::Cache::srcpkgcache "";
# Note that we do realize this isn't the ideal way to do this, and are always
# open to better suggestions (https://github.com/dotcloud/docker/issues).
EOF
# remove apt-cache translations for fast "apt-get update"
echo >&2 "+ cat > '$rootfsDir/etc/apt/apt.conf.d/docker-no-languages'"
echo 'Acquire::Languages "none";' > "$rootfsDir/etc/apt/apt.conf.d/docker-no-languages"
echo >&2 "+ echo Acquire::Languages 'none' > '$rootfsDir/etc/apt/apt.conf.d/docker-no-languages'"
cat > "$rootfsDir/etc/apt/apt.conf.d/docker-no-languages" <<-'EOF'
# In Docker, we don't often need the "Translations" files, so we're just wasting
# time and space by downloading them, and this inhibits that. For users that do
# need them, it's a simple matter to delete this file and "apt-get update". :)
Acquire::Languages "none";
EOF
fi
if [ -z "$DONT_TOUCH_SOURCES_LIST" ]; then
@@ -76,39 +109,53 @@ if [ -z "$DONT_TOUCH_SOURCES_LIST" ]; then
if [ -z "$lsbDist" -a -r "$rootfsDir/etc/debian_version" ]; then
lsbDist='Debian'
fi
# normalize to lowercase for easier matching
lsbDist="$(echo "$lsbDist" | tr '[:upper:]' '[:lower:]')"
case "$lsbDist" in
debian|Debian)
debian)
# updates and security!
if [ "$suite" != 'sid' -a "$suite" != 'unstable' ]; then
(
set -x
sed -i "p; s/ $suite main$/ ${suite}-updates main/" "$rootfsDir/etc/apt/sources.list"
sed -i "
p;
s/ $suite / ${suite}-updates /
" "$rootfsDir/etc/apt/sources.list"
echo "deb http://security.debian.org $suite/updates main" >> "$rootfsDir/etc/apt/sources.list"
# LTS
if [ "$suite" = 'squeeze' ]; then
head -1 "$rootfsDir/etc/apt/sources.list" \
| sed "s/ $suite / ${suite}-lts /" \
>> "$rootfsDir/etc/apt/sources.list"
fi
)
fi
;;
ubuntu|Ubuntu)
# add the universe, updates, and security repositories
ubuntu)
# add the updates and security repositories
(
set -x
sed -i "
s/ $suite main$/ $suite main universe/; p;
s/ $suite main/ ${suite}-updates main/; p;
s/ $suite-updates main/ ${suite}-security main/
p;
s/ $suite / ${suite}-updates /; p;
s/ $suite-updates / ${suite}-security /
" "$rootfsDir/etc/apt/sources.list"
)
;;
tanglu|Tanglu)
tanglu)
# add the updates repository
if [ "$suite" != 'devel' ]; then
(
set -x
sed -i "p; s/ $suite main$/ ${suite}-updates main/" "$rootfsDir/etc/apt/sources.list"
sed -i "
p;
s/ $suite / ${suite}-updates /
" "$rootfsDir/etc/apt/sources.list"
)
fi
;;
steamos|SteamOS)
# add contrib and non-free
steamos)
# add contrib and non-free if "main" is the only component
(
set -x
sed -i "s/ $suite main$/ $suite main contrib non-free/" "$rootfsDir/etc/apt/sources.list"
@@ -117,9 +164,13 @@ if [ -z "$DONT_TOUCH_SOURCES_LIST" ]; then
esac
fi
# make sure we're fully up-to-date, too
(
set -x
chroot "$rootfsDir" apt-get update
chroot "$rootfsDir" apt-get dist-upgrade -y
# make sure we're fully up-to-date
chroot "$rootfsDir" bash -c 'apt-get update && apt-get dist-upgrade -y'
# delete all the apt list files since they're big and get stale quickly
rm -rf "$rootfsDir/var/lib/apt/lists"/*
# this forces "apt-get update" in dependent images, which is also good
)

61
contrib/mkimage/mageia-urpmi Executable file
View File

@@ -0,0 +1,61 @@
#!/usr/bin/env bash
#
# Needs to be run from Mageia 4 or greater for kernel support for docker.
#
# Mageia 4 does not have docker available in official repos, so please
# install and run the docker binary manually.
#
# Tested working versions are for Mageia 2 onwards (inc. cauldron).
#
set -e
rootfsDir="$1"
shift
optTemp=$(getopt --options '+v:,m:' --longoptions 'version:,mirror:' --name mageia-urpmi -- "$@")
eval set -- "$optTemp"
unset optTemp
installversion=
mirror=
while true; do
case "$1" in
-v|--version) installversion="$2" ; shift 2 ;;
-m|--mirror) mirror="$2" ; shift 2 ;;
--) shift ; break ;;
esac
done
if [ -z $installversion ]; then
# Attempt to match host version
if [ -r /etc/mageia-release ]; then
installversion="$(sed 's/^[^0-9\]*\([0-9.]\+\).*$/\1/' /etc/mageia-release)"
else
echo "Error: no version supplied and unable to detect host mageia version"
exit 1
fi
fi
if [ -z $mirror ]; then
# No mirror provided, default to mirrorlist
mirror="--mirrorlist https://mirrors.mageia.org/api/mageia.$installversion.x86_64.list"
fi
(
set -x
urpmi.addmedia --distrib \
$mirror \
--urpmi-root "$rootfsDir"
urpmi basesystem-minimal urpmi \
--auto \
--no-suggests \
--urpmi-root "$rootfsDir" \
--root "$rootfsDir"
)
"$(dirname "$BASH_SOURCE")/.febootstrap-minimize" "$rootfsDir"
if [ -d "$rootfsDir/etc/sysconfig" ]; then
# allow networking init scripts inside the container to work without extra steps
echo 'NETWORKING=yes' > "$rootfsDir/etc/sysconfig/network"
fi

View File

@@ -12,7 +12,7 @@
<array>
<dict>
<key>match</key>
<string>^\s*(ONBUILD\s+)?(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|VOLUME|USER|WORKDIR)\s</string>
<string>^\s*(ONBUILD\s+)?(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|VOLUME|USER|WORKDIR|COPY)\s</string>
<key>captures</key>
<dict>
<key>0</key>

View File

@@ -11,7 +11,7 @@ let b:current_syntax = "dockerfile"
syntax case ignore
syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|VOLUME|WORKDIR)\s/
syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|VOLUME|WORKDIR|COPY)\s/
highlight link dockerfileKeyword Keyword
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/

View File

@@ -15,6 +15,8 @@ import (
"syscall"
"time"
"github.com/docker/libcontainer/devices"
"github.com/docker/libcontainer/label"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/daemon/graphdriver"
@@ -22,8 +24,6 @@ import (
"github.com/dotcloud/docker/image"
"github.com/dotcloud/docker/links"
"github.com/dotcloud/docker/nat"
"github.com/dotcloud/docker/pkg/label"
"github.com/dotcloud/docker/pkg/libcontainer/devices"
"github.com/dotcloud/docker/pkg/networkfs/etchosts"
"github.com/dotcloud/docker/pkg/networkfs/resolvconf"
"github.com/dotcloud/docker/pkg/symlink"
@@ -53,7 +53,7 @@ type Container struct {
Args []string
Config *runconfig.Config
State State
State *State
Image string
NetworkSettings *NetworkSettings
@@ -74,8 +74,7 @@ type Container struct {
daemon *Daemon
MountLabel, ProcessLabel string
waitLock chan struct{}
Volumes map[string]string
Volumes map[string]string
// Store rw/ro in a separate structure to preserve reverse-compatibility on-disk.
// Easier than migrating older container configs :)
VolumesRW map[string]bool
@@ -85,7 +84,12 @@ type Container struct {
}
func (container *Container) FromDisk() error {
data, err := ioutil.ReadFile(container.jsonPath())
pth, err := container.jsonPath()
if err != nil {
return err
}
data, err := ioutil.ReadFile(pth)
if err != nil {
return err
}
@@ -101,15 +105,22 @@ func (container *Container) FromDisk() error {
return container.readHostConfig()
}
func (container *Container) ToDisk() (err error) {
func (container *Container) ToDisk() error {
data, err := json.Marshal(container)
if err != nil {
return
return err
}
err = ioutil.WriteFile(container.jsonPath(), data, 0666)
pth, err := container.jsonPath()
if err != nil {
return
return err
}
err = ioutil.WriteFile(pth, data, 0666)
if err != nil {
return err
}
return container.WriteHostConfig()
}
@@ -118,33 +129,45 @@ func (container *Container) readHostConfig() error {
// If the hostconfig file does not exist, do not read it.
// (We still have to initialize container.hostConfig,
// but that's OK, since we just did that above.)
_, err := os.Stat(container.hostConfigPath())
pth, err := container.hostConfigPath()
if err != nil {
return err
}
_, err = os.Stat(pth)
if os.IsNotExist(err) {
return nil
}
data, err := ioutil.ReadFile(container.hostConfigPath())
data, err := ioutil.ReadFile(pth)
if err != nil {
return err
}
return json.Unmarshal(data, container.hostConfig)
}
func (container *Container) WriteHostConfig() (err error) {
func (container *Container) WriteHostConfig() error {
data, err := json.Marshal(container.hostConfig)
if err != nil {
return
return err
}
return ioutil.WriteFile(container.hostConfigPath(), data, 0666)
pth, err := container.hostConfigPath()
if err != nil {
return err
}
return ioutil.WriteFile(pth, data, 0666)
}
func (container *Container) getResourcePath(path string) string {
func (container *Container) getResourcePath(path string) (string, error) {
cleanPath := filepath.Join("/", path)
return filepath.Join(container.basefs, cleanPath)
return symlink.FollowSymlinkInScope(filepath.Join(container.basefs, cleanPath), container.basefs)
}
func (container *Container) getRootResourcePath(path string) string {
func (container *Container) getRootResourcePath(path string) (string, error) {
cleanPath := filepath.Join("/", path)
return filepath.Join(container.root, cleanPath)
return symlink.FollowSymlinkInScope(filepath.Join(container.root, cleanPath), container.root)
}
func populateCommand(c *Container, env []string) error {
@@ -260,7 +283,6 @@ func (container *Container) Start() (err error) {
if err := container.startLoggingToDisk(); err != nil {
return err
}
container.waitLock = make(chan struct{})
return container.waitForStart()
}
@@ -269,7 +291,7 @@ func (container *Container) Run() error {
if err := container.Start(); err != nil {
return err
}
container.Wait()
container.State.WaitStop(-1 * time.Second)
return nil
}
@@ -283,7 +305,7 @@ func (container *Container) Output() (output []byte, err error) {
return nil, err
}
output, err = ioutil.ReadAll(pipe)
container.Wait()
container.State.WaitStop(-1 * time.Second)
return output, err
}
@@ -324,7 +346,12 @@ func (container *Container) StderrLogPipe() io.ReadCloser {
}
func (container *Container) buildHostnameFile() error {
container.HostnamePath = container.getRootResourcePath("hostname")
hostnamePath, err := container.getRootResourcePath("hostname")
if err != nil {
return err
}
container.HostnamePath = hostnamePath
if container.Config.Domainname != "" {
return ioutil.WriteFile(container.HostnamePath, []byte(fmt.Sprintf("%s.%s\n", container.Config.Hostname, container.Config.Domainname)), 0644)
}
@@ -336,7 +363,11 @@ func (container *Container) buildHostnameAndHostsFiles(IP string) error {
return err
}
container.HostsPath = container.getRootResourcePath("hosts")
hostsPath, err := container.getRootResourcePath("hosts")
if err != nil {
return err
}
container.HostsPath = hostsPath
extraContent := make(map[string]string)
@@ -391,8 +422,17 @@ func (container *Container) allocateNetwork() error {
if container.Config.ExposedPorts != nil {
portSpecs = container.Config.ExposedPorts
}
if container.hostConfig.PortBindings != nil {
bindings = container.hostConfig.PortBindings
for p, b := range container.hostConfig.PortBindings {
bindings[p] = []nat.PortBinding{}
for _, bb := range b {
bindings[p] = append(bindings[p], nat.PortBinding{
HostIp: bb.HostIp,
HostPort: bb.HostPort,
})
}
}
}
container.NetworkSettings.PortMapping = nil
@@ -434,6 +474,7 @@ func (container *Container) monitor(callback execdriver.StartCallback) error {
if err != nil {
utils.Errorf("Error running container: %s", err)
}
container.State.SetStopped(exitCode)
// Cleanup
container.cleanup()
@@ -442,28 +483,17 @@ func (container *Container) monitor(callback execdriver.StartCallback) error {
if container.Config.OpenStdin {
container.stdin, container.stdinPipe = io.Pipe()
}
if container.daemon != nil && container.daemon.srv != nil {
container.daemon.srv.LogEvent("die", container.ID, container.daemon.repositories.ImageName(container.Image))
}
close(container.waitLock)
if container.daemon != nil && container.daemon.srv != nil && container.daemon.srv.IsRunning() {
container.State.SetStopped(exitCode)
// FIXME: there is a race condition here which causes this to fail during the unit tests.
// If another goroutine was waiting for Wait() to return before removing the container's root
// from the filesystem... At this point it may already have done so.
// This is because State.setStopped() has already been called, and has caused Wait()
// to return.
// FIXME: why are we serializing running state to disk in the first place?
//log.Printf("%s: Failed to dump configuration to the disk: %s", container.ID, err)
// FIXME: here is race condition between two RUN instructions in Dockerfile
// because they share same runconfig and change image. Must be fixed
// in server/buildfile.go
if err := container.ToDisk(); err != nil {
utils.Errorf("Error dumping container state to disk: %s\n", err)
utils.Errorf("Error dumping container %s state to disk: %s\n", container.ID, err)
}
}
return err
}
@@ -499,6 +529,7 @@ func (container *Container) cleanup() {
}
func (container *Container) KillSig(sig int) error {
utils.Debugf("Sending %d to %s", sig, container.ID)
container.Lock()
defer container.Unlock()
@@ -544,9 +575,9 @@ func (container *Container) Kill() error {
}
// 2. Wait for the process to die, in last resort, try to kill the process directly
if err := container.WaitTimeout(10 * time.Second); err != nil {
if _, err := container.State.WaitStop(10 * time.Second); err != nil {
// Ensure that we don't kill ourselves
if pid := container.State.Pid; pid != 0 {
if pid := container.State.GetPid(); pid != 0 {
log.Printf("Container %s failed to exit within 10 seconds of kill - trying direct SIGKILL", utils.TruncateID(container.ID))
if err := syscall.Kill(pid, 9); err != nil {
return err
@@ -554,7 +585,7 @@ func (container *Container) Kill() error {
}
}
container.Wait()
container.State.WaitStop(-1 * time.Second)
return nil
}
@@ -572,11 +603,11 @@ func (container *Container) Stop(seconds int) error {
}
// 2. Wait for the process to exit on its own
if err := container.WaitTimeout(time.Duration(seconds) * time.Second); err != nil {
if _, err := container.State.WaitStop(time.Duration(seconds) * time.Second); err != nil {
log.Printf("Container %v failed to exit within %d seconds of SIGTERM - using the force", container.ID, seconds)
// 3. If it doesn't, then send SIGKILL
if err := container.Kill(); err != nil {
container.Wait()
container.State.WaitStop(-1 * time.Second)
return err
}
}
@@ -597,12 +628,6 @@ func (container *Container) Restart(seconds int) error {
return container.Start()
}
// Wait blocks until the container stops running, then returns its exit code.
func (container *Container) Wait() int {
<-container.waitLock
return container.State.GetExitCode()
}
func (container *Container) Resize(h, w int) error {
return container.command.Terminal.Resize(h, w)
}
@@ -645,21 +670,6 @@ func (container *Container) Export() (archive.Archive, error) {
nil
}
func (container *Container) WaitTimeout(timeout time.Duration) error {
done := make(chan bool, 1)
go func() {
container.Wait()
done <- true
}()
select {
case <-time.After(timeout):
return fmt.Errorf("Timed Out")
case <-done:
return nil
}
}
func (container *Container) Mount() error {
return container.daemon.Mount(container)
}
@@ -681,19 +691,23 @@ func (container *Container) Unmount() error {
return container.daemon.Unmount(container)
}
func (container *Container) logPath(name string) string {
func (container *Container) logPath(name string) (string, error) {
return container.getRootResourcePath(fmt.Sprintf("%s-%s.log", container.ID, name))
}
func (container *Container) ReadLog(name string) (io.Reader, error) {
return os.Open(container.logPath(name))
pth, err := container.logPath(name)
if err != nil {
return nil, err
}
return os.Open(pth)
}
func (container *Container) hostConfigPath() string {
func (container *Container) hostConfigPath() (string, error) {
return container.getRootResourcePath("hostconfig.json")
}
func (container *Container) jsonPath() string {
func (container *Container) jsonPath() (string, error) {
return container.getRootResourcePath("config.json")
}
@@ -756,8 +770,7 @@ func (container *Container) Copy(resource string) (io.ReadCloser, error) {
var filter []string
resPath := container.getResourcePath(resource)
basePath, err := symlink.FollowSymlinkInScope(resPath, container.basefs)
basePath, err := container.getResourcePath(resource)
if err != nil {
container.Unmount()
return nil, err
@@ -777,7 +790,7 @@ func (container *Container) Copy(resource string) (io.ReadCloser, error) {
basePath = path.Dir(basePath)
}
archive, err := archive.TarFilter(basePath, &archive.TarOptions{
archive, err := archive.TarWithOptions(basePath, &archive.TarOptions{
Compression: archive.Uncompressed,
Includes: filter,
})
@@ -808,11 +821,16 @@ func (container *Container) GetPtyMaster() (*os.File, error) {
}
func (container *Container) HostConfig() *runconfig.HostConfig {
return container.hostConfig
container.Lock()
res := container.hostConfig
container.Unlock()
return res
}
func (container *Container) SetHostConfig(hostConfig *runconfig.HostConfig) {
container.Lock()
container.hostConfig = hostConfig
container.Unlock()
}
func (container *Container) DisableLink(name string) {
@@ -861,7 +879,13 @@ func (container *Container) setupContainerDns() error {
} else if len(daemon.config.DnsSearch) > 0 {
dnsSearch = daemon.config.DnsSearch
}
container.ResolvConfPath = container.getRootResourcePath("resolv.conf")
resolvConfPath, err := container.getRootResourcePath("resolv.conf")
if err != nil {
return err
}
container.ResolvConfPath = resolvConfPath
return resolvconf.Build(container.ResolvConfPath, dns, dnsSearch)
} else {
container.ResolvConfPath = "/etc/resolv.conf"
@@ -886,12 +910,20 @@ func (container *Container) initializeNetworking() error {
content, err := ioutil.ReadFile("/etc/hosts")
if os.IsNotExist(err) {
return container.buildHostnameAndHostsFiles("")
}
if err != nil {
} else if err != nil {
return err
}
container.HostsPath = container.getRootResourcePath("hosts")
if err := container.buildHostnameFile(); err != nil {
return err
}
hostsPath, err := container.getRootResourcePath("hosts")
if err != nil {
return err
}
container.HostsPath = hostsPath
return ioutil.WriteFile(container.HostsPath, content, 0644)
} else if container.hostConfig.NetworkMode.IsContainer() {
// we need to get the hosts files from the container to join
@@ -1007,12 +1039,18 @@ func (container *Container) setupWorkingDirectory() error {
if container.Config.WorkingDir != "" {
container.Config.WorkingDir = path.Clean(container.Config.WorkingDir)
pthInfo, err := os.Stat(container.getResourcePath(container.Config.WorkingDir))
pth, err := container.getResourcePath(container.Config.WorkingDir)
if err != nil {
return err
}
pthInfo, err := os.Stat(pth)
if err != nil {
if !os.IsNotExist(err) {
return err
}
if err := os.MkdirAll(container.getResourcePath(container.Config.WorkingDir), 0755); err != nil {
if err := os.MkdirAll(pth, 0755); err != nil {
return err
}
}
@@ -1025,19 +1063,24 @@ func (container *Container) setupWorkingDirectory() error {
func (container *Container) startLoggingToDisk() error {
// Setup logging of stdout and stderr to disk
if err := container.daemon.LogToDisk(container.stdout, container.logPath("json"), "stdout"); err != nil {
pth, err := container.logPath("json")
if err != nil {
return err
}
if err := container.daemon.LogToDisk(container.stderr, container.logPath("json"), "stderr"); err != nil {
if err := container.daemon.LogToDisk(container.stdout, pth, "stdout"); err != nil {
return err
}
if err := container.daemon.LogToDisk(container.stderr, pth, "stderr"); err != nil {
return err
}
return nil
}
func (container *Container) waitForStart() error {
callbackLock := make(chan struct{})
callback := func(command *execdriver.Command) {
container.State.SetRunning(command.Pid())
if command.Tty {
// The callback is called after the process Start()
// so we are in the parent process. In TTY mode, stdin/out/err is the PtySlace
@@ -1046,19 +1089,26 @@ func (container *Container) waitForStart() error {
c.Close()
}
}
container.State.SetRunning(command.Pid())
if err := container.ToDisk(); err != nil {
utils.Debugf("%s", err)
}
close(callbackLock)
}
// We use a callback here instead of a goroutine and an chan for
// syncronization purposes
cErr := utils.Go(func() error { return container.monitor(callback) })
waitStart := make(chan struct{})
go func() {
container.State.WaitRunning(-1 * time.Second)
close(waitStart)
}()
// Start should not return until the process is actually running
select {
case <-callbackLock:
case <-waitStart:
case err := <-cErr:
return err
}

View File

@@ -12,6 +12,8 @@ import (
"sync"
"time"
"github.com/docker/libcontainer/label"
"github.com/docker/libcontainer/selinux"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/daemon/execdriver/execdrivers"
@@ -26,11 +28,10 @@ import (
"github.com/dotcloud/docker/graph"
"github.com/dotcloud/docker/image"
"github.com/dotcloud/docker/pkg/graphdb"
"github.com/dotcloud/docker/pkg/label"
"github.com/dotcloud/docker/pkg/namesgenerator"
"github.com/dotcloud/docker/pkg/networkfs/resolvconf"
"github.com/dotcloud/docker/pkg/selinux"
"github.com/dotcloud/docker/pkg/sysinfo"
"github.com/dotcloud/docker/pkg/truncindex"
"github.com/dotcloud/docker/runconfig"
"github.com/dotcloud/docker/utils"
)
@@ -72,9 +73,11 @@ func (c *contStore) Delete(id string) {
func (c *contStore) List() []*Container {
containers := new(History)
c.Lock()
for _, cont := range c.s {
containers.Add(cont)
}
c.Unlock()
containers.Sort()
return *containers
}
@@ -85,7 +88,7 @@ type Daemon struct {
containers *contStore
graph *graph.Graph
repositories *graph.TagStore
idIndex *utils.TruncIndex
idIndex *truncindex.TruncIndex
sysInfo *sysinfo.SysInfo
volumes *graph.Graph
srv Server
@@ -94,6 +97,7 @@ type Daemon struct {
containerGraph *graphdb.Database
driver graphdriver.Driver
execDriver execdriver.Driver
Sockets []string
}
// Install installs daemon capabilities to eng.
@@ -134,7 +138,7 @@ func (daemon *Daemon) containerRoot(id string) string {
// Load reads the contents of a container from disk
// This is typically done at startup.
func (daemon *Daemon) load(id string) (*Container, error) {
container := &Container{root: daemon.containerRoot(id)}
container := &Container{root: daemon.containerRoot(id), State: NewState()}
if err := container.FromDisk(); err != nil {
return nil, err
}
@@ -178,11 +182,7 @@ func (daemon *Daemon) register(container *Container, updateSuffixarray bool, con
// don't update the Suffixarray if we're starting up
// we'll waste time if we update it for every container
if updateSuffixarray {
daemon.idIndex.Add(container.ID)
} else {
daemon.idIndex.AddWithoutSuffixarrayUpdate(container.ID)
}
daemon.idIndex.Add(container.ID)
// FIXME: if the container is supposed to be running but is not, auto restart it?
// if so, then we need to restart monitor and init a new lock
@@ -209,6 +209,7 @@ func (daemon *Daemon) register(container *Container, updateSuffixarray bool, con
}
daemon.execDriver.Terminate(cmd)
}
if err := container.Unmount(); err != nil {
utils.Debugf("unmount error %s", err)
}
@@ -219,29 +220,22 @@ func (daemon *Daemon) register(container *Container, updateSuffixarray bool, con
info := daemon.execDriver.Info(container.ID)
if !info.IsRunning() {
utils.Debugf("Container %s was supposed to be running but is not.", container.ID)
utils.Debugf("Marking as stopped")
container.State.SetStopped(-127)
if err := container.ToDisk(); err != nil {
return err
}
if daemon.config.AutoRestart {
utils.Debugf("Marking as restarting")
if err := container.Unmount(); err != nil {
utils.Debugf("restart unmount error %s", err)
}
if containersToStart != nil {
*containersToStart = append(*containersToStart, container)
}
} else {
utils.Debugf("Marking as stopped")
container.State.SetStopped(-127)
if err := container.ToDisk(); err != nil {
return err
}
}
}
} else {
// When the container is not running, we still initialize the waitLock
// chan and close it. Receiving on nil chan blocks whereas receiving on a
// closed chan does not. In this case we do not want to block.
container.waitLock = make(chan struct{})
close(container.waitLock)
}
return nil
}
@@ -373,8 +367,6 @@ func (daemon *Daemon) restore() error {
}
}
daemon.idIndex.UpdateSuffixarray()
for _, container := range containersToStart {
utils.Debugf("Starting container %d", container.ID)
if err := container.Start(); err != nil {
@@ -590,6 +582,7 @@ func (daemon *Daemon) newContainer(name string, config *runconfig.Config, img *i
Name: name,
Driver: daemon.driver.String(),
ExecDriver: daemon.execDriver.Name(),
State: NewState(),
}
container.root = daemon.containerRoot(container.ID)
@@ -627,8 +620,12 @@ func (daemon *Daemon) createRootfs(container *Container, img *image.Image) error
// Commit creates a new filesystem image from the current state of a container.
// The image can optionally be tagged into a repository
func (daemon *Daemon) Commit(container *Container, repository, tag, comment, author string, config *runconfig.Config) (*image.Image, error) {
// FIXME: freeze the container before copying it to avoid data corruption?
func (daemon *Daemon) Commit(container *Container, repository, tag, comment, author string, pause bool, config *runconfig.Config) (*image.Image, error) {
if pause {
container.Pause()
defer container.Unpause()
}
if err := container.Mount(); err != nil {
return nil, err
}
@@ -839,7 +836,7 @@ func NewDaemonFromDirectory(config *daemonconfig.Config, eng *engine.Engine) (*D
localCopy := path.Join(config.Root, "init", fmt.Sprintf("dockerinit-%s", dockerversion.VERSION))
sysInitPath := utils.DockerInitPath(localCopy)
if sysInitPath == "" {
return nil, fmt.Errorf("Could not locate dockerinit: This usually means docker was built incorrectly. See http://docs.docker.io/en/latest/contributing/devenvironment for official build instructions.")
return nil, fmt.Errorf("Could not locate dockerinit: This usually means docker was built incorrectly. See http://docs.docker.com/contributing/devenvironment for official build instructions.")
}
if sysInitPath != localCopy {
@@ -867,7 +864,7 @@ func NewDaemonFromDirectory(config *daemonconfig.Config, eng *engine.Engine) (*D
containers: &contStore{s: make(map[string]*Container)},
graph: g,
repositories: repositories,
idIndex: utils.NewTruncIndex([]string{}),
idIndex: truncindex.NewTruncIndex([]string{}),
sysInfo: sysInfo,
volumes: volumes,
config: config,
@@ -876,6 +873,7 @@ func NewDaemonFromDirectory(config *daemonconfig.Config, eng *engine.Engine) (*D
sysInitPath: sysInitPath,
execDriver: ed,
eng: eng,
Sockets: config.Sockets,
}
if err := daemon.checkLocaldns(); err != nil {
@@ -901,7 +899,7 @@ func (daemon *Daemon) shutdown() error {
if err := c.KillSig(15); err != nil {
utils.Debugf("kill 15 error for %s - %s", c.ID, err)
}
c.Wait()
c.State.WaitStop(-1 * time.Second)
utils.Debugf("container stopped %s", c.ID)
}()
}

View File

@@ -1,2 +1,2 @@
Michael Crosby <michael@crosbymichael.com> (@crosbymichael)
Guillaume J. Charmes <guillaume@docker.com> (@creack)
Victor Vieux <vieux@docker.com> (@vieux)

View File

@@ -6,7 +6,7 @@ import (
"os"
"os/exec"
"github.com/dotcloud/docker/pkg/libcontainer/devices"
"github.com/docker/libcontainer/devices"
)
// Context is a generic key value pair that allows

View File

@@ -0,0 +1 @@
Dinesh Subhraveti <dineshs@altiscale.com> (@dineshs-altiscale)

View File

@@ -15,11 +15,10 @@ import (
"syscall"
"time"
"github.com/docker/libcontainer/cgroups"
"github.com/docker/libcontainer/label"
"github.com/docker/libcontainer/mount/nodes"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/pkg/label"
"github.com/dotcloud/docker/pkg/libcontainer/cgroups"
"github.com/dotcloud/docker/pkg/libcontainer/mount/nodes"
"github.com/dotcloud/docker/pkg/system"
"github.com/dotcloud/docker/utils"
)
@@ -37,16 +36,7 @@ func init() {
if err := setupNetworking(args); err != nil {
return err
}
if err := setupCapabilities(args); err != nil {
return err
}
if err := setupWorkingDirectory(args); err != nil {
return err
}
if err := system.CloseFdsFrom(3); err != nil {
return err
}
if err := changeUser(args); err != nil {
if err := finalizeNamespace(args); err != nil {
return err
}

View File

@@ -9,10 +9,8 @@ import (
"strings"
"syscall"
"github.com/docker/libcontainer/netlink"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/pkg/netlink"
"github.com/dotcloud/docker/pkg/user"
"github.com/syndtr/gocapability/capability"
)
// Clear environment pollution introduced by lxc-start
@@ -107,65 +105,6 @@ func setupWorkingDirectory(args *execdriver.InitArgs) error {
return nil
}
// Takes care of dropping privileges to the desired user
func changeUser(args *execdriver.InitArgs) error {
uid, gid, suppGids, err := user.GetUserGroupSupplementary(
args.User,
syscall.Getuid(), syscall.Getgid(),
)
if err != nil {
return err
}
if err := syscall.Setgroups(suppGids); err != nil {
return fmt.Errorf("Setgroups failed: %v", err)
}
if err := syscall.Setgid(gid); err != nil {
return fmt.Errorf("Setgid failed: %v", err)
}
if err := syscall.Setuid(uid); err != nil {
return fmt.Errorf("Setuid failed: %v", err)
}
return nil
}
func setupCapabilities(args *execdriver.InitArgs) error {
if args.Privileged {
return nil
}
drop := []capability.Cap{
capability.CAP_SETPCAP,
capability.CAP_SYS_MODULE,
capability.CAP_SYS_RAWIO,
capability.CAP_SYS_PACCT,
capability.CAP_SYS_ADMIN,
capability.CAP_SYS_NICE,
capability.CAP_SYS_RESOURCE,
capability.CAP_SYS_TIME,
capability.CAP_SYS_TTY_CONFIG,
capability.CAP_AUDIT_WRITE,
capability.CAP_AUDIT_CONTROL,
capability.CAP_MAC_OVERRIDE,
capability.CAP_MAC_ADMIN,
capability.CAP_NET_ADMIN,
capability.CAP_SYSLOG,
}
c, err := capability.NewPid(os.Getpid())
if err != nil {
return err
}
c.Unset(capability.CAPS|capability.BOUNDS, drop...)
if err := c.Apply(capability.CAPS | capability.BOUNDS); err != nil {
return err
}
return nil
}
func getEnv(args *execdriver.InitArgs, key string) string {
for _, kv := range args.Env {
parts := strings.SplitN(kv, "=", 2)

View File

@@ -3,9 +3,60 @@
package lxc
import (
"fmt"
"syscall"
"github.com/docker/libcontainer/namespaces"
"github.com/docker/libcontainer/security/capabilities"
"github.com/docker/libcontainer/utils"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/daemon/execdriver/native/template"
"github.com/dotcloud/docker/pkg/system"
)
func setHostname(hostname string) error {
return syscall.Sethostname([]byte(hostname))
}
func finalizeNamespace(args *execdriver.InitArgs) error {
if err := utils.CloseExecFrom(3); err != nil {
return err
}
// We use the native drivers default template so that things like caps are consistent
// across both drivers
container := template.New()
if !args.Privileged {
// drop capabilities in bounding set before changing user
if err := capabilities.DropBoundingSet(container.Capabilities); err != nil {
return fmt.Errorf("drop bounding set %s", err)
}
// preserve existing capabilities while we change users
if err := system.SetKeepCaps(); err != nil {
return fmt.Errorf("set keep caps %s", err)
}
}
if err := namespaces.SetupUser(args.User); err != nil {
return fmt.Errorf("setup user %s", err)
}
if !args.Privileged {
if err := system.ClearKeepCaps(); err != nil {
return fmt.Errorf("clear keep caps %s", err)
}
// drop all other capabilities
if err := capabilities.DropCapabilities(container.Capabilities); err != nil {
return fmt.Errorf("drop capabilities %s", err)
}
}
if err := setupWorkingDirectory(args); err != nil {
return err
}
return nil
}

View File

@@ -2,6 +2,12 @@
package lxc
import "github.com/dotcloud/docker/daemon/execdriver"
func setHostname(hostname string) error {
panic("Not supported on darwin")
}
func finalizeNamespace(args *execdriver.InitArgs) error {
panic("Not supported on darwin")
}

View File

@@ -4,8 +4,8 @@ import (
"strings"
"text/template"
"github.com/docker/libcontainer/label"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/pkg/label"
)
const LxcTemplate = `

View File

@@ -11,8 +11,8 @@ import (
"testing"
"time"
"github.com/docker/libcontainer/devices"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/pkg/libcontainer/devices"
)
func TestLXCConfig(t *testing.T) {

View File

@@ -7,11 +7,11 @@ import (
"strconv"
"strings"
"github.com/dotcloud/docker/pkg/libcontainer"
"github.com/docker/libcontainer"
"github.com/dotcloud/docker/pkg/units"
)
type Action func(*libcontainer.Container, interface{}, string) error
type Action func(*libcontainer.Config, interface{}, string) error
var actions = map[string]Action{
"cap.add": addCap, // add a cap
@@ -35,7 +35,7 @@ var actions = map[string]Action{
"fs.readonly": readonlyFs, // make the rootfs of the container read only
}
func cpusetCpus(container *libcontainer.Container, context interface{}, value string) error {
func cpusetCpus(container *libcontainer.Config, context interface{}, value string) error {
if container.Cgroups == nil {
return fmt.Errorf("cannot set cgroups when they are disabled")
}
@@ -44,7 +44,7 @@ func cpusetCpus(container *libcontainer.Container, context interface{}, value st
return nil
}
func systemdSlice(container *libcontainer.Container, context interface{}, value string) error {
func systemdSlice(container *libcontainer.Config, context interface{}, value string) error {
if container.Cgroups == nil {
return fmt.Errorf("cannot set slice when cgroups are disabled")
}
@@ -53,12 +53,12 @@ func systemdSlice(container *libcontainer.Container, context interface{}, value
return nil
}
func apparmorProfile(container *libcontainer.Container, context interface{}, value string) error {
container.Context["apparmor_profile"] = value
func apparmorProfile(container *libcontainer.Config, context interface{}, value string) error {
container.AppArmorProfile = value
return nil
}
func cpuShares(container *libcontainer.Container, context interface{}, value string) error {
func cpuShares(container *libcontainer.Config, context interface{}, value string) error {
if container.Cgroups == nil {
return fmt.Errorf("cannot set cgroups when they are disabled")
}
@@ -70,7 +70,7 @@ func cpuShares(container *libcontainer.Container, context interface{}, value str
return nil
}
func memory(container *libcontainer.Container, context interface{}, value string) error {
func memory(container *libcontainer.Config, context interface{}, value string) error {
if container.Cgroups == nil {
return fmt.Errorf("cannot set cgroups when they are disabled")
}
@@ -83,7 +83,7 @@ func memory(container *libcontainer.Container, context interface{}, value string
return nil
}
func memoryReservation(container *libcontainer.Container, context interface{}, value string) error {
func memoryReservation(container *libcontainer.Config, context interface{}, value string) error {
if container.Cgroups == nil {
return fmt.Errorf("cannot set cgroups when they are disabled")
}
@@ -96,7 +96,7 @@ func memoryReservation(container *libcontainer.Container, context interface{}, v
return nil
}
func memorySwap(container *libcontainer.Container, context interface{}, value string) error {
func memorySwap(container *libcontainer.Config, context interface{}, value string) error {
if container.Cgroups == nil {
return fmt.Errorf("cannot set cgroups when they are disabled")
}
@@ -108,12 +108,12 @@ func memorySwap(container *libcontainer.Container, context interface{}, value st
return nil
}
func addCap(container *libcontainer.Container, context interface{}, value string) error {
func addCap(container *libcontainer.Config, context interface{}, value string) error {
container.Capabilities = append(container.Capabilities, value)
return nil
}
func dropCap(container *libcontainer.Container, context interface{}, value string) error {
func dropCap(container *libcontainer.Config, context interface{}, value string) error {
// If the capability is specified multiple times, remove all instances.
for i, capability := range container.Capabilities {
if capability == value {
@@ -125,27 +125,27 @@ func dropCap(container *libcontainer.Container, context interface{}, value strin
return nil
}
func addNamespace(container *libcontainer.Container, context interface{}, value string) error {
func addNamespace(container *libcontainer.Config, context interface{}, value string) error {
container.Namespaces[value] = true
return nil
}
func dropNamespace(container *libcontainer.Container, context interface{}, value string) error {
func dropNamespace(container *libcontainer.Config, context interface{}, value string) error {
container.Namespaces[value] = false
return nil
}
func readonlyFs(container *libcontainer.Container, context interface{}, value string) error {
func readonlyFs(container *libcontainer.Config, context interface{}, value string) error {
switch value {
case "1", "true":
container.ReadonlyFs = true
container.MountConfig.ReadonlyFs = true
default:
container.ReadonlyFs = false
container.MountConfig.ReadonlyFs = false
}
return nil
}
func joinNetNamespace(container *libcontainer.Container, context interface{}, value string) error {
func joinNetNamespace(container *libcontainer.Config, context interface{}, value string) error {
var (
running = context.(map[string]*exec.Cmd)
cmd = running[value]
@@ -154,28 +154,13 @@ func joinNetNamespace(container *libcontainer.Container, context interface{}, va
if cmd == nil || cmd.Process == nil {
return fmt.Errorf("%s is not a valid running container to join", value)
}
nspath := filepath.Join("/proc", fmt.Sprint(cmd.Process.Pid), "ns", "net")
container.Networks = append(container.Networks, &libcontainer.Network{
Type: "netns",
Context: libcontainer.Context{
"nspath": nspath,
},
Type: "netns",
NsPath: nspath,
})
return nil
}
func vethMacAddress(container *libcontainer.Container, context interface{}, value string) error {
var veth *libcontainer.Network
for _, network := range container.Networks {
if network.Type == "veth" {
veth = network
break
}
}
if veth == nil {
return fmt.Errorf("not veth configured for container")
}
veth.Context["mac"] = value
return nil
}
@@ -183,7 +168,7 @@ func vethMacAddress(container *libcontainer.Container, context interface{}, valu
// container's default configuration.
//
// TODO: this can be moved to a general utils or parser in pkg
func ParseConfiguration(container *libcontainer.Container, running map[string]*exec.Cmd, opts []string) error {
func ParseConfiguration(container *libcontainer.Config, running map[string]*exec.Cmd, opts []string) error {
for _, opt := range opts {
kv := strings.SplitN(opt, "=", 2)
if len(kv) < 2 {

View File

@@ -3,8 +3,8 @@ package configuration
import (
"testing"
"github.com/docker/libcontainer/security/capabilities"
"github.com/dotcloud/docker/daemon/execdriver/native/template"
"github.com/dotcloud/docker/pkg/libcontainer"
)
// Checks whether the expected capability is specified in the capabilities.
@@ -25,14 +25,14 @@ func TestSetReadonlyRootFs(t *testing.T) {
}
)
if container.ReadonlyFs {
if container.MountConfig.ReadonlyFs {
t.Fatal("container should not have a readonly rootfs by default")
}
if err := ParseConfiguration(container, nil, opts); err != nil {
t.Fatal(err)
}
if !container.ReadonlyFs {
if !container.MountConfig.ReadonlyFs {
t.Fatal("container should have a readonly rootfs")
}
}
@@ -84,8 +84,9 @@ func TestAppArmorProfile(t *testing.T) {
if err := ParseConfiguration(container, nil, opts); err != nil {
t.Fatal(err)
}
if expected := "koye-the-protector"; container.Context["apparmor_profile"] != expected {
t.Fatalf("expected profile %s got %s", expected, container.Context["apparmor_profile"])
if expected := "koye-the-protector"; container.AppArmorProfile != expected {
t.Fatalf("expected profile %s got %s", expected, container.AppArmorProfile)
}
}
@@ -165,7 +166,7 @@ func TestDropCap(t *testing.T) {
}
)
// enabled all caps like in privileged mode
container.Capabilities = libcontainer.GetAllCapabilities()
container.Capabilities = capabilities.GetAllCapabilities()
if err := ParseConfiguration(container, nil, opts); err != nil {
t.Fatal(err)
}

View File

@@ -6,17 +6,19 @@ import (
"os/exec"
"path/filepath"
"github.com/docker/libcontainer"
"github.com/docker/libcontainer/apparmor"
"github.com/docker/libcontainer/devices"
"github.com/docker/libcontainer/mount"
"github.com/docker/libcontainer/security/capabilities"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/daemon/execdriver/native/configuration"
"github.com/dotcloud/docker/daemon/execdriver/native/template"
"github.com/dotcloud/docker/pkg/apparmor"
"github.com/dotcloud/docker/pkg/libcontainer"
"github.com/dotcloud/docker/pkg/libcontainer/devices"
)
// createContainer populates and configures the container type with the
// data provided by the execdriver.Command
func (d *driver) createContainer(c *execdriver.Command) (*libcontainer.Container, error) {
func (d *driver) createContainer(c *execdriver.Command) (*libcontainer.Config, error) {
container := template.New()
container.Hostname = getEnv("HOSTNAME", c.Env)
@@ -26,65 +28,71 @@ func (d *driver) createContainer(c *execdriver.Command) (*libcontainer.Container
container.Env = c.Env
container.Cgroups.Name = c.ID
container.Cgroups.AllowedDevices = c.AllowedDevices
container.DeviceNodes = c.AutoCreatedDevices
container.MountConfig.DeviceNodes = c.AutoCreatedDevices
// check to see if we are running in ramdisk to disable pivot root
container.NoPivotRoot = os.Getenv("DOCKER_RAMDISK") != ""
container.Context["restrictions"] = "true"
container.MountConfig.NoPivotRoot = os.Getenv("DOCKER_RAMDISK") != ""
container.RestrictSys = true
if err := d.createNetwork(container, c); err != nil {
return nil, err
}
if c.Privileged {
if err := d.setPrivileged(container); err != nil {
return nil, err
}
}
if err := d.setupCgroups(container, c); err != nil {
return nil, err
}
if err := d.setupMounts(container, c); err != nil {
return nil, err
}
if err := d.setupLabels(container, c); err != nil {
return nil, err
}
cmds := make(map[string]*exec.Cmd)
d.Lock()
for k, v := range d.activeContainers {
cmds[k] = v.cmd
}
d.Unlock()
if err := configuration.ParseConfiguration(container, cmds, c.Config["native"]); err != nil {
return nil, err
}
return container, nil
}
func (d *driver) createNetwork(container *libcontainer.Container, c *execdriver.Command) error {
func (d *driver) createNetwork(container *libcontainer.Config, c *execdriver.Command) error {
if c.Network.HostNetworking {
container.Namespaces["NEWNET"] = false
return nil
}
container.Networks = []*libcontainer.Network{
{
Mtu: c.Network.Mtu,
Address: fmt.Sprintf("%s/%d", "127.0.0.1", 0),
Gateway: "localhost",
Type: "loopback",
Context: libcontainer.Context{},
},
}
if c.Network.Interface != nil {
vethNetwork := libcontainer.Network{
Mtu: c.Network.Mtu,
Address: fmt.Sprintf("%s/%d", c.Network.Interface.IPAddress, c.Network.Interface.IPPrefixLen),
Gateway: c.Network.Interface.Gateway,
Type: "veth",
Context: libcontainer.Context{
"prefix": "veth",
"bridge": c.Network.Interface.Bridge,
},
Mtu: c.Network.Mtu,
Address: fmt.Sprintf("%s/%d", c.Network.Interface.IPAddress, c.Network.Interface.IPPrefixLen),
Gateway: c.Network.Interface.Gateway,
Type: "veth",
Bridge: c.Network.Interface.Bridge,
VethPrefix: "veth",
}
container.Networks = append(container.Networks, &vethNetwork)
}
@@ -93,6 +101,7 @@ func (d *driver) createNetwork(container *libcontainer.Container, c *execdriver.
d.Lock()
active := d.activeContainers[c.Network.ContainerID]
d.Unlock()
if active == nil || active.cmd.Process == nil {
return fmt.Errorf("%s is not a valid running container to join", c.Network.ContainerID)
}
@@ -100,34 +109,34 @@ func (d *driver) createNetwork(container *libcontainer.Container, c *execdriver.
nspath := filepath.Join("/proc", fmt.Sprint(cmd.Process.Pid), "ns", "net")
container.Networks = append(container.Networks, &libcontainer.Network{
Type: "netns",
Context: libcontainer.Context{
"nspath": nspath,
},
Type: "netns",
NsPath: nspath,
})
}
return nil
}
func (d *driver) setPrivileged(container *libcontainer.Container) (err error) {
container.Capabilities = libcontainer.GetAllCapabilities()
func (d *driver) setPrivileged(container *libcontainer.Config) (err error) {
container.Capabilities = capabilities.GetAllCapabilities()
container.Cgroups.AllowAllDevices = true
hostDeviceNodes, err := devices.GetHostDeviceNodes()
if err != nil {
return err
}
container.DeviceNodes = hostDeviceNodes
container.MountConfig.DeviceNodes = hostDeviceNodes
delete(container.Context, "restrictions")
container.RestrictSys = false
if apparmor.IsEnabled() {
container.Context["apparmor_profile"] = "unconfined"
container.AppArmorProfile = "unconfined"
}
return nil
}
func (d *driver) setupCgroups(container *libcontainer.Container, c *execdriver.Command) error {
func (d *driver) setupCgroups(container *libcontainer.Config, c *execdriver.Command) error {
if c.Resources != nil {
container.Cgroups.CpuShares = c.Resources.CpuShares
container.Cgroups.Memory = c.Resources.Memory
@@ -135,12 +144,13 @@ func (d *driver) setupCgroups(container *libcontainer.Container, c *execdriver.C
container.Cgroups.MemorySwap = c.Resources.MemorySwap
container.Cgroups.CpusetCpus = c.Resources.Cpuset
}
return nil
}
func (d *driver) setupMounts(container *libcontainer.Container, c *execdriver.Command) error {
func (d *driver) setupMounts(container *libcontainer.Config, c *execdriver.Command) error {
for _, m := range c.Mounts {
container.Mounts = append(container.Mounts, libcontainer.Mount{
container.MountConfig.Mounts = append(container.MountConfig.Mounts, mount.Mount{
Type: "bind",
Source: m.Source,
Destination: m.Destination,
@@ -148,11 +158,13 @@ func (d *driver) setupMounts(container *libcontainer.Container, c *execdriver.Co
Private: m.Private,
})
}
return nil
}
func (d *driver) setupLabels(container *libcontainer.Container, c *execdriver.Command) error {
container.Context["process_label"] = c.Config["process_label"][0]
container.Context["mount_label"] = c.Config["mount_label"][0]
func (d *driver) setupLabels(container *libcontainer.Config, c *execdriver.Command) error {
container.ProcessLabel = c.Config["process_label"][0]
container.MountConfig.MountLabel = c.Config["mount_label"][0]
return nil
}

View File

@@ -11,12 +11,12 @@ import (
"sync"
"syscall"
"github.com/docker/libcontainer"
"github.com/docker/libcontainer/apparmor"
"github.com/docker/libcontainer/cgroups/fs"
"github.com/docker/libcontainer/cgroups/systemd"
"github.com/docker/libcontainer/namespaces"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/pkg/apparmor"
"github.com/dotcloud/docker/pkg/libcontainer"
"github.com/dotcloud/docker/pkg/libcontainer/cgroups/fs"
"github.com/dotcloud/docker/pkg/libcontainer/cgroups/systemd"
"github.com/dotcloud/docker/pkg/libcontainer/namespaces"
"github.com/dotcloud/docker/pkg/system"
)
@@ -27,7 +27,7 @@ const (
func init() {
execdriver.RegisterInitFunc(DriverName, func(args *execdriver.InitArgs) error {
var container *libcontainer.Container
var container *libcontainer.Config
f, err := os.Open(filepath.Join(args.Root, "container.json"))
if err != nil {
return err
@@ -54,7 +54,7 @@ func init() {
}
type activeContainer struct {
container *libcontainer.Container
container *libcontainer.Config
cmd *exec.Cmd
}
@@ -83,7 +83,7 @@ func NewDriver(root, initPath string) (*driver, error) {
}
func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error) {
// take the Command and populate the libcontainer.Container from it
// take the Command and populate the libcontainer.Config from it
container, err := d.createContainer(c)
if err != nil {
return -1, err
@@ -110,7 +110,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
term := getTerminal(c, pipes)
return namespaces.Exec(container, term, c.Rootfs, dataPath, args, func(container *libcontainer.Container, console, rootfs, dataPath, init string, child *os.File, args []string) *exec.Cmd {
return namespaces.Exec(container, term, c.Rootfs, dataPath, args, func(container *libcontainer.Config, console, rootfs, dataPath, init string, child *os.File, args []string) *exec.Cmd {
// we need to join the rootfs because namespaces will setup the rootfs and chroot
initPath := filepath.Join(c.Rootfs, c.InitPath)
@@ -171,21 +171,30 @@ func (d *driver) Unpause(c *execdriver.Command) error {
func (d *driver) Terminate(p *execdriver.Command) error {
// lets check the start time for the process
started, err := d.readStartTime(p)
state, err := libcontainer.GetState(filepath.Join(d.root, p.ID))
if err != nil {
// if we don't have the data on disk then we can assume the process is gone
// because this is only removed after we know the process has stopped
if os.IsNotExist(err) {
return nil
if !os.IsNotExist(err) {
return err
}
return err
// TODO: Remove this part for version 1.2.0
// This is added only to ensure smooth upgrades from pre 1.1.0 to 1.1.0
data, err := ioutil.ReadFile(filepath.Join(d.root, p.ID, "start"))
if err != nil {
// if we don't have the data on disk then we can assume the process is gone
// because this is only removed after we know the process has stopped
if os.IsNotExist(err) {
return nil
}
return err
}
state = &libcontainer.State{InitStartTime: string(data)}
}
currentStartTime, err := system.GetProcessStartTime(p.Process.Pid)
if err != nil {
return err
}
if started == currentStartTime {
if state.InitStartTime == currentStartTime {
err = syscall.Kill(p.Process.Pid, 9)
syscall.Wait4(p.Process.Pid, nil, 0, nil)
}
@@ -194,14 +203,6 @@ func (d *driver) Terminate(p *execdriver.Command) error {
}
func (d *driver) readStartTime(p *execdriver.Command) (string, error) {
data, err := ioutil.ReadFile(filepath.Join(d.root, p.ID, "start"))
if err != nil {
return "", err
}
return string(data), nil
}
func (d *driver) Info(id string) execdriver.Info {
return &info{
ID: id,
@@ -229,7 +230,7 @@ func (d *driver) GetPidsForContainer(id string) ([]int, error) {
return fs.GetPids(c)
}
func (d *driver) writeContainerFile(container *libcontainer.Container, id string) error {
func (d *driver) writeContainerFile(container *libcontainer.Config, id string) error {
data, err := json.Marshal(container)
if err != nil {
return err

View File

@@ -3,6 +3,8 @@ package native
import (
"os"
"path/filepath"
"github.com/docker/libcontainer"
)
type info struct {
@@ -14,6 +16,11 @@ type info struct {
// pid file for a container. If the file exists then the
// container is currently running
func (i *info) IsRunning() bool {
if _, err := libcontainer.GetState(filepath.Join(i.driver.root, i.ID)); err == nil {
return true
}
// TODO: Remove this part for version 1.2.0
// This is added only to ensure smooth upgrades from pre 1.1.0 to 1.1.0
if _, err := os.Stat(filepath.Join(i.driver.root, i.ID, "pid")); err == nil {
return true
}

View File

@@ -1,14 +1,14 @@
package template
import (
"github.com/dotcloud/docker/pkg/apparmor"
"github.com/dotcloud/docker/pkg/libcontainer"
"github.com/dotcloud/docker/pkg/libcontainer/cgroups"
"github.com/docker/libcontainer"
"github.com/docker/libcontainer/apparmor"
"github.com/docker/libcontainer/cgroups"
)
// New returns the docker default configuration for libcontainer
func New() *libcontainer.Container {
container := &libcontainer.Container{
func New() *libcontainer.Config {
container := &libcontainer.Config{
Capabilities: []string{
"CHOWN",
"DAC_OVERRIDE",
@@ -34,10 +34,12 @@ func New() *libcontainer.Container {
Parent: "docker",
AllowAllDevices: false,
},
Context: libcontainer.Context{},
MountConfig: &libcontainer.MountConfig{},
}
if apparmor.IsEnabled() {
container.Context["apparmor_profile"] = "docker-default"
container.AppArmorProfile = "docker-default"
}
return container
}

View File

@@ -30,9 +30,9 @@ import (
"sync"
"syscall"
"github.com/docker/libcontainer/label"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/daemon/graphdriver"
"github.com/dotcloud/docker/pkg/label"
mountpk "github.com/dotcloud/docker/pkg/mount"
"github.com/dotcloud/docker/utils"
)
@@ -295,7 +295,7 @@ func (a *Driver) Put(id string) {
// Returns an archive of the contents for the id
func (a *Driver) Diff(id string) (archive.Archive, error) {
return archive.TarFilter(path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
return archive.TarWithOptions(path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
Compression: archive.Uncompressed,
})
}

View File

@@ -39,7 +39,7 @@ func openNextAvailableLoopback(index int, sparseFile *os.File) (loopFile *os.Fil
fi, err := os.Stat(target)
if err != nil {
if os.IsNotExist(err) {
utils.Errorf("There are no more loopback device available.")
utils.Errorf("There are no more loopback devices available.")
}
return nil, ErrAttachLoopbackDevice
}

View File

@@ -18,8 +18,8 @@ import (
"syscall"
"time"
"github.com/docker/libcontainer/label"
"github.com/dotcloud/docker/daemon/graphdriver"
"github.com/dotcloud/docker/pkg/label"
"github.com/dotcloud/docker/pkg/units"
"github.com/dotcloud/docker/utils"
)
@@ -55,7 +55,7 @@ type DevInfo struct {
}
type MetaData struct {
Devices map[string]*DevInfo `json:devices`
Devices map[string]*DevInfo `json:"Devices"`
devicesLock sync.Mutex `json:"-"` // Protects all read/writes to Devices map
}

View File

@@ -1,12 +1,13 @@
package graphtest
import (
"github.com/dotcloud/docker/daemon/graphdriver"
"io/ioutil"
"os"
"path"
"syscall"
"testing"
"github.com/dotcloud/docker/daemon/graphdriver"
)
var (
@@ -94,10 +95,10 @@ func verifyFile(t *testing.T, path string, mode os.FileMode, uid, gid uint32) {
if stat, ok := fi.Sys().(*syscall.Stat_t); ok {
if stat.Uid != uid {
t.Fatal("%s no owned by uid %d", path, uid)
t.Fatalf("%s no owned by uid %d", path, uid)
}
if stat.Gid != gid {
t.Fatal("%s not owned by gid %d", path, gid)
t.Fatalf("%s not owned by gid %d", path, gid)
}
}

View File

@@ -1,6 +1,7 @@
package vfs
import (
"bytes"
"fmt"
"github.com/dotcloud/docker/daemon/graphdriver"
"os"
@@ -35,8 +36,24 @@ func (d *Driver) Cleanup() error {
return nil
}
func isGNUcoreutils() bool {
if stdout, err := exec.Command("cp", "--version").Output(); err == nil {
return bytes.Contains(stdout, []byte("GNU coreutils"))
}
return false
}
func copyDir(src, dst string) error {
if output, err := exec.Command("cp", "-aT", "--reflink=auto", src, dst).CombinedOutput(); err != nil {
argv := make([]string, 0, 4)
if isGNUcoreutils() {
argv = append(argv, "-aT", "--reflink=auto", src, dst)
} else {
argv = append(argv, "-a", src+"/.", dst+"/.")
}
if output, err := exec.Command("cp", argv...).CombinedOutput(); err != nil {
return fmt.Errorf("Error VFS copying directory: %s (%s)", err, output)
}
return nil

View File

@@ -2,6 +2,7 @@ package daemon
import (
"encoding/json"
"fmt"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/runconfig"
@@ -13,11 +14,13 @@ func (daemon *Daemon) ContainerInspect(job *engine.Job) engine.Status {
}
name := job.Args[0]
if container := daemon.Get(name); container != nil {
if job.GetenvBool("dirty") {
container.Lock()
defer container.Unlock()
if job.GetenvBool("raw") {
b, err := json.Marshal(&struct {
*Container
HostConfig *runconfig.HostConfig
}{container, container.HostConfig()})
}{container, container.hostConfig})
if err != nil {
return job.Error(err)
}
@@ -44,7 +47,16 @@ func (daemon *Daemon) ContainerInspect(job *engine.Job) engine.Status {
out.Set("ProcessLabel", container.ProcessLabel)
out.SetJson("Volumes", container.Volumes)
out.SetJson("VolumesRW", container.VolumesRW)
if children, err := daemon.Children(container.Name); err == nil {
for linkAlias, child := range children {
container.hostConfig.Links = append(container.hostConfig.Links, fmt.Sprintf("%s:%s", child.Name, linkAlias))
}
}
out.SetJson("HostConfig", container.hostConfig)
container.hostConfig.Links = nil
if _, err := out.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}

View File

@@ -8,19 +8,20 @@ import (
"strings"
"sync"
"github.com/docker/libcontainer/netlink"
"github.com/dotcloud/docker/daemon/networkdriver"
"github.com/dotcloud/docker/daemon/networkdriver/ipallocator"
"github.com/dotcloud/docker/daemon/networkdriver/portallocator"
"github.com/dotcloud/docker/daemon/networkdriver/portmapper"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/pkg/iptables"
"github.com/dotcloud/docker/pkg/netlink"
"github.com/dotcloud/docker/pkg/networkfs/resolvconf"
"github.com/dotcloud/docker/utils"
)
const (
DefaultNetworkBridge = "docker0"
DefaultNetworkBridge = "docker0"
MaxAllocatedPortAttempts = 10
)
// Network interface represents the networking stack of a container
@@ -354,9 +355,6 @@ func Release(job *engine.Job) engine.Status {
var (
id = job.Args[0]
containerInterface = currentInterfaces.Get(id)
ip net.IP
port int
proto string
)
if containerInterface == nil {
@@ -367,22 +365,6 @@ func Release(job *engine.Job) engine.Status {
if err := portmapper.Unmap(nat); err != nil {
log.Printf("Unable to unmap port %s: %s", nat, err)
}
// this is host mappings
switch a := nat.(type) {
case *net.TCPAddr:
proto = "tcp"
ip = a.IP
port = a.Port
case *net.UDPAddr:
proto = "udp"
ip = a.IP
port = a.Port
}
if err := portallocator.ReleasePort(ip, proto, port); err != nil {
log.Printf("Unable to release port %s", nat)
}
}
if err := ipallocator.ReleaseIP(bridgeNetwork, &containerInterface.IP); err != nil {
@@ -399,7 +381,7 @@ func AllocatePort(job *engine.Job) engine.Status {
ip = defaultBindingIP
id = job.Args[0]
hostIP = job.Getenv("HostIP")
origHostPort = job.GetenvInt("HostPort")
hostPort = job.GetenvInt("HostPort")
containerPort = job.GetenvInt("ContainerPort")
proto = job.Getenv("Proto")
network = currentInterfaces.Get(id)
@@ -409,39 +391,46 @@ func AllocatePort(job *engine.Job) engine.Status {
ip = net.ParseIP(hostIP)
}
var (
hostPort int
container net.Addr
host net.Addr
)
// host ip, proto, and host port
var container net.Addr
switch proto {
case "tcp":
container = &net.TCPAddr{IP: network.IP, Port: containerPort}
case "udp":
container = &net.UDPAddr{IP: network.IP, Port: containerPort}
default:
return job.Errorf("unsupported address type %s", proto)
}
/*
Try up to 10 times to get a port that's not already allocated.
//
// Try up to 10 times to get a port that's not already allocated.
//
// In the event of failure to bind, return the error that portmapper.Map
// yields.
//
In the event of failure to bind, return the error that portmapper.Map
yields.
*/
for i := 0; i < 10; i++ {
// host ip, proto, and host port
hostPort, err = portallocator.RequestPort(ip, proto, origHostPort)
if err != nil {
return job.Error(err)
}
if proto == "tcp" {
host = &net.TCPAddr{IP: ip, Port: hostPort}
container = &net.TCPAddr{IP: network.IP, Port: containerPort}
} else {
host = &net.UDPAddr{IP: ip, Port: hostPort}
container = &net.UDPAddr{IP: network.IP, Port: containerPort}
}
if err = portmapper.Map(container, ip, hostPort); err == nil {
var host net.Addr
for i := 0; i < MaxAllocatedPortAttempts; i++ {
if host, err = portmapper.Map(container, ip, hostPort); err == nil {
break
}
job.Logf("Failed to bind %s:%d for container address %s:%d. Trying another port.", ip.String(), hostPort, network.IP.String(), containerPort)
switch allocerr := err.(type) {
case portallocator.ErrPortAlreadyAllocated:
// There is no point in immediately retrying to map an explicitly
// chosen port.
if hostPort != 0 {
job.Logf("Failed to bind %s for container address %s: %s", allocerr.IPPort(), container.String(), allocerr.Error())
break
}
// Automatically chosen 'free' port failed to bind: move on the next.
job.Logf("Failed to bind %s for container address %s. Trying another port.", allocerr.IPPort(), container.String())
default:
// some other error during mapping
job.Logf("Received an unexpected error during port allocation: %s", err.Error())
break
}
}
if err != nil {
@@ -451,12 +440,18 @@ func AllocatePort(job *engine.Job) engine.Status {
network.PortMappings = append(network.PortMappings, host)
out := engine.Env{}
out.Set("HostIP", ip.String())
out.SetInt("HostPort", hostPort)
switch netAddr := host.(type) {
case *net.TCPAddr:
out.Set("HostIP", netAddr.IP.String())
out.SetInt("HostPort", netAddr.Port)
case *net.UDPAddr:
out.Set("HostIP", netAddr.IP.String())
out.SetInt("HostPort", netAddr.Port)
}
if _, err := out.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
}

View File

@@ -0,0 +1,106 @@
package bridge
import (
"fmt"
"net"
"strconv"
"testing"
"github.com/dotcloud/docker/engine"
)
func findFreePort(t *testing.T) int {
l, err := net.Listen("tcp", ":0")
if err != nil {
t.Fatal("Failed to find a free port")
}
defer l.Close()
result, err := net.ResolveTCPAddr("tcp", l.Addr().String())
if err != nil {
t.Fatal("Failed to resolve address to identify free port")
}
return result.Port
}
func newPortAllocationJob(eng *engine.Engine, port int) (job *engine.Job) {
strPort := strconv.Itoa(port)
job = eng.Job("allocate_port", "container_id")
job.Setenv("HostIP", "127.0.0.1")
job.Setenv("HostPort", strPort)
job.Setenv("Proto", "tcp")
job.Setenv("ContainerPort", strPort)
return
}
func TestAllocatePortDetection(t *testing.T) {
eng := engine.New()
eng.Logging = false
freePort := findFreePort(t)
// Init driver
job := eng.Job("initdriver")
if res := InitDriver(job); res != engine.StatusOK {
t.Fatal("Failed to initialize network driver")
}
// Allocate interface
job = eng.Job("allocate_interface", "container_id")
if res := Allocate(job); res != engine.StatusOK {
t.Fatal("Failed to allocate network interface")
}
// Allocate same port twice, expect failure on second call
job = newPortAllocationJob(eng, freePort)
if res := AllocatePort(job); res != engine.StatusOK {
t.Fatal("Failed to find a free port to allocate")
}
if res := AllocatePort(job); res == engine.StatusOK {
t.Fatal("Duplicate port allocation granted by AllocatePort")
}
}
func TestAllocatePortReclaim(t *testing.T) {
eng := engine.New()
eng.Logging = false
freePort := findFreePort(t)
// Init driver
job := eng.Job("initdriver")
if res := InitDriver(job); res != engine.StatusOK {
t.Fatal("Failed to initialize network driver")
}
// Allocate interface
job = eng.Job("allocate_interface", "container_id")
if res := Allocate(job); res != engine.StatusOK {
t.Fatal("Failed to allocate network interface")
}
// Occupy port
listenAddr := fmt.Sprintf(":%d", freePort)
tcpListenAddr, err := net.ResolveTCPAddr("tcp", listenAddr)
if err != nil {
t.Fatalf("Failed to resolve TCP address '%s'", listenAddr)
}
l, err := net.ListenTCP("tcp", tcpListenAddr)
if err != nil {
t.Fatalf("Fail to listen on port %d", freePort)
}
// Allocate port, expect failure
job = newPortAllocationJob(eng, freePort)
if res := AllocatePort(job); res == engine.StatusOK {
t.Fatal("Successfully allocated currently used port")
}
// Reclaim port, retry allocation
l.Close()
if res := AllocatePort(job); res != engine.StatusOK {
t.Fatal("Failed to allocate previously reclaimed port")
}
}

View File

@@ -1,7 +1,7 @@
package networkdriver
import (
"github.com/dotcloud/docker/pkg/netlink"
"github.com/docker/libcontainer/netlink"
"net"
"testing"
)

View File

@@ -2,13 +2,18 @@ package portallocator
import (
"errors"
"fmt"
"net"
"sync"
)
type portMap struct {
p map[int]struct{}
last int
}
type (
portMap map[int]bool
protocolMap map[string]portMap
protocolMap map[string]*portMap
ipMapping map[string]protocolMap
)
@@ -18,9 +23,8 @@ const (
)
var (
ErrAllPortsAllocated = errors.New("all ports are allocated")
ErrPortAlreadyAllocated = errors.New("port has already been allocated")
ErrUnknownProtocol = errors.New("unknown protocol")
ErrAllPortsAllocated = errors.New("all ports are allocated")
ErrUnknownProtocol = errors.New("unknown protocol")
)
var (
@@ -30,6 +34,34 @@ var (
globalMap = ipMapping{}
)
type ErrPortAlreadyAllocated struct {
ip string
port int
}
func NewErrPortAlreadyAllocated(ip string, port int) ErrPortAlreadyAllocated {
return ErrPortAlreadyAllocated{
ip: ip,
port: port,
}
}
func (e ErrPortAlreadyAllocated) IP() string {
return e.ip
}
func (e ErrPortAlreadyAllocated) Port() int {
return e.port
}
func (e ErrPortAlreadyAllocated) IPPort() string {
return fmt.Sprintf("%s:%d", e.ip, e.port)
}
func (e ErrPortAlreadyAllocated) Error() string {
return fmt.Sprintf("Bind for %s:%d failed: port is already allocated", e.ip, e.port)
}
func RequestPort(ip net.IP, proto string, port int) (int, error) {
mutex.Lock()
defer mutex.Unlock()
@@ -43,11 +75,11 @@ func RequestPort(ip net.IP, proto string, port int) (int, error) {
mapping := getOrCreate(ip)
if port > 0 {
if !mapping[proto][port] {
mapping[proto][port] = true
if _, ok := mapping[proto].p[port]; !ok {
mapping[proto].p[port] = struct{}{}
return port, nil
} else {
return 0, ErrPortAlreadyAllocated
return 0, NewErrPortAlreadyAllocated(ip.String(), port)
}
} else {
port, err := findPort(ip, proto)
@@ -66,8 +98,8 @@ func ReleasePort(ip net.IP, proto string, port int) error {
ip = getDefault(ip)
mapping := getOrCreate(ip)
delete(mapping[proto], port)
mapping := getOrCreate(ip)[proto]
delete(mapping.p, port)
return nil
}
@@ -86,8 +118,8 @@ func getOrCreate(ip net.IP) protocolMap {
if _, ok := globalMap[ipstr]; !ok {
globalMap[ipstr] = protocolMap{
"tcp": portMap{},
"udp": portMap{},
"tcp": &portMap{p: map[int]struct{}{}, last: 0},
"udp": &portMap{p: map[int]struct{}{}, last: 0},
}
}
@@ -95,21 +127,28 @@ func getOrCreate(ip net.IP) protocolMap {
}
func findPort(ip net.IP, proto string) (int, error) {
port := BeginPortRange
mapping := getOrCreate(ip)[proto]
mapping := getOrCreate(ip)
for mapping[proto][port] {
port++
if port > EndPortRange {
return 0, ErrAllPortsAllocated
}
if mapping.last == 0 {
mapping.p[BeginPortRange] = struct{}{}
mapping.last = BeginPortRange
return BeginPortRange, nil
}
mapping[proto][port] = true
for port := mapping.last + 1; port != mapping.last; port++ {
if port > EndPortRange {
port = BeginPortRange
}
return port, nil
if _, ok := mapping.p[port]; !ok {
mapping.p[port] = struct{}{}
mapping.last = port
return port, nil
}
}
return 0, ErrAllPortsAllocated
}
func getDefault(ip net.IP) net.IP {

View File

@@ -83,8 +83,11 @@ func TestReleaseUnreadledPort(t *testing.T) {
}
port, err = RequestPort(defaultIP, "tcp", 5000)
if err != ErrPortAlreadyAllocated {
t.Fatalf("Expected error %s got %s", ErrPortAlreadyAllocated, err)
switch err.(type) {
case ErrPortAlreadyAllocated:
default:
t.Fatalf("Expected port allocation error got %s", err)
}
}

View File

@@ -3,10 +3,12 @@ package portmapper
import (
"errors"
"fmt"
"github.com/dotcloud/docker/pkg/iptables"
"github.com/dotcloud/docker/pkg/proxy"
"net"
"sync"
"github.com/dotcloud/docker/daemon/networkdriver/portallocator"
"github.com/dotcloud/docker/pkg/iptables"
"github.com/dotcloud/docker/pkg/proxy"
)
type mapping struct {
@@ -35,43 +37,66 @@ func SetIptablesChain(c *iptables.Chain) {
chain = c
}
func Map(container net.Addr, hostIP net.IP, hostPort int) error {
func Map(container net.Addr, hostIP net.IP, hostPort int) (net.Addr, error) {
lock.Lock()
defer lock.Unlock()
var m *mapping
var (
m *mapping
err error
proto string
allocatedHostPort int
)
// release the port on any error during return.
defer func() {
if err != nil {
portallocator.ReleasePort(hostIP, proto, allocatedHostPort)
}
}()
switch container.(type) {
case *net.TCPAddr:
proto = "tcp"
if allocatedHostPort, err = portallocator.RequestPort(hostIP, proto, hostPort); err != nil {
return nil, err
}
m = &mapping{
proto: "tcp",
host: &net.TCPAddr{IP: hostIP, Port: hostPort},
proto: proto,
host: &net.TCPAddr{IP: hostIP, Port: allocatedHostPort},
container: container,
}
case *net.UDPAddr:
proto = "udp"
if allocatedHostPort, err = portallocator.RequestPort(hostIP, proto, hostPort); err != nil {
return nil, err
}
m = &mapping{
proto: "udp",
host: &net.UDPAddr{IP: hostIP, Port: hostPort},
proto: proto,
host: &net.UDPAddr{IP: hostIP, Port: allocatedHostPort},
container: container,
}
default:
return ErrUnknownBackendAddressType
err = ErrUnknownBackendAddressType
return nil, err
}
key := getKey(m.host)
if _, exists := currentMappings[key]; exists {
return ErrPortMappedForIP
err = ErrPortMappedForIP
return nil, err
}
containerIP, containerPort := getIPAndPort(m.container)
if err := forward(iptables.Add, m.proto, hostIP, hostPort, containerIP.String(), containerPort); err != nil {
return err
if err := forward(iptables.Add, m.proto, hostIP, allocatedHostPort, containerIP.String(), containerPort); err != nil {
return nil, err
}
p, err := newProxy(m.host, m.container)
if err != nil {
// need to undo the iptables rules before we reutrn
forward(iptables.Delete, m.proto, hostIP, hostPort, containerIP.String(), containerPort)
return err
// need to undo the iptables rules before we return
forward(iptables.Delete, m.proto, hostIP, allocatedHostPort, containerIP.String(), containerPort)
return nil, err
}
m.userlandProxy = p
@@ -79,7 +104,7 @@ func Map(container net.Addr, hostIP net.IP, hostPort int) error {
go p.Run()
return nil
return m.host, nil
}
func Unmap(host net.Addr) error {
@@ -100,6 +125,18 @@ func Unmap(host net.Addr) error {
if err := forward(iptables.Delete, data.proto, hostIP, hostPort, containerIP.String(), containerPort); err != nil {
return err
}
switch a := host.(type) {
case *net.TCPAddr:
if err := portallocator.ReleasePort(a.IP, "tcp", a.Port); err != nil {
return err
}
case *net.UDPAddr:
if err := portallocator.ReleasePort(a.IP, "udp", a.Port); err != nil {
return err
}
}
return nil
}

View File

@@ -1,6 +1,7 @@
package portmapper
import (
"github.com/dotcloud/docker/daemon/networkdriver/portallocator"
"github.com/dotcloud/docker/pkg/iptables"
"github.com/dotcloud/docker/pkg/proxy"
"net"
@@ -44,19 +45,26 @@ func TestMapPorts(t *testing.T) {
srcAddr1 := &net.TCPAddr{Port: 1080, IP: net.ParseIP("172.16.0.1")}
srcAddr2 := &net.TCPAddr{Port: 1080, IP: net.ParseIP("172.16.0.2")}
if err := Map(srcAddr1, dstIp1, 80); err != nil {
addrEqual := func(addr1, addr2 net.Addr) bool {
return (addr1.Network() == addr2.Network()) && (addr1.String() == addr2.String())
}
if host, err := Map(srcAddr1, dstIp1, 80); err != nil {
t.Fatalf("Failed to allocate port: %s", err)
} else if !addrEqual(dstAddr1, host) {
t.Fatalf("Incorrect mapping result: expected %s:%s, got %s:%s",
dstAddr1.String(), dstAddr1.Network(), host.String(), host.Network())
}
if Map(srcAddr1, dstIp1, 80) == nil {
if _, err := Map(srcAddr1, dstIp1, 80); err == nil {
t.Fatalf("Port is in use - mapping should have failed")
}
if Map(srcAddr2, dstIp1, 80) == nil {
if _, err := Map(srcAddr2, dstIp1, 80); err == nil {
t.Fatalf("Port is in use - mapping should have failed")
}
if err := Map(srcAddr2, dstIp2, 80); err != nil {
if _, err := Map(srcAddr2, dstIp2, 80); err != nil {
t.Fatalf("Failed to allocate port: %s", err)
}
@@ -105,3 +113,40 @@ func TestGetUDPIPAndPort(t *testing.T) {
t.Fatalf("expected port %d got %d", ep, port)
}
}
func TestMapAllPortsSingleInterface(t *testing.T) {
dstIp1 := net.ParseIP("0.0.0.0")
srcAddr1 := &net.TCPAddr{Port: 1080, IP: net.ParseIP("172.16.0.1")}
hosts := []net.Addr{}
var host net.Addr
var err error
defer func() {
for _, val := range hosts {
Unmap(val)
}
}()
for i := 0; i < 10; i++ {
for i := portallocator.BeginPortRange; i < portallocator.EndPortRange; i++ {
if host, err = Map(srcAddr1, dstIp1, 0); err != nil {
t.Fatal(err)
}
hosts = append(hosts, host)
}
if _, err := Map(srcAddr1, dstIp1, portallocator.BeginPortRange); err == nil {
t.Fatal("Port %d should be bound but is not", portallocator.BeginPortRange)
}
for _, val := range hosts {
if err := Unmap(val); err != nil {
t.Fatal(err)
}
}
hosts = []net.Addr{}
}
}

View File

@@ -6,7 +6,7 @@ import (
"fmt"
"net"
"github.com/dotcloud/docker/pkg/netlink"
"github.com/docker/libcontainer/netlink"
)
var (

View File

@@ -16,6 +16,13 @@ type State struct {
ExitCode int
StartedAt time.Time
FinishedAt time.Time
waitChan chan struct{}
}
func NewState() *State {
return &State{
waitChan: make(chan struct{}),
}
}
// String returns a human-readable description of the state
@@ -35,56 +42,118 @@ func (s *State) String() string {
return fmt.Sprintf("Exited (%d) %s ago", s.ExitCode, units.HumanDuration(time.Now().UTC().Sub(s.FinishedAt)))
}
func wait(waitChan <-chan struct{}, timeout time.Duration) error {
if timeout < 0 {
<-waitChan
return nil
}
select {
case <-time.After(timeout):
return fmt.Errorf("Timed out: %v", timeout)
case <-waitChan:
return nil
}
}
// WaitRunning waits until state is running. If state already running it returns
// immediatly. If you want wait forever you must supply negative timeout.
// Returns pid, that was passed to SetRunning
func (s *State) WaitRunning(timeout time.Duration) (int, error) {
s.RLock()
if s.IsRunning() {
pid := s.Pid
s.RUnlock()
return pid, nil
}
waitChan := s.waitChan
s.RUnlock()
if err := wait(waitChan, timeout); err != nil {
return -1, err
}
return s.GetPid(), nil
}
// WaitStop waits until state is stopped. If state already stopped it returns
// immediatly. If you want wait forever you must supply negative timeout.
// Returns exit code, that was passed to SetStopped
func (s *State) WaitStop(timeout time.Duration) (int, error) {
s.RLock()
if !s.Running {
exitCode := s.ExitCode
s.RUnlock()
return exitCode, nil
}
waitChan := s.waitChan
s.RUnlock()
if err := wait(waitChan, timeout); err != nil {
return -1, err
}
return s.GetExitCode(), nil
}
func (s *State) IsRunning() bool {
s.RLock()
defer s.RUnlock()
res := s.Running
s.RUnlock()
return res
}
return s.Running
func (s *State) GetPid() int {
s.RLock()
res := s.Pid
s.RUnlock()
return res
}
func (s *State) GetExitCode() int {
s.RLock()
defer s.RUnlock()
return s.ExitCode
res := s.ExitCode
s.RUnlock()
return res
}
func (s *State) SetRunning(pid int) {
s.Lock()
defer s.Unlock()
s.Running = true
s.Paused = false
s.ExitCode = 0
s.Pid = pid
s.StartedAt = time.Now().UTC()
if !s.Running {
s.Running = true
s.Paused = false
s.ExitCode = 0
s.Pid = pid
s.StartedAt = time.Now().UTC()
close(s.waitChan) // fire waiters for start
s.waitChan = make(chan struct{})
}
s.Unlock()
}
func (s *State) SetStopped(exitCode int) {
s.Lock()
defer s.Unlock()
s.Running = false
s.Pid = 0
s.FinishedAt = time.Now().UTC()
s.ExitCode = exitCode
if s.Running {
s.Running = false
s.Pid = 0
s.FinishedAt = time.Now().UTC()
s.ExitCode = exitCode
close(s.waitChan) // fire waiters for stop
s.waitChan = make(chan struct{})
}
s.Unlock()
}
func (s *State) SetPaused() {
s.Lock()
defer s.Unlock()
s.Paused = true
s.Unlock()
}
func (s *State) SetUnpaused() {
s.Lock()
defer s.Unlock()
s.Paused = false
s.Unlock()
}
func (s *State) IsPaused() bool {
s.RLock()
defer s.RUnlock()
return s.Paused
res := s.Paused
s.RUnlock()
return res
}

102
daemon/state_test.go Normal file
View File

@@ -0,0 +1,102 @@
package daemon
import (
"sync/atomic"
"testing"
"time"
)
func TestStateRunStop(t *testing.T) {
s := NewState()
for i := 1; i < 3; i++ { // full lifecycle two times
started := make(chan struct{})
var pid int64
go func() {
runPid, _ := s.WaitRunning(-1 * time.Second)
atomic.StoreInt64(&pid, int64(runPid))
close(started)
}()
s.SetRunning(i + 100)
if !s.IsRunning() {
t.Fatal("State not running")
}
if s.Pid != i+100 {
t.Fatalf("Pid %v, expected %v", s.Pid, i+100)
}
if s.ExitCode != 0 {
t.Fatalf("ExitCode %v, expected 0", s.ExitCode)
}
select {
case <-time.After(100 * time.Millisecond):
t.Fatal("Start callback doesn't fire in 100 milliseconds")
case <-started:
t.Log("Start callback fired")
}
runPid := int(atomic.LoadInt64(&pid))
if runPid != i+100 {
t.Fatalf("Pid %v, expected %v", runPid, i+100)
}
if pid, err := s.WaitRunning(-1 * time.Second); err != nil || pid != i+100 {
t.Fatal("WaitRunning returned pid: %v, err: %v, expected pid: %v, err: %v", pid, err, i+100, nil)
}
stopped := make(chan struct{})
var exit int64
go func() {
exitCode, _ := s.WaitStop(-1 * time.Second)
atomic.StoreInt64(&exit, int64(exitCode))
close(stopped)
}()
s.SetStopped(i)
if s.IsRunning() {
t.Fatal("State is running")
}
if s.ExitCode != i {
t.Fatalf("ExitCode %v, expected %v", s.ExitCode, i)
}
if s.Pid != 0 {
t.Fatalf("Pid %v, expected 0", s.Pid)
}
select {
case <-time.After(100 * time.Millisecond):
t.Fatal("Stop callback doesn't fire in 100 milliseconds")
case <-stopped:
t.Log("Stop callback fired")
}
exitCode := int(atomic.LoadInt64(&exit))
if exitCode != i {
t.Fatalf("ExitCode %v, expected %v", exitCode, i)
}
if exitCode, err := s.WaitStop(-1 * time.Second); err != nil || exitCode != i {
t.Fatal("WaitStop returned exitCode: %v, err: %v, expected exitCode: %v, err: %v", exitCode, err, i, nil)
}
}
}
func TestStateTimeoutWait(t *testing.T) {
s := NewState()
started := make(chan struct{})
go func() {
s.WaitRunning(100 * time.Millisecond)
close(started)
}()
select {
case <-time.After(200 * time.Millisecond):
t.Fatal("Start callback doesn't fire in 100 milliseconds")
case <-started:
t.Log("Start callback fired")
}
s.SetRunning(42)
stopped := make(chan struct{})
go func() {
s.WaitRunning(100 * time.Millisecond)
close(stopped)
}()
select {
case <-time.After(200 * time.Millisecond):
t.Fatal("Start callback doesn't fire in 100 milliseconds")
case <-stopped:
t.Log("Start callback fired")
}
}

View File

@@ -98,12 +98,17 @@ func applyVolumesFrom(container *Container) error {
continue
}
stat, err := os.Stat(c.getResourcePath(volPath))
pth, err := c.getResourcePath(volPath)
if err != nil {
return err
}
if err := createIfNotExists(container.getResourcePath(volPath), stat.IsDir()); err != nil {
stat, err := os.Stat(pth)
if err != nil {
return err
}
if err := createIfNotExists(pth, stat.IsDir()); err != nil {
return err
}
@@ -280,8 +285,8 @@ func initializeVolume(container *Container, volPath string, binds map[string]Bin
delete(container.VolumesRW, volPath)
}
container.Volumes[newVolPath] = destination
container.VolumesRW[newVolPath] = srcRW
container.Volumes[volPath] = destination
container.VolumesRW[volPath] = srcRW
if err := createIfNotExists(source, volIsDir); err != nil {
return err

View File

@@ -31,6 +31,7 @@ type Config struct {
DisableNetwork bool
EnableSelinuxSupport bool
Context map[string][]string
Sockets []string
}
// ConfigFromJob creates and returns a new DaemonConfig object
@@ -66,6 +67,9 @@ func ConfigFromJob(job *engine.Job) *Config {
config.Mtu = GetDefaultNetworkMtu()
}
config.DisableNetwork = config.BridgeIface == DisableNetworkBridge
if sockets := job.GetenvList("Sockets"); sockets != nil {
config.Sockets = sockets
}
return config
}

3
docker/README.md Normal file
View File

@@ -0,0 +1,3 @@
docker.go contains Docker's main function.
This file provides first line CLI argument parsing and environment variable setting.

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"log"
"net"
"os"
"runtime"
"strings"
@@ -47,7 +48,7 @@ func main() {
bridgeName = flag.String([]string{"b", "-bridge"}, "", "Attach containers to a pre-existing network bridge\nuse 'none' to disable container networking")
bridgeIp = flag.String([]string{"#bip", "-bip"}, "", "Use this CIDR notation address for the network bridge's IP, not compatible with -b")
pidfile = flag.String([]string{"p", "-pidfile"}, "/var/run/docker.pid", "Path to use for daemon PID file")
flRoot = flag.String([]string{"g", "-graph"}, "/var/lib/docker", "Path to use as the root of the docker runtime")
flRoot = flag.String([]string{"g", "-graph"}, "/var/lib/docker", "Path to use as the root of the Docker runtime")
flSocketGroup = flag.String([]string{"G", "-group"}, "docker", "Group to assign the unix socket specified by -H when running in daemon mode\nuse '' (the empty string) to disable setting of a group")
flEnableCors = flag.Bool([]string{"#api-enable-cors", "-api-enable-cors"}, false, "Enable CORS headers in the remote API")
flDns = opts.NewListOpts(opts.ValidateIp4Address)
@@ -56,8 +57,8 @@ func main() {
flEnableIpForward = flag.Bool([]string{"#ip-forward", "-ip-forward"}, true, "Enable net.ipv4.ip_forward")
flDefaultIp = flag.String([]string{"#ip", "-ip"}, "0.0.0.0", "Default IP address to use when binding container ports")
flInterContainerComm = flag.Bool([]string{"#icc", "-icc"}, true, "Enable inter-container communication")
flGraphDriver = flag.String([]string{"s", "-storage-driver"}, "", "Force the docker runtime to use a specific storage driver")
flExecDriver = flag.String([]string{"e", "-exec-driver"}, "native", "Force the docker runtime to use a specific exec driver")
flGraphDriver = flag.String([]string{"s", "-storage-driver"}, "", "Force the Docker runtime to use a specific storage driver")
flExecDriver = flag.String([]string{"e", "-exec-driver"}, "native", "Force the Docker runtime to use a specific exec driver")
flHosts = opts.NewListOpts(api.ValidateHost)
flMtu = flag.Int([]string{"#mtu", "-mtu"}, 0, "Set the containers network MTU\nif no value is provided: default to the default route MTU or 1500 if no default route is available")
flTls = flag.Bool([]string{"-tls"}, false, "Use TLS; implied by tls-verify flags")
@@ -67,7 +68,7 @@ func main() {
flKey = flag.String([]string{"-tlskey"}, dockerConfDir+defaultKeyFile, "Path to TLS key file")
flSelinuxEnabled = flag.Bool([]string{"-selinux-enabled"}, false, "Enable selinux support")
)
flag.Var(&flDns, []string{"#dns", "-dns"}, "Force docker to use specific DNS servers")
flag.Var(&flDns, []string{"#dns", "-dns"}, "Force Docker to use specific DNS servers")
flag.Var(&flDnsSearch, []string{"-dns-search"}, "Force Docker to use specific DNS search domains")
flag.Var(&flHosts, []string{"H", "-host"}, "The socket(s) to bind to in daemon mode\nspecified using one or more tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd.")
flag.Var(&flGraphOpts, []string{"-storage-opt"}, "Set storage driver options")
@@ -95,6 +96,14 @@ func main() {
log.Fatal("You specified -b & --bip, mutually exclusive options. Please specify only one.")
}
if !*flEnableIptables && !*flInterContainerComm {
log.Fatal("You specified --iptables=false with --icc=false. ICC uses iptables to function. Please set --icc or --iptables to true.")
}
if net.ParseIP(*flDefaultIp) == nil {
log.Fatalf("Specified --ip=%s is not in correct format \"0.0.0.0\".", *flDefaultIp)
}
if *flDebug {
os.Setenv("DEBUG", "1")
}
@@ -162,6 +171,7 @@ func main() {
job.Setenv("ExecDriver", *flExecDriver)
job.SetenvInt("Mtu", *flMtu)
job.SetenvBool("EnableSelinuxSupport", *flSelinuxEnabled)
job.SetenvList("Sockets", flHosts.GetAll())
if err := job.Run(); err != nil {
log.Fatal(err)
}
@@ -259,7 +269,7 @@ func showVersion() {
func checkKernelAndArch() error {
// Check for unsupported architectures
if runtime.GOARCH != "amd64" {
return fmt.Errorf("The docker runtime currently only supports amd64 (not %s). This will change in the future. Aborting.", runtime.GOARCH)
return fmt.Errorf("The Docker runtime currently only supports amd64 (not %s). This will change in the future. Aborting.", runtime.GOARCH)
}
// Check for unsupported kernel versions
// FIXME: it would be cleaner to not test for specific versions, but rather

5
docs/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
# generated by man/man/md2man-all.sh
man1/
man5/
# avoid commiting the awsconfig file used for releases
awsconfig

View File

@@ -13,10 +13,8 @@ RUN pip install mkdocs
#RUN easy_install -U setuptools
#RUN pip install MarkdownTools2
# this week I seem to need the latest dev release of awscli too
# awscli 1.3.6 does --error-document correctly
# https://github.com/aws/aws-cli/commit/edc2290e173dfaedc70b48cfa3624d58c533c6c3
RUN pip install awscli
# this version works, the current versions fail in different ways
RUN pip install awscli==1.3.9
# get my sitemap.xml branch of mkdocs and use that for now
RUN git clone https://github.com/SvenDowideit/mkdocs &&\
@@ -30,8 +28,12 @@ WORKDIR /docs
RUN VERSION=$(cat /docs/VERSION) &&\
GIT_BRANCH=$(cat /docs/GIT_BRANCH) &&\
GITCOMMIT=$(cat /docs/GITCOMMIT) &&\
AWS_S3_BUCKET=$(cat /docs/AWS_S3_BUCKET) &&\
echo "{% set docker_version = \"${VERSION}\" %}{% set docker_branch = \"${GIT_BRANCH}\" %}{% set aws_bucket = \"${AWS_S3_BUCKET}\" %}{% include \"beta_warning.html\" %}" > /docs/theme/mkdocs/version.html
sed -i "s/\$VERSION/$VERSION/g" /docs/theme/mkdocs/base.html &&\
sed -i "s/\$GITCOMMIT/$GITCOMMIT/g" /docs/theme/mkdocs/base.html &&\
sed -i "s/\$GIT_BRANCH/$GIT_BRANCH/g" /docs/theme/mkdocs/base.html &&\
sed -i "s/\$AWS_S3_BUCKET/$AWS_S3_BUCKET/g" /docs/theme/mkdocs/base.html
# note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525
EXPOSE 8000

View File

@@ -1,3 +1,4 @@
James Turnbull <james@lovedthanlost.net> (@jamtur01)
Sven Dowideit <SvenDowideit@fosiki.com> (@SvenDowideit)
O.S. Tezer <ostezer@gmail.com> (@OSTezer)
Fred Lifton <fred.lifton@docker.com> (@fredlf)

View File

@@ -3,7 +3,7 @@
The source for Docker documentation is here under `sources/` and uses extended
Markdown, as implemented by [MkDocs](http://mkdocs.org).
The HTML files are built and hosted on `https://docs.docker.io`, and update
The HTML files are built and hosted on `https://docs.docker.com`, and update
automatically after each change to the master or release branch of [Docker on
GitHub](https://github.com/dotcloud/docker) thanks to post-commit hooks. The
`docs` branch maps to the "latest" documentation and the `master` (unreleased
@@ -21,14 +21,14 @@ In the rare case where your change is not forward-compatible, you may need to
base your changes on the `docs` branch.
Also, now that we have a `docs` branch, we can keep the
[http://docs.docker.io](http://docs.docker.io) docs up to date with any bugs
[http://docs.docker.com](http://docs.docker.com) docs up to date with any bugs
found between Docker code releases.
**Warning**: When *reading* the docs, the
[http://beta-docs.docker.io](http://beta-docs.docker.io) documentation may
[http://docs-stage.docker.com](http://docs-stage.docker.com) documentation may
include features not yet part of any official Docker release. The `beta-docs`
site should be used only for understanding bleeding-edge development and
`docs.docker.io` (which points to the `docs` branch`) should be used for the
`docs.docker.com` (which points to the `docs` branch`) should be used for the
latest official release.
## Contributing
@@ -53,12 +53,12 @@ run `mkdocs serve`
## Style guide
The documentation is written with paragraphs wrapped at 80 colum lines to make
The documentation is written with paragraphs wrapped at 80 column lines to make
it easier for terminal use.
### Examples
When writing examples give the user hints by making them resemble what they see
When writing examples, give the user hints by making them resemble what they see
in their shell:
- Indent shell examples by 4 spaces so they get rendered as code.
@@ -70,13 +70,13 @@ in their shell:
### Images
When you need to add images, try to make them as small as possible (e.g. as
When you need to add images, try to make them as small as possible (e.g., as
gifs). Usually images should go in the same directory as the `.md` file which
references them, or in a subdirectory if one already exists.
## Working using GitHub's file editor
Alternatively, for small changes and typos you might want to use GitHub's built
Alternatively, for small changes and typos you might want to use GitHub's built-
in file editor. It allows you to preview your changes right on-line (though
there can be some differences between GitHub Markdown and [MkDocs
Markdown](http://www.mkdocs.org/user-guide/writing-your-docs/)). Just be
@@ -85,8 +85,8 @@ work!](../CONTRIBUTING.md#sign-your-work)
## Publishing Documentation
To publish a copy of the documentation you need a `docs/awsconfig` To make life
easier for file containing AWS settings to deploy to. The release script will
To publish a copy of the documentation you need a `docs/awsconfig`
file containing AWS settings to deploy to. The release script will
create an s3 if needed, and will then push the files to it.
[profile dowideit-docs] aws_access_key_id = IHOIUAHSIDH234rwf....

214
docs/docs-update.py Executable file
View File

@@ -0,0 +1,214 @@
#!/usr/bin/env python
#
# Sven's quick hack script to update the documentation
#
# call with:
# ./docs/update.py /usr/bin/docker
#
import re
from sys import argv
import subprocess
import os
import os.path
script, docker_cmd = argv
def print_usage(outtext, docker_cmd, command):
help = ""
try:
#print "RUN ", "".join((docker_cmd, " ", command, " --help"))
help = subprocess.check_output("".join((docker_cmd, " ", command, " --help")), stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError, e:
help = e.output
for l in str(help).strip().split("\n"):
l = l.rstrip()
if l == '':
outtext.write("\n")
else:
# `docker --help` tells the user the path they called it with
l = re.sub(docker_cmd, "docker", l)
outtext.write(" "+l+"\n")
outtext.write("\n")
# TODO: look for an complain about any missing commands
def update_cli_reference():
originalFile = "docs/sources/reference/commandline/cli.md"
os.rename(originalFile, originalFile+".bak")
intext = open(originalFile+".bak", "r")
outtext = open(originalFile, "w")
mode = 'p'
space = " "
command = ""
# 2 mode line-by line parser
for line in intext:
if mode=='p':
# Prose
match = re.match("( \s*)Usage: docker ([a-z]+)", line)
if match:
# the begining of a Docker command usage block
space = match.group(1)
command = match.group(2)
mode = 'c'
else:
match = re.match("( \s*)Usage of .*docker.*:", line)
if match:
# the begining of the Docker --help usage block
space = match.group(1)
command = ""
mode = 'c'
else:
outtext.write(line)
else:
# command usage block
match = re.match("("+space+")(.*)|^$", line)
#print "CMD ", command
if not match:
# The end of the current usage block - Shell out to run docker to see the new output
print_usage(outtext, docker_cmd, command)
outtext.write(line)
mode = 'p'
if mode == 'c':
print_usage(outtext, docker_cmd, command)
def update_man_pages():
cmds = []
try:
help = subprocess.check_output("".join((docker_cmd)), stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError, e:
help = e.output
for l in str(help).strip().split("\n"):
l = l.rstrip()
if l != "":
match = re.match(" (.*?) .*", l)
if match:
cmds.append(match.group(1))
desc_re = re.compile(r".*# DESCRIPTION(.*?)# (OPTIONS|EXAMPLES?).*", re.MULTILINE|re.DOTALL)
example_re = re.compile(r".*# EXAMPLES?(.*)# HISTORY.*", re.MULTILINE|re.DOTALL)
history_re = re.compile(r".*# HISTORY(.*)", re.MULTILINE|re.DOTALL)
for command in cmds:
print "COMMAND: "+command
history = ""
description = ""
examples = ""
if os.path.isfile("docs/man/docker-"+command+".1.md"):
intext = open("docs/man/docker-"+command+".1.md", "r")
txt = intext.read()
intext.close()
match = desc_re.match(txt)
if match:
description = match.group(1)
match = example_re.match(txt)
if match:
examples = match.group(1)
match = history_re.match(txt)
if match:
history = match.group(1).strip()
usage = ""
usage_description = ""
params = {}
key_params = {}
help = ""
try:
help = subprocess.check_output("".join((docker_cmd, " ", command, " --help")), stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError, e:
help = e.output
last_key = ""
for l in str(help).split("\n"):
l = l.rstrip()
if l != "":
match = re.match("Usage: docker "+command+"(.*)", l)
if match:
usage = match.group(1).strip()
else:
#print ">>>>"+l
match = re.match(" (-+)(.*) \s+(.*)", l)
if match:
last_key = match.group(2).rstrip()
#print " found "+match.group(1)
key_params[last_key] = match.group(1)+last_key
params[last_key] = match.group(3)
else:
if last_key != "":
params[last_key] = params[last_key] + "\n" + l
else:
if usage_description != "":
usage_description = usage_description + "\n"
usage_description = usage_description + l
# replace [OPTIONS] with the list of params
options = ""
match = re.match("\[OPTIONS\](.*)", usage)
if match:
usage = match.group(1)
new_usage = ""
# TODO: sort without the `-`'s
for key in sorted(params.keys(), key=lambda s: s.lower()):
# split on commas, remove --?.*=.*, put in *'s mumble
ps = []
opts = []
for k in key_params[key].split(","):
#print "......"+k
match = re.match("(-+)([A-Za-z-0-9]*)(?:=(.*))?", k.lstrip())
if match:
p = "**"+match.group(1)+match.group(2)+"**"
o = "**"+match.group(1)+match.group(2)+"**"
if match.group(3):
# if ="" then use UPPERCASE(group(2))"
val = match.group(3)
if val == "\"\"":
val = match.group(2).upper()
p = p+"[=*"+val+"*]"
val = match.group(3)
if val in ("true", "false"):
params[key] = params[key].rstrip()
if not params[key].endswith('.'):
params[key] = params[key]+ "."
params[key] = params[key] + " The default is *"+val+"*."
val = "*true*|*false*"
o = o+"="+val
ps.append(p)
opts.append(o)
else:
print "nomatch:"+k
new_usage = new_usage+ "\n["+"|".join(ps)+"]"
options = options + ", ".join(opts) + "\n "+ params[key]+"\n\n"
if new_usage != "":
new_usage = new_usage.strip() + "\n"
usage = new_usage + usage
outtext = open("docs/man/docker-"+command+".1.md", "w")
outtext.write("""% DOCKER(1) Docker User Manuals
% Docker Community
% JUNE 2014
# NAME
""")
outtext.write("docker-"+command+" - "+usage_description+"\n\n")
outtext.write("# SYNOPSIS\n**docker "+command+"**\n"+usage+"\n\n")
if description != "":
outtext.write("# DESCRIPTION"+description)
if options == "":
options = "There are no available options.\n\n"
outtext.write("# OPTIONS\n"+options)
if examples != "":
outtext.write("# EXAMPLES"+examples)
outtext.write("# HISTORY\n")
if history != "":
outtext.write(history+"\n")
recent_history_re = re.compile(".*June 2014.*", re.MULTILINE|re.DOTALL)
if not recent_history_re.match(history):
outtext.write("June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>\n")
outtext.close()
# main
update_cli_reference()
update_man_pages()

View File

@@ -38,7 +38,7 @@ A Dockerfile is similar to a Makefile.
**sudo docker build -t repository/tag .**
-- specifies a repository and tag at which to save the new image if the build
succeeds. The Docker daemon runs the steps one-by-one, commiting the result
succeeds. The Docker daemon runs the steps one-by-one, committing the result
to a new image if necessary before finally outputting the ID of the new
image. The Docker daemon automatically cleans up the context it is given.
@@ -93,7 +93,7 @@ or
they omit the executable, an ENTRYPOINT must be specified.
When used in the shell or exec formats, the CMD instruction sets the command to
be executed when running the image.
If you use the shell form of of the CMD, the <command> executes in /bin/sh -c:
If you use the shell form of the CMD, the <command> executes in /bin/sh -c:
**FROM ubuntu**
**CMD echo "This is a test." | wc -**
If you run <command> wihtout a shell, then you must express the command as a
@@ -203,4 +203,4 @@ or
run later, during the next build stage.
# HISTORY
*May 2014, Compiled by Zac Dover (zdover at redhat dot com) based on docker.io Dockerfile documentation.
*May 2014, Compiled by Zac Dover (zdover at redhat dot com) based on docker.com Dockerfile documentation.

View File

@@ -51,7 +51,7 @@ saving you from dealing with Pandoc and dependencies on your own computer.
## Building the Fedora / Pandoc image
There is a Dockerfile provided in the `docker/contrib/man/md` directory.
There is a Dockerfile provided in the `docker/docs/man` directory.
Using this Dockerfile, create a Docker image tagged `fedora/pandoc`:
@@ -61,11 +61,11 @@ Using this Dockerfile, create a Docker image tagged `fedora/pandoc`:
Once the image is built, run a container using the image with *volumes*:
docker run -v /<path-to-git-dir>/docker/contrib/man:/pandoc:rw \
-w /pandoc -i fedora/pandoc /pandoc/md/md2man-all.sh
docker run -v /<path-to-git-dir>/docker/docs/man:/pandoc:rw \
-w /pandoc -i fedora/pandoc /pandoc/md2man-all.sh
The Pandoc Docker container will process the Markdown files and generate
the man pages inside the `docker/contrib/man/man1` directory using
the man pages inside the `docker/docs/man/man1` directory using
Docker volumes. For more information on Docker volumes see the man page for
`docker run` and also look at the article [Sharing Directories via Volumes]
(http://docs.docker.io/use/working_with_volumes/).
(http://docs.docker.com/use/working_with_volumes/).

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