Compare commits

...

4094 Commits

Author SHA1 Message Date
Michael Crosby
a1598d1e1c Bump to version 0.8.1
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-18 12:36:05 -08:00
Michael Crosby
049c7effe9 Merge branch 'master' into bump_v0.8.1
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-18 10:51:19 -08:00
Tianon Gravi
277262d9c7 Merge pull request #4205 from tianon/fix-dyntest
Fix dyntest problems finding dockerinit
2014-02-18 11:50:16 -07:00
Tianon Gravi
b10cfaef62 Merge pull request #4206 from tianon/ubuntu-conflicts
Add "Conflicts" to our lxc-docker package
2014-02-18 11:49:47 -07:00
Tianon Gravi
6d1c0a91f8 Add "Conflicts" to our lxc-docker package to make it more clear that we can't/shouldn't be installed alongside either "docker" or "docker.io"
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-18 11:24:33 -07:00
Tianon Gravi
6ccb30a0e5 Fix dyntest problems finding dockerinit
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-18 11:23:37 -07:00
Michael Crosby
6af6b72023 Merge pull request #4198 from alexlarsson/fix-setuid
archive: Fix the storing of setuid bits, etc
2014-02-18 13:11:32 -05:00
Alexander Larsson
5ba2462961 archive: Fix the storing of setuid bits, etc
In commit 3dfc910d77 we changed from
syscall.Chmod() to os.Chmod(), but these take a different form of the
Mode argument. The sycall one takes the raw linux form, wheras
os.Chmod takes the os.FileMode form, and they differ for the higher
bits (setuid, setgid, etc). The raw tar header uses a form which
is compatible with the syscalls, but not the go calls.

We fix this by using hdr.FileInfo() which properly converts the mode
to what go expects.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-18 09:53:30 +01:00
James Turnbull
ef844adc3e Merge pull request #4196 from mahata/fixTypo
Fix typo in 'Using Supervisor with Docker' example
2014-02-17 22:48:54 -05:00
Yasunori Mahata
68de32888b Fix typo in 'Using Supervisor with Docker' example
Docker-DCO-1.1-Signed-off-by: Yasunori Mahata <mahata777@gmail.com> (github: mahata)
2014-02-17 19:43:56 -08:00
Michael Crosby
8f11a1a61f Merge pull request #4193 from creack/3964-add_tar-fix
Fix remote tar ADD behavior
2014-02-17 20:37:42 -05:00
Guillaume J. Charmes
98ce0cdb4f Fix remote tar ADD behavior
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-17 17:08:17 -08:00
Guillaume J. Charmes
a3bc3bb8c3 Merge pull request #4159 from crosbymichael/move-volumes
Move volumes out of container.go and into volumes.go
2014-02-17 16:43:20 -08:00
Guillaume J. Charmes
e9db157bee Merge pull request #4162 from crosbymichael/movelinks
Move links functionality into pkg
2014-02-17 16:34:47 -08:00
Victor Vieux
4187f4e750 Merge pull request #4168 from crosbymichael/add-listenbuffer
Hold connections until the daemon has fully loaded
2014-02-17 16:04:49 -08:00
unclejack
045462a367 Merge pull request #4192 from crosbymichael/fix-404
Fix error message only if no body is retuned
2014-02-18 01:49:08 +02:00
Michael Crosby
e23190b6b3 Improve error message only if no body is returned
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-17 15:29:52 -08:00
Michael Crosby
d55cc64c4e Revert "Merge pull request #4151 from crosbymichael/improve-404-client-message"
This reverts commit 6dd1bb9eb0, reversing
changes made to 23aec9d7fc.

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-17 15:25:00 -08:00
Michael Crosby
e743021193 Move job register into servapi
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-17 15:10:51 -08:00
Victor Vieux
518670f3d8 Merge pull request #4153 from crosbymichael/move-proxy
Move proxy into pkg
2014-02-17 14:51:16 -08:00
Victor Vieux
14ed82fc89 Merge pull request #4188 from unclejack/update_dns_resolver_warning
update warning about local dns resolvers
2014-02-17 14:39:59 -08:00
Andy Rothfusz
c7c825d9a5 Merge pull request #4171 from SvenDowideit/4061-remote-api-warning
change the -H TCP / docker group warning to not reference a resolved issue
2014-02-17 14:36:05 -08:00
unclejack
66c92140c9 Merge pull request #4155 from crosbymichael/remove-reflink
Remove unused reflink files
2014-02-18 00:29:35 +02:00
Michael Crosby
055f1a1f81 Remove verbose logging for non errors
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-17 13:31:13 -08:00
unclejack
85b8025a35 update warning about local dns resolvers
This changes the local DNS resolver warning to explain what the
warning is about and why the default external DNS server is used.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-02-17 23:29:36 +02:00
Victor Vieux
b7c2e8f54e Merge pull request #3817 from philips/CONTRIBUTING-is-just-a-dco
fix(CONTRIBUTING): Developer Certificate of Origin w/o Grant
2014-02-17 12:28:05 -08:00
Victor Vieux
8f140b2ded Merge pull request #4178 from alexlarsson/fix-aufs-plnk
archive: Handle aufs plink hardlinks in ApplyLayer
2014-02-17 11:48:39 -08:00
Alexander Larsson
6889cd9f9c archive: Handle aufs plink hardlinks in ApplyLayer
Files in the .wh..wh.plnk directory are ignored, but other files
inside the tarfile can be hardlinks to these files. This is not
something that normally happens, as on aufs unmount such files are
supposed to be dropped via the "auplink" too, yet images on the index
(such as shipyard/shipyard, e.g. layer
f73c835af6d58b6fc827b400569f79a8f28e54f5bb732be063e1aacefbc374d0)
contains such files.

We handle these by extracting these files to a temporary directory
and resolve such hardlinks via the temporary files.

This fixes https://github.com/dotcloud/docker/issues/3884

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-17 20:46:32 +01:00
Victor Vieux
24498a896f Merge pull request #4187 from creack/fix_hostflag_panic
Fix DOCKER_HOST=tcp:// panic
2014-02-17 11:43:53 -08:00
Michael Crosby
2769d66f78 Merge pull request #4030 from TheDude05/fix-incorrect-ip-test
Fix IPv4 Subnet Test
2014-02-17 14:41:33 -05:00
Guillaume J. Charmes
513d864880 Fix DOCKER_HOST=tcp:// panic
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-17 11:35:26 -08:00
Guillaume J. Charmes
581ee7e584 Merge pull request #4186 from crosbymichael/netlink-maintainer
Make crosbymichael and creack netlink maintainers
2014-02-17 11:19:55 -08:00
Michael Crosby
a75c6907b4 Make crosbymichael and creack netlink maintainers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-17 11:17:05 -08:00
unclejack
f3ff190491 Merge pull request #4131 from tianon/vendor-golang-xattrs
Add vendored archive/tar that includes xattrs patch
2014-02-17 21:12:28 +02:00
Guillaume J. Charmes
19e44217f5 Merge pull request #4167 from shykes/fix-tests-mac
Fix or document broken tests on mac
2014-02-17 11:01:17 -08:00
Daniel Mizyrycki
f056a5d8c5 Merge pull request #4163 from mzdaniel/docker-ci
docker-ci 0.5.6: Fully dockerize docker-ci. Add build test coverage. Add backup builder.
2014-02-17 18:56:32 +00:00
Tianon Gravi
032f45683b Merge pull request #4185 from tmc/fix-building-with-space
Quote volume path in Makefile to allow spaces
2014-02-17 11:53:41 -07:00
Michael Crosby
bc286d651d Merge pull request #4172 from fabiofalci/test_save_and_load
Test for save and load commands
2014-02-17 13:52:44 -05:00
Daniel Mizyrycki
b7db2d5f80 docker-ci 0.5.6: Fully dockerize docker-ci. Add build test coverage. Add backup builder.
Docker-DCO-1.1-Signed-off-by: Daniel Mizyrycki <daniel@docker.com> (github: mzdaniel)
2014-02-17 10:52:39 -08:00
Victor Vieux
382659e03a Merge pull request #4113 from SvenDowideit/build-quiet-help
add a little reenforcement to the help for docker build -q
2014-02-17 10:38:43 -08:00
Guillaume J. Charmes
a1fb3b5282 Merge pull request #3463 from songgao/patch-2
Support submodules when building from a gh repo
2014-02-17 10:28:17 -08:00
Travis Cline
5006509131 Quote volume path to allow spaces
Docker-DCO-1.1-Signed-off-by: Travis Cline <travis.cline@gmail.com> (github: tmc)
2014-02-17 10:24:50 -08:00
Michael Crosby
1f66296c6e Merge pull request #4180 from alexlarsson/fix-restart-race
Avoid temporarily unmounting the container when restarting it
2014-02-17 13:21:53 -05:00
Song Gao
c9ae66ffe3 Support submodules when building from a gh repo
Docker-DCO-1.1-Signed-off-by: Song Gao <song@gao.io> (github: songgao)
2014-02-17 12:08:23 -06:00
unclejack
59e88b0967 Merge pull request #4164 from fabiofalci/cp_error_message
`docker cp` error when container doesn't exist
2014-02-17 19:13:55 +02:00
Tianon Gravi
b762d3a739 Add vendored archive/tar that includes xattrs patch
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-17 08:20:21 -07:00
James Turnbull
ab49015523 Merge pull request #4061 from mikemaccana/patch-1
Add dockerode NodeJS implementation
2014-02-17 10:14:17 -05:00
Alexander Larsson
ab0f3f86c8 Avoid temporarily unmounting the container when restarting it
Stopping the container will typicall cause it to unmount, to keep it mounted
over the stop/start cycle we aquire a temporary reference to it during this time.

This helps with https://github.com/dotcloud/docker/issues/4036

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-17 16:10:54 +01:00
Mike MacCana
02d94dcf6e Add dockerode NodeJS implementation
Also correctly case 'JavaScript'

Docker-DCO-1.1-Signed-off-by: Mike MacCana <mike.maccana@gmail.com> (github: mikemaccana)
2014-02-17 14:04:47 +00:00
Fabio Falci
4ab3c31b15 Test for save and load commands
Improve test for save to tar and load from tar commands.
Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)
2014-02-17 01:52:50 +00:00
Sven Dowideit
797b7d3446 add a little reenforcement to the help for docker build -q
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-02-17 11:35:55 +10:00
Sven Dowideit
8871fd3a31 change the -H TCP / docker group warning to not reference a resolved issue
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-02-17 10:02:23 +10:00
Fabio Falci
a51441278a docker cp error when container doesn't exist
Fix cp api to return a 404 notfound if container doesn't exist.
Fixes #4119.

Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)
2014-02-16 15:49:36 +00:00
Michael Crosby
d5e41c1cb6 Change name to listenbuffer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-15 21:10:37 -08:00
Michael Crosby
778f1bf663 Integration generic socket wait for docker api
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-15 20:49:50 -08:00
Michael Crosby
64716a21e4 Use socket activation pkg for listeners
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-15 20:24:55 -08:00
Michael Crosby
cfb7711a74 Add socket activation for go apps
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-15 20:18:47 -08:00
Michael Crosby
72ed2537b3 Merge pull request #4107 from shykes/separate-api-client
Move remote API client out of the core and into api/
2014-02-15 18:56:49 -05:00
Michael Crosby
4bc966f302 Merge pull request #4102 from shykes/separate-mkbuildclient
Refactor utility `MkBuildContext` to the more generic `archive.Generate`
2014-02-15 18:27:13 -05:00
Solomon Hykes
44e10433c7 api/container.go: an API-specific representation of a container
This breaks the dependency from the remote API implementation to the
internal representation of a container. Instead it uses its own partial
representation of a container, with only required fields.

* This preserves reverse-compatibility with all past implementations of the remote API.

* This clarifies which fields are guaranteed to be present in a response
	A docker remote api server *may* return more fields in a Container
	object, but their presence and semantics are not guaranteed and should
	not be relied upon by client implementations.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-15 23:24:51 +00:00
Solomon Hykes
567a422a65 Remove duplicate function displayablePorts
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-15 14:55:57 -08:00
Solomon Hykes
ee59ba969f Move remote api client to api/
This moves `commands.go` out of the core and into `api/client.go`

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-15 14:55:51 -08:00
Solomon Hykes
9b56da78e0 Refactor utility MkBuildContext to the more generic archive.Generate
This facilitates refactoring commands.go.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-15 14:52:08 -08:00
Solomon Hykes
7286842a12 Document Darwin test failure in a FIXME
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-15 14:40:07 -08:00
Solomon Hykes
353cc8c2a5 Fix engine tests on systems where temp directories are symlinked.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-15 14:39:51 -08:00
Michael Crosby
147b09fae9 Move links to sub pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 18:18:16 -08:00
Michael Crosby
fc952e0de9 Remove container dependency for links
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 18:07:33 -08:00
Victor Vieux
a7ecc3ea11 Merge pull request #4160 from crosbymichael/cleanup-exec-drivers
Cleanup some statements from exec driver work
2014-02-14 17:32:01 -08:00
Michael Crosby
9e3da87a3a Cleanup some statements from exec driver work
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 17:28:50 -08:00
Michael Crosby
bd54d40f68 Move volumes out of container.go and into volumes.go
This helps clean up the container file and move volumes into
one location.  We currently cannot move volumes to a sub pkg
because they depend on Container and also modify fields on the
container.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 17:15:40 -08:00
Michael Crosby
8c39db8f96 Move proxy into pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 15:48:05 -08:00
Michael Crosby
055bfb699b Remove unused reflink files
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 15:32:39 -08:00
Victor Vieux
072268ae56 Merge pull request #4152 from crosbymichael/update-fixme
Update fixme
2014-02-14 15:19:16 -08:00
Michael Crosby
106079daca Update fixme
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 15:17:12 -08:00
Victor Vieux
6dd1bb9eb0 Merge pull request #4151 from crosbymichael/improve-404-client-message
Improve error message for 404 returned by daemon
2014-02-14 11:57:56 -08:00
Michael Crosby
190504472b Improve error message for 404 returned by daemon
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 11:56:52 -08:00
unclejack
23aec9d7fc Merge pull request #4010 from tianon/iceweasel
Swap Firefox to Iceweasel so that the Desktop Integration example is simplified and easier to understand
2014-02-14 21:38:40 +02:00
Michael Crosby
d3a2c15a5d Merge pull request #4146 from alexlarsson/clean-up-archive-closing
Clean up archive closing
2014-02-14 13:48:26 -05:00
Alexander Larsson
d8c888b3f8 Drop EofReader
This is not used any more

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-14 13:46:21 +01:00
Alexander Larsson
f198ee525a Properly close archives
All archive that are created from somewhere generally have to be closed, because
at some point there is a file or a pipe or something that backs them. So, we
make archive.Archive a ReadCloser. However, code consuming archives does not
typically close them so we add an archive.ArchiveReader and use that when we're
only reading.

We then change all the Tar/Archive places to create ReadClosers, and to properly
close them everywhere.

As an added bonus we can use ReadCloserWrapper rather than EofReader in several places,
which is good as EofReader doesn't always work right. For instance, many compression
schemes like gzip knows it is EOF before having read the EOF from the stream, so the
EofCloser never sees an EOF.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-14 13:46:17 +01:00
Alexander Larsson
804690bd07 archive.TarFilter() - properly close readers
CompressStream() now always returns a stream that is closable, and it never
closes the underlying writer. TarFilter() makes sure the decompressed stream
is closed at the and, as well as the PipeWriter.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-14 12:56:55 +01:00
Alexander Larsson
0d9213f859 archive: Close decompressed streams
Various kinds of decompressed streams are really ReadClosers. For instance
gzip.NewReader() is, and the one returned from CmdStream is changed to be
because it returns a PipeReader which is a ReadCloser.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-14 12:56:55 +01:00
Tianon Gravi
32535e0b82 Merge pull request #4123 from tianon/darwin-shasum
Add shasum fallback to hack/make/dynbinary for Darwin
2014-02-13 21:20:49 -07:00
unclejack
7aff7cc4bb Merge pull request #4135 from creack/console_support
Mount-bind the PTY as container console - allow for tmux/screen to run
2014-02-14 03:47:33 +02:00
unclejack
1b8ec8ff1d Merge pull request #4134 from crosbymichael/fix-add-magic-regression
Fix regression with ADD of tar files
2014-02-14 03:43:39 +02:00
Michael Crosby
968f4800b5 Merge pull request #4128 from vieux/fix_header_content-type_api
Fix header content type api
2014-02-13 20:29:09 -05:00
Guillaume J. Charmes
408ea0771a Mount-bind the PTY as container console - allow for tmux/screen to run
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-13 17:23:09 -08:00
Michael Crosby
cad7f7ee50 Fix regression with ADD of tar files
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-13 17:18:38 -08:00
Andy Rothfusz
a4d1da709e Merge pull request #4120 from apocas/master
Image tag endpoint HTTP code typo
2014-02-13 15:49:45 -08:00
Tianon Gravi
cc14441845 Merge pull request #4093 from stpierre/mkimage-yum
Fix bogus variable reference in mkimage-yum.sh
2014-02-13 15:28:47 -07:00
Tianon Gravi
8d2a2ed457 Merge pull request #4125 from maxamillion/maxamillion/add_redhat_sysvinit
Remove unneeded sysctl changes in sysvinit-redhat init script
2014-02-13 12:53:53 -07:00
Guillaume J. Charmes
6cb0a7e04e Merge pull request #4108 from unclejack/remove_default_tcp_bind_address
disallow tcp:// from defaulting to 127.0.0.1:4243
2014-02-13 11:44:31 -08:00
Victor Vieux
0b403b3531 fix content-type for legacy
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-02-13 19:24:40 +00:00
Victor Vieux
4611a6bdd3 fix content-type for job.Stdout.Add
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-02-13 19:21:27 +00:00
Guillaume J. Charmes
9997d0c9ed Merge pull request #4062 from alexlarsson/clean-shutdown
devmapper: Fix shutdown warnings
2014-02-13 10:45:03 -08:00
Victor Vieux
6f10f33387 Merge pull request #4103 from vieux/add_error_build-rm
add error to docker build --rm
2014-02-13 10:35:55 -08:00
Adam Miller
4317011e21 remove unneeded sysctl changes in sysvinit-redhat init script
Docker-DCO-1.1-Signed-off-by: Adam Miller <admiller@redhat.com> (github: maxamillion)
2014-02-13 12:11:38 -06:00
apocas
3417dd4b3b Image tag endpoint doc typo.
Docker-DCO-1.1-Signed-off-by: Pedro Dias <petermdias@gmail.com> (github: apocas)
2014-02-13 18:11:07 +00:00
Michael Crosby
3f1e6b6368 Merge pull request #4096 from alexlarsson/fix-devmapper-race-2
Avoid extra mount/unmount during build
2014-02-13 12:53:29 -05:00
Tianon Gravi
c7840f522c Add shasum fallback to hack/make/dynbinary for Darwin (where sha1sum is not available)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-13 10:27:45 -07:00
Tianon Gravi
f794fbc230 Merge pull request #4043 from tianon/hack-git-detection-and-use
Add better ".git" detection and use
2014-02-13 09:56:14 -07:00
unclejack
47df7a360a Merge pull request #4056 from alexlarsson/fix-devmapper-test
devicemapper: Fix tests on fedora
2014-02-13 15:06:50 +02:00
unclejack
c6edac9a1a Merge pull request #4073 from crosbymichael/fix-docker-cp-close
Ensure docker cp stream is closed properly
2014-02-13 14:12:53 +02:00
unclejack
31dde3ea05 disallow tcp:// from defaulting to 127.0.0.1:4243
This stops docker from accepting tcp:// as a valid bind address.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-02-13 13:54:37 +02:00
Andy Rothfusz
cddea301ab Merge pull request #4111 from merriam/patch-4
Minor error in example code (resubmit #4109)
2014-02-12 18:34:17 -08:00
Andy Rothfusz
9d75155459 Merge pull request #4112 from merriam/patch-3
(resubmit #4110) Add notes about OS/X and remote daemons
2014-02-12 18:33:11 -08:00
Charles Merriam
ba650e0517 Minor error in example code (resubmit #4109)
Docker-DCO-1.1-Signed-off-by: Charles Merriam <charles.merriam@gmail.com> (github: merriam)
2014-02-12 18:13:46 -08:00
Charles Merriam
2a17bdce9e (resubmit) Add notes about OS/X and remote daemons
Docker-DCO-1.1-Signed-off-by: Charles Merriam <charles.merriam@gmail.com> (github: merriam)
2014-02-12 18:11:01 -08:00
Andy Rothfusz
989fee2490 Merge pull request #4090 from SvenDowideit/add-install-make-git-to-devenv
tell the reader that they need git and make for this tutorial
2014-02-12 15:48:39 -08:00
Victor Vieux
a895c7238d add error to docekr build --rm
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-02-12 23:23:42 +00:00
Tianon Gravi
e7f91a6456 Merge pull request #3947 from maxamillion/maxamillion/add_redhat_sysvinit
Add sysvinit/sysconfig files for redhat family of distros (RHEL/CentOS/SL/etc.)
2014-02-12 11:11:42 -07:00
Adam Miller
e36d4d8821 Merge branch 'master' into maxamillion/add_redhat_sysvinit
* master: (64 commits)
  Move the canonical run configuration objects to a sub-package
  Remove useless code in client implementation of 'run'.
  pkg/opts: a collection of custom value parsers implementing flag.Value
  Move api-specific code to the api package
  Fix the tests, too
  Fix the one spot I missed dockerversion
  fix underline/heading
  New package `nat`: utilities for manipulating the text description of network ports.
  rewrite the PostgreSQL example using a Dockerfile, and add details to it
  Move even more stuff into dockerversion
  fix underline/heading
  Move docker version introspection to a sub-package.
  add port forwarding notes for mac/boot2docker docs
  Update remote_api_client_libraries.rst
  Avoid extra mount/unmount during container registration
  add a little more information about the docker run -P option
  lxc: Drop NET_ADMIN capability in non-privileged containers
  devmapper: Remove directory when removing devicemapper device
  add a little info on upgrading
  point out that ENV DEBIAN_FRONTEND will persist, so its not recommended
  ...
2014-02-12 12:04:02 -06:00
Adam Miller
2222cba5ac Added sysvinit/sysconfig files for redhat family of distros (RHEL/CentOS/SL/etc.)
Docker-DCO-1.1-Signed-off-by: Adam Miller <admiller@redhat.com> (github: maxamillion)
2014-02-12 12:03:32 -06:00
Alexander Larsson
59347fa66d Avoid extra mount/unmount during build
CmdRun() calls first run() and then wait() to wait for it to exit,
then it runs commit(). The run command will mount the container and
the container exiting will unmount it. Then the commit will
immediately mount it again to do a diff.

This seems minor, but this is actually problematic, as the Get/Put
pair will create a spurious mount/unmount cycle that is not needed and
slows things down. Additionally it will create a supurious
devicemapper activate/deactivate cycle that causes races with udev as
seen in https://github.com/dotcloud/docker/issues/4036.

To ensure that we only unmount once we split up run() into create()
and run() and reference the mount until after the commit().

With this change docker build on devicemapper is now race-free, and
slightly faster.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-12 16:02:53 +01:00
Chris St. Pierre
85263cdee8 Fix bogus variable reference in mkimage-yum.sh
Fixes this: d419da7227 (commitcomment-5344982)

Docker-DCO-1.1-Signed-off-by: Chris St. Pierre <chris.a.st.pierre@gmail.com> (github: stpierre)
2014-02-12 08:02:36 -05:00
Sven Dowideit
d9f215eb2a tell the reader that they need git and make for this tutorial
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-02-12 16:30:18 +10:00
Michael Crosby
d3c084beee Merge pull request #4085 from shykes/separate-config-hostconfig
Move canonical run configuration objects to a sub-package
2014-02-11 23:37:40 -05:00
Michael Crosby
19755bcdae Merge pull request #4089 from shykes/autopull-useless-code
Remove useless code in client implementation of 'run'.
2014-02-11 23:23:12 -05:00
Solomon Hykes
6393c38339 Move the canonical run configuration objects to a sub-package
* Config is now runconfig.Config
    * HostConfig is now runconfig.HostConfig
    * MergeConfig is now runconfig.Merge
    * CompareConfig is now runconfig.Compare
    * ParseRun is now runconfig.Parse
    * ContainerConfigFromJob is now runconfig.ContainerConfigFromJob
    * ContainerHostConfigFromJob is now runconfig.ContainerHostConfigFromJob

This facilitates refactoring commands.go and shrinks the core.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-11 20:18:46 -08:00
Solomon Hykes
e3140e1e69 Remove useless code in client implementation of 'run'.
This facilitates refactoring commands.go.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-11 20:16:58 -08:00
Victor Vieux
9a9690360c Merge pull request #4074 from shykes/separate-version
Move docker version introspection to a sub-package.
2014-02-11 20:16:00 -08:00
Victor Vieux
28e4de8bfa Merge pull request #4083 from shykes/api-validate-host
Move api-specific code to the api package
2014-02-11 20:10:35 -08:00
Solomon Hykes
0dc9c5531e Merge pull request #76 from tianon/fix-broken-eagle-tests
Fix the tests, too
2014-02-11 20:07:47 -08:00
Solomon Hykes
e6e320acc7 pkg/opts: a collection of custom value parsers implementing flag.Value
This facilitates the refactoring of commands.go.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-11 19:59:52 -08:00
Solomon Hykes
e08a1c53aa Move api-specific code to the api package
This facilitates the refactoring of commands.go.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-11 19:59:52 -08:00
Tianon Gravi
0d871840b2 Fix the tests, too
Seriously.  There's not much codebase left we haven't touched.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-11 19:10:23 -07:00
Michael Crosby
6da1e092dc Merge pull request #4079 from shykes/separate-nat
New package `nat`: utilities for manipulating the text description of network ports
2014-02-11 20:45:58 -05:00
Solomon Hykes
b609e28e5c Merge pull request #75 from tianon/fix-my-broken-eagle
Fix the one spot I missed dockerversion
2014-02-11 17:32:11 -08:00
Tianon Gravi
7ea725fdc5 Fix the one spot I missed dockerversion
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-11 18:23:17 -07:00
Andy Rothfusz
6fd8e5d976 fix underline/heading
Docker-DCO-1.1-Signed-off-by: Andy Rothfusz <github@developersupport.net> (github: metalivedev)
2014-02-11 16:53:08 -08:00
Solomon Hykes
3ecd8ff0c8 New package nat: utilities for manipulating the text description of network ports.
This facilitates the refactoring of commands.go

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-11 16:51:01 -08:00
Andy Rothfusz
e9e4b8dc15 Merge pull request #4034 from SvenDowideit/postgres-example
rewrite the PostgreSQL example using a Dockerfile, and add details to it
2014-02-11 16:49:22 -08:00
Sven Dowideit
6b925a4991 Merge pull request #4050 from SvenDowideit/put-back-LGTM
bring back the explanation of our LGTM process
2014-02-12 10:41:49 +10:00
Solomon Hykes
619ad84216 Merge pull request #74 from tianon/more-separate
Move even more stuff into dockerversion
2014-02-11 16:37:27 -08:00
Sven Dowideit
2ed2ba4e8c rewrite the PostgreSQL example using a Dockerfile, and add details to it
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-02-12 10:30:57 +10:00
Andy Rothfusz
7396741757 Merge pull request #3988 from dafyddcrosby/fix_formatting
Fix RST formatting
2014-02-11 16:30:21 -08:00
Andy Rothfusz
7fe8b50e2e Merge pull request #4057 from SvenDowideit/add-P-docs
add a little more information about the docker run -P option
2014-02-11 16:27:25 -08:00
Tianon Gravi
da04f49b38 Move even more stuff into dockerversion
Also, use it in all the places. :)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-11 17:26:54 -07:00
Andy Rothfusz
ff2260099a Merge pull request #4054 from SvenDowideit/boot2docker-upgrade-doc
add a little info on upgrading b2d
2014-02-11 16:23:11 -08:00
Andy Rothfusz
c76a4e3489 fix underline/heading 2014-02-11 16:19:42 -08:00
Andy Rothfusz
3122b4b470 Merge pull request #4020 from cameronboehmer/patch-1
add vm port forwarding note/example in osx install docs
2014-02-11 16:18:54 -08:00
Andy Rothfusz
0bcabdbdc7 Merge pull request #4072 from 13W/patch-1
Update remote_api_client_libraries.rst
2014-02-11 16:14:22 -08:00
Solomon Hykes
ae3c7dec3b Move docker version introspection to a sub-package.
This facilitates the refactoring of commands.go.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-11 16:10:51 -08:00
Andy Rothfusz
9176b6fd88 Merge pull request #4035 from SvenDowideit/dont-env-debian-frontend
point out that ENV DEBIAN_FRONTEND will persist, so its not recommended
2014-02-11 15:59:10 -08:00
Cameron Boehmer
49b928c0b0 add port forwarding notes for mac/boot2docker docs
Docker-DCO-1.1-Signed-off-by: Cameron Boehmer <cameron.boehmer@gmail.com> (github: cameronboehmer)
2014-02-11 15:26:12 -08:00
Vladimir Bulyga
d35b03ef8d Update remote_api_client_libraries.rst
hello, add please my interface

Docker-DCO-1.1-Signed-off-by: Vladimir <xx@ccxx.cc> (github: 13w)
2014-02-12 01:09:06 +02:00
Michael Crosby
da3e539133 Merge pull request #4067 from alexlarsson/fix-devmapper-race
Avoid extra mount/unmount during container registration
2014-02-11 17:13:33 -05:00
Michael Crosby
a66124ec6a Merge pull request #4055 from alexlarsson/remove-devmapper-dirs
devmapper: Remove directory when removing devicemapper device
2014-02-11 17:05:56 -05:00
unclejack
2a9a83cf94 Merge pull request #4049 from vieux/fix_commit
fix --run in docker commit
2014-02-11 22:33:27 +02:00
Tianon Gravi
029a045ef5 Merge pull request #3990 from 1uptalent/3989-fix-textmate-syntax
Fix textmate syntax bundler organization
2014-02-11 13:16:26 -07:00
Michael Crosby
3c215ba410 Merge pull request #4059 from alexlarsson/no-netadmin-caps
lxc: Drop NET_ADMIN capability in non-privileged containers
2014-02-11 14:20:34 -05:00
Alexander Larsson
0c71015dcf Avoid extra mount/unmount during container registration
Runtime.Register() called driver.Get()/Put() in order to read back the
basefs of the container. However, this is not needed, as the basefs
is read during container.Mount() anyway, and basefs is only valid
while mounted (and all current calls satisfy this).

This seems minor, but this is actually problematic, as the Get/Put
pair will create a spurious mount/unmount cycle that is not needed and
slows things down. Additionally it will create a supurious
devicemapper activate/deactivate cycle that causes races with udev as
seen in https://github.com/dotcloud/docker/issues/4036.

With this change devicemapper is now race-free, and container startup
is slightly faster.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-11 18:02:30 +01:00
Michael Crosby
35821ad78f Ensure docker cp stream is closes properly
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-11 06:21:53 -08:00
Alexander Larsson
6128dcea4a devmapper: Remove byHash hack
We no longer pass "pool" anywhere that uses byHash() per the last
commit, so we can now remove this hack.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-11 13:02:00 +01:00
Alexander Larsson
eab270395e devmapper: Fix shutdown warnings
Shutdown contains debug warnings like:

[debug] deviceset.go:699 [deviceset docker-0:33-17945897] waitRemove(/dev/mapper/docker-0:33-17945897-pool)
[debug] deviceset.go:380 libdevmapper(3): libdm-common.c:552 (-1) Device /dev/mapper/docker-0:33-17945897-pool not found

This is because shutdown is using removeDeviceAndWait() to remove the pool device and the
wait part fails because the pool is gone.

We fix this by adding a pool specific removal function which avoids all the trickiness of the
normal remove.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-11 12:47:59 +01:00
Sven Dowideit
b2146cb0e7 add a little more information about the docker run -P option
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-02-11 20:34:26 +10:00
Alexander Larsson
02fddffd51 lxc: Drop NET_ADMIN capability in non-privileged containers
With this capability set the container can e.g. change the ip address
of his devices to that of another container on the docker0 bridge. In
a quick test I was able to listen to a port on a different ip than the
one docker assigned me, but was not able to hijack an open port
redirection that another container had open. Maybe its possible with
some more knowledge of networking though.

Anyway, network setup is meant to be handled by docker, not the apps,
so I believe denying this is generally in the spirit of docker, and
it closes down potential security issues.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-11 11:17:34 +01:00
Alexander Larsson
eb4578daee devicemapper: Fix tests on fedora
If /dev/loop-control exists on the system running the test then
ioctlLoopCtlGetFree() will be called, but if not it won't.  It does
not exist in the standard docker build environment, so the tests
currently require this to not be called. This makes it instead
optional, allowing the tests to run on e.g. Fedora.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-11 09:42:34 +01:00
Alexander Larsson
2343fe4453 devmapper: Remove directory when removing devicemapper device
We're currently leaving around lots of empty directories in
/var/lib/docker/devicemapper/mnt/ for removed images and containers.
Fix this by removing the directory when the device is removed.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-11 09:40:13 +01:00
Sven Dowideit
82863aecab add a little info on upgrading
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-02-11 14:58:42 +10:00
Sven Dowideit
c4b9e1c9ad point out that ENV DEBIAN_FRONTEND will persist, so its not recommended
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-02-11 13:16:54 +10:00
Sven Dowideit
5051b8610d bring back the explaination of our LGTM process
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-02-11 10:10:50 +10:00
Victor Vieux
5d29749e9d fix --run in docker commit
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-02-10 23:52:15 +00:00
Andy Rothfusz
2975ba6f73 Merge pull request #4019 from ostezer/fix-installation-windows-doc-title
docs: Installation Instruction Title & Description Fixes
2014-02-10 15:26:32 -08:00
Victor Vieux
2dcb48af0f Merge pull request #3524 from tianon/supplementary-groups
Add supplementary groups lookup in sysinit
2014-02-10 14:42:14 -08:00
Victor Vieux
036900a63a Merge pull request #3871 from jdef/patch-1
Update lxc_template.go
2014-02-10 14:38:39 -08:00
O.S.Tezer
10d57b648f docs: Installation Instruction Title & Description Fixes
Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)

1. All titles are listed by simple platform names apart from Windows' "Installing Docker On Windows". Changed this to "Windows" to match the rest.

2. Some articles' description (and title) information does not match the majority. Modified them to match the rest (i.e. Please note this project is currently under heavy development. It should not be used in production.)

3. Removed "Linux" from Gentoo & Ubuntu descriptions.
2014-02-10 23:34:56 +02:00
Guillaume J. Charmes
63f0bbaf14 Merge pull request #4026 from crosbymichael/fix-linking-icc
Add bidirectional iptables rule back to links
2014-02-10 13:13:28 -08:00
Tianon Gravi
0a0406450f Add better ".git" detection and use
This way, packagers can set GIT_DIR appropriately if they'd prefer to not have ".git" inside their working directory.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-10 13:48:43 -07:00
Guillaume J. Charmes
19e01a6363 Merge pull request #3983 from creack/remove_linux_specific
Remove linux specific calls
2014-02-10 12:10:38 -08:00
Guillaume J. Charmes
b42e669a19 Merge pull request #4042 from crosbymichael/allow-empty-cmd
Improve no command handling
2014-02-10 11:53:14 -08:00
Michael Crosby
4482115840 Improve no command handling
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-10 11:04:24 -08:00
Guillaume J. Charmes
66f639e8a6 Merge pull request #4017 from alexlarsson/skip_block_zeroing
devmapper: Enable skip_block_zeroing
2014-02-10 10:33:37 -08:00
Michael Crosby
6174bad135 Merge pull request #4031 from tianon/gopath
Add slightly better GOPATH detection/handling
2014-02-10 13:06:41 -05:00
Michael Crosby
40ede286b8 Merge pull request #4013 from creack/remove_panic_lxc
Remove panic in lxc driver.
2014-02-10 12:52:52 -05:00
Tianon Gravi
d3d85d38fb Add slightly better GOPATH detection/handling
This also adds a new "AUTO_GOPATH" environment variable that will create an appropriate GOPATH as part of the build process.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-09 18:21:01 -07:00
Andrew Williams
95bcb8924a Adjust test to match its comment
Docker-DCO-1.1-Signed-off-by: Andrew Williams <williams.andrew@gmail.com> (github: TheDude05)
2014-02-09 15:36:04 -06:00
Guillaume J. Charmes
3dfc910d77 Remove linux specific calls
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-09 04:23:57 -08:00
Michael Crosby
0cba91e264 Add bidirectional iptables rule back to links
Fixes #4014
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-09 01:43:46 -08:00
Alexander Larsson
695719b29a devmapper: Enable skip_block_zeroing
This makes the device mapper not zero out blocks allocated on the
thinp device. This is safe in our use case, as we access the device
via a filesystem that doesn't leak any uninitialized data to userspace.

This partially helps with https://github.com/dotcloud/docker/issues/3280
and should generally improve preformance on the devicemapper backend.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-09 07:29:28 +01:00
Tianon Gravi
72c72f91c6 Swap Firefox to Iceweasel so that the Desktop Integration example is simplified and easier to understand
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-08 11:34:11 -07:00
Guillaume J. Charmes
7c06d5e34e Remove panic in lxc driver.
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-07 19:09:52 -08:00
Andy Rothfusz
8228e50581 Merge pull request #3987 from SvenDowideit/warn-against-symlinks
please, for the love of Docker, do. not. use. symlinks
2014-02-07 18:48:19 -08:00
Guillaume J. Charmes
105188be2e Merge pull request #3932 from SvenDowideit/no-docker-meeting-channel
remove mention of #docker-meeting
2014-02-07 16:28:10 -08:00
Michael Crosby
36aafeb0b4 Merge pull request #3978 from philips/add-philips-as-pkg-systemd-maintainer
pkg: systemd: add initial MAINTAINERS
2014-02-07 12:32:21 -05:00
Sven Dowideit
f787bec4a6 please, for the love of Docker, do. not. use. symlinks
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-02-07 20:20:41 +10:00
German DZ
ac06646b1f Instructions for Textmate's bundle installation
Docker-DCO-1.1-Signed-off-by: German Del Zotto <germ@ndz.com.ar> (github: GermanDZ)
2014-02-07 09:30:11 +01:00
German DZ
f289b3a19e New folder structure to support TextMate2 bundles format
Docker-DCO-1.1-Signed-off-by: German Del Zotto <germ@ndz.com.ar> (github: GermanDZ)
2014-02-07 09:29:14 +01:00
Dafydd Crosby
b2945f2776 Fix RST formatting 2014-02-07 00:10:47 -07:00
Andy Rothfusz
31a1a815c4 Merge pull request #3984 from jamtur01/secfaw
Added Security FAQ question
2014-02-06 17:40:59 -08:00
James Turnbull
55b74bfe46 Added Security FAQ security
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-02-07 01:42:11 +01:00
Guillaume J. Charmes
d0fc598ce2 Merge pull request #3948 from alexlarsson/devmapper-unmount
Devmapper cleanup and unmount fix
2014-02-06 15:10:06 -08:00
Alexander Larsson
693d3f8c6a devmapper: Fix MountDevice for non-existing Device
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-06 23:08:17 +01:00
Alexander Larsson
304e33a2fe devmapper: Fix UnmountDevice for non-existing device
Properly error out if passed an id that doesn't exist.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-06 22:26:09 +01:00
Tianon Gravi
84285f7539 Merge pull request #3966 from asbjornenge/updated_tmlang
Update TextMate & Sublime Text Syntaxt Highlighting with ONBUILD
2014-02-06 14:20:52 -07:00
Tianon Gravi
1c6f909d32 Merge pull request #3977 from tianon/vim-onbuild
Add "ONBUILD" highlighting to our vim syntax file
2014-02-06 14:20:09 -07:00
Brandon Philips
15711ed670 pkg: systemd: add initial MAINTAINERS
I volunteered for pkg/systemd MAINTAINER and there were no objections
during the #docker-dev meeting. For context I wrote most of the stuff in
here and wrote the dependent calls in api.go. Plus, I actively test the
code via CoreOS.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-02-06 12:04:35 -08:00
Daniel Mizyrycki
c94ad37370 Merge pull request #3913 from mzdaniel/docker-ci-coverage
docker-ci: Add new docker coverage report
2014-02-06 20:04:21 +00:00
Daniel Mizyrycki
25d87553f6 docker-ci: Add new docker coverage report
Docker-DCO-1.1-Signed-off-by: Daniel Mizyrycki <daniel@docker.com> (github: mzdaniel)
2014-02-06 11:59:29 -08:00
Asbjørn Enge
f6c6f303f8 Added support for single quoted strings
Docker-DCO-1.1-Signed-off-by: Asbjorn Enge <asbjorn@hanafjedle.net> (github: asbjornenge)
2014-02-06 20:50:36 +01:00
Asbjørn Enge
888e8da283 Improved regex
Docker-DCO-1.1-Signed-off-by: Asbjorn Enge <asbjorn@hanafjedle.net> (github: asbjornenge)
2014-02-06 20:48:15 +01:00
Asbjørn Enge
3d86f07f87 Updated readme
Docker-DCO-1.1-Signed-off-by: Asbjorn Enge <asbjorn@hanafjedle.net> (github: asbjornenge)
2014-02-06 20:38:25 +01:00
Asbjørn Enge
647db3938d Added suppport for the ONBUILD instruction
Docker-DCO-1.1-Signed-off-by: Asbjorn Enge <asbjorn@hanafjedle.net> (github: asbjornenge)
2014-02-06 20:38:20 +01:00
Asbjørn Enge
e95bb0b4a9 Removed the YAML file since I wasn't using it
Docker-DCO-1.1-Signed-off-by: Asbjorn Enge <asbjorn@hanafjedle.net> (github: asbjornenge)
2014-02-06 20:37:49 +01:00
Asbjørn Enge
6561d65438 Added Dockerfile.tmPreferences for hotkey commenting
Docker-DCO-1.1-Signed-off-by: Asbjorn Enge <asbjorn@hanafjedle.net> (github: asbjornenge)
2014-02-06 20:35:45 +01:00
Michael Crosby
22aeae34c1 Merge pull request #3974 from creack/3967-add_content_type-fix
Add json content type to /containers/json api endpoint
2014-02-06 14:18:00 -05:00
Michael Crosby
3ff62eb227 Merge pull request #3963 from unclejack/update-contributing
Update issue filing & PR submission instructions
2014-02-06 14:17:07 -05:00
Tianon Gravi
e634f23940 Add "ONBUILD" highlighting to our vim syntax file
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-06 11:12:57 -07:00
unclejack
1a12e9fbc6 Merge pull request #3972 from crosbymichael/fix-release-panic
Check for nil information return
2014-02-06 19:39:07 +02:00
Guillaume J. Charmes
d5d948a038 Add json content type to /containers/json api endpoint
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-06 09:28:30 -08:00
Guillaume J. Charmes
983edd40fa Merge pull request #3956 from crosbymichael/no-ping-from-client
Do not ping registry from the cli
2014-02-06 08:14:35 -08:00
Guillaume J. Charmes
2a1609d618 Merge pull request #3945 from crosbymichael/fix-brigeiface
Fix bad rebase where bridgeiface was removed
2014-02-06 07:38:32 -08:00
Alexander Larsson
2c82fd93d8 devmapper: Handle EBUSY while removing
For some reason we seem to get transient EBUSY when removing
thinp devices, which prohibit removing containers. When
this happens we retry a few times which seems to fix the
issue for me.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-06 13:14:49 +01:00
Alexander Larsson
7e25cd5891 devmapper: Use removeDeviceAndWait in DeviceSet.removeDevice()
This makes sure the device is removed just like in deactivateDevice.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-06 13:14:49 +01:00
Alexander Larsson
b95c560fdd devmapper: Move refcounting to DeviceSet
We already have some kind of refcounting in DeviceSet, this fleshes
it out to allow it to completely subsume the refcounting in
devmapper.Driver.

This allows us to drop the double refcounting, and the locking inside
devmapper.Driver. This, in particular the locking simplification will
make it easier in the future to parallelize the device mapper.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-06 13:14:42 +01:00
Michael Crosby
bbe382bec4 Check for nil information return
Fixes #3912
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-06 03:18:12 -08:00
unclejack
1f6000eaa0 update issue filing & PR submission instructions
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-02-06 11:06:25 +02:00
unclejack
09702f4c31 Merge pull request #3954 from ibuildthecloud/broken-1.6-images-api
Fix broken images API for version <1.7
2014-02-06 10:25:14 +02:00
Sven Dowideit
4f7d325c0a Merge pull request #3888 from therealprologic/master
Added installation docs for CRUX as a Docker Host.
2014-02-06 18:15:49 +10:00
Darren Shepherd
55e5e37c4f Fix broken images API for version <1.7
Simple typo, "ID" should be "Id".  This is causing the images response
to not have IDs in it.

Docker-DCO-1.1-Signed-off-by: Darren Shepherd <darren.s.shepherd@gmail.com> (github: ibuildthecloud)
2014-02-05 19:09:55 -07:00
Michael Crosby
e2eace9715 Do not ping registry from the cli
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-05 16:49:43 -08:00
James Mills
f5d028c838 Added installation docs for CRUX as a Docker Host.
Docker-DCO-1.1-Signed-off-by: James Mills <prologic@shortcircuit.net.au> (github: therealprologic)
2014-02-06 10:37:33 +10:00
Andy Rothfusz
9dd92a9823 Merge pull request #3944 from joeshaw/patch-1
Always download things over https
2014-02-05 13:56:41 -08:00
Andy Rothfusz
f9f30f1ced Merge pull request #3938 from SvenDowideit/workdir-doc-tweak
be a little more explicit about what WORKDIR does
2014-02-05 13:54:49 -08:00
Joe Shaw
3841e88625 Always download things over https
Docker-DCO-1.1-Signed-off-by: Joe Shaw <joe@joeshaw.org> (github: joeshaw)
2014-02-05 15:46:41 -05:00
Alexander Larsson
dca21dfac7 devmapper: add and use removeDeviceAndWait helper
This adds a function that calls the lowlevel removeDevice
and then waits for it to finish.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-05 21:27:12 +01:00
Alexander Larsson
63d4b293e7 devmapper: Rename DeviceSet.RemoveDevice to DeleteDevice
"Remove" is a bit overloaded, as it is also what deactivating a
device mapper device is called. Using "delete" is more clear here.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-05 21:27:12 +01:00
Michael Crosby
347dc39427 Fix bad rebase where bridgeiface was removed
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-05 11:20:59 -08:00
Michael Crosby
7fb8738839 Merge pull request #3941 from crosbymichael/merge_release_v0.8.0
Merge release v0.8.0
2014-02-05 14:16:25 -05:00
Michael Crosby
5cb45544c6 Change version to v0.8.0-dev
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-05 09:54:34 -08:00
Michael Crosby
3a8fff964c Merge branch 'release' into merge_release_v0.8.0
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-05 09:54:15 -08:00
Michael Crosby
fe6406b0f2 Merge pull request #3916 from crosbymichael/bump_v0.8.0
Bump to v0.8.0
2014-02-05 12:49:41 -05:00
Sven Dowideit
a17d7d9a73 be a little more explicit about what WORKDIR does
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-02-05 13:26:49 +10:00
Andy Rothfusz
880dc34c0e Merge pull request #3933 from proppy/patch-1
docs/installation/google: remove -mtu flag
2014-02-04 17:24:18 -08:00
Johan Euphrosine
650200239b docs/installation/google: remove -mtu flag 2014-02-04 17:19:05 -08:00
Sven Dowideit
d43c85961f remove mention of #docker-meeting
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-02-05 10:15:22 +10:00
Michael Crosby
cc3a8c8d8e Bump to version 0.8.0
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-04 16:08:57 -08:00
Andy Rothfusz
501d0499f8 Merge pull request #3928 from metalivedev/fixheadings
Fixes headings in Table of Contents, link from FAQ.
2014-02-04 14:59:24 -08:00
Andy Rothfusz
fa0afe89ad Merge pull request #3929 from ostezer/master
mac-installation-docs: Update the installation dir.
2014-02-04 14:51:05 -08:00
Michael Crosby
5a49fba15e Merge pull request #3927 from tianon/release-checklist-mention-contributors
Update RELEASE-CHECKLIST to mention how to get a decent contributors list
2014-02-04 14:46:41 -08:00
O.S.Tezer
aed37e70b9 mac-installation-docs: Update the installation dir.
Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
2014-02-05 00:44:55 +02:00
Andy Rothfusz
18b896e0f0 Fixes headings in Table of Contents, link from FAQ.
Docker-DCO-1.1-Signed-off-by: Andy Rothfusz <github@developersupport.net> (github: metalivedev)
2014-02-04 14:16:27 -08:00
Michael Crosby
9fbb134d87 Merge pull request #3926 from tianon/update-mailmap
Update .mailmap and AUTHORS
2014-02-04 13:33:41 -08:00
Tianon Gravi
bd85631ca5 Update .mailmap and AUTHORS
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-04 13:40:56 -07:00
Andy Rothfusz
3455c6f470 Merge pull request #3918 from ostezer/master
docs: Requirements And Installation on Mac OS X 10.6 Snow Leopard
2014-02-04 12:38:51 -08:00
Tianon Gravi
bac7e741bf Update RELEASE-CHECKLIST to mention how to get a decent contributors list
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-04 13:34:24 -07:00
O.S.Tezer
a9b325e5b0 docs: Installation on Mac OS X 10.6 Snow Leopard
Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
2014-02-04 22:26:06 +02:00
Guillaume J. Charmes
81b2940c89 Merge pull request #3254 from shykes/onbuild
New build instruction: ONBUILD defines a trigger to execute when extending an image with a new build
2014-02-04 11:38:27 -08:00
Solomon Hykes
ded9e0d6df builder: clearly display ONBUILD triggers during a build.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-04 19:11:56 +00:00
unclejack
6ed7461eac Merge pull request #3557 from unclejack/improve_vagrantfile
improve the Vagrant VMs: bump RAM to 512 MB & correct forwarded ports
2014-02-04 10:23:52 -08:00
unclejack
495135b68a Merge pull request #3922 from jpoimboe/iptables-public-dest-port-fix
iptables: use dest_addr and dest_port for public port FORWARD rule
2014-02-04 10:06:43 -08:00
Andy Rothfusz
23959e6cf8 Merge pull request #3919 from SvenDowideit/missing-quote
missing quote quota
2014-02-04 10:03:26 -08:00
Josh Poimboeuf
ea63ade772 iptables: use dest_addr and dest_port for public port FORWARD rule
Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
2014-02-04 11:32:50 -06:00
unclejack
297001f515 improve the Vagrant VMs
This bumps the VM memory and corrects forwarded ports when they're used
already.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-02-04 12:26:14 +02:00
Tianon Gravi
3fda1819ee Merge pull request #3920 from SvenDowideit/hack-spelling
Fix hack/MAINTAINERS.md spelling problems
2014-02-03 21:34:51 -08:00
Sven Dowideit
df4682907d i was reading, and it sprang out at me :)
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-02-04 15:32:19 +10:00
Sven Dowideit
64426c74f2 missing quote quota
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-02-04 15:29:47 +10:00
Tianon Gravi
cb0ac55b5b Merge pull request #3897 from sandaya/master
Update mkimage-arch.sh to set proper permissions on rootfs directory
2014-02-03 18:42:58 -08:00
Samuel Andaya
736bf3f7e6 Update mkimage-arch.sh
mktemp creates a root directory ("/") with permissions set to 700. Default should be 755 so other users in the container can access its subdirs (e.g http user for nginx for /srv/http/test/index.html).

Docker-DCO-1.1-Signed-off-by: Samuel Andaya <samuel@andaya.net> (github: sandaya)
2014-02-03 21:26:47 -05:00
Solomon Hykes
9f994c9646 New build instruction: ONBUILD defines a trigger to execute when extending an image with a new build
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-04 01:31:19 +00:00
Solomon Hykes
a51f5a287b Builder: extract the execution of a single build step into buildFile.BuildStep
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-02-04 01:23:01 +00:00
unclejack
b5d6208ccf Merge pull request #3915 from crosbymichael/no-double-put
No no put put
2014-02-03 16:40:44 -08:00
Guillaume J. Charmes
b56440fa24 Merge pull request #3887 from proppy/detect-network-mtu
docker: detect defaultNetworkMtu from default route
2014-02-03 16:35:15 -08:00
unclejack
5fcd4efd26 Merge pull request #3188 from keyvanfatehi/vagrant-port-forwarding-list
Vagrantfile port forwarding made more flexible (w/ comments)
2014-02-03 16:29:47 -08:00
Michael Crosby
02fdc194fc Fix unmounts out of container export funcs
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-03 16:14:16 -08:00
Michael Crosby
d277a4c0f8 Do not call Put twice and do not call it on defer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-03 16:14:02 -08:00
Andy Rothfusz
8beca66741 Merge pull request #3883 from metalivedev/fix-3879
Fixes #3879 by updating embedding of ascii.io (now asciinema.io)
2014-02-03 16:09:54 -08:00
Keyvan Fatehi
d8718e435d Vagrantfile port forwarding usages documented. Added usage via envvar FORWARD_PORTS for custom port or list of comma-separated ports
Docker-DCO-1.1-Signed-off-by: Keyvan Fatehi <keyvanfatehi@gmail.com> (github: keyvanfatehi)
2014-02-03 16:07:52 -08:00
Andy Rothfusz
fca2f3e742 Updated width to 815 per comment.
Docker-DCO-1.1-Signed-off-by: Andy Rothfusz <github@developersupport.net> (github: metalivedev)
2014-02-03 16:06:29 -08:00
Johan Euphrosine
ab1482e9c2 docs/cli: add mtu option
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: google)
2014-02-03 16:01:38 -08:00
Johan Euphrosine
92e61f89aa docker/config: update -mtu flag default
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: google)
2014-02-03 15:36:39 -08:00
Johan Euphrosine
1b9c5edc6c networkdriver: add ErrNoDefaultRoute
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: google)
2014-02-03 14:27:59 -08:00
unclejack
4e9164ff5f Merge pull request #3908 from crosbymichael/fix-login-prompt
Fix login prompt on push and pull because of error message
2014-02-03 14:19:14 -08:00
Guillaume J. Charmes
a9860d8553 Merge pull request #3911 from crosbymichael/fix-remove-volume
Fix comparing binds and volume ids from other containers
2014-02-03 14:03:57 -08:00
Michael Crosby
720c5774e9 Fix comparing binds and volume ids from other containers
Currently comparing volume ids for binds and other containers are broken
Fixes #3749
Fixes #3885
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-03 13:18:10 -08:00
James DeFelice
17c124baf6 Update lxc_template.go
If networking is disabled, but then pipework is used later to add nics, the network still doesn't function. Using flags=up for empty networking fixes this.
Docker-DCO-1.1-Signed-off-by: James DeFelice <james.defelice@ishisystems.com> (github: jdef)
2014-02-03 16:14:15 -05:00
Michael Crosby
0fa9199f78 Fix login prompt on push and pull because of error message
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-03 11:38:34 -08:00
Tianon Gravi
88d66600b3 Merge pull request #3906 from tianon/unprefix-ubuntu
Remove stackbrew prefix on ubuntu images now that they're reasonably up-to-date and stable
2014-02-03 10:28:50 -08:00
Tianon Gravi
f4a7c43776 Remove stackbrew prefix on ubuntu images now that they're reasonably up-to-date and stable
Everyone probably wants to run `docker pull ubuntu` before building with this change.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-03 11:08:35 -07:00
Michael Crosby
6863145148 Merge pull request #3904 from alexlarsson/fix-docker-commit-output
Fix docker commit output
2014-02-03 10:00:53 -08:00
Michael Crosby
9431b8d503 Merge pull request #3893 from tianon/clean-up-btrfs-error-messages
Fix several btrfs driver error messages
2014-02-03 09:51:41 -08:00
Michael Crosby
fb796900fb Merge pull request #3892 from tianon/remove-btrfs-header-reference
Remove reference to <linux/btrfs.h>, and instead use <btrfs/ioctl.h> like we're supposed to (from btrfs-progs)
2014-02-03 09:41:11 -08:00
Tianon Gravi
f7f8e3c2b3 Fix several btrfs driver error messages
Several of the error messages were wrong, but not one of them was helpful, so this fixes them to include the important information (the actual error), and a correct description of which operation failed.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-03 09:12:18 -07:00
Tianon Gravi
62aa446101 Merge pull request #3899 from tianon/do-not-strip-binaries
Update PACKAGERS.md to explicitly talk about stripping
2014-02-03 07:08:49 -08:00
Alexander Larsson
b61c1d0d42 Fix docker commit output
The id is returned as Id, not ID, so print the right thing.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-02-03 14:59:09 +01:00
Tianon Gravi
7ffd2b0785 Update PACKAGERS.md to explicitly talk about stripping, quoting Dave Cheney from Golang upstream (who is very, very adamant about not stripping Golang compiled binaries)
While there, remove the now-outdated section about `CGO_ENABLED=0`

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-02 22:47:42 -07:00
Tianon Gravi
6922f1be08 Remove reference to <linux/btrfs.h>, and instead use <btrfs/ioctl.h> like we're supposed to (from btrfs-progs)
This fixes compilation issues when btrfs.h isn't available (because we just need the relevant structs, which for userspace programs are supposed to come from btrfs-progs instead of the kernel headers).

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-01 23:23:33 -07:00
Johan Euphrosine
4d0a026c98 docker: detect defaultNetworkMtu from default route
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: google)
2014-02-01 03:46:37 -08:00
Tianon Gravi
e8963748fc Consolidate a bunch of the supplementary-groups tests to cut down on the number of RUN lines in a single Dockerfile within TestBuild
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-31 20:15:24 -07:00
Michael Crosby
4ffc52385c Use type switch instead of reflection
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 20:15:24 -07:00
Tianon Gravi
ee93f6185b Move UserLookup functionality into a separate pkg/user submodule that implements proper parsing of /etc/passwd and /etc/group, and use that to add support for "docker run -u user:group" and for getting supplementary groups (if ":group" is not specified)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-31 20:15:24 -07:00
Victor Vieux
a446b34719 Merge pull request #3832 from jlhawn/3831-auth-tests-server-address
Prevent Tests from creating users on Prod Index
2014-01-31 18:34:13 -08:00
Guillaume J. Charmes
c9f6e446ee Merge pull request #3881 from crosbymichael/no-all-number
Do not generate all numberic truncated ids
2014-01-31 18:07:01 -08:00
Andy Rothfusz
b0f4ad431d Fixes #3879 by updating embedding of ascii.io (now asciinema.io)
Docker-DCO-1.1-Signed-off-by: Andy Rothfusz <github@developersupport.net> (github: metalivedev)
2014-01-31 18:02:45 -08:00
Guillaume J. Charmes
f9b4146ad4 Merge pull request #3868 from 1uptalent/3867-allow-pax-global-extended-headers-to-passthrough
FIX 3867 allow pax global extended headers to passthrough
2014-01-31 17:54:08 -08:00
Michael Crosby
9b7054fd0b Do not generate all numberic truncated ids
Fixes #3869
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 17:37:13 -08:00
Guillaume J. Charmes
87c1403948 Merge pull request #3880 from vieux/fix_docker_login
fix docker login
2014-01-31 17:31:27 -08:00
Victor Vieux
31ee45e6ae Merge pull request #3882 from vieux/fix_compat_api
fix api with old version
2014-01-31 17:25:39 -08:00
Victor Vieux
e43236c78a fix api with old version
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-02-01 01:24:39 +00:00
Guillaume J. Charmes
819c2e3eca Merge pull request #3872 from crosbymichael/network-driver
Remove networking out of core and into a driver
2014-01-31 17:22:37 -08:00
Victor Vieux
d22a39db26 fix docker login
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-02-01 01:14:59 +00:00
Victor Vieux
23815414ea Merge pull request #3878 from vieux/remove_REMOTE_TODO.md
remove REMOTE_TODO.md
2014-01-31 15:50:57 -08:00
Victor Vieux
bf1f655fa2 remove REMOTE_TODO.md
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 23:50:34 +00:00
Michael Crosby
6a1ee89d2d Merge pull request #3827 from vieux/mova_api_package
Move api into sub package
2014-01-31 15:39:33 -08:00
Victor Vieux
9eea7f28f0 Move serveapi to api/api.go
Remove api import from server.go
Rename initapi to init server

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 23:06:00 +00:00
Victor Vieux
78189c9bcf Merge pull request #3876 from dotcloud/fix_panic_mflag
fix panic in mflag
2014-01-31 14:43:16 -08:00
Michael Crosby
cb3bd91689 Fix IP case for BridgeIP
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:18:45 -08:00
Michael Crosby
50fea89782 Fix links test to not accept bridge
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:07:51 -08:00
Michael Crosby
a11bee44d7 Update code from pr #3842 post rebase
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby
1d4de9ce1f Fix port mapping unit tests
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby
167403988d Move network aspect of links into driver as a job
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby
2df0166107 Implement requesting the name ip
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby
49b9813035 Fix integration tests
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby
2d8709696c Fix sending []byte in job env
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby
c712e74b45 Update core calls to network drivers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby
90494600d3 Finish moving networking information into driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-31 12:04:44 -08:00
Michael Crosby
53ee1daa69 Merge pull request #3841 from alexlarsson/separate-base-fs
Separate out graphdriver mount and container root
2014-01-31 11:49:14 -08:00
Victor Vieux
523341d994 Merge pull request #3857 from creack/remove_darwin_files
Remove all darwin specific files and use more generic _unsupported with build tags.
2014-01-31 11:48:10 -08:00
Victor Vieux
65794a2c49 fix panic in mflag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 11:39:29 -08:00
Michael Crosby
674ee1bc8e Merge pull request #3828 from tianon/add-user-email-to-dockerfile
Add dummy "user.email" setting in our Dockerfile for smooth in-container merge commits
2014-01-31 11:03:17 -08:00
Victor Vieux
b881a6c3c2 merge master
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 19:00:06 +00:00
Michael Crosby
f267938fb8 Merge pull request #3844 from clkao/lxc-kill-deprecation
Use lxc-stop -k instead of lxc-kill
2014-01-31 10:57:40 -08:00
Guillaume J. Charmes
ff6409382b Merge pull request #4 from tianon/cross-compile-and-release-linux-i386-and-arm-clients
Update/fix build tags, Dockerfile, and release.sh for proper building and releasing of linux/386 and linux/arm cross-compiled client binaries
2014-01-31 10:51:25 -08:00
Victor Vieux
51d280f944 merge master
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 18:43:34 +00:00
Michael Crosby
643c7dc25d Merge pull request #3829 from vieux/fix_api_regression
Fix ID -> Id api
2014-01-31 10:38:57 -08:00
Andy Rothfusz
70ab72ff32 Merge pull request #3864 from SvenDowideit/lxc-kill-script-workaround-doc
add a known issue for lxc-1.0.0.beta3 and beyond for removeal of lxc-kil...
2014-01-31 10:27:04 -08:00
Andy Rothfusz
feea1dda41 Merge pull request #3861 from metalivedev/fixkerneldeps
Fixed link to kernel dependencies.
2014-01-31 10:25:25 -08:00
unclejack
5258f833bc Merge pull request #3866 from crosbymichael/dont-allocate-1
Do not allocate networks first ip
2014-01-31 09:47:28 -08:00
unclejack
35ef0d37c2 Merge pull request #3800 from vieux/cleanup_jobs
Cleanup jobs
2014-01-31 06:55:12 -08:00
Abel Muiño
ce74c8b4d2 Ignore tar.TypeXGlobalHeader
Docker-DCO-1.1-Signed-off-by: Abel Muiño <amuino@gmail.com> (github: amuino)
2014-01-31 14:57:30 +01:00
Abel Muiño
7b2ec7fb2d Unit test ensuring that a tar.TypeXGlobalHeader does not cause an error
Docker-DCO-1.1-Signed-off-by: Abel Muiño <amuino@gmail.com> (github: amuino)
2014-01-31 14:57:18 +01:00
Tianon Gravi
065dd231dd Update/fix build tags, Dockerfile, and release.sh for proper building and releasing of linux/386 and linux/arm cross-compiled client binaries
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-31 03:16:42 -07:00
unclejack
59ec012efc Merge pull request #3125 from rjeczalik/master
vagrant: added PRIVATE_NETWORK env var
2014-01-31 01:06:47 -08:00
Tianon Gravi
b4604ae7cf Merge pull request #3822 from tianon/install-your-user
Make get.docker.io install directions slightly better by telling user exactly how to add themselves to the "docker" group
2014-01-31 00:56:30 -08:00
Tianon Gravi
56317c74f7 Merge pull request #3760 from tianon/better-nondocker-warning
Update hack/make.sh with slightly clearer output and a more precise "are we in the Docker container?" check
2014-01-31 00:54:44 -08:00
Tianon Gravi
d009cb0bed Merge pull request #3848 from tianon/fix-yaml-space-parsing
Fix fun Travis DCO check YAML parsing issues (especially with commit messages that start with any kind of whitespace, like this one intentionally does)
2014-01-31 00:53:47 -08:00
Michael Crosby
d86c1b064d Not not allocate networks first ip
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-30 23:10:19 -08:00
Victor Vieux
8fbdb7b59e add setSubEnv and getSubEnv
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 04:01:46 +00:00
Victor Vieux
24086fa75d job.error\* now return engine.StatusErr
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 04:01:46 +00:00
Victor Vieux
2b52d6e801 Remove api_params.go
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 03:59:14 +00:00
Victor Vieux
fc2f998822 remove some mkServerFromEngine
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 03:34:50 +00:00
Solomon Hykes
a0d82b17c7 Merge pull request #3863 from vieux/default_getint_0
changed default value of getenvint to 0. fix tests
2014-01-30 19:04:46 -08:00
Sven Dowideit
630459f2b8 add a known issue for lxc-1.0.0.beta3 and beyond for removeal of lxc-kill see #3844
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-01-31 12:30:16 +10:00
Victor Vieux
1498cd4e05 use exists
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 02:21:59 +00:00
Victor Vieux
28b5ae8cc4 changed default value of getenvint to 0. fix tests
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-31 02:06:08 +00:00
Rafal Jeczalik
ce423cc9a8 vagrant: added PRIVATE_NETWORK env var
Docker-DCO-1.1-Signed-off-by: Rafal Jeczalik <rjeczalik@gmail.com> (github: rjeczalik)
2014-01-31 02:03:57 +01:00
Tianon Gravi
7ced204372 Merge pull request #3860 from vieux/integration_makefile
Add "make test-integration"
2014-01-30 16:10:27 -08:00
Andy Rothfusz
e64a9a3bad Merge pull request #3758 from metalivedev/2720-running
Fixes 2720
2014-01-30 16:09:19 -08:00
Andy Rothfusz
98518bbcad Fixed link to kernel dependencies. Wrapped long lines. Removed old tar dependency from list.
Docker-DCO-1.1-Signed-off-by: Andy Rothfusz <github@developersupport.net> (github: metalivedev)
2014-01-30 16:03:13 -08:00
Victor Vieux
e4b3b391d6 Merge pull request #3858 from vieux/fix_testexitcode
fix TestExitCode
2014-01-30 15:52:28 -08:00
Victor Vieux
4326e541f8 add make test-integration
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-30 23:50:23 +00:00
Guillaume J. Charmes
9ae51c7403 Merge pull request #3859 from rogaha/add_missing_attributes
- Fixed the last cli.call's parameter from CmdSearch
2014-01-30 15:44:36 -08:00
Roberto G. Hashioka
2655a108e1 - Fixed the last cli.call's parameter from CmdSearch
Docker-DCO-1.1-Signed-off-by: Roberto Hashioka <roberto.hashioka@docker.com> (github: rogaha)
2014-01-30 23:21:42 +00:00
Guillaume J. Charmes
45dd051e8e Remove all darwin specific files and use more generic _unsupported with build tags.
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-30 23:10:56 +00:00
Victor Vieux
720f64af18 fix TestExitCode
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-30 22:59:21 +00:00
Victor Vieux
9481afa617 Merge pull request #3854 from vieux/fix_tests
remove TestAllocateTCPPortLocalhost faillure in tests
2014-01-30 13:59:32 -08:00
Victor Vieux
8e619e13ca remove TestAllocateTCPPortLocalhost faillure in tests
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-30 21:53:32 +00:00
Victor Vieux
0c8ddd502e Merge pull request #3833 from vieux/fix_env_conversion_issues
Fix env conversion issues in env
2014-01-30 13:31:25 -08:00
Victor Vieux
9261511aa5 refactor all *FromJob functions
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-30 20:45:32 +00:00
Tianon Gravi
c8d1596902 Fix fun Travis DCO check YAML parsing issues (especially with commit messages that start with any kind of whitespace, like this one intentionally does)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-30 12:27:45 -07:00
Victor Vieux
0942e5c89c Merge pull request #3842 from jpoimboe/iptables-insert-masq
network: insert masq rule
2014-01-30 11:26:32 -08:00
Chia-liang Kao
b111fc3646 Use lxc-stop -k when lxc-kill is not found
lxc-kill was removed in lxc/lxc@33ddfc2

Docker-DCO-1.1-Signed-off-by: Chia-liang Kao <clkao@clkao.org> (github: clkao)
2014-01-31 03:22:22 +08:00
Andy Rothfusz
43b7667dcc Merge pull request #3836 from SvenDowideit/mint-cgroups-lite-docs
Add troubleshooting for missing cgroups on mint 16
2014-01-30 10:58:26 -08:00
Victor Vieux
c7b415d3b4 Merge pull request #3846 from tianon/unclejack-maintainer
Make unclejack the official Vagrantfile maintainer
2014-01-30 10:55:38 -08:00
Tianon Gravi
238dba831a Make unclejack the official Vagrantfile maintainer
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-30 11:51:25 -07:00
Michael Crosby
637a1dcab6 Merge pull request #3718 from alexlarsson/btrfs
Add btrfs support to docker
2014-01-30 10:00:44 -08:00
Josh Poimboeuf
cc382ec628 network: insert masq rule
This fixes IP masquerading on systems with reject rules at the end of
the POSTROUTING table, by inserting the rule at the beginning of the
table instead of adding it at the end.

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
2014-01-30 11:06:28 -06:00
Alexander Larsson
fab19d197c Separate out graphdriver mount and container root
This separates out the directory as returned from the graphdriver (the
"base" fs) from the root filesystem of the live container. This is
necessary as the "diff" operation needs access to the base filesystem
without all the mounts that the running container needs (/.dockerinit,
volumes, etc).

We change container in the following way:

Container.RootfsPath() returns the the directory which will be used as
the root in a running container. It is always of the form
"/var/lib/docker/container/<id>/root" and is a private bind mount to
the base filesystem. It is only available while the container is running.

Container.BasefsPath() returns the raw directory from the graph driver
without the container runtime mounts. It is availible whenever the
container is mounted (in between a container.Mount()/Unmount() pair,
which are properly refcounted).

This fixes issue #3840

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-30 16:43:53 +01:00
Alexander Larsson
fc1169a220 pkg/mount: Add "private" flag
This allows "mount --make-private" functionallity.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-30 16:41:45 +01:00
Sven Dowideit
626a2e1112 Add troubleshooting for missing cgroups on mint 16 #3602
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-01-30 20:53:27 +10:00
James Turnbull
41c10fb256 Merge pull request #3835 from thinkingbox/master
Fix typo
2014-01-29 23:55:36 -08:00
Piergiuliano Bossi
7d95ce6ddd Fix typo
Docker-DCO-1.1-Signed-off-by: Piergiuliano Bossi <pgbossi@gmail.com> (github: thinkingbox)
2014-01-29 23:07:23 -05:00
Tianon Gravi
ab50985ac9 Merge pull request #3834 from philips/fix-socket-activation-systemd
contrib: systemd: make socket-activation Restart same as the main service file
2014-01-29 17:46:25 -08:00
Brandon Philips
4dab34c204 contrib: systemd: make socket-activation Restart=always
Do as was done to f09a78cd21 in the
socket-activation example.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-29 17:42:32 -08:00
Tianon Gravi
de8480f656 Merge pull request #3531 from lsm5/docker-systemd
ExecStartPre commands updated in systemd service file
2014-01-29 17:38:10 -08:00
Josh Hawn
c914abaf15 Prevent Tests from creating users on Prod Index
The integration tests had previously used the environment variable
DOCKER_INDEX_URL but it was apparently removed several months ago.

Change the integration auth tests to specify the ServerAddress field
of the AuthConfig struct to use the staging deployment of the index.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-01-29 17:18:11 -08:00
Victor Vieux
187646127f fix convertion issues
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-30 00:56:42 +00:00
Victor Vieux
5b82a1b726 add tests
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-30 00:55:29 +00:00
Tianon Gravi
95dff84728 Merge pull request #3734 from stpierre/mkimage-yum
Added new mkimage-yum.sh script to create CentOS base images
2014-01-29 14:52:51 -08:00
Victor Vieux
54072dbbd6 fix ID -> Id api
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-29 20:31:49 +00:00
Tianon Gravi
94c5f51c4a Add dummy "user.email" setting in our Dockerfile for smooth in-container merge commits
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-29 13:13:32 -07:00
unclejack
6013cbdce8 Merge pull request #3810 from jpoimboe/iptables-forward-public-ports
network: add publicly mapped ports to FORWARD table
2014-01-29 11:53:26 -08:00
Victor Vieux
f556cd4186 move api to it's own package
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-29 19:26:54 +00:00
Michael Crosby
6fdc543443 Merge pull request #3819 from crosbymichael/move-port-mapper
Move port mapper out of core and into network drivers
2014-01-29 11:16:51 -08:00
Victor Vieux
7b7f7e4436 add setSubEnv and getSubEnv
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-29 18:53:43 +00:00
Victor Vieux
55d7aa1b49 job.error\* now return engine.StatusErr
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-29 18:52:55 +00:00
Victor Vieux
217ad5e5e6 Remove api_params.go
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-29 18:52:54 +00:00
Michael Crosby
c00cb1aca1 Merge pull request #3808 from alexlarsson/execdriver-get-pids-for-container
execdriver: Make GetPidsForContainer() a driver call
2014-01-29 10:38:10 -08:00
Michael Crosby
4a35146461 Merge pull request #3820 from vieux/remove_runtime_from_api
Remove runtime from api
2014-01-29 10:35:27 -08:00
Tianon Gravi
e1b210bee9 Merge pull request #3588 from tianon/debootstrap-tweaks
Add a few small tweaks to mkimage-debootstrap, especially to help with lucid
2014-01-29 08:42:14 -08:00
Lokesh Mandvekar
a9d0bbcfc6 remove ip fowarding from systemd (fixed: commit #3801)
Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com> (github: lsm5)
2014-01-29 11:06:23 -05:00
Lokesh Mandvekar
f09a78cd21 ExecStartPre commands updated
Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com> (github: lsm5)

systemd service no longer does '/bin/mount/ --make-rprivate /'.
Core issue fixed by Alex Larsson (commit 157d99a).

ip forwarding enabled.
2014-01-29 11:06:23 -05:00
Tianon Gravi
6cfe778c2c Make get.docker.io install directions slightly better by telling user exactly how to add themselves to the "docker" group
As a bonus, if the user has run this script the way we recommend (ie, without "sudo" or "su", run as their user), we can actually give them the exact command they'll need with their correct username substituted appropriately.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-29 00:10:39 -07:00
Andy Rothfusz
c82a2d1adf Merge pull request #3813 from jpoimboe/update-ip_forward-docs
docs: remove ip_forward enabling step
2014-01-28 18:08:22 -08:00
Andy Rothfusz
f3a032f27b Address feedback from @jamtur01.
Docker-DCO-1.1-Signed-off-by: Andy Rothfusz <github@developersupport.net> (github: metalivedev)
2014-01-28 17:32:05 -08:00
Victor Vieux
abd64a2b00 move warnings to the job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-29 01:17:55 +00:00
Michael Crosby
b3b12f0059 Move port mapper tests out of core and into portmapper
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-28 17:10:13 -08:00
Victor Vieux
d41844ed2d remove enableCors from the config and move it as a job arg
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-29 00:20:51 +00:00
Michael Crosby
99756ef11f Initial move of port mapper code into sub pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-28 15:42:46 -08:00
Brandon Philips
8458f99a38 fix(CONTRIBUTING): Developer Certificate of Origin w/o Grant
In 7fb55f7725 the DCO lost the grant so
change the title back to just DCO.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-28 13:50:03 -08:00
Victor Vieux
fc697e3fd7 Merge pull request #3794 from vieux/fix_commands_error
check for errors in call, not readBody
2014-01-28 12:57:02 -08:00
Michael Crosby
2723133a69 Merge pull request #3105 from philips/add-socket-activation
Add socket activation
2014-01-28 11:38:25 -08:00
Guillaume J. Charmes
556091ef8b Merge pull request #3811 from jpoimboe/remove-ip_forward-warning
remove ip_forward warning
2014-01-28 11:37:13 -08:00
Josh Poimboeuf
aeb2f479fa docs: remove ip_forward enabling step
Now that docker sets /proc/sys/net/ipv4/ip_forward by default, remove
the step to enable it in the installation docs.

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
2014-01-28 13:29:27 -06:00
Josh Poimboeuf
ef6c0d5341 remove ip_forward warning
Now that docker sets /proc/sys/net/ipv4/ip_forward by default (unless
the user manually specifies "-ip-forward=false"), there's no need to
warn if its disabled.

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
2014-01-28 13:27:56 -06:00
Guillaume J. Charmes
4ab59179e7 Merge pull request #3801 from tianon/ip-forward
Add --ip-forward flag to daemon (enabled by default)
2014-01-28 11:17:45 -08:00
Josh Poimboeuf
db250f709a network: add publicly mapped ports to FORWARD table
Allow publicly mapped ports to be made public beyond the host.  This is
needed for distros like Fedora and RHEL which have a reject all rule at
the end of their FORWARD table.

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
2014-01-28 13:11:49 -06:00
Guillaume J. Charmes
d4ea6308fd Merge pull request #3759 from jpoimboe/links-iptables-cleanup
network: remove unnecessary links iptables rule for return traffic
2014-01-28 11:10:36 -08:00
Guillaume J. Charmes
13ee6d8eee Merge pull request #3807 from pwaller/fix-unclear-error
Fix unclear error message when deleting container
2014-01-28 10:35:09 -08:00
Michael Crosby
09ed7e8878 Merge pull request #3805 from alexlarsson/execdriver-drop-getexitcode
exexdriver: Make Command.GetExitCode an internal call
2014-01-28 10:34:00 -08:00
Alexander Larsson
9ad70528b7 exexdriver: Make Command.GetExitCode an internal call
This code only works for backends that directly spawn the child
via the Command. It will not work for the libvirt backend. So
we move this code into the individual backends that need it.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-28 19:20:35 +01:00
Alexander Larsson
335bc39c9a execdriver: Make GetPidsForContainer() a driver call
The current implementation is lxc specific.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-28 16:21:49 +01:00
Peter Waller
70c1781e07 Fix unclear error message when deleting container
I was getting the following error:

```
$ bundles/0.7.6-dev/binary/docker-0.7.6-dev run -rm -v=/var/run:/foo base echo hi
hi
2014/01/28 14:24:46 Error: container_delete: No such id: run
```

This commit makes the true origin of the error clearer. Issue #3806 is
tracking the cause of the error.

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
2014-01-28 14:28:13 +00:00
Alexander Larsson
a1851a6d3e btrfs: Add comment to Put()
Document why we don't need to do anything in Put().

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-28 09:56:51 +01:00
Tianon Gravi
cabe624c82 Add --ip-forward flag to daemon (enabled by default) which automatically sets "net.ipv4.ip_forward" to 1
See also https://groups.google.com/d/topic/docker-dev/DCjF5Prx7HA/discussion

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-27 21:35:05 -07:00
Brandon Philips
4e5859e830 fix(api): , _ removed to simplify code in range
Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
7839350dd5 chore(coreos/go-systemd): copy to github.com/dotcloud/docker/systemd/pkg/activation
Via https://github.com/dotcloud/docker/pull/3105#issuecomment-32807547

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
def0952606 chore(systemd): use activation.Listeners instead of Files
Use this Listeners() API that was exposed to save a few more lines of
boiler plate code.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
f82d1291cc vendor: bump github.com/coreos/go-systemd/activation
tests now work in the Docker tree with

`go test github.com/coreos/go-systemd/activation`

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
1603039a71 chore(*): go fmt
I noticed that travis was failing, go fmt to make it happy.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
1f44921c51 fix(contrib/init/systemd): remove mount rprivate
Docker does this now via 157d99a727

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
2fe7588af7 fix(cli.rst): add missing underscores
As suggested by @metalivedev

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
7f9d3268bf Allow fd:// like unix:// and tcp://
Somthing like 20605eb310

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
566fb31c88 Move listenfd to utility package
Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
6acc99889d fix(docs): add Systemd in front of socket activation
Suggested by SvenDowideit.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
4a90f00ab7 docs: improve the socket activation cli docs
as suggested by SvenDowideit expand the docs to have more information on
socket activation.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
cfeb1f0f65 fix(docs): fixup based on changes in master
Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:18:09 -08:00
Brandon Philips
87fb2c973d server: add socket activation
This adds the ability to socket activate docker by passing in
`-H fd://*` along with examples systemd configuration files.

The fastest way to test this is to run:

```
/usr/lib/systemd/systemd-activate -l 127.0.0.1:2001 /usr/bin/docker -d -H 'fd://*'
docker -H tcp://127.0.0.1:2001 ps
```

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:17:07 -08:00
Brandon Philips
e996daeed0 vendor: add github.com/coreos/go-systemd/activation
Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:17:07 -08:00
Michael Crosby
ed12818f99 Merge pull request #3789 from pwaller/issue-3674
Fix for #3674 Can't `rm` containers when disk full
2014-01-27 17:00:16 -08:00
Michael Crosby
eaca205942 Merge pull request #3796 from tianon/dockerfile-btrfs
Update Dockerfile to be based on 13.10 instead of 12.04, add linux-libc-dev dep, remove s3cmd backports nonsense
2014-01-27 16:54:06 -08:00
Tianon Gravi
94566b748e Update Dockerfile to be based on 13.10 instead of 12.04 so that we can remove our s3cmd backports need, and so we can have the new linux-libc-dev dependency we need for compiling the btrfs driver without nasty APT hackery
In addition, we've now hard-coded LXC version 0.8 compiled from source so that we can have the most stable dev environment possible.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-27 17:18:33 -07:00
Guillaume J. Charmes
1ddd815191 Merge pull request #3798 from vieux/3777_fix
fix mflag import
2014-01-27 15:31:54 -08:00
Victor Vieux
abbae8f764 check for errors in call, not readBody
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-27 23:31:04 +00:00
Victor Vieux
c4e7b0e4d5 fix mflag import
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-27 23:29:56 +00:00
Andy Rothfusz
07c4eda46a Fix 2720 -- Expanded documentation for docker run.
Docker-DCO-1.1-Signed-off-by: Andy Rothfusz <github@developersupport.net> (github: metalivedev)
2014-01-27 14:44:24 -08:00
Peter Waller
c4c558d138 Add Peter Waller <p@pwaller.net> to AUTHORS
Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
2014-01-27 22:21:58 +00:00
Guillaume J. Charmes
77d4df1e0b Merge pull request #3787 from pwaller/issue-3786
Fix for issue #3786 `docker rm` unmounts in the wrong order
2014-01-27 13:41:14 -08:00
Victor Vieux
99dd387fd7 Merge pull request #3784 from 1uptalent/3783_release_push_lock
FIX #3783: Release the push lock after the image push is completed
2014-01-27 13:40:28 -08:00
Victor Vieux
f4b75e06bc Merge pull request #3790 from crosbymichael/move-port-allocators
Move port allocators into network driver
2014-01-27 13:36:33 -08:00
Peter Waller
6f3d8d3908 Fix for #3674 Can't rm containers when disk full
Rather than creating a new directory and moving it there before
deleting that new directory, just move the directory we intend to
delete.

In the old way, the Mkdirall could fail, which meant that you
couldn't delete containers when the disk was full.

Tested.

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
2014-01-27 21:34:11 +00:00
Victor Vieux
91b11dd156 Merge pull request #3776 from fabiofalci/container_list_test
Improve test for container list `ps`
2014-01-27 13:32:23 -08:00
Andy Rothfusz
bbfc531b51 Merge pull request #3542 from SvenDowideit/curl-prepare-commit-msg
move the contributing hook into contrib, and use curl in the same way as the gofmt above
2014-01-27 12:09:03 -08:00
Andy Rothfusz
093531ddb7 Merge pull request #3781 from mattymo/patch-1
Clean up grammar on puppet.rst
2014-01-27 12:06:43 -08:00
Andy Rothfusz
adae0b248d Merge pull request #3773 from mnaberez/supervisord-apache2-example
Use exec to replace bash with apache2 after environment is set up
2014-01-27 12:01:59 -08:00
Andy Rothfusz
ef37fdd1a8 Merge pull request #3770 from aaronfeng/fix-image-name-pos
move image name into correct position
2014-01-27 11:56:36 -08:00
Victor Vieux
f9e9637a9f Merge pull request #3756 from crosbymichael/fix-register-nobridge
Refactor and fix register interface when bridge does not exist
2014-01-27 10:40:42 -08:00
Peter Waller
32753c3d24 Fix for issue #3786
This is a fix for the case that one mount is inside another mount and
docker can't then delete the resulting container.

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
2014-01-27 17:31:25 +00:00
Abel Muiño
77a34920b2 Release the push lock at the end
Docker-DCO-1.1-Signed-off-by: Abel Muiño <amuino@gmail.com> (github: amuino)
2014-01-27 16:22:59 +01:00
mattymo
551e1a766c Update puppet.rst 2014-01-27 18:21:48 +03:00
mattymo
03d9984f17 Clean up grammar on puppet.rst 2014-01-27 15:13:17 +03:00
Fabio Falci
1ee1dc2340 Improve test for container list ps
Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)
2014-01-26 23:14:50 +00:00
Michael Crosby
5e69b3837b Fix issues from rebase on master
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-26 14:07:43 -08:00
Michael Crosby
da61b99b39 Simplify logic for registering ports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-26 14:01:38 -08:00
Michael Crosby
ac2a4e6410 Refactor to support multiple ip addresses
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-26 14:01:38 -08:00
Guillaume J. Charmes
da30eb7c20 Remove std sort and use custom sort for performances
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-26 14:01:38 -08:00
Michael Crosby
303ed3c830 Add port allocator and move ipset into orderedintset
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-26 14:01:38 -08:00
Tianon Gravi
b994c13159 Update hack/make.sh with slightly clearer output and a more precise "are we in the Docker container?" check
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-26 13:24:03 -07:00
Mike Naberezny
2ba2a8ae40 Use exec to replace bash with apache2 after environment is set up
Docker-DCO-1.1-Signed-off-by: Mike Naberezny <mike@naberezny.com> (github: mnaberez)
2014-01-26 11:53:22 -08:00
James Turnbull
ffdc2d2657 Merge pull request #3771 from srt32/patch-1
Update README.md typo
2014-01-26 09:07:00 -08:00
Aaron Feng
31e5958009 move image name into correct position
Docker-DCO-1.1-Signed-off-by: Aaron Feng <aaron.feng@gmail.com> (github: aaronfeng)
2014-01-26 08:11:30 -05:00
Simon Taranto
33ee78004f Update README.md
Docker-DCO-1.1-Signed-off-by: Simon Taranto <simon.taranto@gmail.com> (github: srt32)
2014-01-26 00:08:55 -07:00
Josh Poimboeuf
5c04f1bcc7 network: remove unnecessary links iptables rule for return traffic
Currently there are two iptables rules per port for each link: one to
allow the parent to connect to the child's port, and another one to
allow return traffic from the child back to the parent.  The second rule
shouldn't be needed because the "ctstate RELATED,ESTABLISHED" rule can
already allow all established traffic.

So this patch does the following:

1. Move the RELATED,ESTABLISHED rule to be _before_ the potential
   inter-container communication DROP rule so it will work for
   inter-container traffic as well.  Since we're inserting, everything
   is reversed chronologically so it should be inserted _after_ we
   insert the DROP.  This also has a small performance benefit because
   it will be processed earlier and it's generally one of the most
   commonly used rules.

2. Get rid of the unnecessary return traffic rule per link.

3. Also move the other "Accept all non-intercontainer outgoing packets"
   rule to earlier.  This gives a small performance benefit since it's
   also a commonly used rule, and it makes sense to logically group it
   next to the ctstate rule.

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
2014-01-24 21:20:34 -06:00
Guillaume J. Charmes
b1d26985d0 Update tests to have custom routes
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-24 17:18:48 -08:00
Guillaume J. Charmes
eedaf08eb8 Merge branch 'fix-register-nobridge' of https://github.com/crosbymichael/docker into crosbymichael-fix-register-nobridge 2014-01-24 17:02:19 -08:00
Victor Vieux
e6ae8f6d21 Merge pull request #3757 from vieux/auth_job
move auth to a job
2014-01-24 16:54:48 -08:00
Victor Vieux
1f8b1bb84e move auth to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 16:51:02 -08:00
Victor Vieux
e2003fea3a Merge pull request #3728 from vieux/container_job
Move containers to a job
2014-01-24 16:10:46 -08:00
Victor Vieux
5ea2986ce5 Move containers to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 16:07:42 -08:00
Victor Vieux
748a009cc4 Merge pull request #3727 from vieux/push_job
push job
2014-01-24 15:42:22 -08:00
Victor Vieux
e8ee18fa29 push job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 15:34:08 -08:00
Victor Vieux
4a708f9f5b Merge pull request #3739 from vieux/events_jobs
move events to job
2014-01-24 15:32:25 -08:00
Victor Vieux
5cc6312bfc move events to job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 15:28:17 -08:00
Victor Vieux
59df776469 Merge pull request #3621 from vieux/inspect_job
Inspect job
2014-01-24 15:22:20 -08:00
Victor Vieux
5fd8aa02ba merge 2 jobs, no more buffer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 15:13:30 -08:00
Victor Vieux
a7e9baaf89 update attach to use the new job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 15:11:38 -08:00
Victor Vieux
134435a79c move inspect to 2 jobs
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 15:11:38 -08:00
Victor Vieux
22fb3e0f38 Merge pull request #3645 from vieux/rmi_job
Move rmi to a job
2014-01-24 15:10:02 -08:00
Victor Vieux
f41e0cf048 fix error handling
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:59:46 -08:00
Victor Vieux
177f658882 remove buffer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:57:18 -08:00
Victor Vieux
564e6bc780 Move docker rmi to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:55:11 -08:00
Victor Vieux
4a96c329c0 Merge pull request #3725 from vieux/pull_import_job
Pull import job
2014-01-24 14:47:40 -08:00
Victor Vieux
35641f0ec7 remove useless flush method
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:46:31 -08:00
Victor Vieux
90e9a2d85a fix flush
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:46:31 -08:00
Victor Vieux
9dcbdbc4b1 move pull and import to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:46:31 -08:00
Victor Vieux
9d44298c5e Merge pull request #3741 from vieux/build_job
move build to a job
2014-01-24 11:34:32 -08:00
Victor Vieux
56ec121925 Merge pull request #3726 from vieux/attach_stderr
don't user os.Stderr in attach
2014-01-24 10:55:55 -08:00
James Turnbull
f1fbf5f219 Merge pull request #3748 from metalivedev/fixarticles
Fix TOC for Articles
2014-01-24 10:01:54 -08:00
Andy Rothfusz
6cae33ca0f Fix TOC for Articles 2014-01-23 18:55:26 -08:00
Victor Vieux
641005777a Merge pull request #3747 from crosbymichael/move-networking
Move IP Allocator into sub package and out of the core
2014-01-23 16:43:21 -08:00
Victor Vieux
42e35ecff3 remove useless anonymous field mentions
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-23 16:20:51 -08:00
Victor Vieux
415379e45d move build to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-23 16:08:05 -08:00
Andy Rothfusz
a71e7fe8ab Merge pull request #3730 from SvenDowideit/JSON-RUN-format-docs
talk about the new exec form of RUN (Closes #3723) implemented by #3558
2014-01-23 15:54:00 -08:00
Victor Vieux
0dd856ee7f Merge pull request #3724 from creack/extract-lxc-phase-2
Refactor process to command
2014-01-23 15:28:45 -08:00
Victor Vieux
f948820d03 Merge pull request #3743 from pmorie/typo
Fix typo in comment in container.go
2014-01-23 15:15:18 -08:00
Paul Morie
2f57eb0410 Fix typo in container.go
Docker-DCO-1.1-Signed-off-by: Paul Morie <pmorie@gmail.com> (github: pmorie)
2014-01-23 18:10:33 -05:00
Michael Crosby
ec73c23231 Refactor and fix register interface when bridge does not exist
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-23 14:39:10 -08:00
Victor Vieux
1896934616 Merge pull request #3742 from vieux/update_todo
no more TODO
2014-01-23 12:57:00 -08:00
Victor Vieux
5d71ad8b19 no more TODO
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-23 12:55:58 -08:00
Victor Vieux
4e08bb5629 Merge pull request #3740 from tianon/fix-mflag-dyntest
Fix mflag test issue with "ResetForTesting"
2014-01-23 12:09:08 -08:00
Tianon Gravi
f60eee4894 Fix mflag test issue with "ResetForTesting" (which only showed up under dyntest for some odd reason)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-23 13:03:17 -07:00
Victor Vieux
7687b3cec1 Merge pull request #3738 from vieux/update_todo
update REMOTE_TODO.md
2014-01-23 10:51:38 -08:00
Victor Vieux
4d4339c6de update REMOTE_TODO.md
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-23 10:50:11 -08:00
Chris St. Pierre
fd2403b830 fix shebang in mkimage-yum.sh
Docker-DCO-1.1-Signed-off-by: Chris St. Pierre <chris.a.st.pierre@gmail.com> (github: stpierre)
2014-01-23 12:01:24 -05:00
Michael Crosby
ea5b3e193b Finalize core changes with new package
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-23 05:22:32 -08:00
Chris St. Pierre
d419da7227 Added new mkimage-yum.sh script to create CentOS base images
mkimage-rinse.sh requires rinse, which is not readily available on
CentOS or Fedora.  Plus, creating a base image is trivial with yum
alone.

Docker-DCO-1.1-Signed-off-by: Chris St. Pierre <chris.a.st.pierre@gmail.com> (github: stpierre)
2014-01-23 07:09:44 -05:00
Michael Crosby
9d11db0f8c Update code for new test cases
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-23 02:22:13 -08:00
Michael Crosby
fccca3542b Move tests from core into ipallocator
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-23 01:31:38 -08:00
Michael Crosby
648357ffdf Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael) 2014-01-23 00:28:35 -08:00
Tianon Gravi
210db8e846 Merge pull request #3720 from therealprologic/master
Add script for building CRUX base images
2014-01-22 21:28:51 -08:00
Sven Dowideit
bfc1043f36 talk about the new exec form of RUN (Closes #3723) implemented by #3558
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-01-23 14:00:16 +10:00
James Mills
d247b7d426 Added script for building Base Docker CRUX images
Docker-DCO-1.1-Signed-off-by: James Mills <prologic@shortcircuit.net.au> (github: therealprologic)
2014-01-23 13:53:19 +10:00
Michael Crosby
79bb8212e0 Implement pos for set and add unit tests
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 19:34:47 -08:00
Michael Crosby
6bc05899aa Finish implementation and begin working on tests
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 18:05:20 -08:00
Michael Crosby
78b3d89f87 Merge remote-tracking branch 'fork/stack_set' into move-networking
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 17:20:52 -08:00
Guillaume J. Charmes
3e3abdd770 Use int32 instead of string for ip set
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-22 17:20:19 -08:00
Michael Crosby
9c29376fcb Merge remote-tracking branch 'fork/stack_set' into move-networking
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 17:13:13 -08:00
Guillaume J. Charmes
18df387bf8 Implement PullBack()
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-22 17:12:28 -08:00
Michael Crosby
b58c1a6438 Merge remote-tracking branch 'fork/stack_set' into move-networking
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 16:24:55 -08:00
Michael Crosby
e048c28159 Merge remote-tracking branch 'fork/stack_set' into move-networking
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 16:13:59 -08:00
Guillaume J. Charmes
43bcbf06a6 Implement Containers in set
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-22 16:13:28 -08:00
Michael Crosby
d32777f6b1 Implement get next ip
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 16:13:22 -08:00
Guillaume J. Charmes
63d18d875b Implement basic stack for ips
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-22 16:00:53 -08:00
Victor Vieux
e7a9d23640 don't user os.Stderr in attach
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-22 15:54:22 -08:00
Michael Crosby
9e2e8a923c WIP for ip allocator
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 15:52:39 -08:00
Michael Crosby
8723a8a89e Populate command in ghost state to pass to RestoreCommand
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 14:05:01 -08:00
Michael Crosby
ba8ca59862 Compile driver interface changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-22 14:05:01 -08:00
Guillaume J. Charmes
75e0357d69 Populate Command self cointainer (toward Restore())
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-22 14:04:55 -08:00
Alexander Larsson
e51af36a85 Add experimenta btrfs driver
This is an experimental btrfs driver. To use it you must have
/var/lib/docker mounted on a btrfs filesystem and explicitly
specify DOCKER_DRIVER=btrfs in the docker daemon environment.

It works by using subvolumes for the docker image/container layers.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-22 21:44:09 +01:00
Andy Rothfusz
700db10c85 Merge pull request #3716 from johngmyers/patch-1
Grammar fixes and wording improvements
2014-01-22 12:01:13 -08:00
Andy Rothfusz
9a2e673f4f Merge pull request #3713 from SvenDowideit/document-bind-mount-file
bind mounts work for files - give an example, as its very very useful.
2014-01-22 11:54:41 -08:00
Michael Crosby
2a6e93a6fb Merge pull request #3558 from tianon/buildfile-run-json
Add support for RUN [""] in Dockerfiles
2014-01-22 11:51:34 -08:00
Guillaume J. Charmes
f61a91f50a Merge pull request #3073 from alexlarsson/refcount-driver-mounts
Refcount driver mounts
2014-01-22 11:42:17 -08:00
Guillaume J. Charmes
44a0bab304 Merge pull request #3712 from plietar/kill-signal
Add a -s option to the kill command to specify a signal.
2014-01-22 11:38:16 -08:00
Michael Crosby
639d2ecd4f Merge pull request #3682 from alexlarsson/implement-tar
Implement tar in Go
2014-01-22 11:23:47 -08:00
Guillaume J. Charmes
4ccf423f42 Merge pull request #3695 from chazomaticus/3628-ignore-kernel-flavor
ignore non-numeric characters when parsing kernel version
2014-01-22 11:19:05 -08:00
Charles Lindsay
dea3c2655d Add comment about ignoring Sscanf error
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-22 09:32:50 -08:00
Sven Dowideit
7c55cbd4c9 move the contributing hook into hack, and use curl in the same way as the gofmt above
and remove the fmt-check one we don't document

tianon tells me they're called GitHub, not Github :)

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-01-22 21:31:42 +10:00
Sven Dowideit
0f5ad430c4 change the documentation only - It looks like we have a number of cmdline params to completely update from the code version
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-01-22 21:29:05 +10:00
John Gardiner Myers
1c06a91964 Wording improvements
Docker-DCO-1.1-Signed-off-by: John Gardiner Myers <jgmyers@proofpoint.com> (github: johngmyers)
2014-01-21 22:40:33 -08:00
John Gardiner Myers
f3cb808e9d Grammar and punctuation fixes
Docker-DCO-1.1-Signed-off-by: John Gardiner Myers <jgmyers@proofpoint.com> (github: johngmyers)
2014-01-21 22:40:06 -08:00
Paul Lietar
1f75a0bf43 Add a --signal option to the kill command to specify a signal.
Docker-DCO-1.1-Signed-off-by: Paul Lietar <paul@lietar.net> (github: plietar)
2014-01-22 06:10:52 +00:00
Michael Crosby
3cb5bc5ae5 Merge pull request #3708 from creack/fix_run_exit_code
Fix issue with exit code in non-tty mode.
2014-01-21 18:15:01 -08:00
Guillaume J. Charmes
fd38de2818 Fix issue with exit code in non-tty mode.
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-21 18:05:03 -08:00
Victor Vieux
4c1879f919 Merge branch 'add_missing_attributes' of https://github.com/rogaha/docker into rogaha-add_missing_attributes
Conflicts:
	api.go

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-21 18:01:19 -08:00
Tianon Gravi
572002a715 Merge pull request #3707 from bkcsoft/fix-bash-hashbangs
Update bash shebangs to use "/usr/bin/env bash" for increased portability
2014-01-21 17:30:52 -08:00
Kim BKC Carlbacker
b1953baba2 This should make all bash-scripts run on pretty much any posix-system (with bash installed ofc...)
Docker-DCO-1.1-Signed-off-by: Kim BKC Carlbacker <kim.carlbacker@gmail.com> (github: bkcsoft)
2014-01-22 02:21:56 +01:00
Guillaume J. Charmes
cb33f739a1 Merge pull request #3705 from crosbymichael/fix-die-event
Fix die command when monitor returns
2014-01-21 17:13:29 -08:00
Michael Crosby
0b789ca844 Merge pull request #3706 from creack/fix_wait_stopped
Fix wait on stopped container (after docker restart) + add Unit test for that case
2014-01-21 17:03:35 -08:00
Guillaume J. Charmes
0376a69cb1 Fix wait on stopped container (after docker restart) + add Unit test for that case
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-21 16:49:24 -08:00
Michael Crosby
980000071d Merge pull request #2655 from mpetazzoni/create-local-bind-dirs
Automatically create non-existent bind-mounted host directories
2014-01-21 16:27:20 -08:00
Michael Crosby
80f128a6ea Fix die command when monitor returns
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-21 16:18:57 -08:00
Maxime Petazzoni
47d1413d7a Documentation about automatic bind-mount dir creation
Docker-DCO-1.1-Signed-off-by: Maxime Petazzoni <max@signalfuse.com> (github: mpetazzoni)
2014-01-21 16:05:30 -08:00
Maxime Petazzoni
3e96f46b30 Automatically create non-existent bind-mounted directories on the host
Fixes #1279.

Docker-DCO-1.1-Signed-off-by: Maxime Petazzoni <max@signalfuse.com> (github: mpetazzoni)
2014-01-21 16:05:29 -08:00
Michael Crosby
b417f79c00 Merge pull request #3704 from vieux/json_api_return_valid
Switch back to the valid json format
2014-01-21 15:35:06 -08:00
Victor Vieux
be6aeda1e4 Merge pull request #3640 from proppy/networkgetroutes-add-default
netlink: add default Route to NetworkGetRoutes
2014-01-21 15:20:16 -08:00
Victor Vieux
e3461bc8d6 switch back to the valid json format
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-21 15:06:23 -08:00
Andy Rothfusz
62c4563987 Merge pull request #3688 from shykes/docs-simplify-basic-usage
Simplify basic usage docs
2014-01-21 11:41:32 -08:00
Guillaume J. Charmes
e56562c35e Merge pull request #3566 from tianon/fix-volume-symlinks
Fix symlink mounting issues
2014-01-21 11:37:05 -08:00
Victor Vieux
9164ba6516 Merge pull request #3686 from vieux/load_job
Load job
2014-01-21 11:29:15 -08:00
Victor Vieux
f2f44b91a8 move load to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-21 11:28:45 -08:00
Andy Rothfusz
ba4ae40445 Merge pull request #3690 from shykes/cleanup-maintainers
Cleanup maintainers
2014-01-21 11:18:23 -08:00
Michael Crosby
f98a596be9 Merge pull request #3698 from alexlarsson/fix-shared-root
Fix handling of shared roots
2014-01-21 11:09:36 -08:00
Andy Rothfusz
fb919137be Merge pull request #3687 from shykes/docs-intro
docs: harmonize intro paragraph with website
2014-01-21 11:02:55 -08:00
Andy Rothfusz
31274ffccb Merge pull request #3700 from jamtur01/fixedtoc
Fixed commandline/index warning in TOC
2014-01-21 10:52:13 -08:00
Tianon Gravi
678d76fa9c Merge pull request #3671 from tianon/completion-ignore-stderr
Update bash completion to ignore stderr output of docker binary
2014-01-21 10:40:23 -08:00
Charles Lindsay
cce099aa34 Re-add kernel Flavor tests
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-21 09:56:53 -08:00
Tianon Gravi
b23e6e99b3 Merge pull request #3459 from Barthalion/master
Fix mkimage-arch.sh to generate cleaner Arch Linux images and do so with cleaner code
2014-01-21 07:11:57 -08:00
Bartłomiej Piotrowski
4137a0ea32 mkimage-arch: provide and use own pacman.conf
Docker-DCO-1.1-Signed-off-by: Bartłomiej Piotrowski <b@bpiotrowski.pl> (github: Barthalion)
2014-01-21 14:22:56 +01:00
James Turnbull
fabf96b8ff Fixed commandline/index warning in TOC
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-01-21 08:22:51 -05:00
Bartłomiej Piotrowski
787ff55283 mkimage-arch: use hash to check if command is available
Apart from having more predictable return codes on various operating
systems, it additionally caches the path to application.

Docker-DCO-1.1-Signed-off-by: Bartłomiej Piotrowski <b@bpiotrowski.pl> (github: Barthalion)
2014-01-21 14:22:47 +01:00
Bartłomiej Piotrowski
da4ba80733 mkimage-arch: don't generate ISO-8859-1 locale
Docker-DCO-1.1-Signed-off-by: Bartłomiej Piotrowski <b@bpiotrowski.pl> (github: Barthalion)
2014-01-21 14:22:39 +01:00
Bartłomiej Piotrowski
c6535d272c mkimage-arch: unify usage of brackets around variables
Docker-DCO-1.1-Signed-off-by: Bartłomiej Piotrowski <b@bpiotrowski.pl> (github: Barthalion)
2014-01-21 14:22:33 +01:00
Bartłomiej Piotrowski
a4e6e9bd41 mkimage-arch: remove $DEV instead of renaming it
Docker-DCO-1.1-Signed-off-by: Bartłomiej Piotrowski <b@bpiotrowski.pl> (github: Barthalion)
2014-01-21 14:22:26 +01:00
Bartłomiej Piotrowski
c138c335a5 mkimage-arch: use mktemp to create ROOTFS directory
Docker-DCO-1.1-Signed-off-by: Bartłomiej Piotrowski <b@bpiotrowski.pl> (github: Barthalion)
2014-01-21 14:21:43 +01:00
Alexander Larsson
f918fca3bf archive: Always end directory filenames in tars with /
This matches what tar does, and without it the tarsum created
by the registry will not match the docker one.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-21 12:52:05 +01:00
Alexander Larsson
5fe26ee426 aufs: Unmount inactive devices
This implements the new Put() operation such that
Get()/Put() maintains a refcount for each ID, mounting
only on first Get() and unmounting on the last Get().

This means we avoid littering the system with lots of mounts
and free resources related to them.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-21 11:26:11 +01:00
Alexander Larsson
886f650d9b devicemapper: Unmount inactive devices
This implements the new Put() operation such that
Get()/Put() maintains a refcount for each ID, mounting
only on first Get() and unmounting on the last Get().

This means we avoid littering the system with lots of mounts
and active devicemapper devices and free resources related
to them.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

asdfljk
2014-01-21 11:26:11 +01:00
Alexander Larsson
191aa17d16 Remove container.EnsureMounted
This was deprecated already and all it did was call Mount().
The use of this was a bit confusing since we need to pair Mount/Unmount
calls which wasn't obvious with "EnsureMounted".

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-21 11:26:11 +01:00
Alexander Larsson
bcaf6c2359 Add Put() to graphdriver API and use it
This makes all users of Put() have a corresponding call
to Get() which means we will be able to track whether
any particular ID is in use and if not unmount it.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-21 11:25:37 +01:00
Alexander Larsson
bde2d3aef7 integration: Fix TestGetContainersExport
The tar changes made the name of the file in the tar archive
change from  "./test" to "test", update the test to the new name.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-21 10:41:08 +01:00
Alexander Larsson
08ab554195 Fix handling of shared roots
If rootIsShared() is detected we apply the shell stuff to early, before
the real command and arguments are added to the parameters. This
means they get passed on to unshare rather than docker-init, breaking
docker on e.g. fedora like:

goroutine 1 [running]:
runtime.panic(0x678340, 0x9b3fd7)
	/usr/lib64/golang/src/pkg/runtime/panic.c:266 +0xb6
github.com/dotcloud/docker/execdriver/lxc.func·001(0xc21000a1b0, 0xc21001eab0, 0x7fff24715faf)
	/home/alex/vcs/go/src/github.com/dotcloud/docker/execdriver/lxc/driver.go:41 +0x525
github.com/dotcloud/docker/sysinit.executeProgram(0xc21000a1b0, 0xc21000a1b0, 0xa)
	/home/alex/vcs/go/src/github.com/dotcloud/docker/sysinit/sysinit.go:34 +0xca
github.com/dotcloud/docker/sysinit.SysInit()
	/home/alex/vcs/go/src/github.com/dotcloud/docker/sysinit/sysinit.go:88 +0x791
main.main()
	/home/alex/vcs/go/src/github.com/dotcloud/docker/dockerinit/dockerinit.go:14 +0x1a

The fix is to construct the full params array before escaping it.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-21 10:22:13 +01:00
Solomon Hykes
fdf43f5de1 docs: harmonize intro paragraph with website
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-21 07:33:26 +00:00
Solomon Hykes
ae2af201f3 Docs: fix capitalization of "Docker"
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-21 07:27:55 +00:00
Charles Lindsay
b78ae3b652 Re-add Flavor to KernelVersionInfo
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 21:26:23 -08:00
Charles Lindsay
5b97e00438 Use Sscanf instead of regexp
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 21:02:37 -08:00
Roberto G. Hashioka
d16691e3ad - Ajusted server.go with gofmt
Docker-DCO-1.1-Signed-off-by: Roberto Hashioka <roberto.hashioka@docker.com> (github: rogaha)
2014-01-21 04:11:40 +00:00
Roberto G. Hashioka
2cfd696b9b Added missing attributes to api search calls:
- Added an argument to the call() method in order to control the auth sharing
- Enabled it only for search. Pulls and pushes were enabled already.
- Grouped a few variable declarations

Docker-DCO-1.1-Signed-off-by: Roberto Hashioka <roberto.hashioka@docker.com> (github: rogaha)
2014-01-21 04:06:19 +00:00
Charles Lindsay
14b2b2b7c2 Fix apparent typo
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 19:49:40 -08:00
Charles Lindsay
d2c9c1036b Remove Flavor from KernelVersionInfo
Also change to parsing it with regexp to keep things simple.

Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 19:49:39 -08:00
Charles Lindsay
fc30346086 Add failing test for odd kernel version
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 19:49:39 -08:00
Tianon Gravi
a37ffa4041 Merge pull request #3662 from tianon/add-udev-to-deb
Add udev rules file to our generated deb package
2014-01-20 19:44:05 -08:00
Solomon Hykes
c24d128bb5 Docs: move advanced topic "create your own base image" out of basic user guide
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-21 03:43:16 +00:00
Solomon Hykes
589e1a9bdc docs: "first steps with docker" is a better title than "learn basic commands"
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-21 03:43:16 +00:00
Solomon Hykes
76eee50a67 docs: add standard 'check your docker install' paragraph to the 'hello world' examples.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-21 03:43:16 +00:00
Solomon Hykes
cf5504eed5 docs: move a sysadmin-focused topic out of the basic usage manual and into installation docs (setting up a user group for non-root access)
docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-21 03:43:16 +00:00
Solomon Hykes
cf17816083 docs: simplify basic usage doc, step 1: check your docker install
docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-21 03:43:16 +00:00
Solomon Hykes
1fe426641d Remove myself as sole maintainer of api reference docs.
Please still ping me before changing APIs :)

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-20 18:49:13 -08:00
Solomon Hykes
230554695a Remove Ken from docs maintainers (he's busy on other things)
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-20 18:48:59 -08:00
Andy Rothfusz
90b52b7e06 Reordering to make FAQ last 2014-01-20 17:11:03 -08:00
Andy Rothfusz
acf43b4da7 Merge pull request #3618 from shykes/docs-cleanup-install
Docs cleanup install
2014-01-20 17:10:02 -08:00
Andy Rothfusz
b38d3154c8 Merge pull request #3600 from SvenDowideit/ghost-status-doc
Ghost status doc
2014-01-20 16:51:47 -08:00
Victor Vieux
497e7d651a update todo
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-20 16:09:07 -08:00
Guillaume J. Charmes
12468f2bc8 Rename Process to Command
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-20 16:05:07 -08:00
Victor Vieux
ffe78e82c3 Merge pull request #3442 from DevTable/master
Fix support for registry auth with Dockerfile build.
2014-01-20 15:50:14 -08:00
Jake Moshenko
6e6ff85362 Fix support for registry auth with Dockerfile build.
Docker-DCO-1.1-Signed-off-by: Jake Moshenko <jake@devtable.com> (github: jakedt)
2014-01-20 18:35:14 -05:00
Michael Crosby
37c1c7cf7a Merge pull request #3685 from pnasrat/3679-cgroups-outside-lxc
Move Resources into exec driver
2014-01-20 15:35:06 -08:00
Guillaume J. Charmes
c2501942cf Merge pull request #3684 from crosbymichael/push-multiple-tags
Push multiple tags for repository
2014-01-20 15:24:53 -08:00
Solomon Hykes
45e8d1f4c0 docs: reuse official dependencies list from packager's guide for custom binary install docs 2014-01-20 23:17:40 +00:00
Solomon Hykes
4e54dd245a docs: remove out-of-date kernel requirements document.
Requirements differ from platform to platform depending on the plugins used, and so should be documented separately for each target platform

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-20 23:11:30 +00:00
Solomon Hykes
dd786eefbb docs: instead of a top-level 'upgrading docker' doc, add an 'upgrades' paragraph to each installation target
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-20 23:11:30 +00:00
Solomon Hykes
29e6868cc3 docs: change topic of windows install docs to 'install docker on windows'
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-20 23:11:30 +00:00
Solomon Hykes
c56e3b8569 docs: move 'vagrant' install docs to the more accurate 'mac' install docs
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-20 23:11:30 +00:00
Solomon Hykes
d8a71635d4 docs: move security article to a new 'articles' section
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-20 23:11:30 +00:00
Paul Nasrat
71c1646ba3 Don't expose cgroups via the execdriver API.
Use Resources to represent container limits rather than a cgroup specific field.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
2014-01-20 17:06:24 -05:00
Michael Crosby
fbd374f30b Merge pull request #3681 from pnasrat/extract-cgroups-pkg
Extract cgroups into pkg sub dir
2014-01-20 14:00:44 -08:00
Andy Rothfusz
6dfbbaa4ff Merge pull request #3650 from tianon/fix-doc-man-generation
Fix docs man page generation and add Dockerfile man page
2014-01-20 13:44:01 -08:00
Michael Crosby
a2aab7757e Make sure new repositories can be pushed with multiple tags
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-20 13:39:35 -08:00
Alexander Larsson
8a4824d1ad hack: Remove GNU Tar requirement
We no longer call out to tar, so this is not needed.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-20 20:35:16 +01:00
Tianon Gravi
6ed9b06e07 Fix Travis build errors by bumping our python module versions to be newer
See also https://bitbucket.org/birkenfeld/sphinx/issue/1281/sphinx-113-not-build-proper-manpages

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 12:30:18 -07:00
Alexander Larsson
5ea48aa7f8 Implement TarFilter in go, rather than calling out to tar
This uses a plain filepath.Walk + addTarFile to create a tar file,
optionially compressing it with gzip.

Unfortunately go only has gzip compression support, not bzip2 or xz.
However, this is not a regression, as docker currently uses *no*
compression for TarFilter(). The only compression of tarfiles
currently happens in utils/tarsum.go, and that manually does gzip
compression.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-20 20:26:20 +01:00
Alexander Larsson
bab8efbf05 Simplify addTarFile
We can use tar.FileInfoHeader to do much of the work.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-20 20:26:20 +01:00
Alexander Larsson
5b77e51e0a archive: Extract code from ExportChanges to addTarFile()
This is the code that takes a normal file and adds it to a TarWriter.
We extract it so that we can share it with Tar().

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-20 20:26:20 +01:00
Alexander Larsson
4fb1db7f74 archive: Remove unused features
This simplifies that code that calls out to tar by removing support
for now unused features.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-20 20:26:20 +01:00
Michael Crosby
03a25c0800 Merge branch 'fix-registry-push-tags' of https://github.com/codeaholics/docker into codeaholics-fix-registry-push-tags
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-20 11:23:09 -08:00
Paul Nasrat
2553029959 Extract cgroups pkg.
Initial move before enhancing cgroups package.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
2014-01-20 14:15:44 -05:00
Victor Vieux
69be8adb68 Merge pull request #3665 from vgeta/3450-fix
Fixes Issue #3450
2014-01-20 11:10:54 -08:00
Guillaume J. Charmes
b563c0c02b Merge pull request #3292 from alexlarsson/export-changes-manual
Don't shell out to tar for ExportChanges
2014-01-20 11:08:16 -08:00
Michael Crosby
0f0e582490 Merge pull request #3680 from pnasrat/extract-mount-pkg
Extract mount into pkg.
2014-01-20 11:04:16 -08:00
Paul Nasrat
2e094db639 Extract mount into pkg.
Mount is self contained and generic, it should be in pkg, to allow other pkg modules to use it.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
2014-01-20 13:59:29 -05:00
Guillaume J. Charmes
3aa27eb055 Merge pull request #3295 from alexlarsson/implement-untar
Implement UnTar via archive/tar
2014-01-20 10:54:42 -08:00
Guillaume J. Charmes
a431f1703d Merge pull request #3678 from creack/sysinfo_update
Add MAINTAINER and remove docker/utils dep from pkg/sysinfo
2014-01-20 10:39:37 -08:00
Michael Crosby
f87a67a3a8 Merge pull request #3649 from vieux/remove_buffers
refactor, remove useless buffers
2014-01-20 10:29:54 -08:00
Tianon Gravi
274863f221 Update Travis to also compile the man page(s) now that they compile properly again
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 11:29:24 -07:00
Tianon Gravi
1c152f443d Add Dockerfile man page generation from our Dockerfile reference page
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 11:29:07 -07:00
Tianon Gravi
10fc518fba Fix docs manpage generation
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 11:29:07 -07:00
Tianon Gravi
4fb507d756 Merge pull request #3656 from tianon/travis-test-docs
Update Travis to also test compiling the docs
2014-01-20 10:28:44 -08:00
Tianon Gravi
fe02d58927 Update Travis to also test compiling the docs
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 11:24:38 -07:00
Tianon Gravi
3bd36157a1 Merge pull request #3652 from tianon/fix-travis-on-non-master-prs
Fix Travis for PRs against non-master (like release, for example)
2014-01-20 10:21:50 -08:00
Guillaume J. Charmes
ff662446f7 Add MAINTAINER and remove docker/utils dep from pkg/sysinfo
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-20 10:20:29 -08:00
Tianon Gravi
9152aab653 Update bash completion to ignore stderr output of docker binary
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 01:26:01 -07:00
Victor Vieux
cfd3d02737 Merge pull request #3669 from tianon/new-flags-completion
Update New Flags Completion
2014-01-20 00:12:40 -08:00
Tianon Gravi
7379a22a8d Fix symlink mounting issues by evaluating symlinks directly on the LHS of a bind-mount -v and by FollowSymlinkInScope on the RHS just before mounting
Tested successfully with variations around mounting /var/run and /var/run/docker.sock inside a "debian" container directly at /var/run/docker.sock where /var/run is a symlink to "/run" on both the host and in the container.

Fixes #3262

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 00:38:54 -07:00
Tianon Gravi
fb981bdace Switch docker run --username to docker run --user which is more accurate (while we can still do so without breaking anyone's scripts)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 00:28:55 -07:00
Tianon Gravi
c6e43154f1 Resync bash completion to include all flags defined in the code, and to autocomplete properly on all parameters that are reasonably possible to do so on today
This also includes several new minor features that are interesting, so do explore a little. :)

Finally, this also fixes a few bugs where commands would complete parameters that they won't necessarily accept.  We still have a few of these cases, but they're reduced to a minimum now.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-20 00:28:55 -07:00
vgeta
e45b87031c Fixes Issue# 3450
Docker-DCO-1.1-Signed-off-by: Gopikannan Venugopalsamy <gopikannan.venugopalsamy@gmail.com> (github: vgeta)
2014-01-19 17:48:54 -08:00
Sven Dowideit
b8cca8138b add a little info about ghosts
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-01-20 10:37:06 +10:00
Tianon Gravi
595b8f2986 Add udev rules file to our generated deb package
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-19 17:27:43 -07:00
Michael Crosby
a60f0a0754 Merge pull request #3256 from alexlarsson/blkdiscard
Discard all data on devicemapper devices when deleting them
2014-01-18 10:12:10 -08:00
Tianon Gravi
980e0bf52c Fix Travis for PRs against non-master (like release, for example)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-18 10:41:37 -07:00
Victor Vieux
455495f7ca refactor, remove useless buffers
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-17 18:54:02 -08:00
Victor Vieux
dc359e07d3 Merge pull request #3638 from tianon/update-mailmap-authors
Update .mailmap and AUTHORS - we're up to 316 unique contributors by my count!
2014-01-17 18:19:41 -08:00
Guillaume J. Charmes
fec97e72db Merge pull request #3580 from crosbymichael/extract-lxc
Move LXC into a sub pkg and provide initial execution driver interface
2014-01-17 18:10:10 -08:00
Michael Crosby
d5112ffce6 Fix rebase for init error
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:58 -08:00
Michael Crosby
5c30c4379a Add todos for driver changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:58 -08:00
Michael Crosby
97c8450705 Make sure drivers are registerd within sysinit
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:58 -08:00
Michael Crosby
cdfebc2a20 Change drvier name to append version
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:58 -08:00
Michael Crosby
70a5cb95b3 Move lxc template into lxc driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:58 -08:00
Guillaume J. Charmes
9e9f4b925b Rename Capabilities in sysinfo and move it to its own subpackage
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: crosbymichael)
2014-01-17 17:42:58 -08:00
Michael Crosby
ca8dd73fbf Small fixes to type names
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Guillaume J. Charmes
889b4b10ae Cleanup + add Info to driver in order to have specific IsRunning()
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Guillaume J. Charmes
f7684ea7f6 Move docker init into drivers functions
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
d3bae131d6 Make sure proc is umounted for chroot driver within init
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
8c9f62d037 Improve wait for lxc and driver interface
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
c2b602b2ac Use utils.Go to get error from monitor
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
e765c67b47 Add json tags and comments to exedriver types
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
f3f2456b04 Simplify chroot wait, address code review issues
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
8a38ead219 Move setup pty and standard pipes to funcs
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
1e81387edc Remove SysinitPath from process
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
f846ecdc77 Make exec driver run a blocking command
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
92e6db7beb Improve chroot driver by mounting proc
Add -driver flag to dockerinit

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
8e0741f5e4 Add chroot driver for testing
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
1d8455e683 Move RootIsShared to lxc driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
93ead2fe78 Update with lxc unconfined changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
66782730b8 Fix network disabled for container
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
77936ba1a1 Fix race in set running
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
381d593d04 Fix race in cleanup
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
ad9710685c Fix race in TestRun
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
8b60273f76 Update with container specific waitLock
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
8e87835968 Rework monitor and waitlock inside of driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:22 -08:00
Michael Crosby
5a3d9bd432 WIP complete integration test run
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:21 -08:00
Michael Crosby
1c1cf54b0a Fix tty set issue for ioctl error
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:21 -08:00
Michael Crosby
5573c744e4 Embed exec.Cmd on Process
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:21 -08:00
Michael Crosby
25a2697717 Keep state in core on container
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:21 -08:00
Michael Crosby
f2680e5a5b Integrate process changes in container.go
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:21 -08:00
Michael Crosby
203b69c8c9 Implement lxc driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:21 -08:00
Michael Crosby
1ceb049118 Initial driver changes proposal
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 17:42:21 -08:00
Victor Vieux
a823d7967f Merge pull request #3647 from vieux/refactor_registers
refactor registers
2014-01-17 17:39:54 -08:00
Victor Vieux
1776046618 Merge pull request #3322 from vieux/new_flags
new --flags
2014-01-17 17:35:18 -08:00
Victor Vieux
e71dbf4ee5 update commands.go
update docker.go

move to pkg

update docs

update name and copyright

change --sinceId to --since-id, update completion and docs

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor@docker.com> (github: vieux)
2014-01-17 17:33:15 -08:00
Victor Vieux
3ff5f2374c refactor registers
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-17 16:57:43 -08:00
Johan Euphrosine
77d9fd2628 netlink: make darwin happy
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-01-17 16:55:42 -08:00
Johan Euphrosine
dadd54dba3 netlink: move Route type to common arch file
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-01-17 14:04:11 -08:00
Andy Rothfusz
ebaa92b208 Merge pull request #3620 from jamtur01/refman
Added Reference Manual
2014-01-17 13:42:22 -08:00
James Turnbull
89ff488b55 Added Reference Manual
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2014-01-17 15:29:32 -05:00
Guillaume J. Charmes
941d4ffa3e Merge pull request #3641 from gfrey/fix_compression
detect compressed archives in API /build call
2014-01-17 12:02:54 -08:00
Michael Crosby
2f066aef49 Merge pull request #3632 from crosbymichael/stream-cp
Stream the cp operation on the client
2014-01-17 11:29:51 -08:00
Johan Euphrosine
a886fbfa4a network: exclude default routes from checkRouteOverlaps
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-01-17 11:09:53 -08:00
Johan Euphrosine
26726dc9ff netlink: add default Route to NetworkGetRoutes
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-01-17 11:09:50 -08:00
Michael Crosby
95df957f73 Replace creating buffer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 11:02:44 -08:00
Michael Crosby
fdd8d4b7d9 Stream the cp operation on the client
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 10:51:29 -08:00
Victor Vieux
b4e5bfbf6f Merge pull request #3637 from crosbymichael/no-panic-on-exec
Return error and not panic when cannot exec in dockerinit
2014-01-17 10:42:46 -08:00
Victor Vieux
6188d7ef66 Merge pull request #3635 from vieux/top_job
move Top to a job
2014-01-17 10:19:28 -08:00
Gereon Frey
4f53722dee detect compressed archives in API /build call
AFAIK in some previous version it was possible to give a compressed docker file
to the API's build command and that was handled properly (aka compression was
detected and archive uncompressed accordingly). Fails with at least 0.7.5.

Fixed this using the DecompressStream method from the archive package.

Docker-DCO-1.1-Signed-off-by: Gereon Frey <me@gereonfrey.de> (github: gfrey)
2014-01-17 12:21:26 +01:00
Alexander Larsson
ba52130873 Fix cross compile
stat.Rdev and time.* is 32bit on OSX, which breaks cross builds with eg:
cannot use stat.Rdev (type int32) as type uint64 in function argument

We fix this with an extra conversion to uint64.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-17 11:01:28 +01:00
Tianon Gravi
2f6fb41dd1 Update .mailmap and AUTHORS - we're up to 316 unique contributors by my count!
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-16 20:13:51 -07:00
Michael Crosby
11ef2f0db4 Return error and not panic when cannot exec in dockerinit
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-16 18:31:21 -08:00
Michael Crosby
d6b810c32e Merge pull request #3624 from tianon/vendor-maintainers
Symlink vendor/MAINTAINERS over to hack/MAINTAINERS
2014-01-16 17:58:28 -08:00
Tianon Gravi
59fe36623b Merge pull request #3599 from tianon/fix-install-sed
Fix release.sh sed of install.sh so we preserve tests against 'https://get.docker.io/'
2014-01-16 16:54:39 -08:00
Victor Vieux
93ce4d2c0b Merge pull request #3625 from tianon/cleanup-vendor-sh
Clean and simplify vendor.sh while making it easier to maintain as well
2014-01-16 16:42:52 -08:00
Victor Vieux
8cbabf2c3e clean up test log
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-16 16:07:42 -08:00
Victor Vieux
812798a7d6 move top job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-16 16:07:42 -08:00
Victor Vieux
3155ef5cbc Merge pull request #3616 from vieux/job_changes
move changes to a job
2014-01-16 15:52:57 -08:00
Andy Rothfusz
2cdbc719c5 Merge pull request #3583 from metalivedev/3497-copyright
Update docs/NOTICE copyrights to 2014
2014-01-16 12:18:34 -08:00
Tianon Gravi
40b40cffb1 Clean and simplify vendor.sh while making it easier to maintain as well
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-15 22:20:51 -07:00
Tianon Gravi
98111a4a94 Symlink vendor/MAINTAINERS over to hack/MAINTAINERS (since it depends explicitly on hack/vendor.sh)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-15 22:12:32 -07:00
Victor Vieux
90ec5de430 move changes to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 17:13:45 -08:00
Victor Vieux
20f36f088c Merge pull request #3615 from vieux/search_job
move search to a job
2014-01-15 17:13:07 -08:00
Victor Vieux
1669b802cc move search to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 17:12:48 -08:00
Victor Vieux
0b7d4c855d Merge pull request #3512 from vieux/attach_job
move attach to a job
2014-01-15 17:12:14 -08:00
Victor Vieux
e1d8543c78 move attach to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 17:11:44 -08:00
Victor Vieux
c4b0eedc92 Merge pull request #3617 from dotcloud/fix_insert_display
fix docker insert display
2014-01-15 16:14:59 -08:00
Victor Vieux
2edcebc027 fix docker insert display
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 15:41:57 -08:00
Victor Vieux
44b8d8addf Merge pull request #3559 from vieux/insert_job
move insert to a job
2014-01-15 15:18:02 -08:00
Victor Vieux
a33bc3018b use the same 'Used' method as before
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 14:52:58 -08:00
Victor Vieux
0fb8a55753 move insert to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 14:52:58 -08:00
Victor Vieux
52ec95f363 Merge pull request #3560 from vieux/copy_job
move copy to a job
2014-01-15 14:48:51 -08:00
Victor Vieux
e2fa3f56df move copy to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 14:48:31 -08:00
Victor Vieux
f213e2dd6c Merge pull request #3613 from vieux/deprecated_viz_job
move viz to a job
2014-01-15 14:47:56 -08:00
Victor Vieux
a98e40fa73 update TODO
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 14:47:35 -08:00
Victor Vieux
7fbc315aa9 move viz to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 13:52:35 -08:00
Andy Rothfusz
cdea7d3b5f Merge pull request #3598 from tianon/fix-vieux-docs-errors-again
Fix odd issues with "make docs", add "make docs-shell", and canonicalize...
2014-01-15 13:42:28 -08:00
Andy Rothfusz
0113c087b2 Merge pull request #3593 from dotcloud/fix_doc
fix doc, load and get
2014-01-15 13:33:00 -08:00
Victor Vieux
78138344a4 Merge pull request #3606 from jpallen/1319-fix-race-condition-in-truncindex
Add RWMutex lock into TruncIndex to fix race condition when inserting values
2014-01-15 11:41:51 -08:00
Victor Vieux
7e00ba03ec fix doc, load and get
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 11:12:05 -08:00
Victor Vieux
ad5d675553 Merge pull request #3582 from vieux/history_job
move history to a job
2014-01-15 11:06:54 -08:00
Victor Vieux
7898dca8b3 fix tests & small code improvment
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-15 11:06:00 -08:00
Guillaume J. Charmes
5a91781ef9 Merge pull request #3608 from crosbymichael/merge_release_v0.7.6
Merge release v0.7.6 to master
2014-01-15 10:41:43 -08:00
Michael Crosby
3ef777ecbe Merge branch 'release' into merge_release_v0.7.6
Conflicts:
	VERSION
	hack/make/ubuntu

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-15 09:54:06 -08:00
Michael Crosby
4934c35aa1 Merge pull request #3597 from crosbymichael/bump_v0.7.6
Bump to version v0.7.6
2014-01-15 09:40:43 -08:00
James Allen
37fcbfa1f4 Add RWMutex lock into TruncIndex to fix race condition when inserting values
The idx.index array is overwritten when a new value is inserted to the index.
When two containers are created concurrently, their ids are inserted to the
index and one can overwrite the other leaving one of ids missing from the
index. Adding a RWMutex lock around read/write operations fixes this.

Docker-DCO-1.1-Signed-off-by: James Allen <jamesallen0108@gmail.com> (github: jpallen)
2014-01-15 17:30:00 +00:00
Tianon Gravi
dbf249e239 Merge pull request #3508 from tutumcloud/seccomp
Add capabilities needed by new sysinit to mkseccomp.pl sample list
2014-01-14 18:55:53 -08:00
Tianon Gravi
221454f315 Fix release.sh sed of install.sh so we preserve tests against 'https://get.docker.io/'
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-14 19:29:02 -07:00
Tianon Gravi
eaa9c85511 Fix odd issues with "make docs", add "make docs-shell", and canonicalize our docs Dockerfile a bit more
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-14 19:23:30 -07:00
Michael Crosby
bc3b2ec062 Bump to version v0.7.6
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-14 17:53:20 -08:00
Tianon Gravi
d103b6f6df Add more specific lvm2 version to PACKAGERS document
I personally tested this using our container, and this was the lowest version that compiles and runs properly.

Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)

Docker-DCO-1.1-Signed-off-by: Tianon Gravi <admwiggin@gmail.com> (github: crosbymichael)
2014-01-14 17:29:25 -08:00
Tianon Gravi
07b50a90a8 Inline the test.docker.io fingerprint in the install.sh script as well
As long as we're doing it, we ought to do it for all the "official" Docker properties at least

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: crosbymichael)
2014-01-14 17:27:51 -08:00
Tianon Gravi
75293b12b3 Add ca-certificates to our package Recommends
It's only in "Recommends" because it's only required for all but the esoteric configurations (since you can't "docker pull" from the index without it, but that's about it).

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: crosbymichael)
2014-01-14 17:27:34 -08:00
Fabio Falci
734b4566df Use https to get the latest docker version
To avoid unexpected results since docker was using http.
For instance, my broadband doesn't return not found when it's down but
a html page saying that the internet is down. Docker was showing that
html instead of ignoring it.

Fix #3570

Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)

Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: crosbymichael)
2014-01-14 17:27:12 -08:00
Michael Crosby
8d19b2caa0 Add remount for bind mounts in ro
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-14 17:26:34 -08:00
Tianon Gravi
42fed841d3 Fix "foo: no such file or directory" test failure, and normalize creation of custom error to always depend on if os.IsNotExist(err) so we don't hide other errors that might crop up in these tests
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: crosbymichael)
2014-01-14 17:25:35 -08:00
Tianon Gravi
ad69836247 Stop ADD from following symlinks outside the context when passed as the first argument
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: crosbymichael)
2014-01-14 17:25:26 -08:00
Victor Vieux
152c956719 Merge pull request #3594 from crosbymichael/add-bind-remount
Add remount for bind mounts in ro
2014-01-14 16:57:55 -08:00
Michael Crosby
f231539e99 Add remount for bind mounts in ro
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-14 15:20:21 -08:00
Tianon Gravi
bfc256f6c9 Merge pull request #3581 from tianon/deb-xz-utils
Add xz-utils to our deb-recommends since it's necessary for some images
2014-01-14 12:07:10 -08:00
Guillaume J. Charmes
12d00d19bb Merge pull request #3592 from tianon/fix-travis-vendor
Fix Travis to not check gofmt on vendor/*
2014-01-14 11:52:08 -08:00
Tianon Gravi
feb3f98418 Merge pull request #3567 from tianon/dockerfile-add-symlink
Stop ADD from following symlinks outside the context when passed as the first argument
2014-01-14 11:48:54 -08:00
Andy Rothfusz
be44bf8170 Merge pull request #3585 from tianon/remove-uid-ns-reference
Remove reference to nonexistent CONFIG_UID_NS
2014-01-14 11:37:00 -08:00
Andy Rothfusz
da78dd0eb8 Merge pull request #3586 from flavio/add_openSUSE_installation_docs
Added document explaining openSUSE installation
2014-01-14 11:36:15 -08:00
Victor Vieux
bea6dd3888 move history to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-14 10:52:42 -08:00
Tianon Gravi
7a6255efbc Fix "foo: no such file or directory" test failure, and normalize creation of custom error to always depend on if os.IsNotExist(err) so we don't hide other errors that might crop up in these tests
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-14 11:42:03 -07:00
Fernando
32565a4451 added capabilities needed by new sysinit
Docker-DCO-1.1-Signed-off-by: Fernando Mayo <fernando@tutum.co> (github: fermayo)
2014-01-14 19:27:31 +01:00
Tianon Gravi
f700aa1570 Fix Travis to not check gofmt on vendor/*
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-14 11:07:18 -07:00
Victor Vieux
bdcd1cfba5 Merge pull request #3591 from tianon/fix-vendor
Un-gofmt ./vendor
2014-01-14 10:06:11 -08:00
Michael Crosby
a49efa975e Merge pull request #3534 from philips/reformat-DCO
CONTRIBUTING.md: wrap DCO to 78 chars per line
2014-01-14 10:00:14 -08:00
Tianon Gravi
e8ffc2eee0 Un-gofmt ./vendor
We can't be modifying this except to update from upstream.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-14 10:54:19 -07:00
Michael Crosby
b68ddcec21 Merge pull request #3570 from fabiofalci/3569-validate-docker-version
Fetch docker version over https
2014-01-14 09:36:18 -08:00
James Turnbull
7d702ef501 Merge pull request #3587 from tianon/fix-gentoo-typo
Fix docs typo: "Gento" -> "Gentoo"
2014-01-14 09:22:58 -08:00
Flavio Castelli
3a1ce011a0 Added document explaining openSUSE installation
Added a new documentation page explaining how to install Docker on
openSUSE.

Docker-DCO-1.1-Signed-off-by: Flavio Castelli <fcastelli@suse.com> (github: flavio)
2014-01-14 16:26:18 +01:00
Tianon Gravi
5a3fa3c901 Add a few small tweaks to mkimage-debootstrap, especially to help with lucid
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-14 04:20:27 -07:00
Tianon Gravi
c7dcd19b28 Fix docs typo: "Gento" -> "Gentoo"
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-14 04:18:51 -07:00
Alexander Larsson
a4868e233c Implement UnTar via archive/tar
This replaces the shelling out to tar with a reimplementation of untar
based on the archive/tar code and the pre-existing code from ApplyLayer
to create real files from tar headers.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-14 11:21:29 +01:00
Alexander Larsson
710d5a48fb archive: Extract createTarFile() from ApplyLayer
This way we can reuse it for Untar()

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-14 11:21:07 +01:00
Tianon Gravi
658f57fdfa Remove reference to nonexistent CONFIG_UID_NS
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-13 23:32:21 -07:00
Andy Rothfusz
fe6c9e8fd7 Merge pull request #3584 from tianon/fix-docs-dockerfile
Fix docs Dockerfile to install correctly again
2014-01-13 17:42:20 -08:00
Tianon Gravi
4087a643ea Fix docs Dockerfile to install correctly again
Previously we've been getting:

```
Step 6 : RUN pip install Sphinx==1.1.3
 ---> Running in 397eab32f57a
 Wheel installs require setuptools >= 0.8 for dist-info support.
 pip's wheel support requires setuptools >= 0.8 for dist-info support.
 Storing debug log for failure in /.pip/pip.log
 2014/01/13 18:01:34 The command [/bin/sh -c pip install Sphinx==1.1.3] returned a non-zero code: 1
 make: *** [docs] Error 1
```

This fixes that by telling pip not to use sudo to install (since we're already root).

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-13 18:22:23 -07:00
Andy Rothfusz
a92699ab6c Fixes 3497
Docker-DCO-1.1-Signed-off-by: Andy Rothfusz <github@developersupport.net> (github: @metalivedev)
2014-01-13 17:12:53 -08:00
Victor Vieux
9792df2080 Merge pull request #3575 from shykes/engine-get-images
move `docker images` to a job
2014-01-13 16:25:23 -08:00
Victor Vieux
16ca6a1c12 move legacy stuff outside the job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-13 16:20:05 -08:00
Victor Vieux
aca1270104 add legacy compat
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-13 15:50:20 -08:00
Victor Vieux
3a610f754f Add compat 1.8
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-13 15:50:20 -08:00
Solomon Hykes
17a806c8a0 Port 'docker images' to the engine API
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-01-13 15:49:33 -08:00
Tianon Gravi
1004c2d3d8 Add xz-utils to our deb-recommends since it's necessary for some images
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-13 16:25:23 -07:00
Fabio Falci
89bed4337d Use https to get the latest docker version
To avoid unexpected results since docker was using http.
For instance, my broadband doesn't return not found when it's down but
a html page saying that the internet is down. Docker was showing that
html instead of ignoring it.

Fix #3570

Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)
2014-01-13 20:37:29 +00:00
Andy Rothfusz
6652416f4c Merge pull request #3544 from SvenDowideit/build-image-cache
add info and example of image cache in use when building
2014-01-13 11:10:29 -08:00
Alexander Larsson
93e120e7d6 Discard all data on devicemapper devices when deleting them
This works around the fact that deleting a device in a thin pool
doesn't discard the free space. Unfortunately even this is not perfect,
as it seems discards are respected only for blocks that has never been
shared in the thin device code. However, this has been fixed in the
upstream kernel device-mapper tree:

http://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=0ab1c92ff748b745c1ed7cde31bb37ad2c5f901a

When this hits the kernel I belive this will fully return space
for removed images/containers to the host FS. For now it only
helps partially (which is better than nothing).

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-13 13:41:04 +01:00
Alexander Larsson
d54ce8087a Don't shell out to tar for ExportChanges
This changes ExportChanges to use the go tar support so we can
directly create tar layer files. This has several advantages:

* We don't have to create the whiteout files on disk to get them
  added to the layer

* We can later guarantee specific features (such as xattrs) being
  supported by the tar implementation.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-01-13 13:36:11 +01:00
Sven Dowideit
f30ca8935d add info and example of image cache in use when building
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)

Docker-DCO-1.0-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-01-13 22:17:47 +10:00
Tianon Gravi
07f62f199f Merge pull request #3554 from tianon/ubuntu-dep
Add ca-certificates to our package Recommends
2014-01-11 15:07:50 -08:00
Tianon Gravi
7273b33e86 Merge pull request #3551 from tianon/test-docker-io-gpg-fingerprint
Inline the test.docker.io fingerprint in the install.sh script as well
2014-01-11 15:07:06 -08:00
James Turnbull
ba90fcfc08 Merge pull request #3539 from jeandalido/patch-1
Update docker_remote_api_v1.8.rst
2014-01-11 13:29:56 -08:00
Tianon Gravi
fb63cfa9a5 Stop ADD from following symlinks outside the context when passed as the first argument
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-11 05:46:11 -07:00
Tianon Gravi
f65706aaeb Merge pull request #3500 from tianon/lvm2-version
Add more specific lvm2 version to PACKAGERS document
2014-01-11 03:39:01 -08:00
Tianon Gravi
fd78128870 Add support for RUN [""] in Dockerfiles for greater specificity in what is actually executed
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-11 04:00:52 -07:00
Tianon Gravi
cb314b9752 Merge pull request #3555 from jordansissel/patch-1
Update Ubuntu packaging script to use 'fpm -s empty' instead of 'mkdir empty && fpm -s dir -C empty'
2014-01-10 22:46:30 -08:00
Jordan Sissel
a02450d048 Use '-s empty' instead of '-s dir'
This *should* have the same effect as the previous strategy: Instead of
'mkdir empty; fpm -s dir -C empty ...' we can simply do 'fpm -s empty'

Docker-DCO-1.1-Signed-off-by: Jordan Sissel <jls@semicomplete.com> (github: jordansissel)
2014-01-10 22:36:58 -08:00
Victor Vieux
b61570b521 Merge pull request #3490 from vieux/image_export_job
Move image_export to a job
2014-01-10 15:58:47 -08:00
Victor Vieux
5264914e57 Move image_export to a job
Docker-DCO-1.0-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-10 15:54:44 -08:00
Victor Vieux
6dde20c0c5 Merge pull request #3180 from vieux/job_container_delete
Move container_delete to job
2014-01-10 15:53:38 -08:00
Victor Vieux
ad162b75a0 Merge pull request #3476 from vieux/restart_job
Move restart to a job
2014-01-10 15:52:42 -08:00
Victor Vieux
15689b56c8 Move restart to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-10 15:51:48 -08:00
Victor Vieux
aa3339cf39 move container_delete to job
handle error

remove useless errStr

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor@docker.com> (github: vieux)
2014-01-10 15:34:10 -08:00
Tianon Gravi
459e0aa2c1 Merge pull request #3543 from EvanKrall/gzip_debs
Use gzip compression in Ubuntu packages to make it possible to install on Lucid
2014-01-10 15:29:22 -08:00
Tianon Gravi
e5189b5dd2 Add ca-certificates to our package Recommends
It's only in "Recommends" because it's only required for all but the esoteric configurations (since you can't "docker pull" from the index without it, but that's about it).

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-10 13:06:53 -07:00
Evan Krall
c2a59dfe48 Use gzip compression in Ubuntu packages to make it at least possible to install on Lucid.
Docker-DCO-1.1-Signed-off-by: Evan Krall <krall@yelp.com> (github: EvanKrall)
2014-01-10 11:45:00 -08:00
Tianon Gravi
051e7a0bef Inline the test.docker.io fingerprint in the install.sh script as well
As long as we're doing it, we ought to do it for all the "official" Docker properties at least

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-10 10:20:31 -07:00
Jean-Baptiste Dalido
2fd4c39c86 Update docker_remote_api_v1.7.rst and non-versionned
Docker-DCO-1.1-Signed-off-by: Jean-Baptiste Dalido <jbdalido@gmail.com> (github: jeandalido)
2014-01-10 11:35:25 +01:00
Jean-Baptiste
d69cf2986e Update docker_remote_api_v1.8.rst
Docker-DCO-1.1-Signed-off-by: Jean-Baptiste Dalido <jbdalido@gmail.com> (github: jeandalido)
2014-01-10 11:27:21 +01:00
Guillaume J. Charmes
7985125602 Merge pull request #3537 from crosbymichael/merge_release_v0.7.5
Merge release v0.7.5
2014-01-09 11:39:35 -08:00
Michael Crosby
c3c89abfd6 Change version to v0.7.5
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-09 11:36:30 -08:00
Michael Crosby
1fcbd36cb2 Merge branch 'release' into merge_release_v0.7.5
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-09 11:36:14 -08:00
Michael Crosby
845b816686 Merge pull request #3532 from crosbymichael/bump_v0.7.5
Bump to v0.7.5
2014-01-09 11:33:57 -08:00
Guillaume J. Charmes
fc14e81bf9 Merge pull request #3533 from crosbymichael/run-rm-remove-volumes
Remove volumes on docker run -rm
2014-01-09 10:47:28 -08:00
Michael Crosby
c348c04fdf Bump to version v0.7.5
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-09 10:34:50 -08:00
Michael Crosby
5ca0fedffc Merge pull request #3535 from plietar/3457-git-build
Don't compress the archive made from git's output.
2014-01-09 10:32:28 -08:00
Paul Lietar
562a235763 Don't compress the archive made from git's output.
Commit 894d4a23fb made BuildFile use TarSum, which doesn't support
compressed tar archives.
This breaks builds from git url, which compressed it with bzip2.
Instead, just pass it uncompressed.

Docker-DCO-1.0-Signed-off-by: Paul Lietar <paul@lietar.net> (github: plietar)
2014-01-09 18:23:19 +00:00
Brandon Philips
e4af8b2ddc CONTRIBUTING.md: wrap DCO to 78 chars per line
The DCO is a bit hard to read on Github right now because there is lots
of horizontal scrolling. Reformat it to 78 chars per line like the rest
of the file.

Example: http://imgur.com/LtJEIsl

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-09 10:08:52 -08:00
Michael Crosby
14acf6883d Remove volumes on docker run -rm
If we don't care about the container then we don't care about any
volumes created with the run of that container

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-09 09:58:40 -08:00
Guillaume J. Charmes
eb131250aa Merge pull request #3530 from creack/update_dco_doc
Update DCO git hook example
2014-01-09 09:23:35 -08:00
Guillaume J. Charmes
9ec29fddf8 Merge pull request #3528 from tianon/update-travis-dco
Update Travis to check for new 1.1 DCO version
2014-01-09 09:23:23 -08:00
Guillaume J. Charmes
d015d31b1c Merge pull request #3527 from keeb/add-dco
Amend DCO
2014-01-09 09:23:11 -08:00
Guillaume J. Charmes
f6292ab8d0 Merge pull request #3522 from bantic/fix-misspelled-names
Fix misspelled Hawkings -> Hawking, Archimede -> Archimedes, Euclide -> Euclid
2014-01-09 09:12:05 -08:00
Guillaume J. Charmes
c3f2597546 Update DCO git hook example 2014-01-09 09:02:56 -08:00
Tianon Gravi
a4f3cd62a3 Update Travis to check for new 1.1 DCO version
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-09 09:52:17 -07:00
Nick Stinemates
11d61ec77f Bump DCO version 2014-01-09 08:47:03 -08:00
Nick Stinemates
40c90796e9 Fix layout 2014-01-09 08:35:47 -08:00
Nick Stinemates
7fb55f7725 Removed the 5th clause
Removed clause which states contributions should be relicensed
2014-01-09 08:35:06 -08:00
Cory Forsyth
7a7c3d87d8 Fix misspelled Hawkings -> Hawking, Archimede -> Archimedes, Euclide -> Euclid
Docker-DCO-1.0-Signed-off-by: Cory Forsyth <cory.forsyth@gmail.com> (github: bantic)
2014-01-09 10:02:55 -05:00
Guillaume J. Charmes
42df36b6fc Merge pull request #3515 from crosbymichael/no-host-name-without-networking
Do not add hostname when networking is disabled
2014-01-08 17:22:24 -08:00
Michael Crosby
0354c3a95c Do not add hostname when networking is disabled
Docker-DCO-1.0-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-08 16:57:56 -08:00
Victor Vieux
189c40597f Merge pull request #3511 from bantic/fix-misspelled-feynman
Fix misspelling of Richard Feynman's last name
2014-01-08 16:29:59 -08:00
Cory Forsyth
98193a397e Fix misspelling of Richard Feynman's last name
Docker-DCO-1.0-Signed-off-by: Cory Forsyth <cory.forsyth@gmail.com> (github: bantic)
2014-01-08 19:02:15 -05:00
Andy Rothfusz
c45cd9174e Merge pull request #3460 from tsaavik/patch-1
Fixed error in group add example
2014-01-08 15:45:23 -08:00
Michael Crosby
ee65633620 Merge pull request #3446 from tianon/update-checklist
Update release checklist with more information, more commands, and more ...
2014-01-08 15:37:49 -08:00
Guillaume J. Charmes
3be2ea021d Merge pull request #3417 from Sjord/use-most-recent-cache-image
Fix issue #3375 - Return most recent image from the cache
2014-01-08 15:30:36 -08:00
Guillaume J. Charmes
1d0d093d0b Merge pull request #3464 from vieux/fix_error_wait
fix error on docker wait
2014-01-08 15:06:54 -08:00
Guillaume J. Charmes
38a49951b3 Merge pull request #3493 from SvenDowideit/commit-signoff-location
give more specific advice on setting up signing
2014-01-08 15:04:00 -08:00
Guillaume J. Charmes
772765c404 Merge pull request #3510 from creack/hotfix-add_caching
Hotfix add caching
2014-01-08 15:00:18 -08:00
Victor Vieux
71e89fdc75 Merge pull request #3514 from vieux/update_REMOTE_TODO
update REMOTE_TODO.md
2014-01-08 14:51:35 -08:00
Victor Vieux
5530cc29b2 update REMOTE_TODO.md
Docker-DCO-1.0-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-08 14:50:52 -08:00
Tianon Gravi
82aed48bbc Merge pull request #3494 from tianon/makefile-use-branch-tag
Update Makefile to use "docker:GIT_BRANCH" as the generated image name
2014-01-08 14:47:41 -08:00
Guillaume J. Charmes
0fd9c98de3 Make sure the remote ADD are cached properly
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-08 14:22:49 -08:00
Guillaume J. Charmes
762a0cc472 Cleanup utils.Download
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-08 14:22:49 -08:00
Guillaume J. Charmes
e24e9c09f8 Make sure file are cached correctly during build
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-08 14:22:49 -08:00
Frank Macreery
93ff70a3e7 Potential fix for ADD .
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-08 14:22:24 -08:00
Guillaume J. Charmes
c6350bcc24 Disable compression for build. More space usage but much faster upload
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-08 14:21:13 -08:00
Andy Rothfusz
9a6333466b Merge pull request #3503 from gertvv/patch-1
Hello World: fix detach behavior
2014-01-08 11:44:26 -08:00
Andy Rothfusz
187eed7da5 Merge pull request #3501 from proppy/patch-1
google-compute-engine: fix typos
2014-01-08 11:40:30 -08:00
Victor Vieux
368e308971 Merge pull request #3499 from tianon/typos
Fix a few miscellaneous typos (Unkown -> Unknown, Recieve -> Receive)
2014-01-08 10:37:00 -08:00
Victor Vieux
149156a272 Merge pull request #3402 from manuel-woelker/3345-add-content-type-header-to-version-remote-api
Fix for #3345: Add Content-Type Header "application/json" to GET /version response in remote API
2014-01-08 10:15:22 -08:00
Gert van Valkenhoef
8298a200ce Add the customary bold 2014-01-08 18:45:06 +01:00
Danny Yates
c4535c833d gofmt
Docker-DCO-1.0-Signed-off-by: Danny Yates <danny@codeaholics.org> (github: codeaholics)
2014-01-08 10:37:22 +00:00
Danny Yates
145501bee3 Fix indentation to match rest of file (tabs, not spaces)
Docker-DCO-1.0-Signed-off-by: Danny Yates <danny@codeaholics.org> (github: codeaholics)
2014-01-08 10:14:30 +00:00
Danny Yates
df4ea946a6 Further simplification
Docker-DCO-1.0-Signed-off-by: Danny Yates <danny@codeaholics.org> (github: codeaholics)
2014-01-08 10:14:25 +00:00
Danny Yates
6b48761ce9 Remove unneeded DependencyGraph
Docker-DCO-1.0-Signed-off-by: Danny Yates <danny@codeaholics.org> (github: codeaholics)
2014-01-08 10:14:14 +00:00
Danny Yates
5aa304f969 Fix registry pushing/tagging
* docker push host:port/namespace/repo wouldn't push multiple tags for
  the same image
* getImageList was unnecessarily complex returning a nested array of
  ImgData when a correctly ordered list of images was sufficient
* removed various bits of redundancy

Docker-DCO-1.0-Signed-off-by: Danny Yates <danny@codeaholics.org> (github: codeaholics)
2014-01-08 10:13:14 +00:00
Gert van Valkenhoef
c9cebf3a73 Hello World: fix detach behavior
The hello world example relies on being able to exit the container attachment using Control-C without stopping it. According to this thread (and my own experience), this doesn't work anymore:

https://groups.google.com/forum/#!msg/docker-user/nWXAnyLP9-M/kbv-FZpF4rUJ

Added -sig-proxy=false to the attach command.
2014-01-08 10:58:55 +01:00
Manuel Woelker
53a01aebd6 Fix for #3345: Add Content-Type Header "application/json" to GET /version and /info responses in remote API
Docker-DCO-1.0-Signed-off-by: Manuel Woelker <github@manuel.woelker.org> (github: manuel-woelker)
2014-01-08 09:17:20 +01:00
Sjoerd Langkemper
46c8b11f24 Fix issue #3375 - Return most recent image from the cache
ImageGetCached searches for an image from the cache. Instead of returning the
first image it finds, it should return the most recently created image. When a
build with --no-cache then adds a new image with the same parameters, it is
used instead of the old, existing image.

Docker-DCO-1.0-Signed-off-by: Sjoerd Langkemper <sjoerd@byte.nl> (github: Sjord)
2014-01-08 09:15:45 +01:00
Sjoerd Langkemper
10b794b332 Revert "Make sure the cache lookup returns always the same result"
This reverts commit 1d4b7d8fa1.

Docker-DCO-1.0-Signed-off-by: Sjoerd Langkemper <sjoerd@byte.nl> (github: Sjord)
2014-01-08 09:14:31 +01:00
Johan Euphrosine
a3ee36b747 google-compute-engine: fix typos 2014-01-08 00:11:06 -08:00
Tianon Gravi
7626e9fd64 Add more specific lvm2 version to PACKAGERS document
I personally tested this using our container, and this was the lowest version that compiles and runs properly.

Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-08 00:27:50 -07:00
Tianon Gravi
e525ad3f9b Fix a few miscellaneous typos (Unkown -> Unknown, Recieve -> Receive)
Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-07 22:15:53 -07:00
Michael Crosby
322a42b8a2 Merge pull request #3496 from creack/disable_build_compression
Disable compression for build. More space usage but much faster upload
2014-01-07 18:57:18 -08:00
Guillaume J. Charmes
90ea81433f Merge pull request #3498 from crosbymichael/merge_release_v0.7.4
Merge release v0.7.4
2014-01-07 18:44:03 -08:00
Michael Crosby
d7f26c93d9 Change version to v0.7.4-dev
Docker-DCO-1.0-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-07 18:41:06 -08:00
Michael Crosby
d4e61b48eb Merge branch 'release' into merege_release_v0.7.4
Docker-DCO-1.0-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-07 18:40:54 -08:00
Michael Crosby
1a6fc02348 Merge pull request #3495 from crosbymichael/bump_v0.7.4
Bump v0.7.4
2014-01-07 18:35:44 -08:00
Michael Crosby
010d74ec2f Bump to v0.7.4
Docker-DCO-1.0-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-07 18:06:20 -08:00
Guillaume J. Charmes
1137ecf7d1 Disable compression for build. More space usage but much faster upload
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-07 17:46:04 -08:00
Tianon Gravi
a25a80b2d3 Merge pull request #3361 from zimbatm/gpg-key-secure-best
Makes sure the GPG fingerprint is inlined in the doc everywhere.
2014-01-07 17:43:04 -08:00
Tianon Gravi
a95712899e Update Makefile to use "docker:GIT_BRANCH" as the generated image name for increased versatility
... and other minor Makefile improvements :)

Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-07 18:38:07 -07:00
Tianon Gravi
b57051a724 Update release checklist with more information, more commands, and more correct flow (test, upload to test.docker.io, test, upload to get.docker.io, THEN tag&merge)
Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-07 18:28:07 -07:00
Guillaume J. Charmes
bb76985d39 Merge pull request #3474 from creack/fix_add_cache_issue
Fix ADD caching issue with . prefixed path
2014-01-07 17:24:18 -08:00
Guillaume J. Charmes
28ec47c441 Merge pull request #3492 from unclejack/3449-fix_docker_build_on_devicemapper
#3449 - fix `docker build` on devicemapper
2014-01-07 17:12:31 -08:00
zimbatm
94c803e9f0 Fixes key installation for other target urls in hack/install.sh
Docker-DCO-1.0-Signed-off-by: Jonas Pfenniger <zimbatm@zimbatm.com> (github: zimbatm)
2014-01-08 01:08:14 +00:00
zimbatm
13ebc68636 Makes sure the GPG key fingerprint is inlined in the doc everywhere.
Instead of `curl $url | apt-get add -` use the ubuntu keyserver and a full
fingerprint to retreive the key. This makes the distribution of the GPG key
more secure an less likely to change even if 3rd party gains access to the
packages repository.

Docker-DCO-1.0-Signed-off-by: Jonas Pfenniger <zimbatm@zimbatm.com> (github: zimbatm)
2014-01-08 01:07:04 +00:00
unclejack
d003cfea25 Revert "Add -S option to tar for efficient sparse file handling"
This reverts commit 733bf5d3dd.

This is needed to fix "no such file" errors `docker build` errors for
devicemapper.

This fixes issue #3449.

Docker-DCO-1.0-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-01-08 02:58:39 +02:00
Guillaume J. Charmes
f3103e5c91 Fix issue with file caching + prevent wrong cache hit
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-07 16:53:55 -08:00
Sven Dowideit
0eb5f233d6 give more specific advice on setting up signing
Docker-DCO-1.0-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-01-08 10:19:44 +10:00
Guillaume J. Charmes
ef7e000a13 Make vfs error more explicit
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-07 16:02:41 -08:00
Guillaume J. Charmes
811341423b Fix ADD caching issue with . prefixed path
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <charmes.guillaume@gmail.com> (github: creack)
2014-01-07 16:02:20 -08:00
Andy Rothfusz
b3addb5fb8 Merge pull request #3430 from lsm5/fedora-official-image
install instructions use unprefixed fedora image
2014-01-07 15:12:37 -08:00
Andy Rothfusz
00ee6d1925 Merge pull request #3483 from lukaspustina/patch-1
Missing redirect in line 85
2014-01-07 15:11:02 -08:00
Andy Rothfusz
6f8a79c23c Merge pull request #3462 from tsaavik/patch-2
Simplified and streamlined Amazon Quickstart
2014-01-07 15:09:35 -08:00
Andy Rothfusz
cf8063d152 Merge pull request #3461 from jbeda/patch-1
Update instructions for mtu flag for Docker on GCE
2014-01-07 15:03:19 -08:00
Andy Rothfusz
3e10fe1a15 Merge pull request #3488 from jamtur01/1310
Fixed #3481 - Added Ubuntu Saucy to installation
2014-01-07 14:56:03 -08:00
Michael Crosby
45ecdf9c8e Merge pull request #3487 from crosbymichael/improve-images-speed
Only get rootfs when we need to calculate the image size
2014-01-07 14:47:31 -08:00
Tianon Gravi
b942f24ba8 Merge pull request #3491 from tianon/travis-numeric-commit
Fix Travis handling of a fully-numeric commit hash being YAML-converted ...
2014-01-07 14:35:06 -08:00
Tianon Gravi
3779291e9b Fix Travis handling of a fully-numeric commit hash being YAML-converted to a number instead of a string
Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-07 15:27:51 -07:00
Michael Crosby
fa14a1b983 Only get rootfs when we need to calculate the image size
Docker-DCO-1.0-Signed-off-by: Michael Crosby <crosby.michael@gmail.com> (github: crosbymichael)
2014-01-07 13:56:26 -08:00
Tianon Gravi
f9e14cc838 Merge pull request #3489 from tianon/travis-fixes
Fix Travis PR testing to not overwrite the "master" that Travis creates with our "upstream master"
2014-01-07 12:53:19 -08:00
Victor Vieux
f2ea539467 Update REMOTE_TODO.md 2014-01-07 12:51:17 -08:00
Tianon Gravi
7c4e5fbd46 Fix Travis PR testing to not overwrite the "master" that Travis creates with our "upstream master", and to also ignore commits with no content (like a Merge commit - there's no need to sign off on literally nothing)
Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-07 13:45:40 -07:00
James Turnbull
97ef8a067c Fixed #3481 - Added Ubuntu Saucy to installation
Docker-DCO-1.0-Signed-off-by: James Turnbull <james@lovedthanlost.net> jamtur01
2014-01-07 11:46:07 -08:00
Michael Crosby
4b9e475a3d Merge pull request #2091 from keeb/add-dco
Add Developer Certificate of Origin Text
2014-01-07 10:42:53 -08:00
Michael Crosby
1d0aeae339 Merge pull request #3431 from shin-/ping_standalone_check
Check standalone header when pinging a registry server.
2014-01-07 10:33:07 -08:00
Solomon Hykes
859856b3e4 Merge pull request #3475 from tianon/travis
Add Travis CI configuration to validate DCO and gofmt
2014-01-07 10:19:43 -08:00
Michael Crosby
b8b18a2b42 Merge pull request #3435 from roylee17/3149-fix_port_mapping_of_tcp_plus_udp
Fix #3149: port mapping of TCP + UDP
2014-01-07 10:08:13 -08:00
Tianon Gravi
561d1db074 Add Travis CI configuration to validate DCO and gofmt
After each push, Travis CI will trigger, and check two things:

- make sure that each commit in the push has the Docker certificate of origin
- make sure that all .go files changed by this sequence of commits are correctly formatted in the most recent commit

Note: there is one edge case; if you do a git force push, we cannot figure out the actual commits in the force push, and we will just run the checks as if upstream master were the base. Pull requests will always be tested correctly, though.

Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-07 08:25:54 -07:00
Michael Crosby
1f9abfe841 Merge pull request #3480 from tianon/gofmt
Run 'gofmt -s -w'
2014-01-07 06:41:23 -08:00
lukaspustina
2b93f18223 Missing pipe in line 85 2014-01-07 15:20:38 +01:00
Tianon Gravi
8f3b8f3835 Run 'gofmt -s -w' 2014-01-06 22:14:35 -07:00
Michael Crosby
fca83b4cfb Merge pull request #3477 from creack/fix_tar_leaks
Make CopyFileWithTar use a pipe instead of a buffer. Save more than 1Gb of ram for a 500Mb file.
2014-01-06 18:04:44 -08:00
Guillaume J. Charmes
444a087ac2 Make CopyFileWithTar use a pipe instead of a buffer. Save more than 1Gb of ram for a 500Mb file. 2014-01-06 17:44:22 -08:00
Victor Vieux
e1c861cf33 Update REMOTE_TODO.md 2014-01-06 17:37:30 -08:00
Nick Stinemates
6fe3da9924 Remove the @github handle as it generates emails. 2014-01-06 17:21:14 -08:00
Andy Rothfusz
f43f3fa218 Merge pull request #3473 from dhrp/docs-version-warning-fix
[docs] Fix for wrong version warning on master instead of latest.
2014-01-06 16:26:04 -08:00
Thatcher Peskens
1e551c7cc5 [docs] Fix for wrong version warning on master instead of latest. 2014-01-06 16:18:00 -08:00
Michael Crosby
2c395ce8fb Merge pull request #3328 from shykes/pkg-iptables
Move utility package 'iptables' to pkg/iptables
2014-01-06 15:54:07 -08:00
Solomon Hykes
7799ae27ca Move utility package 'iptables' to pkg/iptables 2014-01-06 15:41:24 -08:00
Michael Crosby
bb754fd34d Merge pull request #3388 from tianon/more-build-tests
Add more TestBuild Dockerfiles, especially for 'echo shebang' testing
2014-01-06 15:14:30 -08:00
Victor Vieux
a0298c0bd0 Merge pull request #3420 from RoelVanNyen/getfullname
Cleanup: runtime.getFullName is deprecated by getFullName
2014-01-06 13:59:04 -08:00
Victor Vieux
a86a82cb7e Merge pull request #3384 from tianon/fix-load-help
Fix "docker load" help by removing "SOURCE" prompt and mentioning STDIN
2014-01-06 13:30:16 -08:00
Nick Stinemates
36ab1836f9 Fix dotCloud to Docker, Inc 2014-01-06 12:26:53 -08:00
shin-
5e8912e0e8 Fixed registry unit tests 2014-01-06 21:04:44 +01:00
Victor Vieux
4e414f6205 Merge pull request #3377 from cpuguy83/3333-fix_-H_default
Make blank -H option default to the same as no -H was sent
2014-01-06 11:30:27 -08:00
Michael Crosby
4f31141e13 Merge pull request #3310 from pnasrat/cgroups-subpackage
Extract cgroups utilities to own submodule.
2014-01-06 11:27:29 -08:00
Victor Vieux
82531f7168 fix error on docker wait 2014-01-06 11:11:04 -08:00
Michael Crosby
ee6823d797 Merge pull request #3297 from jaseg/master
Return meaningful error for meaningless Dockerfiles
2014-01-06 10:58:24 -08:00
Michael Crosby
1363dfdd1d Merge pull request #3426 from bcbcarl/3425-upgrade_vbox_guest_additions
Upgrade VBox Guest Additions (Fix #3425)
2014-01-06 10:39:26 -08:00
Joe Beda
b308e33106 Tweak formatting for GCE instructions 2014-01-06 10:35:51 -08:00
Victor Vieux
e5b09523dc Merge pull request #3367 from cpuguy83/3362-unify_cmd_entrypoint_handling
Use same error handling while unmarshalling args for CMD and ENTRYPOINT
2014-01-06 10:29:37 -08:00
Victor Vieux
d44abae873 Merge pull request #3441 from RoelVanNyen/container_start
Just pass the container in RegisterLinks(), no need to lookup by name
2014-01-06 10:19:01 -08:00
Brian Goff
323c4b5211 Use same error handling while unmarshalling args for CMD and ENTRYPOINT 2014-01-06 13:15:14 -05:00
Michael Crosby
5b4a0cac4e Merge pull request #3335 from vieux/remote_todo
add REMOTE_TODO
2014-01-06 10:12:08 -08:00
Victor Vieux
73294b6d56 Merge pull request #3455 from crigor/fix-pull-message
Fix login message to say pull instead of push.
2014-01-06 10:02:32 -08:00
David Mcanulty
d6ca05f7cb Simplified and streamlined Amazon Quickstart
The amazon quickstart images are EBS backed and include cloudinit. I've personally tested these documentation changes as a new user to Docker.
2014-01-06 09:53:58 -08:00
Victor Vieux
dfc2dc4d35 Merge pull request #3445 from dotcloud/merge_release_v0.7.3
Merge release v0.7.3
2014-01-06 09:51:41 -08:00
David Mcanulty
fc559d9992 Fixed error in group add example
There is no ${USERNAME} in bash, only ${USER}
2014-01-06 09:29:56 -08:00
Joe Beda
ea762c1a51 Update instructions for mtu flag for Docker on GCE 2014-01-06 09:29:33 -08:00
Christopher Rigor
599009191a Fix login message to say pull instead of push. 2014-01-05 17:07:16 +08:00
Tianon Gravi
af50b2f17c Merge pull request #3454 from sudosurootdev/master
Fix spelling error in hack/make.sh comment
2014-01-04 20:24:48 -08:00
sudosurootdev
2a1181f404 Spelling error. 2014-01-04 23:15:15 -05:00
Tianon Gravi
f7afbf34fe Merge pull request #3448 from tmahesh/patch-1
Changelog date typo fix: 2013-01-02 -> 2014-01-02
2014-01-04 08:21:48 -08:00
Mahesh Tiyyagura
3069bf9460 Changelog date typo fix: 2013-01-02 -> 2014-01-02 2014-01-04 11:24:48 +05:30
Tianon Gravi
32b9a429c5 Change version to 0.7.3-dev 2014-01-03 17:02:59 -07:00
Tianon Gravi
76910d16cc Merge pull request #3439 from dotcloud/bump_v0.7.3
Bump v0.7.3
2014-01-03 16:01:56 -08:00
Roel Van Nyen
42c7dc448f Just pass the container in RegisterLinks(), no need to lookup by name again 2014-01-03 15:49:39 +01:00
Tianon Gravi
8502ad4ba7 Bump version to v0.7.3 2014-01-02 21:19:19 -07:00
Andy Rothfusz
58ec7855bc substantial spelling fix 2014-01-02 16:46:50 -08:00
Andy Rothfusz
949fde88df Merge pull request #3437 from jamtur01/faqhere
Fixed duplicate here references in FAQ
2014-01-02 16:44:38 -08:00
James Turnbull
5a9f45cb7a Fixed duplicate here references in FAQ 2014-01-02 19:40:19 -05:00
Andy Rothfusz
8f4a54734f Merge pull request #3428 from jamtur01/port1.8
Added some 1.7 API updates that were missing from 1.8
2014-01-02 16:34:56 -08:00
Andy Rothfusz
9359d79c4f Merge pull request #3389 from SvenDowideit/3366-simplify-volumes-documentation
simplify the volumes documentation and mention more details
2014-01-02 16:29:09 -08:00
James Turnbull
69db6ea867 Added some 1.7 API updates that were missing from 1.8 2014-01-02 19:27:59 -05:00
Andy Rothfusz
3b89187d03 Merge pull request #3409 from Chris00/patch-1
Mention lxc-checkconfig
2014-01-02 16:20:30 -08:00
Andy Rothfusz
82a47b0e82 Keep original transcript in Thatcher's voice
and clarify that this is an update to the example.
2014-01-02 16:17:52 -08:00
Andy Rothfusz
e0f07bc186 Merge pull request #3399 from rgstephens/patch-1
Update for Ubuntu 13.10
2014-01-02 16:14:47 -08:00
Guillaume J. Charmes
194eb246ef Merge pull request #3353 from creack/improve_add_cache
Improve add cache
2014-01-02 16:07:33 -08:00
Tzu-Jung Lee
f560b87a86 Fix #3149: port mapping of TCP + UDP
Signed-off-by: Tzu-Jung Lee <roylee17@gmail.com>
2014-01-02 16:01:04 -08:00
Paul Nasrat
c561212b83 Extract cgroups utilities to own submodule.
Use mountinfo rather than for cgroups parsing.
Make helper method private and change name.
Makes method naming more explicit rather than GetThisCgroup.
Use upstream term subsystem rather than cgroupType.
2014-01-02 17:54:57 -05:00
Michael Crosby
81e596e272 Merge pull request #3287 from vieux/fix_progressbar_display_push
fix progressbar in docker push
2014-01-02 13:38:11 -08:00
Tianon Gravi
acfdfa81be Merge pull request #3427 from tianon/stub-deb-init-config
Add stubbed and commented "/etc/default/docker" to our deb package
2014-01-02 09:44:36 -08:00
shin-
589515c717 Check standalone header when pinging a registry server. Standalone has to be true to use basic auth (in addition to previous requirements) 2014-01-02 17:51:42 +01:00
Lokesh Mandvekar
523f726716 install instructions use unprefixed fedora image
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2014-01-02 11:29:24 -05:00
Tianon Gravi
7fd6dcc831 Add stubbed and commented "/etc/default/docker" to our deb package
This is to especially fix FPM 1.0+ complaining that we told it we have an /etc/default/docker "config file", but didn't actually include one.
2014-01-01 22:34:22 -07:00
Carl X. Su
848f290012 Upgrade VBox Guest Additions (Fix #3425) 2014-01-02 12:56:29 +08:00
James Turnbull
add97f7eb0 Merge pull request #3419 from newzealandpaul/master
Mac OS X command in docs for pip fixed
2014-01-01 20:27:38 -08:00
Roel Van Nyen
9dd7ae4074 Cleanup: runtime.getFullName is deprecated by getFullName 2014-01-02 00:06:50 +01:00
Tianon Gravi
5f55784224 Merge pull request #3374 from tianon/fpm-license-vendor
Replace FPM --vendor with --license, and give it the proper value of "Apache-2.0"
2014-01-01 14:42:47 -08:00
Paul
f3816ee024 Mac OSX command for pip was incorrect 2014-01-02 09:52:07 +13:00
Christophe Troestler
0b3e153588 Implement suggestions 2014-01-01 12:28:22 +01:00
Christophe Troestler
2226989410 Mention lxc-checkconfig
This is important because the list below is not complete when one build one's own kernel.  Plus it is more robust in the face of changes.
2014-01-01 00:59:47 +01:00
Tianon Gravi
c23b15b9d8 Merge pull request #3398 from thomasleveil/bash_completion_names
support for container names in bash completion
2013-12-31 08:28:21 -08:00
Thomas LEVEIL
055b32e3f4 support for container names in bash completion 2013-12-31 11:34:23 +00:00
Michael Crosby
907d9ce13c Merge pull request #3355 from creack/fix_build_exit
Exit with code 1 in case of error for `docker build`
2013-12-30 22:14:01 -08:00
Tianon Gravi
74d45789dd Merge pull request #3379 from tianon/organize-contrib-syntax
Reorganize the syntax highlighting files in contrib under a common directory
2013-12-30 21:57:19 -08:00
Tianon Gravi
40522c0380 Merge pull request #3392 from tianon/fix-install-failure
Fix install failure when busybox can't be downloaded
2013-12-30 20:04:30 -08:00
Tianon Gravi
d5bb0ff80a Merge pull request #3401 from odonnellryan/patch-1
Swap "grep -q" with "grep > /dev/null" so that "go help" doesn't balk when the pipe closes unexpectedly (since "grep -q" closes the pipe the second it finds a match)
2013-12-30 18:44:23 -08:00
Ryan O'Donnell
ad80da3389 Fixes Issue #3400
See Issue #3400
2013-12-30 20:58:25 -05:00
rgstephens
1f80c2a652 Update for Ubuntu 13.10
With two additional commands, this procedure will work for Ubuntu 13.10 using the image stackbrew/ubuntu:13.10.

1) change /etc/pam.d/sshd, pam_loginuid line 'required' to 'optional'
2) echo LANG=\"en_US.UTF-8\" > /etc/default/locale
2013-12-30 17:50:58 -08:00
Andy Rothfusz
1bc3f6b7b5 Merge pull request #3303 from crosbymichael/add-host-flag
Add DOCKER_HOST env var for client
2013-12-30 15:54:37 -08:00
Andy Rothfusz
643621133f Merge pull request #3395 from jamtur01/basicsfixes
Minor fixes to the basic command documentation
2013-12-30 15:41:59 -08:00
Sven Dowideit
fd240413ff simplify the volumes documentation and mention more details 2013-12-31 09:09:57 +10:00
Solomon Hykes
392b1e99b2 Merge pull request #3344 from tianon/dockerfile-cleanup
Many various Dockerfile cleanups
2013-12-30 11:26:13 -08:00
James Turnbull
0dfebf2d93 Minor fixes to the basic command documentation 2013-12-30 13:57:11 -05:00
Andy Rothfusz
40aaebe56a Merge pull request #3394 from jamtur01/clifixes
Numerous small fixes to the CLI documentation
2013-12-30 10:56:47 -08:00
James Turnbull
a1dba16fe8 Numerous small fixes to the CLI documentation 2013-12-30 13:48:12 -05:00
Andy Rothfusz
e31f1f1eba Merge pull request #3371 from Grunny/volumes-typo-fix
Fix typo in working with volumes doc page
2013-12-30 10:35:09 -08:00
Andy Rothfusz
7e720d0a77 Merge pull request #3312 from DeX77/master
Installation for FrugalWare
2013-12-30 10:34:39 -08:00
Andy Rothfusz
237868e9c3 Merge pull request #3380 from SvenDowideit/add-no-auth-note
add a simple note to suggest to the user to use RUN curl/wget/tool if the URL they need is behind auth
2013-12-30 10:00:51 -08:00
Tianon Gravi
fc197188d7 Fix install failure when busybox can't be downloaded
Whether or not the "busybox" image downloads and runs properly at the end of the build, we don't want to have the script return a failing exit code, especially since at that point, Docker is successfully installed, and we're just tooting our own horn for good measure.
2013-12-30 08:38:43 -07:00
Thatcher
d59080d119 Merge pull request #3386 from bwiklund/headerfix
Fixed header image on docs.docker.io site
2013-12-30 06:48:02 -08:00
Tianon Gravi
c6dcee329d Add more TestBuild Dockerfiles, especially for making sure manual RUN echo '#!...' continues to work correctly 2013-12-30 00:10:48 -07:00
Tianon Gravi
484a75f354 Update Dockerfile to use stackbrew/ubuntu (until it graduates), update Dockerfile MAINTAINER line, coalesce all apt-get installs into one invocation (including s3cmd by bringing in backports) 2013-12-29 23:27:01 -07:00
Ben Wiklund
434cf6c8ca fixed header size on narrow desktop window 2013-12-29 19:22:52 -08:00
Tianon Gravi
83d631b6a4 Fix "docker load" help by removing "SOURCE" prompt and mentioning STDIN
Fixes #3383
2013-12-29 13:25:57 -07:00
Brian Goff
8b82b0dfe7 Make blank -H option default to the same as no -H was sent 2013-12-29 14:36:46 -05:00
Sven Dowideit
e93b7b4647 add a simple note to suggest to the user to use RUN curl/wget/tool if the URL they need is behind auth 2013-12-29 21:27:59 +10:00
Tianon Gravi
06a818616b Reorganize the syntax highlighting files in contrib under a common directory to match "contrib/init" and "contrib/completion"
This is split off from #2970.
2013-12-29 01:46:00 -07:00
Michael Crosby
f50b8b08b5 Add DOCKER_HOST env var for client
This env var will set the -H flag on the docker
client.
2013-12-28 16:42:18 -08:00
Tianon Gravi
cda146547e Replace FPM --vendor with --license, and give it the proper value of "Apache-2.0"
Fixes #3372
2013-12-28 06:35:00 -07:00
grunny
a17fd7b294 Fix typo in working with volumes doc page 2013-12-28 20:22:46 +10:00
Tianon Gravi
22162687df Merge pull request #3358 from asbjornenge/master
Apply automatically to files named 'Dockerfile'
2013-12-27 08:22:52 -08:00
Daniel Exner
d256f3049b * s/docker/Docker/ 2013-12-27 11:55:57 +01:00
Asbjørn Enge
a1a4a99d7e Apply automatically to files named 'Dockerfile' 2013-12-27 10:05:25 +01:00
Guillaume J. Charmes
4986958e7e Exit with code 1 in case of error for docker build 2013-12-26 17:49:41 -08:00
Guillaume J. Charmes
cd735496da Hash the sums for directory (ureadable when there is too many 2013-12-26 16:42:05 -08:00
Guillaume J. Charmes
894d4a23fb Change BuildFile in order to use TarSum instead of custom checksum 2013-12-26 16:16:26 -08:00
Guillaume J. Charmes
fc9f4d8bad Log files name along with their checksum in TarSum + add a Method to retrieve the checksum map 2013-12-26 16:01:36 -08:00
Guillaume J. Charmes
1d4b7d8fa1 Make sure the cache lookup returns always the same result 2013-12-26 15:43:27 -08:00
Guillaume J. Charmes
360078d761 Remove old debug from tarsum 2013-12-26 15:39:06 -08:00
Guillaume J. Charmes
808f2d39bd Merge pull request #3343 from bwiklund/comment-edits
small batch of edits/corrections to comments
2013-12-26 10:22:33 -08:00
Guillaume J. Charmes
d1ca12e81b Merge pull request #3347 from smarterclayton/patch-1
Fix typo in devmapper error message
2013-12-26 10:19:55 -08:00
Guillaume J. Charmes
a042c9fb1b Merge pull request #3348 from manuel-woelker/document-name-param-in-remote-api
Document "name" query parameter for "POST /containers/create" in Remote API v1.8
2013-12-26 10:19:42 -08:00
Manuel Woelker
721bb410f6 Document "name" query parameter for "POST /containers/create" in Remote API v1.8 2013-12-26 06:43:26 +01:00
Clayton Coleman
029625981d Fix typo in devmapper error message 2013-12-25 15:49:58 -05:00
Ben Wiklund
0fccf0f686 small batch of edits/corrections to comments 2013-12-24 16:40:14 -08:00
Guillaume J. Charmes
efaf2cac5c Merge pull request #2809 from graydon/880-cache-ADD-commands-in-dockerfiles
Issue #880 - cache ADD commands in dockerfiles
2013-12-24 16:22:51 -08:00
Guillaume J. Charmes
cb1fe939a8 Merge pull request #3337 from tianon/release-darwin
Release tgz and binaries for cross-compiled platforms
2013-12-24 14:44:41 -08:00
Andy Rothfusz
c654aea4f2 Merge pull request #3340 from jamtur01/apiport
Fixed #3039 - Added clarification on port options in API
2013-12-24 14:34:13 -08:00
James Turnbull
d2d8a4a6c5 Fixed #3039 - Added clarify on port options in API 2013-12-24 13:01:59 -05:00
Tianon Gravi
4100e9b7df Update cross and tgz to play nicely together (creating a tgz for each supported OS/ARCH), and update release.sh to upload binaries and tgz files for all the supported OS/ARCH combos 2013-12-23 23:55:06 -07:00
Tianon Gravi
5875953d9b Merge pull request #3112 from shawnl/master
hack/PACKAGERS.md: libdevmapper
2013-12-23 19:24:36 -08:00
Victor Vieux
3264c1c5eb add REMOTE_TODO 2013-12-23 19:01:10 -08:00
Tianon Gravi
f4ce106e02 Merge pull request #3318 from sugi/mkimage-deb-fix-cache-glob
Fix glob expansion on mkimage-debootstrap
2013-12-23 17:20:41 -08:00
Victor Vieux
7ec1236cee Merge pull request #3324 from roylee17/enhance-docker-top-err-msg
docker-top: improve error message for non-running containers
2013-12-23 17:15:37 -08:00
Guillaume J. Charmes
2b4bb67ce0 Merge pull request #3327 from shykes/pkg-graphdb
Move utility package 'graphdb' to pkg/graphdb
2013-12-23 16:33:11 -08:00
Victor Vieux
6155f07561 Merge pull request #3331 from shykes/pkg-names
Move utility package 'namesgenerator' to pkg/namesgenerator
2013-12-23 16:15:26 -08:00
Victor Vieux
e6e35e5984 Merge pull request #3330 from shykes/pkg-term
Move utility package 'term' to pkg/term
2013-12-23 16:11:42 -08:00
Victor Vieux
0d207abf8e Merge pull request #3329 from shykes/pkg-netlink
Move utility package 'netlink' to pkg/netlink
2013-12-23 16:08:07 -08:00
Solomon Hykes
a009d4ae8d Move utility package 'namesgenerator' to pkg/namesgenerator 2013-12-23 23:45:18 +00:00
Victor Vieux
b75f385abd Merge pull request #3304 from vieux/prevent_orphan_deletion
Prevent orphan in docker rmi
2013-12-23 15:44:46 -08:00
Solomon Hykes
7ce7516c12 Move utility package 'term' to pkg/term 2013-12-23 23:42:37 +00:00
Solomon Hykes
f6b91262a7 Move utility package 'netlink' to pkg/netlink 2013-12-23 23:39:39 +00:00
Solomon Hykes
d16d748132 Move utility package 'graphdb' to pkg/graphdb 2013-12-23 23:33:06 +00:00
Victor Vieux
3fc9de3d03 Merge pull request #3325 from shykes/pkg-systemd
Move utility package 'systemd' to pkg/systemd
2013-12-23 15:26:25 -08:00
Solomon Hykes
652c2c2a80 Add README to pkg 2013-12-23 23:12:19 +00:00
Solomon Hykes
8e7db0432e Move utility package 'systemd' to pkg/systemd 2013-12-23 23:07:01 +00:00
Guillaume J. Charmes
e1a15b25dc Merge pull request #3309 from apocas/master
Wrong HTTP method in events endpoint. (documentation)
2013-12-23 14:58:49 -08:00
Tzu-Jung Lee
b1a3a55802 docker-top: improve error message for non-running containers
Signed-off-by: Tzu-Jung Lee <roylee17@gmail.com>
2013-12-23 14:50:24 -08:00
apocas
614bc5c1e1 http method typo in documentation for events endpoint (all api versions) 2013-12-23 21:21:01 +00:00
Victor Vieux
3fe4d5477a Merge pull request #3298 from creack/add_arch_user_agent
Add arch/os info to user agent (Registry)
2013-12-23 12:08:26 -08:00
Andy Rothfusz
cda24e345c Merge pull request #3302 from briandorsey/master
Added a note about a networking work-around.
2013-12-23 11:25:20 -08:00
Andy Rothfusz
88037b2877 Merge pull request #3320 from jamtur01/privapi
API documentation update for Privileged
2013-12-23 11:22:47 -08:00
Andy Rothfusz
6cdd1aa350 Merge pull request #3321 from jamtur01/apiclean
Minor style cleanups to the API spec docs
2013-12-23 11:20:56 -08:00
James Turnbull
ea8a3438f7 Minor style cleanups to the API spec docs 2013-12-23 11:45:51 -05:00
Tianon Gravi
954158ce52 Merge pull request #2986 from SvenDowideit/still-need-privileged
still need  -privileged to run a build / test
2013-12-23 07:58:17 -08:00
James Turnbull
bf17383e35 API documentation update for Privileged
The 1.7 API docs show the ability to pass Privileged
when creating a container. This is not supported as.
Privileged is now part of hostConfig and can only be
passed when starting a container.

This fixes the documentation issue.
2013-12-23 09:08:28 -05:00
Sven Dowideit
83d81758b0 use the Makefile - it makes life so much simpler 2013-12-23 23:46:52 +10:00
Tatsuki Sugiura
e3b878ce98 Fix glob expansion for no-cache setting.
On previous version, glob pattern will be expanded to actual file
names when writing setting to etc/apt/apt.conf.d/no-cache.

This patch fixes to quote to work cache clean command properly.
2013-12-23 17:27:22 +09:00
James Turnbull
1e5f9334e0 Merge pull request #3308 from crigor/patch-1
Change an to a
2013-12-21 15:12:50 -08:00
Daniel Exner
3edbf416bf + added missing link in index.rst
* some gramatic and spelling fixes

Thx jamtur :)
2013-12-22 00:00:20 +01:00
James Turnbull
c2364b978d Merge pull request #3272 from SvenDowideit/more-complete-run-cmd-example
A more complete example of docker run.
2013-12-21 14:52:41 -08:00
Daniel Exner
158e3d60ec Installation for FrugalWare 2013-12-21 23:38:13 +01:00
apocas
e4e579b40d Wrong HTTP method in events endpoint. 2013-12-21 16:41:41 +00:00
Christopher Rigor
071528e103 Change an to a 2013-12-21 16:23:13 +08:00
Victor Vieux
a2fcd3d8f0 Merge pull request #3306 from roylee17/3224-fix-udp-cleanup
network: fix a typo in udp cleanup path
2013-12-21 00:03:07 -08:00
Tzu-Jung Lee
7d2e851d8e network: fix a typo in udp cleanup path
Fix #3224 - Port already in use error when running a container

Signed-off-by: Tzu-Jung Lee <roylee17@gmail.com>
2013-12-20 17:54:54 -08:00
Victor Vieux
85f9b778f5 fix progressbar in docker push 2013-12-20 16:55:41 -08:00
Victor Vieux
369cde4ad7 discard test output 2013-12-20 16:50:31 -08:00
Victor Vieux
3ffc52bcf5 Merge branch 'test-container-orphaning' of https://github.com/gabrtv/docker into prevent_orphan_deletion 2013-12-20 16:27:33 -08:00
Victor Vieux
8dcca2125a prevent orphan 2013-12-20 16:26:02 -08:00
Brian Dorsey
cdd14b1a31 Update MTU work-around to use the new -mtu flag 2013-12-20 16:19:35 -08:00
Brian Dorsey
37ed178611 Added a note about a networking work around.
An additional flag to limit the networking MTU is required in three Compute Engine zones for reliable networking from inside the docker container. Added a warning to that effect to the QuickStart guide.
2013-12-20 16:06:28 -08:00
Gabriel Monroy
c995c9bb91 add TestContainerOrphaning integration test 2013-12-20 16:52:34 -07:00
Michael Crosby
aa619de748 Merge pull request #3289 from crosbymichael/add-mtu-option
Allow mtu to be configured at daemon start
2013-12-20 13:21:56 -08:00
Michael Crosby
6fde28c293 Merge pull request #3300 from crosbymichael/fix-mountinfo-parsing
Only parse upto the mountpoint in mountinfo
2013-12-20 13:21:20 -08:00
Michael Crosby
f4358fc647 Merge pull request #3291 from dineshs-altiscale/3282-sparse-files
Add -S option to tar for efficient sparse file handling
2013-12-20 11:10:31 -08:00
Michael Crosby
57e19b1475 Merge pull request #3294 from discordianfish/3293-better-error-dockerfile-empty
Return error if Dockerfile is empty
2013-12-20 10:45:56 -08:00
Michael Crosby
8051b6c1a1 Only parse upto the mountpoint in mountinfo 2013-12-20 13:34:05 -05:00
Michael Crosby
566ff54d0d Allow mtu to be configured at daemon start 2013-12-20 12:12:03 -05:00
Guillaume J. Charmes
f9359f59a8 Add dynamic os/arch detection to Images 2013-12-20 08:20:08 -08:00
Guillaume J. Charmes
e4561438f1 Add arch/os info to user agent (Registry) 2013-12-20 08:19:25 -08:00
jaseg
b8cd2bc94d Return meaningful error for meaningless Dockerfiles 2013-12-20 16:19:21 +01:00
Johannes 'fish' Ziemke
f7ba1c34bb Return error if Dockerfile is empty 2013-12-20 14:13:52 +01:00
Sven Dowideit
df87919165 make a more complete example of docker run, showing the use of most of the options (Closes #1500) 2013-12-20 20:06:07 +10:00
Dinesh Subhraveti
733bf5d3dd Add -S option to tar for efficient sparse file handling
Fixes issue #3282
2013-12-19 21:41:22 -08:00
Andy Rothfusz
efde305c05 Merge pull request #3286 from pandrew/3279-documentation-docker-inspect
Update docs to include images for docker inspect
2013-12-19 14:50:55 -08:00
Guillaume J. Charmes
636dfc82b0 Merge pull request #3064 from tianon/custom-dockerinit-path
Allow custom dockerinit path
2013-12-19 14:31:41 -08:00
Victor Vieux
93abcc3a3b Merge pull request #3273 from crosbymichael/set-mtu-in-dockerinit
Move MTU setting outside of lxc and set with netlink
2013-12-19 14:25:27 -08:00
Tianon Gravi
c3ec696284 Merge pull request #3244 from codeaholics/remove-apt-errors-during-build
Tidy up some of the error messages from apt during build
2013-12-19 13:28:56 -08:00
Michael Crosby
fdd81b423b Merge pull request #3288 from tianon/makefile-maintainer
Add Tianon as Makefile maintainer
2013-12-19 13:26:52 -08:00
Tianon Gravi
cd89fe5c4f Add Tianon as Makefile maintainer 2013-12-19 13:42:35 -07:00
Tianon Gravi
1636ed9826 Merge pull request #3283 from jpoimboe/update-vendor.sh
add gosqlite to vendor.sh
2013-12-19 12:37:25 -08:00
pandrew
8072d3a4e0 Update docs to include images for docker inspect 2013-12-19 20:55:19 +01:00
Josh Poimboeuf
d215724ad6 add gosqlite to vendor.sh
Add gosqlite and its latest revision to vendor.sh so that the vendor
directory can be reliably recreated.
2013-12-19 13:51:46 -06:00
Michael Crosby
0e6f0c4e02 Move MTU setting outside of lxc and set with netlink 2013-12-19 11:51:44 -08:00
Andy Rothfusz
629cc2fce4 Merge pull request #3284 from jamtur01/faqmore
Added some more items to the FAQ
2013-12-19 11:32:53 -08:00
James Turnbull
8c52140059 Added some more items to the FAQ 2013-12-19 14:27:47 -05:00
Victor Vieux
f21bd80e90 Merge pull request #3271 from crosbymichael/mount-outside
Perform docker specific mounts outside of lxc
2013-12-19 11:13:31 -08:00
Guillaume J. Charmes
4bdd4599f0 Merge pull request #3243 from alexlarsson/compressed-tar
Handle compressed tars in ApplyLayer
2013-12-19 11:02:32 -08:00
Michael Crosby
ed93dab9a8 Merge pull request #3276 from tianon/cross-compile
Add new "cross" bundle to cross-compile the Docker client
2013-12-19 10:41:12 -08:00
Tianon Gravi
62a81370ff Add new "cross" bundle to cross-compile the Docker client for other platforms (currently just 32-bit and 64-bit OS X) 2013-12-19 11:33:49 -07:00
Guillaume J. Charmes
e74c65c3db Merge pull request #3274 from tianon/tianon-dockerfile
Make Tianon the official root "Dockerfile" maintainer
2013-12-19 10:31:00 -08:00
Victor Vieux
248eadd341 Merge pull request #3277 from jpoimboe/fix-root-symlink
Move root symlink check to engine.New
2013-12-19 10:24:23 -08:00
Victor Vieux
e829d5b6d2 Merge pull request #3275 from crosbymichael/sqlite-import
Move sqlite conn to graph db for cross compile support
2013-12-19 10:18:30 -08:00
Michael Crosby
35d8ac94f3 Merge pull request #3270 from vreon/tree-box-drawing-characters
Use box-drawing characters in `docker images -tree`
2013-12-19 10:00:33 -08:00
Josh Poimboeuf
94821a3353 Move root symlink check to engine.New
Since commit c91c365, when starting the docker daemon without an
existing /var/lib/docker directory, it fails with:

  2013/12/18 23:39:36 Unable to canonicalize root (%!s(*string=0xc210077c80)): lstat /var/lib/docker: no such file or directory

Move the symlink checking code to engine.New after the root dir has been
created.
2013-12-19 00:39:12 -06:00
Jesse Dubay
d14c162fd6 Use box-drawing characters in docker images -tree
This makes the output of `docker images -tree` look a little prettier.
Previously it displayed a combination of box-drawing characters and pipe
characters, so the lines didn't quite connect...

Before:

    └─aceb1e132fe5 Size: 487 MB (virtual 1.728 GB)
      |─c5480c55e00a Size: 44.89 MB (virtual 1.773 GB)
      | └─96c21b5e3c80 Size: 17.25 kB (virtual 1.773 GB)
      |   └─58f3f2293512 Size: 8.191 MB (virtual 1.782 GB)

After:

    └─aceb1e132fe5 Size: 487 MB (virtual 1.728 GB)
      ├─c5480c55e00a Size: 44.89 MB (virtual 1.773 GB)
      │ └─96c21b5e3c80 Size: 17.25 kB (virtual 1.773 GB)
      │   └─58f3f2293512 Size: 8.191 MB (virtual 1.782 GB)
2013-12-18 22:30:21 -08:00
Tianon Gravi
14d1c5a2c3 Make Tianon the official root "Dockerfile" maintainer, since it's so hard-locked to hack changes most of the time 2013-12-18 22:29:48 -07:00
Michael Crosby
329d154209 Move sqlite conn to graph db for cross compile support 2013-12-18 21:14:16 -08:00
Michael Crosby
7bc96aec7b Improve interface by moving to subpkg
Enable builds on OSX
2013-12-18 16:42:49 -08:00
Michael Crosby
a6fdc5d208 Fix unmount issues 2013-12-18 15:24:08 -08:00
Guillaume J. Charmes
681b40c801 Merge pull request #3268 from vieux/prevent_panic_volume
prevent a panic with docker run -v /
2013-12-18 14:06:44 -08:00
Victor Vieux
536da93380 prevent a panic with docker run -v / 2013-12-18 13:57:49 -08:00
Michael Crosby
45d7dcfea2 Handle external mounts outside of lxc 2013-12-18 13:46:02 -08:00
Guillaume J. Charmes
210fa0871c Merge pull request #3267 from vieux/debug_daemon_start
add some debug to runtime.restore()
2013-12-18 13:45:22 -08:00
Victor Vieux
f768c6adb7 Merge pull request #3263 from tianon/abspath-root
Canonicalize our root path before we try using it
2013-12-18 11:41:47 -08:00
Victor Vieux
fde909ffb8 add some debug to runtime.restore() 2013-12-18 10:57:21 -08:00
Michael Crosby
553b4dae45 Merge pull request #3264 from creack/fix_osx_compilation
Fix osx compilation
2013-12-18 10:50:14 -08:00
Tianon Gravi
929662a4d5 Merge pull request #3266 from tianon/fix-integration-test-building
Add -a to our BUILDFLAGS directly, which fixes some fun test compilation issues
2013-12-18 10:37:55 -08:00
Tianon Gravi
fbac812540 Add -a to our BUILDFLAGS directly, which fixes some fun test compilation issues
Also, now that we use "-a", we no longer get any benefit from "go test -i", and it actually causes problems sometimes, so let's nuke it.
2013-12-18 11:32:25 -07:00
Guillaume J. Charmes
e481c82fa9 Fix OSX compilation for aufs 2013-12-18 10:18:49 -08:00
Guillaume J. Charmes
73a1ef7c22 Fix OSX build for sysinit 2013-12-18 10:16:48 -08:00
Tianon Gravi
c91c365f88 Canonicalize our root path before we try using it, because we make assumptions about it not containing symlinks
Fixes #3242
2013-12-18 11:15:09 -07:00
Alexander Larsson
b8a4f570fb archive: Re-add XZ compression support
This shells out to the xz binary to support .tar.xz layers, as
there is no compression/xz support in go.
2013-12-18 10:50:22 +01:00
Michael Crosby
70c7220a99 Merge pull request #3128 from codeaholics/1530-improve-error-message
Improve error message when refusing to remove image due to multiple repo tags
2013-12-17 20:49:25 -08:00
Michael Crosby
0f45e3c6e0 Merge pull request #3205 from cddr/Vagrantfile-typos
Fix typos in Vagrantfile
2013-12-17 20:41:53 -08:00
Michael Crosby
be0beb897a Merge pull request #3238 from tianon/go-build-a
Readd go build -a
2013-12-17 20:40:36 -08:00
Michael Crosby
8fa4c4b062 Merge pull request #3253 from titanous/update-container-name-validation
Update container name validation
2013-12-17 20:34:53 -08:00
Jonathan Rudenberg
c06ab5f9c2 Add container name validation test 2013-12-17 20:19:23 -05:00
Jonathan Rudenberg
3ec39ad01a DRY up valid container name pattern usage 2013-12-17 20:17:50 -05:00
Jonathan Rudenberg
1940015824 Add '.' to valid container name pattern 2013-12-17 20:17:06 -05:00
Andy Rothfusz
1acefac97e Merge pull request #3234 from creack/default_unix_path
Default unix path
2013-12-17 16:24:01 -08:00
Andy Rothfusz
f630fbc7cf Merge pull request #3228 from maztaim/patch-1
Update binaries.rst
2013-12-17 13:10:08 -08:00
Andy Rothfusz
e61f327ec9 Merge pull request #3250 from vincentwoo/patch-1
Update docker_remote_api.rst to reflect that the latest remote API version is 1.8
2013-12-17 13:09:37 -08:00
Vincent Woo
c4444ce48f Update docker_remote_api.rst to reflect that the latest remote API version is 1.8 2013-12-17 11:48:21 -08:00
Andy Rothfusz
7ba0f1f421 Merge pull request #3236 from dhrp/doc-master-warning
Added warning when browsing master. & no longer hides alternative versions
2013-12-17 11:17:17 -08:00
Andy Rothfusz
30454bb85c Merge pull request #3249 from tianon/fix-sphinx-warning
Fix minor sphinx warning
2013-12-17 11:03:44 -08:00
Andy Rothfusz
2deb0c3365 Merge pull request #3248 from lsm5/docker-fedora-conflict
Docker fedora conflict
2013-12-17 11:01:37 -08:00
Thatcher Peskens
efc0610c0e Removed unnessary span element from version floater and
Replaced social footer by the one from www.docker.io
2013-12-17 10:39:22 -08:00
Andy Rothfusz
391676b598 Merge pull request #3221 from jamtur01/introlink
Updated Introduction link
2013-12-17 10:36:00 -08:00
Guillaume J. Charmes
5204feeaa9 Merge pull request #3237 from tianon/hack-fix-cover-detection
Fix "go tool cover" detection to only add -cover and -coverprofile if we...
2013-12-17 10:09:40 -08:00
Tianon Gravi
81d112cb7f Fix minor sphinx warning 2013-12-17 10:38:55 -07:00
Lokesh Mandvekar
25be0b1e98 Fedora first letter capitalize and misc. rewording
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-17 11:32:40 -06:00
Michael Crosby
c56b045270 Merge pull request #3239 from tianon/old-go-not-supported
Purge more hack references to Go 1.1.2
2013-12-17 09:08:42 -08:00
Guillaume J. Charmes
d9a1cc7e2b Merge pull request #3168 from discordianfish/2464-replace-lxc-ps
Reimplement lxc-ps
2013-12-17 09:06:52 -08:00
Lokesh Mandvekar
30b4a0f76a docker and docker-io conflict update for epel
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-17 10:56:31 -06:00
Lokesh Mandvekar
7d95145b76 update fedora doc: docker and docker-io conflict
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-17 10:33:52 -06:00
Guillaume J. Charmes
379a7fab07 Update docs 2013-12-17 07:55:36 -08:00
Danny Yates
36e060299f Tidy up some of the error messages from apt during build 2013-12-17 13:50:37 +00:00
Alexander Larsson
a96a26c62f Handle compressed tars in ApplyLayer
When pulling from a registry we get a compressed tar archive, so
we need to wrap the stream in the right kind of compress reader.

Unfortunately go doesn't have an Xz decompression method, but I
don't think any docker layers use that atm anyway.
2013-12-17 14:19:48 +01:00
Danny Yates
c3705e83e7 Improve error message when refusing to remove image due to multiple repo tags 2013-12-17 12:34:25 +00:00
Tianon Gravi
5e9b4a23e6 Purge more hack references to Go 1.1.2 (since it requires backported archive/tar patches now, and Go 1.2 is _widely_ packaged successfully) 2013-12-16 23:57:54 -07:00
Tianon Gravi
a1c5e276f4 Add "-a" back to our "go build" 2013-12-16 23:50:03 -07:00
Tianon Gravi
eddda577a4 Fix "go tool cover" detection to only add -cover and -coverprofile if we both have cover support in Go, and if we have the cover tool downloaded 2013-12-16 22:54:06 -07:00
Tianon Gravi
2ed1001c57 Allow packagers to specify a custom dockerinit lookup location via DOCKER_INITPATH in dynbinary
Only necessary if distro policy dictates that the path deviate from the paths already listed in utils/utils.go - please refrain from using it otherwise.
2013-12-16 22:29:08 -07:00
Tianon Gravi
f02d766f9a Add dockerinit SHA1 and path to "docker info" when debug mode is enabled 2013-12-16 22:29:05 -07:00
Tianon Gravi
2035af44aa Always copy dockerinit locally, regardless of whether our docker binary is static, because even it might get deleted or moved/renamed 2013-12-16 22:29:00 -07:00
Thatcher Peskens
746ae155fb Added warning when browsing master. & no longer hides alternative versions. 2013-12-16 18:36:35 -08:00
Graydon Hoare
a26801c73f Add CHANGELOG.md entry for ADD caching. 2013-12-16 17:38:16 -08:00
Graydon Hoare
670b326c1b Add self to AUTHORS. 2013-12-16 17:36:51 -08:00
Graydon Hoare
15a6854119 Add testcases for ADD caching, closes #880. 2013-12-16 17:36:51 -08:00
Graydon Hoare
3f9416b58d Record added-tree sha256 in buildfile.CmdAdd, probe and use cache. 2013-12-16 17:36:51 -08:00
Graydon Hoare
7afd7a82bd Factor cache-probing logic out of buildfile.commit() and CmdRun(). 2013-12-16 17:36:50 -08:00
Michael Crosby
124da338fd Merge pull request #3207 from alexlarsson/fix-applylayer
Re-enable TestApplyLayer and make it work
2013-12-16 16:55:48 -08:00
Guillaume J. Charmes
69a31c3386 Improve TestParseHost 2013-12-16 16:35:56 -08:00
Guillaume J. Charmes
20605eb310 Allow to use -H unix:// like -H tcp:// 2013-12-16 16:30:23 -08:00
Thatcher
945a1f06f9 Merge pull request #3232 from dhrp/Full-width-documentation
Full width documentation
2013-12-16 15:56:39 -08:00
Michael Crosby
64136071c6 Change version to 0.7.2-dev 2013-12-16 15:43:46 -08:00
Guillaume J. Charmes
28b162eeb4 Merge pull request #3233 from crosbymichael/bump_0.7.2
Bump to 0.7.2
2013-12-16 15:06:42 -08:00
Michael Crosby
e960152a1e Bump to v0.7.2 2013-12-16 14:50:07 -08:00
Thatcher Peskens
fe956ad449 Improvement upon @SvenDowideit suggestion to make the docs use full-width
Moved the style comments source to into the .less file
2013-12-16 14:37:56 -08:00
Guillaume J. Charmes
47375ddf54 Merge pull request #3230 from crosbymichael/allow-untag
Allow untag operations with no container validation
2013-12-16 14:34:56 -08:00
Michael Crosby
f0d6a91a1b Merge pull request #3217 from SvenDowideit/deal-with-changing-paths-for-lxc-start
lxc-start-unconfined softlink can go bad
2013-12-16 13:38:03 -08:00
Michael Crosby
62213ee314 Allow untag operations with no container validation 2013-12-16 13:29:43 -08:00
Thatcher Peskens
fa48f17493 Merge branch 'use-complete-width-of-browser-for-docs' of github.com:SvenDowideit/docker into SvenDowideit-use-complete-width-of-browser-for-docs 2013-12-16 13:08:00 -08:00
Guillaume J. Charmes
41d972baf1 Merge pull request #3219 from unclejack/vagrant_fix_version_check
install vbox guest additions if the latest aren't already installed
2013-12-16 12:49:32 -08:00
Guillaume J. Charmes
b3ad330782 Merge pull request #3099 from vieux/fix_pull_build
added authConfig to docker build
2013-12-16 10:53:10 -08:00
Tim Bosse
6721525068 Update binaries.rst
Along with the kernel requirement, you need a working copy of lxc.  When trying to start using "/docker -d", received error 'initapi: exec: "lxc-start": executable file not found in $PATH'
2013-12-16 12:04:29 -05:00
Johannes 'fish' Ziemke
5cfcb05486 Fix and re-enable TestGetContainersTop 2013-12-16 16:01:55 +01:00
Alexander Larsson
78c22c24b3 ApplyLayer: Fix TestLookupImage
The TestLookupImage test seems to use a layer that contains
/etc/postgres/postgres.conf, but not e.g. /etc/postgres.

To handle this we ensure that the parent directory always
exists, and if not we create it.
2013-12-16 14:35:43 +01:00
Johannes 'fish' Ziemke
4faba4fae7 Reimplement lxc-ps
Instead of calling lxc-ps in top endpoint, we reimplement it by
calling ps and filter for pids running in a given container.
2013-12-16 13:30:35 +01:00
Sven Dowideit
e1efd4cb8c please, don't use 30% of the screen for whitespace, and thus compress the examples so they are ~80 chars wide - the output of 'docker ps' and 'docker images' becomes needlessly unreadable 2013-12-16 13:24:35 +10:00
Tianon Gravi
606cacdca0 Merge pull request #3222 from gurjeet/zfs_driver_owner
Update readme to mark ZFS driver as Alpha quality.
2013-12-15 07:09:00 -08:00
Gurjeet Singh
d526038503 Update readme to mark ZFS driver as Alpha quality. 2013-12-15 09:17:16 -05:00
James Turnbull
58daccab26 Updated Introduction link
Previously the introduction link pointed to www.docker.io. That
did not seem to make a lot of sense to me so instead I pointed it
at:

http://www.docker.io/learn_more/
2013-12-15 03:13:41 -05:00
unclejack
12fb508262 install vbox guest additions if not latest 2013-12-14 16:00:52 +02:00
Sven Dowideit
0a3eedd4c9 when sharing a /var/lib/docker dir with more than one distribution, an existing lxc-start-unconfined softlink may point to a non-existant path, following that link (as Stat does) will cause the daemon to fail to start 2013-12-14 15:29:08 +10:00
Guillaume J. Charmes
a6928e70ac Merge pull request #3197 from ajhager/3138-names
Validate container names on creation. Fixes #3138
2013-12-13 17:28:36 -08:00
Guillaume J. Charmes
20197385b2 Merge pull request #3173 from vieux/docker_info_job
Move info to job
2013-12-13 17:27:59 -08:00
Victor Vieux
85b9338205 add GetenvInt64 ans SetenvInt64 2013-12-13 16:29:22 -08:00
Victor Vieux
51e2c1794b move docker info to the job api 2013-12-13 16:15:15 -08:00
Guillaume J. Charmes
20899cdb34 Merge pull request #3183 from vieux/job_commit
Move commit to job
2013-12-13 16:11:58 -08:00
Guillaume J. Charmes
f5ab2516d8 Merge pull request #2897 from crosbymichael/aufs-42
Increase max image depth to 127
2013-12-13 16:03:57 -08:00
Victor Vieux
d5f5ecb658 improve GetenvJson 2013-12-13 16:02:19 -08:00
Victor Vieux
4b5ceb0f24 use args 2013-12-13 14:29:27 -08:00
Andy Rothfusz
906b481148 Merge pull request #3213 from metalivedev/1695-dockerlogs
Add more information about Docker logging
2013-12-13 14:29:14 -08:00
Victor Vieux
930ec9f52c move commit to job 2013-12-13 14:19:56 -08:00
Guillaume J. Charmes
aaa1c48d24 Merge pull request #3175 from vieux/engine-job-stop
Move stop to job
2013-12-13 14:15:58 -08:00
Victor Vieux
d7123a597f Merge pull request #3214 from dotcloud/shykes_maintainer
Temporarily remove @shykes from engine/MAINTAINERS
2013-12-13 14:03:08 -08:00
Guillaume J. Charmes
9a9ecda7c8 Merge pull request #3208 from WarheadsSE/bridgeip
Add -bip flag: allow specification of dynamic bridge IP via CIDR
2013-12-13 13:56:35 -08:00
Guillaume J. Charmes
071338172c Merge pull request #3187 from vieux/resize_job
Move resize to job
2013-12-13 13:55:23 -08:00
Victor Vieux
4975c1b549 Temporarily remve @shykes from engine/MAINTAINERS 2013-12-13 13:51:20 -08:00
Victor Vieux
73e8a39ff2 move resize to job 2013-12-13 13:15:39 -08:00
Victor Vieux
847cf5b599 Merge branch 'master' of https://github.com/dotcloud/docker 2013-12-13 13:15:22 -08:00
Michael Crosby
bf91636558 Merge pull request #3210 from rsampaio/fix_bridge_creation_3141
Bridge creation when ipv6 is not enabled
2013-12-13 12:03:55 -08:00
Andy Rothfusz
1e85aabf71 Fix #1695 by adding more about logging. 2013-12-13 11:42:58 -08:00
Michael Crosby
4fe0a9b6a0 Merge pull request #3211 from tianon/hack-make-cover
Add new cover bundlescript for giving a nice report across all the coverprofiles
2013-12-13 11:17:03 -08:00
Joseph Hager
f63cdf0260 Validate container names on creation. Fixes #3138
Move valid container name regex to the top of the file

Added hyphen as a valid rune in container names.

Remove group in valid container name regex.
2013-12-13 14:14:05 -05:00
Victor Vieux
9fb1ba97b1 Merge branch 'master' of https://github.com/dotcloud/docker 2013-12-13 11:06:20 -08:00
Tianon Gravi
59dc2876a7 Add new cover bundlescript for giving a nice report across all the coverprofiles generated by the test scripts 2013-12-13 11:59:54 -07:00
Tianon Gravi
23ab0af2ff Merge pull request #3132 from tianon/hack-separate-integration
Separate Integration Tests
2013-12-13 10:55:49 -08:00
Victor Vieux
b8a16b3459 Merge pull request #3194 from tianon/tianon-hack-maintainer
Make Tianon the hack maintainer
2013-12-13 10:55:07 -08:00
Rodrigo Vaz
a530b8d981 fix #3141 Bridge creation when ipv6 is not enabled 2013-12-13 16:39:49 -02:00
Victor Vieux
89beb55c32 Merge branch 'master' of https://github.com/dotcloud/docker 2013-12-13 10:38:26 -08:00
Victor Vieux
f9328ad9cc Merge pull request #3201 from jpoimboe/libvirt-prereq-network
Set hostname and IP address from dockerinit
2013-12-13 10:38:17 -08:00
Victor Vieux
20759c3ef7 Merge branch 'libvirt-prereq-network' of https://github.com/jpoimboe/docker 2013-12-13 10:34:09 -08:00
Victor Vieux
5d81776714 Merge pull request #3202 from jpoimboe/libvirt-prereq-env
dockerinit: propagate "container" env variable from lxc
2013-12-13 10:32:17 -08:00
Tianon Gravi
0ef1ff91cb Merge pull request #3151 from tianon/more-debootstrap-tweaks
Update mkimage-debootstrap with even more tweaks for keeping images tiny...
2013-12-13 09:28:11 -08:00
WarheadsSE
a68d7f3d70 Add -bip flag: allow specification of dynamic bridge IP via CIDR
e.g.:

```
docker -d -bip "10.10.0.1/16"
```

If set and valid, use provided in place of trial and error from pre-defined array in network.go.
Mutually exclusive of -b option.
2013-12-13 10:47:19 -05:00
Alexander Larsson
a8af12f80a Re-enable TestApplyLayer
With the previous two changes we now pass this test.
2013-12-13 15:50:25 +01:00
Alexander Larsson
10cd902f90 Fix change detection when applying tar layers
The default gnu tar format has no sub-second precision mtime support,
and the golang tar writer currently doesn't support that either.
This means if we export the changes from a container we will not
get zeron in the sub-second precision field when the change is applied.

This means we can't compare that to the original without getting a
spurious change. So, we detect this case by treating a case where the
seconds match and either of the two nanoseconds are zero as equal.
2013-12-13 15:46:41 +01:00
Alexander Larsson
818c249bae archive: Implement ApplyLayer directly
Rather than calling out to tar we use the golang tar parser
to directly extract the tar files. This has two major advantages:

1) We're able to replace an existing directory with a file in the
   new layer. This currently breaks with the external tar, since
   it refuses to recursively remove the destination directory in
   this case, and there are no options to make it do that.

2) We avoid extracting the whiteout files just to later remove them.
2013-12-13 15:43:50 +01:00
Tianon Gravi
5a89c6f6df Merge pull request #3192 from unclejack/update_virtualbox_guest_additions
vagrant: update & verify virtualbox guest tools
2013-12-12 21:22:29 -08:00
Andy Chambers
2e6dbe87ad Fix typos in Vagrantfile 2013-12-13 00:09:05 -05:00
Josh Poimboeuf
e877294321 dockerinit: propagate "container" env variable from lxc
Lxc (and libvirt) already set the "container" env variable
appropriately[1], so just use that.

[1] http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
2013-12-12 20:08:58 -06:00
Josh Poimboeuf
ecc51cd465 dockerinit: set IP address
Set the IP address in dockerinit instead of lxc utils, to prepare for
using libvirt-lxc.
2013-12-12 19:57:11 -06:00
Josh Poimboeuf
f7c7f7978c dockerinit: set hostname
Set the hostname in dockerinit instead of with lxc utils.  libvirt-lxc
doesn't have a way to do this, so do it in a common place.
2013-12-12 19:56:05 -06:00
Michael Crosby
8224e13bd2 Merge pull request #3185 from vieux/job_tag
Move tag to job
2013-12-12 17:02:39 -08:00
Guillaume J. Charmes
912bf8ff92 Merge pull request #3015 from jpoimboe/dockerinit-libvirt-prereqs
dockerinit: drop capabilities
2013-12-12 15:49:21 -08:00
Victor Vieux
e43ff2f6f2 move tag to job 2013-12-12 11:52:11 -08:00
Josh Poimboeuf
b8f1c73705 dockerinit: drop capabilities
Drop capabilities in dockerinit instead of with lxc utils, since
libvirt-lxc doesn't support it.

This will also be needed for machine container mode, since dockerinit
needs CAP_SYS_ADMIN to setup /dev/console correctly.
2013-12-12 13:47:24 -06:00
Josh Poimboeuf
1572989201 dockerinit: refactor error handling 2013-12-12 13:47:24 -06:00
Josh Poimboeuf
bd02d6e662 dockerinit: put args in a struct 2013-12-12 13:47:23 -06:00
Andy Rothfusz
2d1f61ef0e Merge pull request #3190 from zain/master
Small typo fixes
2013-12-12 11:25:11 -08:00
Andy Rothfusz
54df95f26c Merge pull request #3189 from aknikitin/patch-1
Minor spelling fix
2013-12-12 11:24:45 -08:00
Guillaume J. Charmes
5b33ae5971 Merge pull request #3145 from vieux/fix_docker_images
multiple fixed in docker images
2013-12-12 11:17:19 -08:00
Tianon Gravi
0db1c60542 Make Tianon the hack maintainer 2013-12-12 11:25:30 -07:00
unclejack
f216448c82 vagrant: update & verify virtualbox guest tools 2013-12-12 13:03:33 +02:00
Zain Memon
f26a9d456c Small typo fixes 2013-12-12 01:23:16 -08:00
Anton Nikitin
bf5b949ffc Minor spelling fix 2013-12-12 01:09:24 -05:00
Victor Vieux
621523a041 Merge pull request #3184 from creack/fix-volumes-on-host
Fix volumes on host
2013-12-11 18:06:25 -08:00
Guillaume J. Charmes
8fd9633a6b Improve FollowLink to handle recursive link and be more strick 2013-12-11 17:19:02 -08:00
Victor Vieux
1124261158 Merge pull request #3144 from codeaholics/643-stale-nfs-handle
Prevent deletion of image if ANY container is depending on it; not just running containers
2013-12-11 17:18:54 -08:00
Andy Rothfusz
b722f809e7 Merge pull request #3181 from lsm5/rhel-docs-typos
Rhel docs typos
2013-12-11 16:37:24 -08:00
Michael Crosby
f396c42cad Fix volumes on the host by following symlinks in a scope 2013-12-11 16:31:02 -08:00
Lokesh Mandvekar
8874f2aef9 keeping rhel page sorta in sync with fedora
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-11 18:26:17 -06:00
Lokesh Mandvekar
e8ec3dba7b remove step numbers, keep consistent with fedora
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-11 18:21:52 -06:00
Andy Rothfusz
4eda2a54de Merge pull request #3177 from tianon/fix-turnbull-github
Fix James's github handle in docs/MAINTAINERS
2013-12-11 16:00:06 -08:00
Andy Rothfusz
d3292078dc Merge pull request #3176 from lsm5/rhel-docs
Rhel docs
2013-12-11 15:58:42 -08:00
Victor Vieux
6ba456ff87 move t from arg to env 2013-12-11 15:36:50 -08:00
Lokesh Mandvekar
44984602c7 more typo corrections
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-11 16:36:14 -06:00
Lokesh Mandvekar
d534e1c3a1 some typo corrections
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-11 16:20:54 -06:00
Andy Rothfusz
d56d8ab96e Merge pull request #3174 from richo/features/https_install_script
Use https to get the install script
2013-12-11 14:09:22 -08:00
Andy Rothfusz
6cf8ec606e Merge pull request #3161 from SvenDowideit/make-replace-docker-binary-note-more-obvious
associate swapping the built docker binary with building the binary, rather than a note in building the docs
2013-12-11 14:04:34 -08:00
Lokesh Mandvekar
db3019d50b rhel page keywords update
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-11 16:00:46 -06:00
Lokesh Mandvekar
42c38bf34d rhel description update
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-11 15:59:35 -06:00
Andy Rothfusz
11b3fbb3bd Merge pull request #3167 from qbrossard/patch-1
Corrected typo (resdis -> redis)
2013-12-11 13:57:59 -08:00
Andy Rothfusz
036f41fde3 Merge pull request #3165 from SvenDowideit/cmd-rmi-example
add example for docker rmi, and explain the need to remove all references (tags) to and image before its garbage collected :)
2013-12-11 13:57:13 -08:00
Andy Rothfusz
6e9c1590c6 Merge pull request #3162 from SvenDowideit/docker-commit-example-change-CMD
add a direct example for changing the cmd that is run
2013-12-11 13:52:12 -08:00
Tianon Gravi
39cc8a32b1 Fix James's github handle in docs/MAINTAINERS 2013-12-11 14:13:55 -07:00
Lokesh Mandvekar
31961ccd94 rhel page only for rhel
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-11 14:36:12 -06:00
Lokesh Mandvekar
eec48f93a3 rhel docs update
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-11 14:34:51 -06:00
Solomon Hykes
dbe1915fee Engine: new command 'stop' gracefully stops a container. 2013-12-11 11:52:59 -08:00
Solomon Hykes
bef8de9319 Engine: integer job status, improved stream API
* Jobs return an integer status instead of a string
* Status convention mimics unix process execution: 0=success, 1=generic error, 127="no such command"
* Stdout and Stderr support multiple thread-safe data receivers and ring buffer filtering
2013-12-11 11:52:59 -08:00
Richo Healey
81fc368a6d Use https to get the install script 2013-12-11 11:27:36 -08:00
Michael Crosby
bd292759f0 Merge pull request #3153 from vieux/improve_docker_push_display
Update docker push to use new display
2013-12-11 11:11:53 -08:00
Michael Crosby
5fd3c8204d Merge pull request #2735 from shykes/engine-job-kill
New engine command: 'kill'
2013-12-11 10:35:57 -08:00
Quentin Brossard
af21908493 Corrected typo (resdis -> redis) 2013-12-11 13:15:27 +01:00
Sven Dowideit
7edd1f6bad add example for docker rmi, and explain the need to remove all references (tags) to and image before its garbage collected :) 2013-12-11 15:54:34 +10:00
Sven Dowideit
d878632b25 add a direct example for changing the cmd that is run 2013-12-11 12:07:07 +10:00
Sven Dowideit
be13735001 associate swapping the built docker binary with building the binary, rather than a note in building the docs 2013-12-11 11:12:11 +10:00
Andy Rothfusz
fb9ddc5de5 Merge pull request #3159 from SvenDowideit/make-docs-consistency
Makefile: make docs is more consistent
2013-12-10 16:51:35 -08:00
Sven Dowideit
27646c4459 make docs is more consistent 2013-12-11 10:14:56 +10:00
Victor Vieux
b98d51dddb revert 'firstErr' 2013-12-10 15:37:03 -08:00
Victor Vieux
0025e9bd71 Merge pull request #3113 from shykes/engine-export
Move 'docker export' to the engine API
2013-12-10 13:28:24 -08:00
Victor Vieux
4c6e528f13 Merge pull request #3152 from daniel-garcia/3129_dont-open-bindmounted-files
don't open bind mounted files/dirs to get Stat, use os.Lstat
2013-12-10 11:05:39 -08:00
Victor Vieux
95f061b408 update docker push to use [====> ] 2013-12-10 10:57:16 -08:00
Daniel Garcia
761184df52 don't open bind mounted files/dirs to get Stat, use os.Lstat 2013-12-10 12:49:53 -06:00
Tianon Gravi
78b85220be Update mkimage-debootstrap with even more tweaks for keeping images tiny by more aggressively removing cache files and by not downloading apt-cache Translations files 2013-12-10 10:59:32 -07:00
Andy Rothfusz
8814c11b14 Merge pull request #3103 from metalivedev/1229-titleactions
Update "Use" titles to be action-oriented
2013-12-09 18:57:48 -08:00
Victor Vieux
09d2c2351c Merge pull request #3119 from shykes/engine-version
Port 'docker version' to the engine API
2013-12-09 17:35:44 -08:00
Victor Vieux
c618a906a4 fix size in -tree 2013-12-09 17:27:05 -08:00
Andy Rothfusz
9c1e9a5157 Fix #1229. Update titles, fix some wrapping.
Make the Ambassador container explicit.
Apply Sven's suggestions.
2013-12-09 17:23:56 -08:00
Andy Rothfusz
0b0b0ca0f9 Merge pull request #3146 from jamtur01/linkedits
Some minor cleanup of the Links use document
2013-12-09 17:09:59 -08:00
Victor Vieux
ac1093b83a fix docker images -tree <invalid_image> and docker images -viz <image_name> 2013-12-09 16:58:17 -08:00
James Turnbull
c9cedb4c04 Some minor cleanup of the Links use document 2013-12-09 16:47:19 -08:00
Victor Vieux
a74be95b23 Merge pull request #2843 from shykes/engine-job-wait
New engine job:wait
2013-12-09 16:36:23 -08:00
Victor Vieux
8291f00a0e refactor and fix tests 2013-12-09 16:25:19 -08:00
Andy Rothfusz
b7bc80cba9 Merge pull request #3109 from artagnon/arch-install
Update Arch installation doc
2013-12-09 15:52:54 -08:00
Andy Rothfusz
864729b96f Merge pull request #3104 from jamtur01/uses
Added section on Trusted Builds
2013-12-09 15:51:52 -08:00
Andy Rothfusz
a67571668e Merge pull request #3143 from idupree/patch-1
Make it extra clear that the `docker` group is root-equivalent.
2013-12-09 15:48:05 -08:00
Danny Yates
776bb43c9e Prevent deletion of image if ANY container is depending on it; not just running containers 2013-12-09 20:46:21 +00:00
Michael Crosby
75bd5bea70 Merge pull request #3114 from shykes/hack-stats
Hack: stats.sh prints useful project stats for maintainers
2013-12-09 10:36:17 -08:00
Isaac Dupree
e2ee5c71fc Make it extra clear that the docker group is root-equivalent. 2013-12-09 12:25:20 -05:00
Tianon Gravi
f0879a1e14 Add separate "test-integration" bundlescript (and corresponding dyntest-integration bundlescript) 2013-12-08 18:43:24 -07:00
Tianon Gravi
ca405786f4 Unify dyntest/test and dynbinary/binary hack bundlescripts further by cross-invocation and keeping all the logic in one place, taking advantage of LDFLAGS_STATIC that is the only bit that gets replaced for dyntest/dynbinary 2013-12-08 18:40:05 -07:00
Michael Crosby
cdc07f7d5c Merge pull request #3126 from unclejack/remove_vendored_tar
Remove vendored dotcloud/tar
2013-12-08 16:51:52 -08:00
Shawn Landden
f379f667a2 hack/PACKAGERS.md: libdevmapper 2013-12-08 14:39:06 -08:00
Tianon Gravi
45cea94a82 Unify hack/make/*test further by invoking hack/make/test directly from dyntest 2013-12-08 15:34:08 -07:00
unclejack
8ec96c9605 remove vendored dotcloud/tar
The tar dependency has been removed. It's
time to remove the vendored tar as well.
2013-12-09 00:02:13 +02:00
James Turnbull
c094807a1b Added section on Trusted Builds 2013-12-08 15:54:12 -05:00
Tianon Gravi
bac3a8e6f5 Add much better pruning of non-tested directories, including pruning the integration tests directory (doing more with "find" and nothing with "grep") 2013-12-08 13:50:48 -07:00
Tianon Gravi
dcfc4ada4d Clean output and simplify hack/make/*test by adding go_test_dir function in make.sh 2013-12-08 13:49:57 -07:00
Tianon Gravi
416b16e1e2 Simplify and resync hack/make/test and hack/make/dyntest output handling 2013-12-08 12:57:11 -07:00
Ramkumar Ramachandra
f832b76bdf archlinux installation doc: correct some details
1. The AUR package is called docker-git, not lxc-docker-git.

2. According to the official community package, docker depends on
   sqlite.

3. 02ef8ec (Update archlinux.rst as packages have changed, 2013-12-06)
   updated the installation instructions, but left behind residual
   wording about the AUR package not being officially supported; the
   community repository is officially supported.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-12-08 15:36:02 +05:30
Solomon Hykes
d502f0cfac Merge pull request #3118 from shykes/engine-structured-output
Engine: jobs can send structured output as json on stdout
2013-12-07 23:46:50 -08:00
Solomon Hykes
16fad96007 Merge pull request #3117 from shykes/engine-refactor-env
Engine: break out Env utilities into their own type - Env
2013-12-07 23:45:00 -08:00
Solomon Hykes
de35b346d1 Port 'docker version' to the engine API 2013-12-08 07:41:53 +00:00
Solomon Hykes
869a11bc93 Cleanup version introspection
* Unify version checking code into version.go
* Make 'version' available as a job in the engine
* Use simplified version checking code when setting user agent for registry client.
2013-12-08 07:35:24 +00:00
Solomon Hykes
f806818154 Engine: convenience http transport for simple remote job execution 2013-12-08 07:33:23 +00:00
Solomon Hykes
a7a171b6c2 Engine: Output.AddEnv decodes structured data from the standard output of a job 2013-12-08 06:16:10 +00:00
Solomon Hykes
a80c059bae Engine: break out Env utilities into their own type - Env 2013-12-08 06:06:05 +00:00
Solomon Hykes
edace08327 Hack: stats.sh prints useful project stats for maintainers 2013-12-08 01:47:03 +00:00
Solomon Hykes
9656cdf0c2 Engine: 'export' returns a raw archive of a container's filesystem 2013-12-08 01:33:37 +00:00
Solomon Hykes
50f3a696bd Engine: don't log job stdout to engine stdout (it might be non-text output, for example tar data for 'export' 2013-12-08 01:33:05 +00:00
Solomon Hykes
f4676f0ffa Merge pull request #3101 from creack/merge_release
Merge release
2013-12-06 18:09:38 -08:00
Guillaume J. Charmes
3c1f3be032 Update version 2013-12-06 17:31:09 -08:00
Guillaume J. Charmes
aeba4e6482 Merge remote-tracking branch 'origin/release' into merge_release 2013-12-06 17:30:52 -08:00
Solomon Hykes
3569d080af New engine command: 'wait' 2013-12-06 23:05:21 +00:00
Solomon Hykes
427bdb60e7 Engine: port 'kill' to the new integer status. 2013-12-06 23:02:27 +00:00
Solomon Hykes
9b1930c5a0 gofmt 2013-12-06 23:02:27 +00:00
Solomon Hykes
2546a2c645 Hack: use new 'kill' command in integration tests 2013-12-06 23:02:27 +00:00
Solomon Hykes
fdb3de7b11 Engine: new command 'kill' sends a signal to a running container 2013-12-06 23:02:27 +00:00
Guillaume J. Charmes
88df052197 Merge pull request #3098 from creack/bump_v0.7.1
Bump v0.7.1
2013-12-06 14:42:14 -08:00
Guillaume J. Charmes
04ffa53ba8 Merge pull request #3077 from jlhawn/3076-handle-inactive-user-login
Adjusted handling of inactive user login
2013-12-06 14:40:35 -08:00
Andy Rothfusz
07f7643bbc Merge pull request #3030 from jamtur01/versions
Fixed #2136 - Added styles
2013-12-06 14:27:53 -08:00
Victor Vieux
228091c79e added authConfig to docker build 2013-12-06 14:27:10 -08:00
Andy Rothfusz
6fa1463614 Merge pull request #3094 from tang0th/patch-1
Update archlinux.rst as packages have changed
2013-12-06 14:18:31 -08:00
Victor Vieux
f28445254f disable progressbar in non-terminal 2013-12-06 14:15:40 -08:00
Victor Vieux
0969be5ddb update doc 2013-12-06 14:15:40 -08:00
Victor Vieux
95c0ade04b fix jsonmessage in build 2013-12-06 14:15:40 -08:00
Tianon Gravi
e01732f857 Revert "Add cgroup-bin dependency to our Ubuntu package"
This reverts commit c81bb20f5b.

After re-reading the documentation: "The Recommends field should list packages that would be found together with this one in all but unusual installations."

Thus, "Recommends" is an acceptable place for this dep, and anyone disabling that gets to keep the pieces.

The main crux of why this needs to be reverted is because it breaks Debian completely because "lxc" and "cgroup-bin" can't be installed concurrently.
2013-12-06 14:15:40 -08:00
Guillaume J. Charmes
9b644ff246 Merge pull request #3096 from dotcloud/fix_fix_jsonmessage
fix jsonmessage in build
2013-12-06 14:10:24 -08:00
Victor Vieux
2c646b2d46 disable progressbar in non-terminal 2013-12-06 14:09:27 -08:00
Victor Vieux
becb13dc26 update doc 2013-12-06 14:09:27 -08:00
Victor Vieux
05f416d869 fix jsonmessage in build 2013-12-06 14:09:27 -08:00
Andy Rothfusz
7fd64e0196 Merge pull request #3088 from SvenDowideit/start-cmdline-examples-with-dollar-for-easier-testing
change the policy wrt $ sudo docker to simplify auto-testing
2013-12-06 13:37:02 -08:00
Sven Dowideit
13da09d22b change the policy wrt $ sudo docker to simplify auto-testing 2013-12-07 07:23:53 +10:00
Josh Hawn
6720bfb243 Adjusted handling of inactive user login
The return status for inactive users was being checked
too early in the process, so I moved it from just after
the handling of POST /v1/users/ to after getting the
response from GET /v1/users/
2013-12-06 11:57:05 -08:00
Andy Rothfusz
d75fc6e529 Merge pull request #3071 from lsm5/fedora-docs-update
use mattdm/fedora in fedora doc and other cosmetic changes
2013-12-06 11:25:10 -08:00
Andy Rothfusz
4a148919c3 Merge pull request #3052 from shawnl/patch-1
nftables dependancies in kernel
2013-12-06 11:02:49 -08:00
Guillaume J. Charmes
c7d75588f4 Merge pull request #3079 from crosbymichael/give-engine-noop-tests
Enable engine to take Stderr and Stdout for mocking in tests
2013-12-06 10:43:39 -08:00
Guillaume J. Charmes
dfade9e2d8 Merge pull request #3095 from jpoimboe/missing-defines
devmapper: add missing defines
2013-12-06 10:31:42 -08:00
Guillaume J. Charmes
b655406faa Merge pull request #3085 from tianon/fix-cgroup-dep
Revert "Add cgroup-bin dependency to our Ubuntu package"
2013-12-06 09:15:41 -08:00
Josh Poimboeuf
a015f38f4a devmapper: add missing defines
Add some missing defines which are needed for compiling on older systems
like RHEL 6.
2013-12-06 10:13:47 -06:00
tang0th
02ef8ec3ca Update archlinux.rst as packages have changed
The docker package has been added into the Arch Linux community repo, this means that the package names and installation instructions have slightly changed.
2013-12-06 15:47:24 +00:00
Michael Crosby
25d3db048e Enable engine to take Stderr and Stdout for mocking in tests 2013-12-06 01:18:18 -08:00
Shawn Landden
a69bb25820 specific kernel config 2013-12-05 23:54:23 -08:00
Andy Rothfusz
5f5949f6a6 Merge pull request #3086 from metalivedev/3045-addmirrors
Add debian mirrors. Fixes #3045.
2013-12-05 18:16:28 -08:00
Andy Rothfusz
58b75f8f29 Add debian mirrors. Fixes #3045. 2013-12-05 18:08:56 -08:00
Tianon Gravi
aea7418d8a Revert "Add cgroup-bin dependency to our Ubuntu package"
This reverts commit c81bb20f5b.

After re-reading the documentation: "The Recommends field should list packages that would be found together with this one in all but unusual installations."

Thus, "Recommends" is an acceptable place for this dep, and anyone disabling that gets to keep the pieces.

The main crux of why this needs to be reverted is because it breaks Debian completely because "lxc" and "cgroup-bin" can't be installed concurrently.
2013-12-05 19:03:47 -07:00
Andy Rothfusz
f9147effac Merge pull request #3069 from proppy/patch-1
docs/installation/google: add enabling Google Compute Engine step
2013-12-05 17:40:42 -08:00
Andy Rothfusz
0e2b0f284c Merge pull request #3001 from dotcloud/api_json
add docs for the new json format
2013-12-05 17:35:51 -08:00
Andy Rothfusz
80dfa23da8 Merge pull request #3051 from pariviere/2490-docs-network
Network documentation page
2013-12-05 17:29:54 -08:00
Guillaume J. Charmes
bc9b239d74 Merge pull request #3081 from creack/bump_0.7.1
Bump to 0.7.1
2013-12-05 17:19:06 -08:00
Andy Rothfusz
4bea68dfa6 Clean up quoting, wraps, and build error on code-block. 2013-12-05 17:16:31 -08:00
Andy Rothfusz
ea0ed9a915 Merge branch 'docker-run-prose-2149' of github.com:SvenDowideit/docker into 3036-test 2013-12-05 17:03:26 -08:00
Guillaume J. Charmes
e39d35deda Bump to 0.7.1 2013-12-05 16:49:39 -08:00
Guillaume J. Charmes
4acd579226 Merge pull request #3078 from crosbymichael/remove-name-if-not-exist
If container does not exist try to remove the name and continue
2013-12-05 16:41:43 -08:00
Victor Vieux
c764fb0c29 Merge pull request #3006 from tianon/ubuntu-cgroup-bin
Add cgroup-bin dependency to our Ubuntu package
2013-12-05 16:41:01 -08:00
Guillaume J. Charmes
de090116dd Merge branch 'master' into release
Conflicts:
	commands.go
2013-12-05 16:40:24 -08:00
Victor Vieux
7a87023587 Merge pull request #2955 from crosbymichael/search-name-first
Search for repo first before image id
2013-12-05 16:16:55 -08:00
Tianon Gravi
584164177e Merge pull request #2358 from tianon/mkimage-rinse
Remove mkimage-centos.sh in favor of a new rinse-based script...
2013-12-05 16:07:59 -08:00
Victor Vieux
35e80868ad Merge pull request #3004 from tianon/shebang-bash
Update bundlescript shebangs to be bash, reflecting how they're actually invoked
2013-12-05 16:04:09 -08:00
Tianon Gravi
2acea6090f Merge pull request #2983 from tianon/udev
Add udev rules files for hiding the docker loopback devices from udisks
2013-12-05 16:01:04 -08:00
Andy Rothfusz
81b25fde79 Merge pull request #3065 from SvenDowideit/use-makefile-in-devenv-documentation
use the Makefile in the dev environment documentation - its way less typing, and fewer typing mistakes
2013-12-05 15:27:36 -08:00
Andy Rothfusz
0189a99471 Merge pull request #3062 from SvenDowideit/cli-examples-dollar-sudo-docker
Some examples didnt use $ sudo docker, so this makes it a little more consistent
2013-12-05 15:25:09 -08:00
Michael Crosby
7bf3a07371 If container does not exist try to remove the name and continue 2013-12-05 15:22:21 -08:00
Andy Rothfusz
9320f4e2d1 Merge pull request #3061 from shykes/sven-doc-maintainers
Add Sven Dowideit to docs maintainers
2013-12-05 15:17:34 -08:00
Guillaume J. Charmes
d1a4f83e5e Merge pull request #3075 from dotcloud/pull_layers
Wait on pull from another client
2013-12-05 14:47:39 -08:00
Victor Vieux
fb810b54ff wait on pull from another client 2013-12-05 14:41:56 -08:00
Pierre-Alain RIVIERE
eac95671f5 refs #2490 : add a network page to docs 2013-12-05 23:40:33 +01:00
Michael Crosby
06379d8bd9 Merge pull request #2992 from jpoimboe/bridge-create-ioctl
Create the bridge device with ioctl
2013-12-05 14:40:03 -08:00
Andy Rothfusz
a96bf74397 include Red Hat Enterprise, should have part of #3011
oops, forgot the index!
2013-12-05 14:34:10 -08:00
Andy Rothfusz
cc0466bb68 Merge pull request #3011 from goldmann/rhel_instructions
Instructions on how to install Docker on Red Hat Enterprise Linux / CentOS
2013-12-05 14:30:31 -08:00
Andy Rothfusz
0a7e0f0819 Merge pull request #3034 from rogaha/fix_doc_registry_index_spec
- Updated the doc according to the current implementation status
2013-12-05 14:24:13 -08:00
Guillaume J. Charmes
ef157cee30 Merge pull request #3074 from crosbymichael/dm-history-calc
Save layersize on pull
2013-12-05 14:13:03 -08:00
Lokesh Mandvekar
7ab4f37d60 separate block for yum update docker
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-05 16:11:33 -06:00
Lokesh Mandvekar
5d022f0445 add unofficial header back, yum update docker
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-05 16:08:08 -06:00
Michael Crosby
697707e4af Save layersize on pull
Do not display size and virtual size on the cli.
Only display virtual size on the cli
2013-12-05 14:03:23 -08:00
Andy Rothfusz
e3c3f3c324 Merge pull request #3010 from SvenDowideit/origin/docker-ps-linked-container-alias-example
add an example of docker ps, and also of link aliases
2013-12-05 14:00:53 -08:00
Guillaume J. Charmes
797bac2344 Merge pull request #3057 from crosbymichael/test-cpu-share
Move test cpu shares out of test start
2013-12-05 13:58:01 -08:00
Josh Poimboeuf
7a94cdf8ed create the bridge device with ioctl
On RHEL 6, creation of a bridge device with netlink fails.  Use the more
backward-compatible ioctl instead.  This fixes networking on RHEL 6.
2013-12-05 15:32:15 -06:00
Lokesh Mandvekar
61fbf3d8e2 yum upgrade on fedora not required before install
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-05 14:21:03 -06:00
Lokesh Mandvekar
f49eb29497 use mattdm/fedora in fedora doc and other cosmetic changes
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2013-12-05 14:03:17 -06:00
Guillaume J. Charmes
1525f71b5a Merge pull request #3016 from pnasrat/3014-clarify-maintainer-process
Add a proposal step for potential MAINTAINERS.
2013-12-05 11:28:30 -08:00
Guillaume J. Charmes
4188cd6bcd Merge pull request #3024 from jamtur01/ubunturepo
Added note about Ubuntu curl installation
2013-12-05 11:27:46 -08:00
Andy Rothfusz
e304e8936b Merge pull request #3038 from SvenDowideit/2485-ambassador-pattern-doc
initial stab at writing a use/ambassador-pattern howto
2013-12-05 11:01:27 -08:00
James Turnbull
03f8a3bbae Fixed #2136 - Added styles
Added styling for versionadded, versionchanged, and
deprecated.
2013-12-05 13:46:15 -05:00
Guillaume J. Charmes
066b961a0c Merge pull request #3060 from dotcloud/sd_notify
sd_notify ready status when accepting API requests
2013-12-05 10:33:29 -08:00
Victor Vieux
f95f2789f2 add docs for the new json format 2013-12-05 10:12:22 -08:00
Victor Vieux
a8e99d9235 Merge pull request #2917 from codeaholics/2698-only-tag-top-layer
Only tag the top-most layer when pushing to a registry
2013-12-05 10:02:57 -08:00
Johan Euphrosine
5a17c208cd docs/installation/google: add enabling Google Compute Engine step 2013-12-05 09:43:08 -08:00
Sven Dowideit
e9bf971e69 use the Makefile in the dev environment documentation - its way less typing, and fewer typing mistakes 2013-12-05 21:48:35 +10:00
Roberto Gandolfo Hashioka
909da5d524 - Added link to the source code repo on github 2013-12-04 21:08:44 -08:00
Sven Dowideit
04c32495f6 add a little prose to tell the user that run creates a container, and then starts it 2013-12-05 14:20:16 +10:00
Sven Dowideit
af020e2d67 I was reading the doc, and noticed that some examples didnt use $ sudo docker, so this makes it a little more consistent 2013-12-05 14:14:08 +10:00
Andy Rothfusz
94d46a8d3a Merge pull request #2991 from fortybillion/patch-1
API documentation: added format of Volumes and Binds parameters to "create" and "start"
2013-12-04 18:32:19 -08:00
Andy Rothfusz
ec9f2f1d0f Merge branch '2971-cleanconflicts' 2013-12-04 18:26:45 -08:00
Andy Rothfusz
0bfa22124e Merge branch 'pgdoc' of github.com:jamtur01/docker into 2971-cleanconflicts
Conflicts:
	docs/sources/examples/postgresql_service.rst
2013-12-04 18:25:58 -08:00
Victor Vieux
79031c4f8c Merge pull request #2907 from goldmann/iptables-fix
Make sure the firewall rules are created even if the bridge interface is already created
2013-12-04 18:04:57 -08:00
Victor Vieux
5f55c1aee1 Merge pull request #2966 from andrewsmedina/govet2
fixed some `go vet` issues.
2013-12-04 17:57:10 -08:00
Solomon Hykes
b4e21ad1da Add Sven Dowideit to docs maintainers 2013-12-04 17:50:33 -08:00
Victor Vieux
97088ebef7 sd_notify ready status when accepting API requests 2013-12-04 17:50:20 -08:00
Solomon Hykes
c35cebaa06 Merge pull request #3031 from jamtur01/docsmaintain
Add James Turnbull to docs maintainers
2013-12-04 17:48:45 -08:00
Victor Vieux
41b5e87873 Merge pull request #2993 from jpoimboe/rhel6-version-check
remove kernel version warning on rhel 6.5
2013-12-04 17:46:20 -08:00
Andy Rothfusz
9dfc7bc36f Merge pull request #2834 from fj/topic/clarify-aws-instructions
Fix installing-on-AWS workflow description
2013-12-04 17:25:35 -08:00
Guillaume J. Charmes
afbea3f13f Merge pull request #3058 from dotcloud/add_stderr_hijack
fix docker run -a stderr
2013-12-04 17:16:56 -08:00
Andy Rothfusz
5dab47a475 Merge pull request #2886 from jamtur01/fedora_community
Updated Fedora docs
2013-12-04 17:12:00 -08:00
Victor Vieux
3ba279a370 fix docker run -a stderr 2013-12-04 17:08:14 -08:00
Guillaume J. Charmes
944c1f10ea Merge pull request #2967 from crosbymichael/return-host-config
Add hostconfig to container inspect
2013-12-04 16:50:42 -08:00
Michael Crosby
0d1506adb3 Move test cpu shares out of test start
Fixes #2107
2013-12-04 16:31:09 -08:00
Michael Crosby
3a8222dfa5 Merge pull request #3032 from tianon/makefile-tweaks
Tweak Makefile for consistency and Ctrl+C-ability
2013-12-04 16:04:47 -08:00
Tianon Gravi
00030ced4b Tweak Makefile for consistency and Ctrl+C-ability (also, -rm to keep it clean) 2013-12-04 16:56:01 -07:00
Andy Rothfusz
f95621fd05 Merge pull request #3033 from proppy/add-compute-docs
Add Google Cloud Platform installation docs
2013-12-04 15:05:07 -08:00
Guillaume J. Charmes
4328926acc Merge pull request #3020 from crosbymichael/remove-init-layer
Ensure that the init layer is removed with the container
2013-12-04 14:46:48 -08:00
Nick Stinemates
8f382aaecd Merged with master 2013-12-04 12:40:54 -08:00
Johan Euphrosine
3df5d120de docs/installation: add google compute engine quickstart 2013-12-04 12:25:22 -08:00
Victor Vieux
1b5517b68f Merge pull request #3046 from dotcloud/fix_offline_image_transfert_jsonmessage
Fix offline image transfer jsonmessage
2013-12-04 12:05:28 -08:00
Victor Vieux
4bc100b494 fix jsonmessage 2013-12-04 11:57:18 -08:00
Victor Vieux
be282b57d5 fix offline image transfert 2013-12-04 11:55:42 -08:00
Victor Vieux
12180948be remove unused parameter in Download 2013-12-04 11:54:11 -08:00
Victor Vieux
6cf2c14c00 Merge pull request #2796 from EmilHernvall/master
Support for same port on multiple interfaces
2013-12-04 11:15:51 -08:00
Michael Crosby
dc9f8bf072 Merge pull request #2790 from proppy/fix-tar
utils: remove dotcloud/tar dep
2013-12-04 11:06:13 -08:00
Michael Crosby
0862756beb Merge pull request #3018 from pnasrat/3017-debug-expvar
Expose expvar endpoint during debugging.
2013-12-04 10:53:35 -08:00
Andy Rothfusz
de60bee3d4 Merge pull request #2946 from dhrp/doc-postgres-typo
Fixed some grammar and one other line in postgres example
2013-12-04 10:51:02 -08:00
Michael Crosby
51b9fe7301 Merge pull request #3000 from creack/improve_make_sh_test
Improve make sh test
2013-12-04 10:41:55 -08:00
Michael Crosby
61aad8fc10 Merge pull request #3029 from pnasrat/container-refactoring
Container refactoring
2013-12-04 10:35:42 -08:00
Sven Dowideit
6ddea783ef initial stab at writing a use/ambassador-pattern howto (Issue #2485) 2013-12-04 16:47:45 +10:00
Roberto Gandolfo Hashioka
58c33360b0 - Updated the doc with the current implementation status 2013-12-03 16:39:23 -08:00
Paul Nasrat
40fe9f581b Extract volume bind, creation and external methods.
Make Start() slightly more readable.
2013-12-03 18:58:31 -05:00
Sam Alba
258d707548 Merge pull request #2339 from shin-/private_reg_auth
Private registry auth
2013-12-03 15:29:38 -08:00
Victor Vieux
99e4f56353 Merge pull request #2930 from creack/docker-osx
Docker client on OSX
2013-12-03 15:27:21 -08:00
James Turnbull
0132547a38 Added myself to docs MAINTAINERS 2013-12-03 17:51:34 -05:00
Paul Nasrat
84f78d9cad Extract helper method for volume linking.
Makes this more readable.
2013-12-03 17:35:54 -05:00
Victor Vieux
f8176de191 Merge pull request #2999 from dotcloud/improve_progress_bars
Handle small screens
2013-12-03 14:24:40 -08:00
Victor Vieux
f50fe14e13 Handle small screens 2013-12-03 14:21:33 -08:00
James Turnbull
45567f2209 Updated Fedora docs
* Added Fedora installation instructions
2013-12-03 16:55:55 -05:00
Victor Vieux
2fd76fc0b8 Merge pull request #3009 from silas/stream-logs
Add stream flag to logs command
2013-12-03 13:43:35 -08:00
Silas Sewell
b699aee91f Rename logs -stream to logs -f 2013-12-03 20:35:22 +00:00
James Turnbull
64439505c7 Added note about Ubuntu curl installation 2013-12-03 14:37:01 -05:00
Michael Crosby
664174c7aa Add docs for hostconfig in inspect 2013-12-03 11:09:10 -08:00
Michael Crosby
7428e6a5f0 Merge pull request #3022 from pnasrat/3021-makefile-testflags
Support TESTFLAGS
2013-12-03 10:55:22 -08:00
Paul Nasrat
d21563ced3 Support TESTFLAGS 2013-12-03 14:49:10 -05:00
Paul Nasrat
6a55169e2e Expose expvar endpoint during debugging.
Fixes #3017
2013-12-03 13:04:18 -05:00
Michael Crosby
5976c26c1e Ensure that the init layer is removed with the container 2013-12-03 09:44:48 -08:00
Paul Nasrat
b59dea6767 Add a proposal step for potential MAINTAINERS.
Fixes #3014
2013-12-03 11:04:53 -05:00
shin-
9be5db8704 Handle 401 response in auth.Login() for authed private registries 2013-12-03 16:32:13 +01:00
shin-
3f92163989 Don't return req as result of setTokenAuth 2013-12-03 16:32:13 +01:00
shin-
3b5010e90b missed one call to setTokenAuth 2013-12-03 16:32:13 +01:00
shin-
ec4863ae55 Factorized auth token setting 2013-12-03 16:32:13 +01:00
shin-
a02bc8a5db gofmt 2013-12-03 16:32:13 +01:00
shin-
045989e3d8 Use basic auth for private registries when over HTTPS.
RequestFactory is no longer a singleton (can be different for different instances of Registry)
Registry now has an indexEndpoint member
Registry methods that needed the indexEndpoint parameter no longer do so
Registry methods will only use token auth where applicable if basic auth is not enabled.
2013-12-03 16:32:13 +01:00
shin-
bbf9135adc Added HTTPAuthDecorator 2013-12-03 16:24:47 +01:00
Emil Hernvall
1cb1e08644 Support for same port on multiple interfaces
This commit improves upon the PortMapper and PortAllocator classes by changing
their internal data structures for port allocations to use a string rather than
a single integer. This string holds the network interface address as well as the
port number. This solves a previous problem where a port would be incorrectly
reported as being in use because it had been allocated for a different interface.

I've also added a basic test case for the PortMapper class, and extended the
existing test case for PortAllocator. In the case of PortMapper, this is done
by handing it a stub function for creating proxies rather than an actual
implementation.
2013-12-03 15:14:54 +01:00
Marek Goldmann
682cf48d1d Instructions on how to install Docker on Red Hat Enterprise Linux / CentOS. 2013-12-03 11:25:53 +01:00
Sven Dowideit
48e1766527 add an example of docker ps, and also of link aliases 2013-12-03 17:57:51 +10:00
Silas Sewell
3ddbb36a84 Only stream logs when container is running 2013-12-03 07:17:07 +00:00
Silas Sewell
62263967b9 Add stream flag to logs command 2013-12-03 06:18:01 +00:00
Michael Crosby
3ed0ff85f5 Merge pull request #2821 from jpellerin/2820-fix-daemon-dns
Fixes #2820
2013-12-02 18:19:31 -08:00
Michael Crosby
c4c90e9cec Add hostconfig to container inspect 2013-12-02 18:06:04 -08:00
Tianon Gravi
650d4cc644 Merge pull request #3005 from gurjeet/zfs_driver_owner
Typo fix
2013-12-02 15:06:05 -08:00
Gurjeet Singh
d9b742419c Typo fix 2013-12-02 18:03:54 -05:00
Tianon Gravi
c81bb20f5b Add cgroup-bin dependency to our Ubuntu package
Since cgroup-bin is only "recommended" by the lxc package on Ubuntu, but is necessary for having the proper cgroups mounted for Docker to function, this makes some sense for us to add separately.

Fixes #2990
2013-12-02 16:02:54 -07:00
John Feminella
6c70d23e0d Fixes broken RST links; clarifies AWS instructions 2013-12-02 17:55:42 -05:00
John Feminella
c9432cf51a Reformats source text to proper widths 2013-12-02 17:55:42 -05:00
Guillaume J. Charmes
829b118dd8 Add some color in order to emphasis the test FAILURE 2013-12-02 14:54:01 -08:00
Tianon Gravi
3ac76cfeff Update bundlescript shebangs to be bash, reflecting how they're actually invoked 2013-12-02 15:48:39 -07:00
JP
5a9cf7e754 Add unit test for ValidateIp4Address 2013-12-02 17:33:33 -05:00
Josh Poimboeuf
e4aba11e80 add env variable to disable kernel version warning
Allow the user to set DOCKER_NOWARN_KERNEL_VERSION=1 to disable the
warning for RHEL 6.5 and other distributions that don't exhibit the
panics described in https://github.com/dotcloud/docker/issues/407.
2013-12-02 15:56:51 -06:00
Tianon Gravi
9d62dc1a08 Remove mkimage-centos.sh in favor of a new rinse-based script, since febootstrap is fragile and picky 2013-12-02 14:54:04 -07:00
Guillaume J. Charmes
0017c68f4a Remove trailing whitespace 2013-12-02 13:52:27 -08:00
JP
3cd9b2aadf Fixes #2820 2013-12-02 16:22:39 -05:00
Victor Vieux
8afb0abbee Merge pull request #2998 from creack/fix_json_display
Fix json display
2013-12-02 12:58:58 -08:00
Guillaume J. Charmes
98ed1dc433 Fix unit test with new buildfile prototype 2013-12-02 12:51:37 -08:00
Victor Vieux
7aec93c370 Merge pull request #2959 from crosbymichael/fix-auth-split
Split auth on first colon
2013-12-02 12:21:04 -08:00
Victor Vieux
62f0e5aef9 Merge pull request #2965 from crosbymichael/no-private-port
Only return published ports for docker port
2013-12-02 12:18:47 -08:00
Victor Vieux
59a85798fa Merge pull request #2982 from tianon/dockerfile-best-practice
Update Dockerfile with all-caps INSTRUCTIONS
2013-12-02 12:14:04 -08:00
Victor Vieux
67c03552f6 Merge pull request #2957 from creack/handle_sigquit
Catch SIGQUIT for cleanup
2013-12-02 12:13:07 -08:00
Victor Vieux
4fdc117ad2 Merge pull request #2921 from dustin/inspect-format
Add -format to 'docker inspect'
2013-12-02 12:08:15 -08:00
Guillaume J. Charmes
5cd09dc115 small reformatting jsonmessage 2013-12-02 11:49:11 -08:00
Guillaume J. Charmes
6ea3b9651b Fix displayJson behavior (dont add newline) 2013-12-02 11:47:13 -08:00
Guillaume J. Charmes
de4429f70d Do not format at each write but use a Writer instead (build) 2013-12-02 11:43:41 -08:00
Michael Crosby
8cc524996a Merge pull request #2924 from tianon/strict-fhs-compatibility
Add proper dockerinit path support for distros that use FHS 2.3
2013-12-02 11:35:36 -08:00
Tianon Gravi
d9fbdd7b3f Merge pull request #2995 from gurjeet/zfs_driver_owner
Add contrb/zfs/ and add self as maintainer of ZFS storage driver.
2013-12-02 11:10:16 -08:00
Dustin Sallings
4ad3dfb05f CLI docs and examples of format 2013-12-02 11:07:41 -08:00
Dustin Sallings
1d503be466 Use inspect format to get IP address for psql example 2013-12-02 11:07:41 -08:00
Dustin Sallings
9837ad8e9b Add -format to 'docker inspect'
This makes it a lot easier to script with docker instances as one can
ask for details about running instances more easily without having to
have additional JSON processing tools installed.

dotcloud/docker#734
2013-12-02 11:07:41 -08:00
Gurjeet Singh
70b586702c Add contrb/zfs/ and add self as maintainer of ZFS storage driver. 2013-12-02 14:03:16 -05:00
Victor Vieux
4b35c1b6a6 Merge pull request #2728 from SvenDowideit/docker-import-doc
re-word the help for docker import to make it clear that this will be an empty image containing only the files in the tar file
2013-12-02 10:59:15 -08:00
Michael Crosby
fe571dd293 Merge pull request #2829 from dotcloud/refactor_opts
Refactor opts
2013-12-02 10:41:30 -08:00
Michael Crosby
e1414a4c39 Merge pull request #2945 from dotcloud/refactor_stream
Refactor stream
2013-12-02 10:31:09 -08:00
Victor Vieux
d4ebba703c Merge pull request #2994 from discordianfish/1150-build-return-exit-code
Bump api version and update docs
2013-12-02 10:30:46 -08:00
Johannes 'fish' Ziemke
e4cb83c50e Bump api version and update docs 2013-12-02 19:27:28 +01:00
Michael Crosby
d7dd19d22e Merge pull request #2981 from tianon/less-verbose-testing
Remove "-v" from "go test" (since it's easy to add back manually via TESTFLAGS)
2013-12-02 10:14:25 -08:00
Guillaume J. Charmes
5f2313aad3 Merge pull request #2984 from SvenDowideit/2319-build-check-for-dockerfile
check on the client side that there is a Dockerfile
2013-12-02 09:35:31 -08:00
Guillaume J. Charmes
d6cdbca6c1 Merge pull request #2775 from daniel-garcia/2671-bindmount_files
fixes #2671, add support for bind mounting individual files in to contai...
2013-12-02 09:30:08 -08:00
Guillaume J. Charmes
751250015b Merge pull request #2206 from discordianfish/1150-build-return-exit-code
Make docker build return exit code of build step
2013-12-02 09:01:11 -08:00
Johannes 'fish' Ziemke
b04c6466cd Make docker build return exit code of build step
If a command during build fails, `docker build` now returns with
the exit code of that command.

This makes it necessary to change the build api endpoint to
return a json object stream.
2013-12-02 17:52:37 +01:00
Ben Sargent
b9ad0c9f74 Added format of Volumes and Binds parameters to create and start
* Added sample Volumes parameter to container create API.
* Added PortBindings and PublishAllPorts parameter to container start API
* Added note to container start about Binds needed to be declared as Volumes during container create.
2013-12-02 16:52:12 +00:00
Tianon Gravi
dbb47f63ab Add udev rules files for hiding the docker loopback devices from udisks
This prevents them from showing up on the desktop in a window manager, for example.
2013-12-02 09:11:06 -07:00
Solomon Hykes
c4548506c5 Merge pull request #2693 from fkautz/makefile
Adding a makefile
2013-12-01 23:25:24 -08:00
Sven Dowideit
26cf8b9aff check on the client side that there is a Dockerfile, so we don't upload a huge stack of files, only to realise we can't do anything 2013-12-02 15:55:08 +10:00
Tianon Gravi
7f1a91121c Update Dockerfile with all-caps INSTRUCTIONS (as explained in docs as being "convention": http://docs.docker.io/en/latest/use/builder/#format) 2013-12-01 21:31:28 -07:00
Tianon Gravi
c30e2dc28c Remove "-v" from "go test" (since it's easy to add back via TESTFLAGS) 2013-12-01 21:20:35 -07:00
Guillaume J. Charmes
d9cdd45d2e Merge pull request #2978 from tianon/go1.2
Update to Go 1.2 officially, now that it is released
2013-12-01 16:46:38 -08:00
Tianon Gravi
5c5f670901 Update to Go 1.2 officially, now that it is released 2013-12-01 15:11:10 -07:00
Andrews Medina
fea432bdf5 fixed Looback typo. 2013-11-30 16:28:52 -02:00
James Turnbull
39aac21db4 Updated and simplified the PG example 2013-11-30 10:58:52 -05:00
Frederick F. Kautz IV
56ab9cb0d5 Minor fixes based on discussions on #2693
* Volume exports ./bundles instead of root directory
* Documents build using docker-docs instead of docker:docs
* Bundles directory is created before running build or docs
2013-11-30 00:09:41 -08:00
Solomon Hykes
d8ee08ba7b Merge pull request #2925 from tianon/update-systemd-service
Update systemd service file with suggestions from @seblu
2013-11-29 21:25:08 -08:00
Andrews Medina
e8437e8fcf using errors.New instead fmt.Error. 2013-11-30 01:02:09 -02:00
Guillaume J. Charmes
4e030c78d2 Merge branch 'master' into handle_sigquit
Conflicts:
	server.go
2013-11-29 18:51:32 -08:00
Guillaume J. Charmes
62b1faf28c Merge pull request #2926 from crosbymichael/attach-wait
Return process exit code for attach
2013-11-29 18:49:24 -08:00
Guillaume J. Charmes
2dac7b5209 Merge pull request #2781 from shykes/engine-status-int
Engine: integer status, better streaming, lots of tests
2013-11-29 17:57:28 -08:00
Guillaume J. Charmes
1890301e67 Merge pull request #2964 from andrewsmedina/gofmt2
go fmt.
2013-11-29 17:19:28 -08:00
Andrews Medina
a6c9a332d0 fixed some go vet issues. 2013-11-29 22:53:20 -02:00
Michael Crosby
65db62619c Only return published ports for docker port 2013-11-29 16:45:20 -08:00
Solomon Hykes
35d54c6655 Fix a bug in Output.Write, and improve testing coverage of error cases. 2013-11-30 00:25:46 +00:00
Solomon Hykes
3553a803e3 Engine: better testing of streams and of basic engine primitives. Coverage=81.2% 2013-11-30 00:25:46 +00:00
Solomon Hykes
a4f8a2494b Engine: integer job status, improved stream API
* Jobs return an integer status instead of a string
* Status convention mimics unix process execution: 0=success, 1=generic error, 127="no such command"
* Stdout and Stderr support multiple thread-safe data receivers and ring buffer filtering
2013-11-30 00:25:46 +00:00
Andrews Medina
fe72f15e4a go fmt.
result of `gofmt -w -s .` without vendors.
2013-11-29 22:20:59 -02:00
Michael Crosby
a37b155384 Split auth on first colon 2013-11-29 15:14:36 -08:00
Guillaume J. Charmes
82cecb34b5 Merge pull request #2954 from creack/fix_tests
Fix tests
2013-11-29 15:08:11 -08:00
Guillaume J. Charmes
e1278e9ec2 Merge pull request #2952 from codeaholics/2126-registry-close-wait
Closing HTTP connection after Registry ping
2013-11-29 14:21:52 -08:00
Guillaume J. Charmes
db7c55ba7f Catch SIGQUIT for cleanup 2013-11-29 14:13:00 -08:00
Guillaume J. Charmes
0d3f4017cf Merge pull request #2929 from pnasrat/2928-fix-signal-handling
Remove incorrect SIGKILL handler.
2013-11-29 14:10:46 -08:00
Guillaume J. Charmes
ab35aef6b5 Add unit test to check bind / server side 2013-11-29 13:43:37 -08:00
Guillaume J. Charmes
bb284ce59d Merge branch 'master' into fix_tests 2013-11-29 13:17:36 -08:00
Guillaume J. Charmes
34353e782e Reduce the timeout for restart/stop 2013-11-29 11:08:01 -08:00
Michael Crosby
ca98434a45 Search for repo first before image id 2013-11-29 11:06:35 -08:00
Guillaume J. Charmes
86c00be180 Fix behavior of tty tests 2013-11-29 10:17:25 -08:00
Guillaume J. Charmes
2ec1146679 Remove an unit test from integrations test 2013-11-29 10:17:04 -08:00
Guillaume J. Charmes
2e6a958612 Fix TestAttachDetachTruncatedID (behavior + tty issue) 2013-11-29 10:03:36 -08:00
Guillaume J. Charmes
697be6aaa0 Create helper function for tests 2013-11-29 10:02:22 -08:00
Guillaume J. Charmes
c13821ad0b Make sure the termcaps are restored after hijack 2013-11-29 09:55:15 -08:00
Guillaume J. Charmes
aa68656cd3 Fix term.RestoreTerminal behavior 2013-11-29 09:52:44 -08:00
Guillaume J. Charmes
63d6cbe3e4 Actually test the detach (was not the case before) 2013-11-29 09:11:20 -08:00
Guillaume J. Charmes
67e9e0e11b Make the PTY in raw mode before assert test (TestAttachDetach) 2013-11-29 08:29:56 -08:00
Guillaume J. Charmes
fbebe20bc6 Add a GetPtyMaster() method to container to retrieve the pty from an other package.
We could also have put ptyMaster public, but then we need to ignore it in json
otherwise the Marshalling fails. I think it is cleaner that way.
2013-11-29 07:40:44 -08:00
Guillaume J. Charmes
e535f544c7 Make sure the container is running before testing against it (TestAttachDetach) 2013-11-29 07:39:51 -08:00
cressie176
fe727e2a87 Closing connection after ping 2013-11-29 12:07:20 +00:00
Guillaume J. Charmes
f72e604872 Merge branch 'master' into docker-osx 2013-11-28 21:16:32 -08:00
Victor Vieux
926f7b579e Merge pull request #2692 from SvenDowideit/add-specific-feedback-for-bad-ADD
Add specific feedback for ADD outside context
2013-11-28 17:55:11 -08:00
Victor Vieux
ff5747728c Merge pull request #2357 from ulyssecarion/master
Document setting up Vagrant-docker with the remote API
2013-11-28 17:54:05 -08:00
Thatcher
6c56993639 Merge pull request #2901 from dkumor/patch-1
Deleted references to AUFS in Arch docs
2013-11-28 17:39:26 -08:00
Sven Dowideit
ba5268d382 re-word the help for docker import to make it clear that this will be an empty image containing only the files in the tar file 2013-11-29 11:22:17 +10:00
Thatcher Peskens
8291d509c2 Fixed some grammar and one other line about needing the postgresql-client for connecting to the service. 2013-11-28 17:19:26 -08:00
Thatcher
139644895e Merge pull request #2894 from brunoqc/patch-1
Update postgresql's version in example
2013-11-28 17:16:25 -08:00
Victor Vieux
cca9e51f5d Merge pull request #2941 from codeaholics/2940-invalid-registry-calls
Stop invalid calls to Registry
2013-11-28 17:00:22 -08:00
Victor Vieux
668d22be54 Merge pull request #2808 from tianon/run-all-tests
Update test scripts to always run ALL tests, even when some fail
2013-11-28 16:58:31 -08:00
Guillaume J. Charmes
77c94175bd Make CopyEscapable consistent with Copy and return nil in case of success instead of io.EOF 2013-11-28 16:57:51 -08:00
Victor Vieux
f94ea7769f Merge pull request #2923 from creack/refactor_cgo_in_go
Refactor attach loop device in pure Go
2013-11-28 16:52:38 -08:00
Victor Vieux
39bec226c0 Merge pull request #2844 from tianon/fix-mount-spaces
Add space-escaping to path parts of lxc.mount.entry lines in generated lxc.conf, allowing for spaces in mount point names
2013-11-28 16:48:36 -08:00
Victor Vieux
677e2ad92e Merge pull request #2881 from yrashk/patch-1
Fix command line help for docker save
2013-11-28 16:42:40 -08:00
Victor Vieux
d3cc558d14 add test 2013-11-28 16:28:31 -08:00
Guillaume J. Charmes
ad43d88af5 Make race condition more obvious by performing more asserts 2013-11-28 16:12:45 -08:00
Michael Crosby
1fe1b216ad Return process exit code for attach
Fixes #2240
2013-11-28 15:25:50 -08:00
Solomon Hykes
3faf450f11 Merge pull request #2818 from pnasrat/docker-pprof
Wire in pprof handlers.
2013-11-28 14:43:13 -08:00
Victor Vieux
b36dd3f9cc fix display on test 2013-11-28 14:40:17 -08:00
Thatcher
a0525d90ab Merge pull request #2937 from jwarwick/hello_world_doc
Remove explanation of removed argument
2013-11-28 14:35:17 -08:00
Victor Vieux
ebc36b879d add progressbar and time 2013-11-28 14:33:18 -08:00
Thatcher
14425c1690 Merge pull request #2922 from ath0mas/patch-1
Restore 'save' paragraph
2013-11-28 14:15:43 -08:00
Michael Crosby
aae23255a0 Merge pull request #2888 from tianon/changelog-fix
Fix CHANGELOG: we ended up not merging the btrfs driver for last night's release
2013-11-28 12:24:56 -08:00
Guillaume J. Charmes
2bbc90e92f Make volumes opts more strict 2013-11-28 12:24:04 -08:00
Guillaume J. Charmes
0c758e9312 Merge branch 'master' into refactor_opts
Conflicts:
	commands.go
2013-11-28 12:23:45 -08:00
Victor Vieux
597e0e69b4 split in 3 files 2013-11-28 12:16:57 -08:00
Guillaume J. Charmes
261bd0d187 Improve devmapper unit tests with syscall/ioctl 2013-11-28 11:53:09 -08:00
Michael Crosby
3d0486979e Merge pull request #2892 from creack/add_cli_test-1
Add ParseRun unit tests
2013-11-28 11:39:48 -08:00
Victor Vieux
377817db1b Merge pull request #2913 from pnasrat/2852-deleteimage-performance
Performance of deleteImageAndChildren.
2013-11-28 11:20:43 -08:00
Guillaume J. Charmes
a990b3aeb9 Correct comments 2013-11-28 11:02:53 -08:00
Paul Nasrat
9f46779d42 Wire in pprof handlers.
Based on http://stackoverflow.com/questions/19591065/profiling-go-web-application-built-with-gorillas-mux-with-net-http-pprof
2013-11-28 13:46:58 -05:00
Guillaume J. Charmes
533067bba4 Rename file for consistency 2013-11-28 10:37:03 -08:00
Tianon Gravi
438607ecc3 Add proper dockerinit path support for distros that use FHS 2.3 2013-11-28 11:11:30 -07:00
Danny Yates
d47507791e Stop invalid calls to Registry
This code was resulting in a call for
/v1/images/<namespace>/<repository>/ancestry which the Registry
doesn't understand. Furthermore, it was masking the original
error.
2013-11-28 16:43:28 +00:00
Paul Nasrat
bdfe8ed403 Remove incorrect SIGKILL handler.
As per POSIX signal handling SIGKILL does not work.

Fixes #2928
2013-11-28 10:42:06 -05:00
John Warwick
f1e44e0b0c Remove explanation of removed argument 2013-11-28 09:55:15 -05:00
Ulysse Carion
c226ab6d9e Document setting up Vagrant-docker with the remote API 2013-11-27 20:05:54 -08:00
Guillaume J. Charmes
74ea136a49 Move reflink to os dependent file. OSX docker client fully functionnal. 2013-11-27 19:23:48 -08:00
Guillaume J. Charmes
24c03b2d93 Make devicemapper linux-only 2013-11-27 19:12:51 -08:00
Guillaume J. Charmes
a58fef9f13 Merge branch 'master' into refactor_cgo_in_go 2013-11-27 18:55:11 -08:00
Victor Vieux
597ca192e7 Merge pull request #2927 from andrewsmedina/stat_macos
Move syscall.Stats logic to os specific file.
2013-11-27 18:32:18 -08:00
Andrews Medina
8b2a7e35c3 Move syscall.Stats logic to os specific file.
related to #2909.
2013-11-28 00:22:47 -02:00
Guillaume J. Charmes
8a5d927a53 Check if the target loopback is a block device 2013-11-27 18:21:17 -08:00
Guillaume J. Charmes
1214b8897b Extract ioctl from wrapper 2013-11-27 17:47:20 -08:00
Guillaume J. Charmes
eb528b959e Move attach loop device to its own file 2013-11-27 17:12:57 -08:00
Tianon Gravi
75e9cff98c Update systemd service file with suggestions from @seblu 2013-11-27 16:55:37 -07:00
Guillaume J. Charmes
74c8f7af75 Refactor attach loop device in pure Go 2013-11-27 15:39:30 -08:00
Alexis THOMAS
2c27da8818 Restore 'save' paragraph 2013-11-28 00:39:06 +01:00
Solomon Hykes
39f21af687 Merge pull request #2914 from crosbymichael/open-issues
Add instructions for opening issues on the repository
2013-11-27 15:25:12 -08:00
Danny Yates
d1a631cedb Only tag the top-most layer, not all interim layers 2013-11-27 22:00:58 +00:00
Michael Crosby
7f9cdaa342 Merge pull request #2831 from SvenDowideit/please-ignore-squiggle-backup-files
Please ignore squiggle backup files
2013-11-27 11:04:21 -08:00
Michael Crosby
e4ae44b844 Add instructions for opening issues on the repository 2013-11-27 10:41:20 -08:00
Guillaume J. Charmes
89454851d1 Merge pull request #2814 from dotcloud/release_checklist_update
update release checklist
2013-11-27 10:04:55 -08:00
Guillaume J. Charmes
f75dc36204 Merge pull request #2904 from SvenDowideit/dont-show-user-internal-slash-in-error-message
there appears to be a slash prepended to a container name internally
2013-11-27 09:58:24 -08:00
Michael Crosby
5fe5055bd9 Merge pull request #2910 from codeaholics/wait-for-simultaneous-pull
Allow multiple clients to pull the same tag simultaneously
2013-11-27 09:58:13 -08:00
Paul Nasrat
4e826e99b2 Performance of deleteImageAndChildren.
Don't walk the file system for parents each time we recurse.

Fixes #2852
2013-11-27 12:55:15 -05:00
Danny Yates
788feab3a7 Handle the case where poolAdd() gives an error for an unknown pool type 2013-11-27 16:53:36 +00:00
dkumor
682a188ead Arch docs: Added lxc-docker-nightly AUR package, modified deps
lxc-docker-nightly installs latest build. Removed go from dependencies, as it is not needed in lxc-docker and lxc-docker-nightly. The -git package will flag go as a dependency upon installation.
2013-11-27 10:25:30 -06:00
Bruno Bigras
45b1e8c236 Update postgresql's version in example
It seems ppa:pitti/postgresql will be deprecated and only apt.postgresql.org has 9.3.
2013-11-27 09:55:41 -05:00
Danny Yates
ae474e05f5 Allow multiple clients to pull the same tag simultaneously
If two clients simultaneously try to pull the same tag, there was a race
whereby one would succeed and the second would generate an error. Now,
the second simply waits for the first to complete.
2013-11-27 12:18:01 +00:00
Marek Goldmann
0ff9bc1be3 Make sure the firewall rules are created even if the bridge interface is already created 2013-11-27 12:14:18 +01:00
dkumor
b3e8ba1908 Arch docs: Updated dependencies to match AUR
The AUR packages lxc-docker and lxc-docker-git have changed their dependencies.
2013-11-26 22:07:56 -06:00
Sven Dowideit
7b95d41092 tell anyone that might want to ignore their editor choice's backup files that there is a better way - thanks @pnasrat 2013-11-27 13:19:06 +10:00
Sven Dowideit
1cb7b9adc6 there appears to be a slash prepended to a container name internally - don't tell the user about it in an error message, it might cause them to worry about it 2013-11-27 12:58:54 +10:00
dkumor
d370a889c3 Deleted references to AUFS
AUFS is no longer a dependency (both lxc-docker and lxc-docker-git are >=0.7), and the Arch kernel doesn't need to be replaced with AUFS_friendly.
2013-11-26 20:00:13 -06:00
Michael Crosby
6d34c50e89 Increase max image depth to 127 2013-11-26 17:04:55 -08:00
Tianon Gravi
6344e6f258 Merge pull request #2887 from kleptog/master
Add mkseccomp.pl, helper script to make seccomp profiles.
2013-11-26 15:24:35 -08:00
Guillaume J. Charmes
462e30dcbd Add parseRun volume unit tests 2013-11-26 23:03:50 +00:00
Guillaume J. Charmes
c7661f40b6 Make volumes opts more strict 2013-11-26 23:00:44 +00:00
Guillaume J. Charmes
c707c587c1 Add ParseRun unit tests 2013-11-26 20:16:16 +00:00
Guillaume J. Charmes
5e3f6e7023 Change the default Host affectation to not rely on slice 2013-11-26 18:31:59 +00:00
Guillaume J. Charmes
1beb5005d1 Format main() 2013-11-26 17:47:58 +00:00
Guillaume J. Charmes
1ba11384bf Refactor Opts 2013-11-26 17:46:06 +00:00
Tianon Gravi
8398abf0dc Fix CHANGELOG: we ended up not merging the btrfs driver for last night's release 2013-11-26 09:36:46 -07:00
Martijn van Oosterhout
ab3a83c617 Add mkseccomp.pl, helper script to make seccomp profiles. 2013-11-26 17:13:02 +01:00
Guillaume J. Charmes
8b99e4ed37 Merge pull request #2884 from nikai3d/patch-1
fix typo in CONTRIBUTING.md
2013-11-26 07:40:49 -08:00
Guillaume J. Charmes
17efa9dc2d Merge pull request #2872 from goldmann/runtime_typo
Fix the 'but is not' typo
2013-11-26 07:40:25 -08:00
Nicolas Kaiser
76c71260f1 fix typo in CONTRIBUTING.md 2013-11-26 16:13:39 +01:00
Yurii Rashkovskii
8267437294 Fix command line help for docker save
`docker save IMAGE DESTINATION` is not what `docker save` expects
2013-11-26 06:54:46 -08:00
Marek Goldmann
9c15322894 Fix the 'but is not' typo. 2013-11-26 11:18:50 +01:00
Victor Vieux
0d078b6581 fix -link parsing 2013-11-26 00:09:45 -08:00
Victor Vieux
06d5e25224 Merge pull request #2870 from dotcloud/fix-links-parsing
fix -link parsing
2013-11-26 00:09:09 -08:00
Victor Vieux
009024ad64 fix -link parsing 2013-11-26 00:05:46 -08:00
Victor Vieux
14d9f04e89 fix docker run on an unknown image 2013-11-25 23:28:48 -08:00
Victor Vieux
18d08d0d42 Merge pull request #2869 from dotcloud/fix-docker-pull-run
fix docker run on an unknown image
2013-11-25 23:28:15 -08:00
Victor Vieux
0bb2c0b1d0 fix docker run on an unknown image 2013-11-25 23:20:36 -08:00
Tianon Gravi
1af6ffb9bb Add explicit test strings for new escapeFstabSpaces function 2013-11-26 00:11:42 -07:00
Michael Crosby
233ad38802 Merge branch 'release' 2013-11-25 22:25:47 -08:00
Solomon Hykes
db28e839e0 Merge pull request #2857 from shykes/0.7-release
0.7 release
2013-11-25 22:14:33 -08:00
Solomon Hykes
de30ffb2c3 Add 0.7.0 Changelog entry, with notable high-level features since 0.6.0. 2013-11-26 06:06:22 +00:00
Solomon Hykes
5c5ee194cb Bump version file to 0.7.0 2013-11-26 06:06:22 +00:00
Solomon Hykes
b6dd67c707 Merge pull request #2868 from jamtur01/ubtfixes
Tidied up Ubuntu installation documentation
2013-11-25 22:05:36 -08:00
Michael Crosby
740958dda7 Merge pull request #2867 from shykes/more-random-names
Add more moods and inventor names to random name generator
2013-11-25 22:04:29 -08:00
Solomon Hykes
c38386d876 Remove non-ascii characters from name generator 2013-11-26 06:02:37 +00:00
Victor Vieux
4267fb66ef Merge pull request #2866 from tianon/binaries-docs
Update "Binaries" installation language to point to distro packages first
2013-11-25 22:00:20 -08:00
James Turnbull
a74b512540 Tidied up Ubuntu installation documentation 2013-11-26 00:58:17 -05:00
Solomon Hykes
60809a4f72 Add more moods to random name generator 2013-11-26 05:55:48 +00:00
Tianon Gravi
65fcc81b42 Update "Binaries" installation language to point to distro packages first
Also, added a minor consistency update to our usage of "wget".
2013-11-25 22:53:50 -07:00
Michael Crosby
06cf8fee1b Merge pull request #2865 from tianon/arch-docs
A couple tiny docs consistency fixes
2013-11-25 21:53:16 -08:00
Tianon Gravi
c92dab0eb4 Update Fedora placeholder to include the same "community" and "pre-1.0" warnings so we don't forget them 2013-11-25 22:48:51 -07:00
Tianon Gravi
6ad5b2bcf4 Update Arch Linux instructions to include warnings at the top like other "community" platforms 2013-11-25 22:47:15 -07:00
Tianon Gravi
77f1362c64 Merge pull request #2864 from tianon/gentoo-docs
Update the Gentoo installation docs for 0.7+
2013-11-25 21:42:14 -08:00
Tianon Gravi
4049359bee Update the Gentoo installation docs for 0.7+ 2013-11-25 22:40:24 -07:00
Michael Crosby
7daefc9d3f Merge pull request #2862 from shykes/integration-tests-vfs
Improve integration tests with vfs driver
2013-11-25 21:37:35 -08:00
Victor Vieux
d4c32b9015 Merge pull request #2854 from dotcloud/copy_dockerinit
create a copy of dockerinit on new runtime to handle upgrades
2013-11-25 21:31:33 -08:00
Solomon Hykes
8bd6127ab3 Merge pull request #2815 from tianon/hack-make-tgz
Add tgz bundlescript
2013-11-25 21:29:14 -08:00
Solomon Hykes
2302293244 Fix a race condition in the integration tests 2013-11-26 05:28:00 +00:00
Tianon Gravi
fd7ff6411d Merge pull request #2863 from jamtur01/instsort
Installation docs update
2013-11-25 21:19:30 -08:00
James Turnbull
59f76bf1c7 Installation docs update
* Updated TOC sort order
* Fixed some grammar in Rackspace doc
* Updated titles to remove Linux where not needed
2013-11-26 00:16:30 -05:00
Solomon Hykes
02cb7f45fa Fix a race condition in TestInterruptedRegister 2013-11-26 05:05:15 +00:00
Solomon Hykes
a937313747 Always use the 'vfs' storage driver in integration tests. To test other drivers, we need a dedicated driver validation suite. 2013-11-26 05:05:15 +00:00
Solomon Hykes
fb3d60f27a Move all graph tests into integration, because they now rely on the underlying graph driver, which currently cannot be mocked. 2013-11-26 05:05:15 +00:00
Tianon Gravi
5ff74e268d Merge pull request #2860 from jamtur01/fedora2
Updated Fedora docs with simple placeholder
2013-11-25 20:59:15 -08:00
Solomon Hykes
09b7b55e2c Merge pull request #2861 from crosbymichael/fix-time-race-archive
Set consistent time for sample dir in archive test
2013-11-25 20:24:16 -08:00
Victor Vieux
110c4f2043 create a copy of dockerinit 2013-11-25 20:21:54 -08:00
Michael Crosby
0d1b5d7676 Set consistent time for sample dir in archive test 2013-11-25 19:58:14 -08:00
James Turnbull
5242a49f3f Updated Fedora docs
* Added warning to Fedora docs
2013-11-25 22:51:38 -05:00
Michael Crosby
2586c042ae Merge pull request #2810 from dotcloud/use_utc_time
Use UTC for time
2013-11-25 19:11:59 -08:00
Solomon Hykes
688e86c625 Merge pull request #2858 from jamtur01/fedora
Added Fedora skeleton
2013-11-25 19:10:50 -08:00
James Turnbull
750d2d8d07 Added Fedora skeleton 2013-11-25 22:06:18 -05:00
Guillaume J. Charmes
19df6c32c0 Merge branch 'master' into use_utc_time
Conflicts:
	image.go
2013-11-25 19:01:13 -08:00
Solomon Hykes
1d903da6fd Merge pull request #2609 from shykes/0.6.5-dm-plugin
Move aufs to a storage driver, add devicemapper and dummy drivers
2013-11-25 18:58:26 -08:00
Solomon Hykes
aaefb8c07c Docs: update install pages (ubuntu and kernel requirements) to reflect the optional nature of AUFS 2013-11-26 02:45:32 +00:00
Guillaume J. Charmes
b3959e69b5 Merge pull request #2837 from shykes/0.7-names
New collection of random names for 0.7
2013-11-25 18:39:36 -08:00
Solomon Hykes
43c7df946d Merge branch 'master' into 0.6.5-dm-plugin 2013-11-26 02:00:25 +00:00
Solomon Hykes
6acdf68ee1 Merge pull request #2804 from tianon/fix-hack-git-assumption
Hack: add support for compiling using make.sh without '.git'
2013-11-25 16:52:22 -08:00
Michael Crosby
487b3d8a8c Merge pull request #72 from shykes/creack-reduce-debug
Reduce debugf frequency to avoid terminal freeze
2013-11-25 15:50:07 -08:00
Andy Rothfusz
33f70f8978 Merge pull request #2725 from SvenDowideit/docker-export-doc
add 'to STDOUT' to the help and give an example
2013-11-25 14:42:57 -08:00
Andy Rothfusz
809239c0af Merge pull request #2853 from estenberg/cfe-docker-process
docker in-container process management with CFEngine
2013-11-25 14:31:52 -08:00
Eystein Måløy Stenberg
937f52aef9 docker in-container process management with CFEngine 2013-11-25 14:24:23 -08:00
Andy Rothfusz
aa48acc5ec Merge pull request #2849 from jamtur01/supervisor
Added a Supervisor process management example
2013-11-25 13:50:44 -08:00
Andy Rothfusz
ac70e296db Merge pull request #2836 from fj/topic/spinx⇒sphinx
Corrects misspellings of 'Sphinx'
2013-11-25 13:40:26 -08:00
Andy Rothfusz
e2c3860ec3 Merge pull request #2835 from fj/topic/update-native-installation-instructions
Use requirements.txt rather than manual installation for docs
2013-11-25 13:28:18 -08:00
Andy Rothfusz
2d715bf3c0 Merge pull request #2833 from twillouer/patch-1
Better copy/paste :)
2013-11-25 13:21:50 -08:00
Victor Vieux
d9e54e28e7 Merge pull request #2848 from pnasrat/713-data-races
Fix data race in TestLogEvent
2013-11-25 12:07:01 -08:00
Guillaume J. Charmes
78d2e2dc37 Reduce debugf frequency to avoid terminal freeze 2013-11-25 12:06:16 -08:00
Paul Nasrat
abfdaca3f8 Fix data race in TestLogEvent
Found with -race. Improve locking on Server.
2013-11-25 14:17:58 -05:00
Guillaume J. Charmes
3a2fbcfdec Merge pull request #68 from crosbymichael/daemon-docs
Add daemon docs with selecting graph driver
2013-11-25 11:06:28 -08:00
James Turnbull
ba2b36e192 Added a Supervisor process management example 2013-11-25 14:05:01 -05:00
Guillaume J. Charmes
d47d49a2f9 Merge pull request #71 from crosbymichael/fix-dummy-import
Rename dummy in driver.go to vfs
2013-11-25 10:30:20 -08:00
Michael Crosby
8b0b10b6f9 Rename dummy in driver.go to vfs 2013-11-25 10:28:17 -08:00
Guillaume J. Charmes
399c71de83 Merge pull request #67 from crosbymichael/driver-flag
Change graph-driver flag to be s
2013-11-25 09:45:31 -08:00
Michael Crosby
d8f4b733f2 Add daemon docs with selecting graph driver 2013-11-25 09:44:55 -08:00
Michael Crosby
b4eeb6be61 Change graph-driver flag to be s 2013-11-25 09:43:32 -08:00
Guillaume J. Charmes
41704d8933 Merge pull request #69 from crosbymichael/rename-dummy
Rename dummy driver to vfs
2013-11-25 09:42:50 -08:00
Michael Crosby
64dd4afed6 Merge pull request #70 from codeaholics/use-https-url-in-dockerfile
Clone LVM using https: instead of git:
2013-11-25 09:17:35 -08:00
Andy Rothfusz
5da1ed3291 Merge pull request #2730 from SvenDowideit/docker-insert-doc
Be more explicit about what insert does.
2013-11-25 09:16:08 -08:00
Danny Yates
ad23745456 Clone LVM using https: instead of git:
The ports for the git protocol are not open in all corporate environments
2013-11-25 17:12:18 +00:00
Michael Crosby
cee0a292d0 Rename dummy driver to vfs 2013-11-25 09:04:04 -08:00
Tianon Gravi
b702edadb7 Format lxc_template.go with gofmt 2013-11-24 20:02:06 -07:00
Tianon Gravi
f16c45f8b0 Add space-escaping to path parts of lxc.mount.entry lines in generated lxc.conf, allowing for spaces in mount point names
Fixes #2802
2013-11-24 20:00:39 -07:00
Solomon Hykes
07180f3aa7 Add unit test for awesomeness of generated container names 2013-11-25 00:25:15 +00:00
Solomon Hykes
a606474825 Add Ada Lovelace to the names generator (thanks James Turnbull) 2013-11-25 00:22:06 +00:00
Solomon Hykes
5d6ef3177b New collection of random names for 0.7: mood + famous inventor. Eg. 'sad-tesla' or 'naughty-turing' 2013-11-25 00:22:06 +00:00
William Delanoue
0a89db04fe Better copy/paste :) 2013-11-24 13:55:53 +01:00
John Feminella
1cce9f25b2 Corrects misspellings of 'Sphinx' 2013-11-23 16:21:27 -05:00
John Feminella
f1b3e278b9 Suggest users install dependencies by using requirements.txt, not manually 2013-11-23 15:53:50 -05:00
Sven Dowideit
e288e7763e be very explicit about docker insert - it does not insert a file into an IMAGE, it creates a new image that adds only that file to its specified parent 2013-11-23 12:48:34 +10:00
Sven Dowideit
9696ec509a add 'to STDOUT' to the help, and add a simple eg that mentions it too 2013-11-23 12:28:50 +10:00
Sven Dowideit
96b5be9dd9 add more searchable info to the error message when ADD tries to go outside the context 2013-11-23 12:23:31 +10:00
Guillaume J. Charmes
ba6dd1d8d6 Merge pull request #2827 from dotcloud/2778-fix-shell-corrupt
2778 fix shell corrupt
2013-11-22 15:46:02 -08:00
Guillaume J. Charmes
c67f9b671d Remove useless New*Opt functions, singleline Opt types 2013-11-22 14:42:30 -08:00
Guillaume J. Charmes
1c8ae47770 Make a validation on links name 2013-11-22 14:33:25 -08:00
Guillaume J. Charmes
d55998be81 Remove goroutine leak. Make sure termcap are reset each time. 2013-11-22 14:09:37 -08:00
Michael Crosby
e69bbd239e Merge branch 'master' into 0.6.5-dm-plugin 2013-11-22 14:06:59 -08:00
Victor Vieux
a26f9183bd Merge pull request #56 from shykes/creack-dm-plugin
Use variable to call functions in devmapper_wrapper + some formatting
2013-11-22 14:05:59 -08:00
Victor Vieux
944a48ec5a Merge pull request #2822 from dotcloud/better_port_help
Better port help
2013-11-22 13:59:35 -08:00
Guillaume J. Charmes
79e2b33ede Use variable to call functions in devmapper_wrapper + some formatting 2013-11-22 12:25:37 -08:00
Guillaume J. Charmes
076c0eab70 Format CmdRun 2013-11-22 12:14:34 -08:00
Guillaume J. Charmes
1f9223a7c2 Use a constant for PortSpecTemplate + display the template in the CmdRun help 2013-11-22 12:00:34 -08:00
Guillaume J. Charmes
476559458d Reformatting parseRun and partParse 2013-11-22 11:58:02 -08:00
Michael Crosby
d4c8fb9ee2 Merge pull request #2769 from vbatts/none_bridge
Do not setup bridge ip if 'none' bridge is provided
2013-11-22 11:48:33 -08:00
Michael Crosby
ae8c589d35 Merge pull request #2823 from dotcloud/2817-run_rm-fix
Fix docker run -rm
2013-11-22 11:35:29 -08:00
Guillaume J. Charmes
6130f2531e Merge pull request #2677 from mrallen1/fix/2627
Check for a terminal before using escapes
2013-11-22 11:30:16 -08:00
Vincent Batts
ef14aaf627 fix the nil pointer panic on closing a disabled network manager
Issue #2768
2013-11-22 14:28:49 -05:00
Victor Vieux
1e7c04fcfe fix -rm 2013-11-22 11:23:48 -08:00
Tianon Gravi
37e0083169 Add a few more small RELEASE-CHECKLIST tweaks, fixes, and improvements 2013-11-22 11:46:15 -07:00
Mark Allen
8b0cd60019 Pass terminal setting to display utils 2013-11-22 00:05:55 -06:00
daniel-garcia
0198f8a879 fixes #2671, add support for bind mounting individual files in to containers, rebases of #1757 #2301 2013-11-21 23:40:35 -06:00
Tianon Gravi
b3f5973f41 Add new tgz bundlescript to default make and release 2013-11-21 22:34:54 -07:00
Tianon Gravi
3314e005f3 Add new bundlescript to build a tgz 2013-11-21 22:34:54 -07:00
Victor Vieux
a93e40a158 Merge pull request #2812 from dotcloud/bump_v0.6.7
Bump v0.6.7
2013-11-21 18:39:15 -08:00
Victor Vieux
58f8503b73 update release checklist 2013-11-21 18:34:23 -08:00
Victor Vieux
cb48ecc9dc Merge pull request #2812 from dotcloud/bump_v0.6.7
Bump v0.6.7
2013-11-21 18:21:19 -08:00
Victor Vieux
53f1bf0f99 Bump version to v0.6.7 2013-11-21 18:03:41 -08:00
Victor Vieux
9dc59797e0 Merge branch 'master' into bump_v0.6.7 2013-11-21 17:40:29 -08:00
Michael Crosby
0cecc2a78c Merge branch 'master' into 0.6.5-dm-plugin
Conflicts:
	container.go
	image.go
2013-11-21 17:18:41 -08:00
Michael Crosby
437bdeee59 Merge pull request #62 from shykes/devmapper-unit-tests
Devmapper unit tests
2013-11-21 16:54:50 -08:00
Guillaume J. Charmes
806abe90ba Use UTC for time 2013-11-21 16:43:36 -08:00
Michael Crosby
25e443a3c7 Merge pull request #2798 from dotcloud/fix_state_race
Refactor State to be 100% thread safe
2013-11-21 16:39:50 -08:00
Guillaume J. Charmes
33e70864a2 Refactor State to be 100% thread safe 2013-11-21 16:34:58 -08:00
Guillaume J. Charmes
bc82940a57 Forbid syscalls in tests, add 2 new unit tests 2013-11-21 16:32:16 -08:00
Michael Crosby
d6e6214d37 Merge pull request #2678 from cxmcc/minor
Minor code simplification for Containers api
2013-11-21 16:27:15 -08:00
Michael Crosby
70f1bd3104 Merge pull request #2488 from viirya/fix_container_volumes_delete
Skip the volumes mounted when deleting the volumes of container.
2013-11-21 16:20:22 -08:00
Michael Crosby
f7c2a00557 Merge pull request #2304 from unclejack/fix_layer_size_computation
Fix layer size computation: handle hard links correctly
2013-11-21 16:10:24 -08:00
Victor Vieux
8498b44eac Merge pull request #2731 from SvenDowideit/docker-commit-doc
make the docker commit help more copy&pasteable
2013-11-21 15:33:05 -08:00
Tianon Gravi
f1e6dce047 Update test scripts to always run ALL tests, even when some fail 2013-11-21 16:19:19 -07:00
Andy Rothfusz
e2dcfc2cf7 Merge pull request #2772 from bitoiu/patch-3
Change to documentation for AWS AMI request
2013-11-21 15:15:04 -08:00
Andy Rothfusz
9b4c151142 Merge pull request #2717 from metalivedev/2342-uploadingcontext
Fix #2342. Harmonize information about ADD. Cross-link build info.
2013-11-21 15:09:47 -08:00
Andy Rothfusz
50239e0573 Merge pull request #2799 from rosenhouse/patch-1
Fix title on doc page for remote_api_client_libraries.rst
2013-11-21 14:40:33 -08:00
Guillaume J. Charmes
42c23b0f04 Merge pull request #2763 from dotcloud/use_full_id_delete
Do ont truncate ID on docker rmi
2013-11-21 14:39:38 -08:00
Guillaume J. Charmes
eec91e7941 Merge pull request #2805 from pmorie/typo
Fix typo in pullImage
2013-11-21 14:35:07 -08:00
Paul Morie
3f17844b6e Fix typo in pullImage 2013-11-21 17:29:03 -05:00
Tianon Gravi
efd0e13ca7 Add support for compiling using make.sh without '.git' (ie, from a Github tarball, for example) 2013-11-21 15:11:17 -07:00
Guillaume J. Charmes
bcdeb37bb6 Merge pull request #2794 from dotcloud/fix_status_code_and_usage
fix status code and usage
2013-11-21 13:48:38 -08:00
Gabe Rosenhouse
362e9d6b3c Fix title on doc page for remote_api_client_libraries.rst 2013-11-21 12:45:01 -08:00
Guillaume J. Charmes
c4ab498920 Merge pull request #2797 from crosbymichael/revert-exit-lock
Revert "Lock state before we modify."
2013-11-21 12:19:23 -08:00
Michael Crosby
cb70eedfda Revert "Lock state before we modify."
This reverts commit d7e2fc8982.
2013-11-21 12:11:25 -08:00
Victor Vieux
75a7f4d90c Return status exit status 2 on usage, move parserun into commands.go, display usage on stderr 2013-11-21 11:43:07 -08:00
Victor Vieux
da824b4a5a Merge pull request #63 from tianon/flag-help-consistency
Update a few flag help strings for consistency and clarity
2013-11-21 11:31:34 -08:00
Tianon Gravi
1ab6b8bf49 Update a few flag help strings for consistency and clarity 2013-11-21 12:30:17 -07:00
Victor Vieux
eaeb969138 Merge pull request #2795 from pnasrat/docker-testmultipleattachrestart-race
Lock state before we modify.
2013-11-21 11:28:02 -08:00
Michael Crosby
253214f07d Update ImageExport after merge fail 2013-11-21 10:26:21 -08:00
Michael Crosby
a2c9d2da93 Merge branch 'master' into 0.6.5-dm-plugin 2013-11-21 10:21:30 -08:00
Paul Nasrat
d7e2fc8982 Lock state before we modify.
When we start a container we lock state, we should do the same in stop.

Detected via -race.
2013-11-21 08:06:02 -05:00
Victor Vieux
f20c738963 Merge pull request #2793 from crosbymichael/offline-ids
Allow images to be saved and loaded by id and repository
2013-11-21 02:44:00 -08:00
Solomon Hykes
df258f5861 Devmapper: test driver initialization and its interaction with libdevmapper 2013-11-21 02:17:03 +00:00
Solomon Hykes
60f728b170 Devmapper: wrap calls to os/exec for easier mocking 2013-11-21 02:16:26 +00:00
Solomon Hykes
2b7c63b1b5 devmapper: skip test which are not unit tests 2013-11-21 02:12:51 +00:00
Michael Crosby
fd7ab143bf Allow images to be saved and loaded by id and repository 2013-11-20 17:28:19 -08:00
Andy Rothfusz
82cdd21a34 Merge pull request #2727 from SvenDowideit/docker-images-doc
add some common examples for docker images, and tell the user what -a filters out
2013-11-20 16:30:48 -08:00
Michael Crosby
a9230af52e Merge pull request #57 from shykes/wait_on_pull_already
Wait on pull already in progress
2013-11-20 15:58:51 -08:00
Victor Vieux
2f0d18ac4a Merge pull request #59 from crosbymichael/fix-image-save-size
Fix image save size
2013-11-20 15:58:31 -08:00
Michael Crosby
6469422465 Merge pull request #58 from crosbymichael/update-aufs-tests
Add more aufs tests and implement Status
2013-11-20 15:41:59 -08:00
Michael Crosby
5306053e21 Add more aufs tests and implement Status 2013-11-20 15:41:37 -08:00
Solomon Hykes
e2390318bb Devmapper: mock all calls to libdevmapper in the unit tests, and deny them by default 2013-11-20 23:39:02 +00:00
Michael Crosby
4e0c76b321 Ensure that only the layers are compressed and not mnt points 2013-11-20 15:37:26 -08:00
Solomon Hykes
da514223d1 Devmapper: remove deprecated test helpers 2013-11-20 23:25:27 +00:00
Solomon Hykes
023ff36704 devmapper: fix typo 2013-11-20 23:12:19 +00:00
Michael Crosby
8fdbf46afb Fix image size calc on initial save 2013-11-20 14:51:04 -08:00
Guillaume J. Charmes
d233894c25 Add devmapper struct doc 2013-11-20 14:09:46 -08:00
Victor Vieux
8a756f417e wait on pull already in progress 2013-11-20 14:04:19 -08:00
Guillaume J. Charmes
a39bd65662 Remove os from devmapper 2013-11-20 13:05:17 -08:00
Guillaume J. Charmes
5690139785 Remove all syscall calls from devicemapper 2013-11-20 12:49:01 -08:00
Solomon Hykes
92f94f06ae Mock calls to system functions to facilitate unit testing 2013-11-20 20:05:10 +00:00
Michael Crosby
2bc35287a0 Merge pull request #2723 from SvenDowideit/doc-build-image
Use the work Path for docker cp CONTAINER:PATH
2013-11-20 11:10:13 -08:00
Michael Crosby
2382a0f920 Merge branch 'master' into 0.6.5-dm-plugin
Conflicts:
	server.go
2013-11-20 11:07:42 -08:00
Guillaume J. Charmes
579a5c843b Merge pull request #51 from crosbymichael/driver-specific-image
Handle image metadata when drivers are switched
2013-11-20 10:45:51 -08:00
Johan Euphrosine
b3bee7e0c4 utils: remove dotcloud/tar dep 2013-11-20 18:45:12 +00:00
Guillaume J. Charmes
6ebb236aa1 Merge pull request #55 from alexlarsson/dm-plugins-cleanup-graph-test
graph_test: Clean up drivers allocated in tempGraph()
2013-11-20 10:41:18 -08:00
Guillaume J. Charmes
b4f7078a02 Merge pull request #2773 from dotcloud/speed_up_docker_ps
speedup docker ps
2013-11-20 10:40:03 -08:00
Guillaume J. Charmes
9e68913397 Merge pull request #2760 from dotcloud/improve_engine_test
improve tests on the engine
2013-11-20 10:38:46 -08:00
Michael Crosby
1b28cdc7f9 Handle image metadata when drivers are switched 2013-11-20 10:31:51 -08:00
Victor Vieux
304a80fcd5 Merge pull request #2747 from jpoimboe/test-fixes
Test fixes
2013-11-20 10:07:40 -08:00
Guillaume J. Charmes
04f1d4dcdb Merge pull request #2788 from jpoimboe/resize-after-start
resize pty after starting
2013-11-20 10:01:59 -08:00
Josh Poimboeuf
171d681724 resize pty after starting
Since ptyMaster is created during container start (startPty), it should
resized after starting, not before.
2013-11-20 11:40:30 -06:00
Vincent Batts
60cb5f1a34 do not setup bridge ip if bridgeNetwork is nil. This is the case when
-b='none' bridge is provided.

issue #2768
https://bugzilla.redhat.com/show_bug.cgi?id=1032094
2013-11-20 09:36:38 -05:00
Alexander Larsson
cfdc284abe tags test: cleanup driver
If not we leak a devicemapper pool
2013-11-20 14:52:06 +01:00
Alexander Larsson
7192be47c5 graph_test: Clean up drivers allocated in tempGraph()
If we don't do this we leak devicemapper pools with the dm backend.
2013-11-20 14:42:32 +01:00
Michael Crosby
cd4c1ac356 Merge pull request #2779 from crosbymichael/pin-python-deps
Pip python deps to a specific version
2013-11-19 21:29:09 -08:00
Michael Crosby
b8af68a92b Merge pull request #1974 from dotcloud/1155-offline-image-transfer
Implement offline image transfers
2013-11-19 20:00:58 -08:00
Michael Crosby
9de4590498 Add typo in remove all. Ensure tmpDir is removed 2013-11-20 03:52:33 +00:00
Michael Crosby
0ef6fed5c7 Fix error checks for offline transfer and remove unneeded debug output 2013-11-20 03:52:33 +00:00
Frederick F. Kautz IV
383f95bba1 Adding 1.7 documentation 2013-11-20 03:52:33 +00:00
Frederick F. Kautz IV
1211065c8d Adding content type to images/(name)/get 2013-11-20 03:52:33 +00:00
Frederick F. Kautz IV
844c13bce6 Fixing build 2013-11-20 03:52:33 +00:00
Frederick F. Kautz IV
6014db4a7e Setting offline package version to 1.0 2013-11-20 03:52:33 +00:00
Frederick F. Kautz IV
bf504f2afa Adding spaces to fix docs build 2013-11-20 03:52:33 +00:00
Frederick F. Kautz IV
61a8020e51 Adding version info, switching to defer for cleanup 2013-11-20 03:52:33 +00:00
Frederick F. Kautz IV
7eaa59f626 Offline Image Transfers #1155 2013-11-20 03:52:33 +00:00
Michael Crosby
2cccbbdadd Pip python deps to a specific version 2013-11-19 19:25:54 -08:00
Michael Crosby
24586d7af5 Merge pull request #54 from shykes/vieux_merge_master
Merge from master
2013-11-19 18:38:15 -08:00
Victor Vieux
b700ee006a Merge pull request #2777 from dotcloud/fix_port_stop_start
don't import emport empty hostconfig
2013-11-19 18:36:22 -08:00
Victor Vieux
880a0e9c36 Merge branch 'master' into vieux_merge_master 2013-11-19 18:34:19 -08:00
Victor Vieux
0169cf15dd don't import emport empty hostconfig 2013-11-19 18:28:50 -08:00
Victor Vieux
cd022376b8 Merge branch 'master' into vieux_merge_master
Conflicts:
	runtime.go
2013-11-19 17:32:08 -08:00
Michael Crosby
234f5ac39f Merge pull request #2750 from jpoimboe/simplify-register-reconnect
Simplify the runtime Register reconnect logic
2013-11-19 17:30:59 -08:00
Michael Crosby
d4ef551d65 Merge pull request #53 from shykes/improve_cleanup
Improve aufs cleanup and debugging
2013-11-19 17:16:36 -08:00
Victor Vieux
76f54f3a28 Merge pull request #39 from crosbymichael/add-driver-flag
Add flag to set default graph driver
2013-11-19 17:16:25 -08:00
Victor Vieux
43b709ab36 Merge pull request #52 from crosbymichael/rename-aufs-driver
Rename AufsDriver to Driver to be consistent
2013-11-19 17:13:44 -08:00
Victor Vieux
43899a77bf improve aufs cleanup and debugging 2013-11-19 17:12:37 -08:00
Victor Vieux
d575918038 Merge pull request #2748 from jpoimboe/fix-restart-race-condition
fix container restart race condition
2013-11-19 16:26:13 -08:00
Guillaume J. Charmes
f6629bbbd5 Merge pull request #50 from crosbymichael/limit-dm
Prohibit more than 42 layers in the core
2013-11-19 15:42:00 -08:00
Guillaume J. Charmes
91330243b5 Merge pull request #48 from crosbymichael/reset-mtime
Ensure same atime, mtime after applying whiteouts
2013-11-19 15:40:12 -08:00
Guillaume J. Charmes
3e0a5ac48b Merge pull request #41 from alexlarsson/dm-plugin-device-tool
Update docker-device-tool
2013-11-19 15:38:47 -08:00
Michael Crosby
0d603df6dc Merge pull request #49 from shykes/creack-merge-master
Merge master into 0.6.5-dm-plugin
2013-11-19 15:29:09 -08:00
Guillaume J. Charmes
12e993549d Fix unit-tests 2013-11-19 15:24:14 -08:00
Guillaume J. Charmes
28d4cbbc59 Merge branch 'master' into creack-merge-master
Conflicts:
	api_params.go
	graph.go
	graph_test.go
	image.go
	integration/api_test.go
	integration/container_test.go
	integration/runtime_test.go
	runtime.go
2013-11-19 14:58:12 -08:00
Victor Vieux
5a4113140e Merge pull request #43 from alexlarsson/dm-plugin-use-root-subdir
devmapper: Use a "root" subdirectory in the devmapper volume
2013-11-19 13:51:04 -08:00
Victor Vieux
85b5062502 Merge pull request #44 from crosbymichael/container-migration
Container and Image migration for aufs
2013-11-19 13:47:23 -08:00
Tianon Gravi
66beafa9f3 rename file to remove testing flags from docker binary 2013-11-19 12:41:29 -08:00
Josh Poimboeuf
3cbec95177 simplify the runtime Register reconnect logic
Refactor the Register code a little bit to make it easier to comprehend.
2013-11-19 14:09:30 -06:00
Victor Vieux
8e5ab5bfca improve tests on the engine 2013-11-19 11:47:47 -08:00
Michael Crosby
9d867a389b Merge pull request #2759 from dotcloud/lintify-1
Lintify code with confidence=1
2013-11-19 11:26:15 -08:00
Andy Rothfusz
4f9f83d6c6 Fix #2342. Harmonize information about ADD. Cross-link build info. 2013-11-19 11:16:28 -08:00
Victor Vieux
145c2008ae speedup docker ps 2013-11-19 11:02:10 -08:00
Andy Rothfusz
4eaba8de91 Merge pull request #2757 from Painted-Fox/patch-2
Simplify the upstart example in host_integration.rst
2013-11-19 10:29:54 -08:00
Andy Rothfusz
434c1613a4 Merge pull request #2770 from tianon/better-man-page
Switch sphinx man_pages generation to use commandline/cli
2013-11-19 10:28:50 -08:00
Andy Rothfusz
18da26c62a Merge pull request #2766 from sbellem/doc-improvements
fixed typos, and made small improvements to the wording
2013-11-19 10:27:25 -08:00
Michael Crosby
4c2624a277 Merge pull request #45 from alexlarsson/dm-plugin-diff-size
Implement fallback for getting the size of a container
2013-11-19 10:25:31 -08:00
Michael Crosby
f4b3b7c055 Merge pull request #47 from alexlarsson/dm-plugin-ummount-when-removing
Devicemapper: Unmount when removing device
2013-11-19 10:24:44 -08:00
Michael Crosby
9af1b07086 Merge pull request #46 from alexlarsson/dm-plugin-dummy-use-cp
Dummy driver: Use cp --reflink=auto to copy directories
2013-11-19 10:16:56 -08:00
Vitor Monteiro
aeb304b37c Change to documentation for AWS AMI request
Hi guys, it just might be me, but clicking the AMI from http://cloud-images.ubuntu.com/locator/ec2/ is broken to me. So I just did it via the normal Create Instance Wizard.

I just though some people might have the same issue.

Sorry if my markdown for links is screwed up, I went by the examples, since I'm used to the `[]()` traditional one.

Cheers.
2013-11-19 17:50:38 +00:00
Ryan Seto
1da8c50ded Fix quote mistake. 2013-11-19 12:14:39 -05:00
Tianon Gravi
1cd9529ad3 Switch sphinx man_pages generation to use commandline/cli instead of toctree for a more relevant/useful man page 2013-11-19 10:10:42 -07:00
Daniel Mizyrycki
f78d45863c Merge pull request #2734 from zitrusmedia/master
Vagrantfile modified to support VBoxGuestAdditions_4.3.2
2013-11-19 09:04:28 -08:00
Sylvain Bellemare
3656db66d2 fixed typos, and made small improvements to the wording 2013-11-19 14:44:50 +01:00
Alexander Larsson
0ed762f2d2 devicemapper: Unmount when removing device
Without this the remove will fail due to a busy device.
2013-11-19 14:40:15 +01:00
Alexander Larsson
242fd4b3ef dummy driver: Use cp --reflink=auto to copy directories
On systems that supports reflinking (i.e. btrfs) this means the dummy
backend is much faster at copying files and will be sharing file data in
a CoW fashion.

On my (btrfs) system this makes "docker run ubuntu echo hello world" go
from about 3 seconds to about 1 second. Not instant, but clearly better.

cp --reflink=auto is availible since coreutils 7.5 (around 2009), so this
seems pretty ok to rely on.

cp is also better at preserving file metadata than tar, so for instance
it will copy xattrs.
2013-11-19 13:09:36 +01:00
unclejack
78c843c8ef fix container size computation: handle hard links
This change makes docker compute container size correctly.

The old code isn't taking hard links into account. Containers could
seem like they're up to 1-1.5x larger than they really were.
2013-11-19 13:53:34 +02:00
unclejack
ac821f2446 fix layer size computation: handle hard links
This change makes docker compute layer size correctly.

The old code isn't taking hard links into account. Layers could
seem like they're up to 1-1.5x larger than they really were.
2013-11-19 13:37:54 +02:00
Michael Crosby
51a972f38d Rename AufsDriver to Driver to be consistent 2013-11-19 03:27:59 -08:00
Michael Crosby
aea6001baf Check env var for setting driver in tests 2013-11-19 03:13:22 -08:00
Michael Crosby
6dbeed89c0 Add flag to set default graph driver
Remove the env var DOCKER_DRIVER
2013-11-19 02:37:44 -08:00
Alexander Larsson
5d76681c3d Implement fallback for getting the size of a container
This moves Driver.Size() to Differ.DiffSize(), removing the empty
implementations in devmapper and dummy, and renaming the one in aufs.

Then we fall back to a container.Changes() implementation in the non-aufs
case.
2013-11-19 10:36:54 +01:00
Alexander Larsson
9415c2b1f0 Move docker-device-tool to contrib 2013-11-19 10:03:04 +01:00
Alexander Larsson
a0224e61b4 devicemapper tool: Add support for pool resizing 2013-11-19 09:59:13 +01:00
Michael Crosby
af753cbad8 Prohibit more than 42 layers in the core
We need to do this because we still support aufs
and users on other drivers can push incompat images
to the registory that aufs users cannot use.
2013-11-19 00:51:16 -08:00
Alexander Larsson
80aecc7014 devmapper: Update device-mapper-tool
This makes the device mapper tool work again and adds new features
to get pool status, device status and to list all devices.
2013-11-19 09:44:19 +01:00
Michael Crosby
3edb4af663 Ensure same atime, mtime after applying whiteouts 2013-11-19 00:35:03 -08:00
Alexander Larsson
00401a30b7 devmapper: Use a "rootfs" subdirectory in the devmapper volume
We place the actual image/containers in the "rootfs" directory, which
allows us to have other data in the toplevel directory in the mount.

For starters, this means the "lost+found" directory from mkfs will
not always be in your container/image.

Secondly, we can create a file "id" in the toplevel dir which is not
visible from the container. This is useful because it allows us to map
back from the device fs to the container if something goes wrong with
the devicemapper metadata.
2013-11-19 09:29:42 +01:00
Michael Crosby
5ee8e41e43 Retry moving dirs on every daemon startup
This will try to move the directories that were
previously symlinked until a full migration is complete.
2013-11-18 23:28:45 -08:00
Michael Crosby
29f07f8544 Add container migration to aufs driver 2013-11-18 18:39:21 -08:00
Victor Vieux
2fe4467d73 Do ont truncate ID on docker rmi 2013-11-18 18:39:02 -08:00
Ryan Seto
194d4b9376 Correct the quotations in the command to add the -r=false flag. Thanks to @tianon for pointing this out. 2013-11-18 21:23:00 -05:00
Andy Rothfusz
1de02a70de Merge pull request #2719 from metalivedev/2702-knownissue-lxc-start-failed-to-mount
Fixes #2702. Also cleans up formatting and long lines in volumes doc.
2013-11-18 17:27:49 -08:00
Guillaume J. Charmes
5e941f1ca0 Lintify code with confidence=1 2013-11-18 16:24:11 -08:00
Michael Crosby
f88b760809 Migrate images with parent relationship 2013-11-18 16:17:43 -08:00
Andy Rothfusz
511a62a099 Merge pull request #2755 from metalivedev/test-2592
Replace PR#2592
2013-11-18 15:29:48 -08:00
Andy Rothfusz
256d46fe68 Merge pull request #2721 from metalivedev/2701-addmedia
Add security section and embed private registry video.
2013-11-18 15:29:35 -08:00
Ryan Seto
76ee860ece Simplify the upstart example in host_integration.rst
Taking some pointers from @tianon on my pull request #2685.
2013-11-18 16:21:03 -05:00
Michael Crosby
94e854823f Use tryRelocate to fall back to symlink if rename fails 2013-11-18 13:16:28 -08:00
Guillaume J. Charmes
e42b574579 Merge pull request #42 from alexlarsson/dm-plugin-archive-test-skip
Mark archive.TestApplyLayer as skipped
2013-11-18 13:10:39 -08:00
Andy Rothfusz
2ae1f29dfe Fixes #2702. Also cleans up formatting and long lines in volumes doc. 2013-11-18 13:09:13 -08:00
Josh Poimboeuf
4b80ec9aae test: remove extra args in TestExitCode
The extra blank argument isn't needed and confuses libvirt.
2013-11-18 15:07:11 -06:00
Josh Poimboeuf
fef41ef7bf test: fix TestRmi race condition 2013-11-18 15:07:06 -06:00
Victor Vieux
f946a486ea Merge pull request #2718 from dotcloud/fix_tmp_dir_never_cleanup
Fix tmp dir never cleanup
2013-11-18 12:20:23 -08:00
Guillaume J. Charmes
e008c7c068 Merge pull request #2743 from tianon/go1.2rc5
Update to go1.2rc5
2013-11-18 12:11:56 -08:00
Andy Rothfusz
669e4bac30 Merge pull request #2729 from SvenDowideit/docker-info-doc
add example for docker info
2013-11-18 11:44:54 -08:00
Andy Rothfusz
f6362fbb0e Merge pull request #2726 from SvenDowideit/docker-history-doc
add example for docker history
2013-11-18 11:43:44 -08:00
Andy Rothfusz
c1cd824570 Merge pull request #2742 from rick/patch-1
Tiny typo cleanup
2013-11-18 11:37:37 -08:00
Michael Crosby
4546832507 Merge pull request #2752 from dotcloud/gofmt_test
Go fmt tests
2013-11-18 11:34:59 -08:00
Andy Rothfusz
b5934711d0 Merge pull request #2724 from SvenDowideit/docker-diff-example
add an example of what to expect from docker diff, and what the 3 codes mean
2013-11-18 11:34:05 -08:00
Victor Vieux
ed8f75d25c gofmt_test 2013-11-18 11:25:13 -08:00
Michael Crosby
cfbd9ea16d Merge pull request #2749 from jpoimboe/dont-forward-SIGCHLD
Do not forward SIGCHLD to container
2013-11-18 11:24:08 -08:00
Michael Crosby
75dd1663e0 Merge pull request #2638 from FreakyDazio/2506-name-conflict-error
More informative error message on name collisions
2013-11-18 11:13:43 -08:00
Darren Coxall
3c67a28493 More informative error message on name collisions
This is the proposed fix for #2506. It provides a more complete message
with regards to name collisions including informing of the opposing
containers ID.

I have included a test to ensure that the correct short id is displayed
to make the message easier to understand.
2013-11-18 17:51:47 +00:00
Josh Poimboeuf
440422a963 don't forward SIGCHLD to container
It makes no sense to forward SIGCHLD to the container.
2013-11-18 11:45:29 -06:00
Josh Poimboeuf
fc2f5758cf fix container restart race condition
Finish container cleanup before setting the state to stopped.
Otherwise, for an application that exits quickly, a call to Restart
can allow Start to be called again before cleanup is done, resulting in
overritten data in the Container struct.
2013-11-18 11:42:30 -06:00
Josh Poimboeuf
fe302fbfd2 test: 2 second timeout (not 2000) 2013-11-18 10:23:30 -06:00
Josh Poimboeuf
72d02ecdde test: skip TestCreate on Fedora due to lxc utils bug
In the dind environment running on a Fedora host, the lxc utils get
confused by the /sys/fs/cgroup/cpuacct,cpu cgroup mount and lxc-start
fails trying to access the wrong cgroup directory.
2013-11-18 10:23:30 -06:00
Josh Poimboeuf
baa687bed2 test: fix TestCreateStartRestartStopStartKillRm
cat needs stdin opened, otherwise it dies immediately.
2013-11-18 10:23:30 -06:00
Josh Poimboeuf
30ea0bebce test: put each arg in a separate string
Each arg to docker run should be placed in a separate string.
Otherwise, when starting the command via exec.Cmd, the command is
interpreted as "echo test", which can't be found.
2013-11-18 10:23:06 -06:00
Alexander Larsson
8ed4307f50 Mark archive.TestApplyLayer as skipped
Instead of just returning we call Skip to log that the test
was skipped.
2013-11-18 14:31:34 +01:00
Tianon Gravi
9e1da3ec9c Update to go1.2rc5 2013-11-17 22:36:26 -07:00
Rick Bradley
b76574f855 Tiny typo cleanup 2013-11-17 21:10:06 -08:00
Tianon Gravi
457375ea37 Merge pull request #2732 from jplock/patch-2
Fix images not being properly tagged in mkimage-debootstrap.sh
2013-11-17 08:06:58 -08:00
Frederik Loeffert
7e580aacec Vagrantfile modified to support VBoxGuestAdditions_4.3.2 2013-11-17 01:20:21 +01:00
Justin Plock
0e64b987e8 Fix images not being properly tagged 2013-11-16 11:05:38 -05:00
Sven Dowideit
bc74f65068 make the docker commit help more copy&pasteable 2013-11-16 21:11:34 +10:00
Sven Dowideit
5c741ef11d add example 2013-11-16 20:53:45 +10:00
Sven Dowideit
152459b727 add some common examples for docker images, and tell the user what -a filters out 2013-11-16 20:45:30 +10:00
Sven Dowideit
f04142c1f7 add example for docker history 2013-11-16 20:36:33 +10:00
Sven Dowideit
af05ab399e add an example of what to expect from docker diff, and what the 3 codes mean 2013-11-16 20:26:47 +10:00
Sven Dowideit
27159ce6ba expunge the word 'Resource' in reference to a file/dir in a CONTAINER - that way users don't wonder how its different from a Path 2013-11-16 20:15:04 +10:00
Michael Crosby
51576069ad Merge pull request #2694 from shykes/separate-integration-tests
Separate integration tests
2013-11-15 18:21:34 -08:00
Andy Rothfusz
d33ffe44a9 Fixes #2701. Adds security section. 2013-11-15 18:12:35 -08:00
Solomon Hykes
afe230718e Re-enable api integration tests using only public remote API. 2013-11-16 02:12:14 +00:00
Michael Crosby
427649eee1 Merge pull request #40 from shykes/creack-0.6.5-dm-plugin
Rename gograph and move drivers to sub pkg
2013-11-15 17:31:50 -08:00
Guillaume J. Charmes
a518b84751 WIP 2013-11-15 17:16:30 -08:00
Victor Vieux
9261690593 Fix tmp dir never cleanup 2013-11-15 16:23:55 -08:00
Guillaume J. Charmes
cbd1281ec9 rename gograph in graphdb 2013-11-15 15:55:45 -08:00
Guillaume J. Charmes
035c144242 Move all drivers to the same subdir graphdriver 2013-11-15 15:48:24 -08:00
Guillaume J. Charmes
fb245f7903 Merge pull request #38 from crosbymichael/add-container-driver
Save driver to container and skip incompat containers
2013-11-15 14:20:19 -08:00
Guillaume J. Charmes
dc5b7b32c3 Merge pull request #36 from crosbymichael/unlink-init-files
Unlink docker init files
2013-11-15 14:09:51 -08:00
Andy Rothfusz
e12bba66ea Merge pull request #2709 from eugenkrizo/patch-1
path needs to be specified to 'docker build' command
2013-11-15 13:34:08 -08:00
Andy Rothfusz
92c3a319fb Merge pull request #2713 from eugenkrizo/patch-2
port published explicitly (for docker 0.6.6)
2013-11-15 13:32:18 -08:00
Andy Rothfusz
323e86032d Merge pull request #2685 from Painted-Fox/patch-1
Add more depth to the upstart example in host_integration.rst
2013-11-15 12:28:07 -08:00
Victor Vieux
c06d903edd bring back tests about LXCConfig 2013-11-15 11:48:18 -08:00
Andy Rothfusz
9a9d3239e1 Fix typos, add links, streamline content of #2592 2013-11-15 11:38:03 -08:00
Andy Rothfusz
33110ddc3f Merge branch 'fix_examples_use_docs' of git://github.com/rogaha/docker into test-2592 2013-11-15 11:15:14 -08:00
Andy Rothfusz
6341768393 Merge pull request #2689 from metalivedev/fix-syntax
Clean up sphinx syntax
2013-11-15 11:09:51 -08:00
Victor Vieux
ad96d5ff04 Merge pull request #2712 from makinacorpus/master
Do not drop sys_boot
2013-11-15 10:33:41 -08:00
Michael Crosby
7cad77b1e2 Merge pull request #33 from alexlarsson/dm-plugin-status
Add driver plugin status
2013-11-15 10:15:59 -08:00
Guillaume J. Charmes
2b23da1d2f Merge pull request #34 from alexlarsson/dm-plugin-dummy-volumes
Use dummy driver for volumes
2013-11-15 09:41:16 -08:00
Guillaume J. Charmes
bcf96d95bc Merge pull request #30 from alexlarsson/dm-plugins-archive-tests
Dm plugins archive tests
2013-11-15 09:38:17 -08:00
eugenkrizo
492ce4c665 port published explicitly (for docker 0.6.6)
port 5984 to couchdb needs to be published explicitly in docker version 0.6.6
2013-11-15 17:12:48 +01:00
Mathieu Le Marec - Pasquet
76ab8fa00f Merge pull request #1 from jpetazzo/2392-add-kernel-docs
Add warning about SYS_BOOT capability with pre-3.4 kernels and pre-0.8 LXC.
2013-11-15 07:58:54 -08:00
eugenkrizo
007964793d path needs to be specified to 'docker build' command
current folder '.' appended as a path
2013-11-15 16:16:59 +01:00
Alexander Larsson
10f23a94f6 Use dummy driver for volumes
It makes no sense to use the aufs or devicemapper drivers for volumes.
The aufs one is perhaps not a big problem, but the devicemapper one
certainly is. It will be unnecessarily using a dm
blockdevice-over-loopback with a limited size base FS.

This just hardcodes the driver to be the dummy, perhaps in the future
we can have other drivers that make sense for the volumes.
2013-11-15 11:30:28 +01:00
Alexander Larsson
243843c078 Print devicemapper status details in docker info
This adds a generic Status call in the Driver api and
implements if for the devicemapper backend.

The status is an array of key/value strings rather than a map so that
we can guarantee some static order of the docker info output.
2013-11-15 11:04:02 +01:00
Alexander Larsson
062810caed Show active driver in docker info output 2013-11-15 10:24:48 +01:00
Alexander Larsson
f7238f94e8 Add tests for the changes detection code
This adds 3 tests:

Verify that ChangesDirs() returns nothing when run on a copy of the
same directory.

Verify that various mutations of a directory get reported with the
right changes.

Verify that ExportChanges() + ApplyLayer() of the above mutation gets
an identical directory.

Unfortunately the last test is disabled because it fails in multiple
ways atm. But I want to get it in so that we can fix it.
2013-11-15 09:49:46 +01:00
Alexander Larsson
d69a6a20f0 Use ExportChanges() in runtime.Diff()
This code was duplicated in two places, one which was unused. This
syncs the code and removes the unused version.
2013-11-15 09:49:42 +01:00
Michael Crosby
4908d7f81d Save driver to container and skip incompat containers
For people who toggle drivers we want to save the driver used
to create a container so that if the driver changes we can skip
loading the container and it should not show up in docker ps
2013-11-14 22:53:59 -08:00
Michael Crosby
29fa1b6666 Unlink docker init files 2013-11-14 21:23:23 -08:00
Andy Rothfusz
bed87ea103 Merge pull request #2690 from codevin/master
Improvise documentation for builder.rst / VOLUME command
2013-11-14 19:23:18 -08:00
Solomon Hykes
823674816e Move iptables test to integration tests 2013-11-15 01:15:39 +00:00
Solomon Hykes
8d3e35cd8d Split auth tests between unit tests and integration tests 2013-11-15 01:13:20 +00:00
Michael Crosby
0c38f86e5e Merge pull request #32 from shykes/shykes-0.6.5-dm-plugin
Merge bug fix from dotcloud/docker master
2013-11-14 16:21:19 -08:00
Guillaume J. Charmes
8a358e8833 Merge branch 'master' into shykes-0.6.5-dm-plugin 2013-11-14 16:18:33 -08:00
Guillaume J. Charmes
84ed18827a Merge pull request #2704 from shykes/fix-auto-pull
Fix the brittle errorstring-to-httperror recognition code
2013-11-14 16:15:46 -08:00
Solomon Hykes
693ff4d2ae Fix the brittle errorstring-to-httperror recognition code which in turn is required by autopull (the client issues a pull if container creation returns 404) 2013-11-14 23:54:28 +00:00
Victor Vieux
596810d8db move TestMount to integration 2013-11-14 15:17:31 -08:00
Victor Vieux
661a8a0e0c fix Integration tests 2013-11-14 14:46:13 -08:00
Michael Crosby
eb06a7b8f8 Merge pull request #31 from shykes/shykes-0.6.5-dm-plugin
Merge from dotcloud/docker master
2013-11-14 14:14:13 -08:00
Guillaume J. Charmes
7cf60da388 Merge branch 'master' into shykes-0.6.5-dm-plugin
Conflicts:
	utils.go
	utils_test.go
2013-11-14 14:02:44 -08:00
Alexander Larsson
006e2a600c ApplyLayer() use RemoveAll to handle removing directories
rmTargetPath can be a directory, so we have to use RemoveAll() or we
will fail to whiteout non-empty directories.
2013-11-14 22:56:18 +01:00
Michael Crosby
eace2dbe1d Merge branch 'dm-plugin-new-ChangesDirs' of https://github.com/alexlarsson/docker into alexlarsson-dm-plugin-new-ChangesDirs
Conflicts:
	archive/changes.go
2013-11-14 12:23:01 -08:00
Michael Crosby
629c6e3649 Merge pull request #2445 from alexlarsson/fix-shared-root-from-dm
Fix lxc start for shared root filesystems
2013-11-14 11:20:53 -08:00
Andy Rothfusz
c7aaf831d7 Merge pull request #2691 from SvenDowideit/add-instruction-path-limitations
except URL-based ADDs
2013-11-14 11:12:08 -08:00
Solomon Hykes
e9624bf715 Remove deprecated tags_test.go 2013-11-14 10:50:43 -08:00
Solomon Hykes
2a209afe5f gofmt 2013-11-14 10:50:43 -08:00
Victor Vieux
c001a5af67 Integration tests: remove dependency on private APIs 2013-11-14 10:50:43 -08:00
Solomon Hykes
359a6f49b9 Move integration tests to integration/, expose missing public methods in the core 2013-11-14 10:50:00 -08:00
Solomon Hykes
099c53b28e Merge pull request #29 from crosbymichael/try-load-aufs
Try to load aufs first then check in filesystems for aufs support
2013-11-14 10:11:19 -08:00
Michael Crosby
7b2d59b91e Try to load aufs first then check in filesystems for aufs support 2013-11-14 09:42:12 -08:00
Guillaume J. Charmes
529c30261e Merge pull request #28 from crosbymichael/close-sparse-files
Close sparse files when done
2013-11-14 07:02:47 -08:00
Frederick F. Kautz IV
7267c4b746 Removing sudo 2013-11-14 05:53:53 +00:00
Frederick F. Kautz IV
26533eb2c4 Adding a makefile 2013-11-14 05:34:25 +00:00
¨Sven
e42144674f thankyou @tomdz - I forgot about URL based ADDs 2013-11-14 14:53:55 +10:00
Vinod Kulkarni
37abc07852 Improvise documentation for builder.rst / VOLUME command 2013-11-14 09:54:31 +05:30
Andy Rothfusz
61abc3f8ac Merge pull request #2688 from dhrp/doc-layout-dotcloud-to-docker-inc
Updated documentation footer to say "Docker Inc." instead of dotCloud. And added Read the Docs.
2013-11-13 18:31:21 -08:00
Andy Rothfusz
5fc56b6b47 Merge pull request #2661 from rogaha/links_docs
- Added a doc about Links and Container Naming
2013-11-13 18:15:25 -08:00
Andy Rothfusz
059950b095 Clean up sphinx syntax, upgrade http markup package, minor link changes, update intro. 2013-11-13 17:45:22 -08:00
Michael Crosby
bbc9fc7907 Close sparse files when done 2013-11-13 17:05:32 -08:00
Michael Crosby
7682ec04cd Merge pull request #27 from shykes/refactor_dm
Add more dm unit tests
2013-11-13 16:50:26 -08:00
Guillaume J. Charmes
590465b395 Merge branch 'shykes-0.6.5-dm-plugin' into refactor_dm 2013-11-13 16:47:37 -08:00
Guillaume J. Charmes
05d70cbcf4 More dm unit tests 2013-11-13 16:46:10 -08:00
Thatcher Peskens
9ab85f4d12 Updated documentation footer to say "Docker Inc." instead of dotCloud. And added link to Read the Docs for giving them credit to hosting us. (Thanks Read The Docs!) 2013-11-13 16:09:23 -08:00
Michael Crosby
539708aa8a Merge pull request #26 from shykes/refactor_dm
Refactor dm
2013-11-13 15:45:58 -08:00
Guillaume J. Charmes
3aaef96e36 Merge branch 'shykes-0.6.5-dm-plugin' into refactor_dm 2013-11-13 15:44:13 -08:00
Guillaume J. Charmes
921e2e9ae2 Merge pull request #25 from crosbymichael/add-aufs-diff-test
Add test for ApplyDiff
2013-11-13 15:43:26 -08:00
Guillaume J. Charmes
b50838c359 Merge pull request #24 from crosbymichael/dm-tests
Add device mapper tests for driver.go
2013-11-13 15:41:59 -08:00
Guillaume J. Charmes
4bebca848e Add devmapper_test.go 2013-11-13 15:35:52 -08:00
Michael Crosby
6b3dd02bb8 Add test coverage for devicemapper driver.go 2013-11-13 14:56:26 -08:00
Michael Crosby
80e7319558 Make sure setInitialized is called when device is mounted 2013-11-13 14:54:47 -08:00
Guillaume J. Charmes
1d188c8737 Create devmapper_wrapper.go 2013-11-13 14:36:31 -08:00
Andy Rothfusz
3cf23b93ea Merge pull request #2679 from FreekKalter/master
fix error in python webapp example
2013-11-13 13:35:01 -08:00
Guillaume J. Charmes
3ba6835ead Merge pull request #2676 from tianon/go1.2rc4
Update to go1.2rc4
2013-11-13 11:45:56 -08:00
Guillaume J. Charmes
dc13b9473f Merge pull request #2686 from shykes/gofmt
gofmt
2013-11-13 11:35:37 -08:00
Solomon Hykes
b00d5f0185 gofmt 2013-11-13 19:25:55 +00:00
Andy Rothfusz
8e71391572 Merge pull request #2660 from SvenDowideit/2601-remote-api-json-case
update the API docs to reflect the change in the case of the /index/search reposnse
2013-11-13 11:17:54 -08:00
Michael Crosby
a69d86e0b1 Add test for ApplyDiff 2013-11-13 11:03:56 -08:00
Andy Rothfusz
077c2496ed Merge pull request #2681 from SvenDowideit/add-instruction-path-limitations
add a little more info about the limitations of ADD wrt ../ and docker build
2013-11-13 10:56:35 -08:00
Guillaume J. Charmes
46ab7d1e8a Merge pull request #15 from alexlarsson/dm-plugin-explicit-init
Remove devicemapper lazy initialization
2013-11-13 10:46:24 -08:00
Tianon Gravi
b94e9ed0de Merge pull request #2652 from tianon/upstart-defaults-too
Add /etc/default/docker support to upstart, too (mirroring sysvinit)
2013-11-13 10:42:41 -08:00
Guillaume J. Charmes
e3597624dd Merge pull request #23 from crosbymichael/ignore-dir-sizes
Ignore dir sizes in TreeSize func
2013-11-13 10:40:03 -08:00
Ryan Seto
02884ee429 Add more depth to the upstart example in host_integration.rst
I found that the original example wasn't starting the docker container when docker is started.  So, I modified it using information I found from https://groups.google.com/forum/#!msg/docker-user/OWz8EOpiXuo/L_uxGFQuYlkJ

Also, upstart wasn't starting docker if it wasn't running ahead of time.  So, I added a change to the docker upstart script to solve this.
2013-11-13 13:34:34 -05:00
Michael Crosby
a4f14528c2 Ignore dir sizes in TreeSize func 2013-11-13 10:33:24 -08:00
Jérôme Petazzoni
8145e57cee Add warning about SYS_BOOT capability with pre-3.4 kernels and pre-0.8 LXC. 2013-11-13 10:29:29 -08:00
Solomon Hykes
c964494d31 Merge pull request #2673 from shykes/engine-patch-2
* Engine: expand the engine API with 'create' and 'start' jobs Edit
2013-11-13 10:14:56 -08:00
Solomon Hykes
c6e83b8779 Merge pull request #2656 from shykes/export-restrictions-debian
Change crypto export notice to meet Debian requirements
2013-11-13 09:37:23 -08:00
Guillaume J. Charmes
369e39aea1 Merge pull request #2680 from inglesp/patch-1
Typo in ROADMAP.md
2013-11-13 09:19:37 -08:00
¨Sven
af0b2e38c3 add a little more info about the limitations of ADD wrt ../ and docker build - 2013-11-13 22:55:55 +10:00
inglesp
87b4bb9fcc Typo in ROADMAP.md 2013-11-13 12:32:49 +00:00
Freek Kalter
f5e6c2d060 fix error in python webapp example
When getting the private port used by a container using
`docker port` returns 0.0.0.0:49353, stript just the portnumber of the address with awk to used it in the rest of the example code.
2013-11-13 13:20:38 +01:00
¨Sven
f0f8462d18 update the v1.7 API to reflect the case change in the /index/search response, and note that its to align better with the registry server response that its proxying 2013-11-13 22:11:20 +10:00
Xiuming Chen
0013aa7d9f Minor code simplification for Containers api 2013-11-13 01:29:00 -08:00
Liang-Chi Hsieh
1d7f22c0d4 use Binds key in hostConfig to detect volumes mounted from external. 2013-11-13 15:08:46 +08:00
Liang-Chi Hsieh
6a693176d6 skip the volumes mounted when deleting the volumes of container. 2013-11-13 14:58:24 +08:00
Tianon Gravi
8523d5518c Update to go1.2rc4 2013-11-12 21:51:12 -07:00
Solomon Hykes
6c4393ccbb Merge branch 'job-create-start-clean' into engine-patch-2
Conflicts:
	engine/engine.go
	engine/job.go
	server.go
	utils_test.go
2013-11-13 00:36:20 +00:00
Solomon Hykes
3885ef585b Merge pull request #2612 from tianon/release-script-tweaks
* Hack: release script tweaks
2013-11-12 15:04:26 -08:00
Victor Vieux
388057f11a Merge pull request #2648 from dotcloud/docker_kill_exit_code
Make sure docker kill exit with failure in case of error
2013-11-12 14:40:17 -08:00
Michael Crosby
a06edd77e5 Merge pull request #22 from shykes/shykes-0.6.5-dm-plugin
Fix ImageTree test
2013-11-12 12:30:30 -08:00
Guillaume J. Charmes
c69e6a90e4 Merge pull request #2663 from viirya/fix_nameserver_regex
Fix nameserver regex
2013-11-12 12:29:40 -08:00
Guillaume J. Charmes
08623dc216 Fix ImageTree test 2013-11-12 12:25:35 -08:00
Guillaume J. Charmes
50d80a8938 Merge pull request #17 from alexlarsson/dm-plugin-whiteout-directory
archive.ApplyLayer() - handle directory whiteouts
2013-11-12 12:16:30 -08:00
Alexander Larsson
6f3c32eb18 archive.ApplyLayer() - handle directory whiteouts
When directories are white-outed we can get called with the previously
removed directories. Handle this with os.IsNotExist(error).
2013-11-12 21:14:54 +01:00
Guillaume J. Charmes
0dd92d8f1c Merge pull request #21 from crosbymichael/pull-parent-layers
Pull parent layers first before children
2013-11-12 11:50:20 -08:00
Michael Crosby
7301fbe035 Pull parent layers first before children 2013-11-12 11:48:35 -08:00
Guillaume J. Charmes
4ec05b5dbf Merge pull request #20 from crosbymichael/force-driver-to-implement-differ
Force driver to implement differ
2013-11-12 11:48:20 -08:00
Victor Vieux
71c05bb87c Merge pull request #2662 from dotcloud/do_not_cleanup_start_if_running
on docker start, do not cleanup if already running
2013-11-12 11:02:10 -08:00
Victor Vieux
637850063c Merge pull request #2614 from dotcloud/prevent_delete_image_running_container
Runtime: prevent deletion if image is used by a running container
2013-11-12 11:01:51 -08:00
Victor Vieux
dcc9980550 Merge pull request #2657 from dotcloud/fix_docker_images_output
use utils.ParseRepositoryTag instead of strings.split in docker images
2013-11-12 11:01:29 -08:00
Victor Vieux
e405337926 Merge pull request #2669 from tianon/clarify-test-calls
Add clarification of multiple "go test" calls in hack/make/*test
2013-11-12 10:42:24 -08:00
Tianon Gravi
5cdb3aec50 Add clarification of multiple "go test" calls in hack/make/*test 2013-11-12 11:23:06 -07:00
Victor Vieux
b314f19db8 Merge branch 'tests/insert' of https://github.com/mrallen1/docker into mrallen1-tests/insert
Conflicts:
	server.go
2013-11-12 10:19:29 -08:00
Roberto Gandolfo Hashioka
353243a725 - Improved documentation and typos fixing (Thanks to @jamtur01) 2013-11-12 10:11:52 -08:00
Liang-Chi Hsieh
879aa29cb0 modify test of GetNameserversAsCIDR for its regex change. 2013-11-12 18:18:30 +08:00
Michael Crosby
5d9723002b Allow drivers to implement ApplyDiff in Differ interface 2013-11-11 19:09:57 -08:00
Liang-Chi Hsieh
1e5ba57de3 fix nameserver regex. 2013-11-12 10:53:34 +08:00
Victor Vieux
bc6d872841 on docker start, do not cleanup if already running 2013-11-11 18:15:38 -08:00
Roberto Gandolfo Hashioka
981560c436 - Added a doc about Links and Container Naming 2013-11-11 17:38:54 -08:00
Victor Vieux
d589cc3622 Merge pull request #2527 from jpoimboe/fedora-iptables-fix
Fix container networking on Fedora
2013-11-11 15:12:40 -08:00
Andy Rothfusz
69a9614cb4 Merge pull request #2621 from rogaha/rm_del_all_example
- Added delete all the containers example (docker rm `docker ps -a -q`)
2013-11-11 14:55:50 -08:00
Victor Vieux
e2ac0e6b80 add wait, stop, start, restart, rm, rmi 2013-11-11 14:47:23 -08:00
Michael Crosby
2c7f50a77d Add ability to exclude files from tar 2013-11-11 14:30:38 -08:00
Solomon Hykes
01dd7e7459 Change crypto export notice to meet Debian requirements 2013-11-11 22:08:37 +00:00
Victor Vieux
84a3600ea8 use utils.ParseRepositoryTag instead of strings.split in docker images 2013-11-11 13:54:17 -08:00
Andy Rothfusz
cb9e0aee48 Merge pull request #2646 from fgrehm/contrib-vagrant
Update contrib/vagrant-docker with projects available
2013-11-11 13:49:15 -08:00
Andy Rothfusz
52d3137713 Merge pull request #2641 from artagnon/master
CONTRIBUTING: wrap a couple of long lines
2013-11-11 13:43:30 -08:00
Victor Vieux
4c7d24bc8b Merge branch 'master' of https://github.com/zilin/docker into zilin-master
Conflicts:
	container.go
2013-11-11 12:59:18 -08:00
Victor Vieux
87c8437a90 Merge pull request #2140 from SvenDowideit/2098-run-cidfile-should-return-longid
Server: always return long id's
2013-11-11 13:06:19 -08:00
Daniel Mizyrycki
6fab249b21 Merge pull request #2313 from wazboy/master
Vagrant AWS update
2013-11-11 13:01:20 -08:00
Victor Vieux
da24945070 Merge branch 'master' of https://github.com/aanand/docker into aanand-master 2013-11-11 12:34:16 -08:00
Michael Crosby
4d1a537433 Remove Differ and Changer interfaces
Add the methods to the Driver interface
to force the drivers to implement the methods
2013-11-11 12:10:53 -08:00
Tianon Gravi
ca113bb1b2 Merge pull request #2613 from tianon/ubuntu-fpm-tweaks
Update ubuntu packaging script, especially to stop docker group deletion
2013-11-11 12:01:40 -08:00
Andy Rothfusz
9ff36cb00c Merge pull request #2630 from jamtur01/api_status
Added status column to API client table
2013-11-11 11:56:04 -08:00
Mark Allen
62f873aa1f Just return the id; nothing else. 2013-11-11 13:26:24 -06:00
Tianon Gravi
2091b59721 Merge pull request #2653 from tianon/sysvinit-upstart-check
Update upstart check in sysvinit to be exactly the same as the init_is_upstart function
2013-11-11 11:00:07 -08:00
Tianon Gravi
88edba7e86 Update upstart check in sysvinit to be exactly the same as the init_is_upstart function from /lib/lsb/init-functions (which isn't available in 12.04 or we'd use it directly) 2013-11-11 11:57:25 -07:00
Solomon Hykes
ec6fe9f200 Hack: set NONUKE environment variable to run the tests without cleanup, to investigate temp directories 2013-11-11 18:56:21 +00:00
Tianon Gravi
5fe4c9a39a Merge pull request #2651 from tianon/fix-sysvinit-upstart-logic
Fix sysvinit upstart detection and give it a pretty message
2013-11-11 10:39:51 -08:00
Michael Crosby
2fc0084f6b Merge pull request #2633 from danderson/2598-fix-iptables-anydest
Correctly express "any address" to iptables.
2013-11-11 10:22:02 -08:00
Tianon Gravi
7cf7dda87d Add /etc/default/docker support to upstart, too (mirroring sysvinit) 2013-11-11 11:13:16 -07:00
Tianon Gravi
bb76157d24 Fix sysvinit upstart detection and give it a pretty message 2013-11-11 11:10:19 -07:00
Solomon Hykes
e87c3ea342 Merge pull request #19 from alexlarsson/dm-plugin-Diff-fallback
Implement fallback operation for driver.Diff()
2013-11-11 10:09:12 -08:00
Andy Rothfusz
1d9139bb89 Merge pull request #2574 from crosbymichael/api-port-changes
Update documentation to reflect changes in Config and HostConfig
2013-11-11 09:59:48 -08:00
Guillaume J. Charmes
8149439d95 Make sure docker kill exit with failure in case of error 2013-11-11 09:15:51 -08:00
Guillaume J. Charmes
402a58a75a Fix formatting in tests 2013-11-11 09:05:38 -08:00
Alexander Larsson
e82f8c1661 Implement fallback operation for driver.Diff()
This moves the Diff() operation to a separate Differ interface and
implements a fallback that uses the Changes() results to encode
a diff tar.
2013-11-11 17:46:07 +01:00
Fabio Rehm
9c7a8edddd Update contrib/vagrant-docker with projects available 2013-11-11 13:36:44 -02:00
Alexander Larsson
b6ef4bc952 archive.ChagesDir() - faster and better implementation
This replaces the current version with the latest version from the
dm branch. Advantages in this version:

We only scan each directory tree once, which means less i/o and less chance
of container changes inbetween the two scans causing inconsistencies.

We avoid comparing some fields for change detection:

* Inode
* size-in-blocks
  These can change during a copy operation (e.g. in the dummy backend)
  without needing to actually reflect a change in content or metadata.

* Ctime
  Any copy operation will create a new Ctime value, and there is no
  API to change it to the "source" value.

* size for directories
  The size of a directory doesn't have to be the same just because you
  recreated the same content as another director. Internal details in
  the filesystem may make these different with no "real" change.
2013-11-11 14:51:19 +01:00
Alexander Larsson
b5795749d1 Remove devicemapper lazy initialization
We now always initialize devicemapper on startup, so
no need for the code that did lazy initialization, we
just delete it.
2013-11-11 13:29:27 +01:00
Ramkumar Ramachandra
cf30b85eb1 CONTRIBUTING: wrap a couple of long lines
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-11-11 16:21:34 +05:30
Galen Sampson
ccbb5d3492 Vagrantfile updates.
- Remove the overrides config.vm.box and config.vm.box_url and use
  the same values for all providers.
- Use the same private key path for all providers.  It is still possible
  to set a different private key path through the environment variable
  SSH_PRIVKEY_PATH if desired (your AWS key may be different from your
  Virtualbox key).
- Allow the environment variable AWS_INSTANCE_TYPE to specify the
  instance type of instead of hard coding the AWS instance type as
  't1.micro'.  't1.micro' is still the default if unspecified.
- Use the same environment variables for keys as the Amazon provided EC2
  API tools.  This allows people who already have the EC2 tools set up
  correctly to use 'vagrant up' with less environment configuration
  than before.
- Rewrite the provisioning code.  The goal is to be idempotent and to
  correctly install docker for all providers instead of just virtualbox.
  It will conditionally install the virtualbox guest additions if
  virtualbox is the provider.
- Update the AWS install documentation to reflect the changes.
2013-11-10 23:39:26 -08:00
James Turnbull
5a1bfd9aa9 Added status column to API client table 2013-11-10 12:14:45 -05:00
Mark Allen
8cc19765b4 Edits after code review
Return long image ID
Return streamformatted error or "raw" error
2013-11-10 00:06:55 -06:00
David Anderson
8ba8783bcc Correctly express "any address" to iptables.
Iptables interprets "-d 0.0.0.0" as "-d 0.0.0.0/32", not /0. This
results in the DNAT rule never matching any traffic if not bound
to a specific host IP.

Fixes #2598
2013-11-09 19:40:56 -08:00
Roberto Gandolfo Hashioka
4ec0b51578 - Updated description 2013-11-09 11:08:43 -08:00
Tianon Gravi
7f1b179c67 Fix the display of get.docker.io in Firefox by making our index files text/plain 2013-11-09 02:28:04 -07:00
Sven Dowideit
b3974abe4f make all image ID and container ID API responses use the Long ID (Closes #2098) 2013-11-09 12:16:49 +10:00
Solomon Hykes
948bb29d27 Don't use drivers to store temporary image downloads 2013-11-09 00:53:58 +00:00
Roberto Gandolfo Hashioka
403f9fc357 - Added delete all the containers example 2013-11-08 16:47:42 -08:00
Michael Crosby
1f35531f39 Merge pull request #13 from crosbymichael/fix-volume-mount
Do not pass container information when creating a volume
2013-11-08 16:35:00 -08:00
Michael Crosby
f30c660f6f Merge pull request #12 from crosbymichael/core-driver-test-failures
Core driver test failures
2013-11-08 16:33:53 -08:00
Tianon Gravi
498b6031b1 Update ubuntu packaging script, especially to stop docker group deletion 2013-11-08 17:23:37 -07:00
Michael Crosby
ddb27268c9 Do not pass container information when creating a volume 2013-11-08 16:11:57 -08:00
Andy Rothfusz
f26da9638f Merge pull request #2590 from metalivedev/2585-addphplib
Fix 2585 and clean up warning in contributing.rst
2013-11-08 15:35:24 -08:00
Michael Crosby
1eb00e1d5b Allow drivers to export their own diff 2013-11-08 15:32:50 -08:00
Guillaume J. Charmes
126b17a0ff Merge pull request #2615 from jpoimboe/ghost-networking-fix
setup network when reconnecting to ghost container
2013-11-08 15:31:55 -08:00
Andy Rothfusz
34d294c461 Fix 2585, rebase to master 2013-11-08 15:15:45 -08:00
Victor Vieux
45c2b5dc1a prevent deletion if image is used by a running container 2013-11-08 15:01:01 -08:00
Michael Crosby
9514767587 Allow driver to provide changes if it impl the Changer interface 2013-11-08 14:54:20 -08:00
Tianon Gravi
f56945d71b Update release script to move https://get.docker.io/ubuntu/info to https://get.docker.io/ubuntu/ and provide a backwards-compatibility redirect (same for /builds/info) 2013-11-08 15:45:18 -07:00
Tianon Gravi
b8e7ec1b74 Update release script with proper support for non-*.docker.io bucket URLs 2013-11-08 15:44:52 -07:00
Guillaume J. Charmes
3bbe8ee055 Merge pull request #2611 from seancron/changelog-edit
Removes duplicate changelog entry
2013-11-08 14:39:02 -08:00
Josh Poimboeuf
2448058ee2 setup network when reconnecting to ghost container
Re-adding the line to setup the network when reconnecting to a ghost
container.  It was inadvertently removed by commit
31638ab2ad.
2013-11-08 16:28:41 -06:00
Sean Cronin
ca174ae84d Removes duplicate changelog entry 2013-11-08 17:17:39 -05:00
Victor Vieux
f9dd0da182 Merge pull request #2610 from stapelberg/patch-1
Return “err” instead of “nil” when MkdirAll() fails when binding a volume
2013-11-08 14:00:06 -08:00
Michael Stapelberg
e7fdcc15c5 Return “err” instead of “nil” when MkdirAll() fails when binding a volume 2013-11-08 22:52:10 +01:00
Michael Crosby
f512049c8f Add unit test for child changes diff in aufs 2013-11-08 12:25:17 -08:00
Andy Rothfusz
67b0b97a8f Merge pull request #2526 from metalivedev/2074-AddKnownIssues
Add Known Issue
2013-11-08 12:14:04 -08:00
Michael Crosby
20f690f176 Make sure dirs are created before injecting file 2013-11-08 12:06:15 -08:00
Michael Crosby
6669c86fdf Use tmp dir in driver home 2013-11-08 11:56:34 -08:00
Solomon Hykes
78ef0bd998 Merge pull request #6 from alexlarsson/fix-ApplyLayer-remove
archive.ApplyLayer() remove files recursively
2013-11-08 11:46:55 -08:00
Solomon Hykes
c1563de7a1 Merge pull request #10 from crosbymichael/aufs-fixes
Aufs fixes and driver dir namespaceing
2013-11-08 11:45:45 -08:00
Michael Crosby
08a276986c Name sure drivers are confined into their own dir 2013-11-08 11:36:58 -08:00
Michael Crosby
ed18844613 Implement changes for aufs driver 2013-11-08 11:10:33 -08:00
Michael Crosby
52f31657cc Do not remove mountpoint on umount 2013-11-08 10:17:51 -08:00
Michael Crosby
6d0b3f350e Merge pull request #9 from crosbymichael/fix-aufs-tests
Fix aufs error at startup
2013-11-08 09:55:24 -08:00
Guillaume J. Charmes
310fbe7bb7 Merge pull request #2565 from danielnorberg/master
lock around read operations in graph
2013-11-08 09:34:18 -08:00
Michael Crosby
3f2a5912ee Merge pull request #2593 from dotcloud/2578
Fix mergeConfig with new ports
2013-11-08 09:23:06 -08:00
Michael Crosby
65102d6b36 Merge pull request #2597 from dotcloud/deprecate_separate_tag
Deprecate old tagging format
2013-11-08 09:15:47 -08:00
Michael Crosby
997a32706f Merge pull request #2599 from dotcloud/prevent_panic_wrong_api_use
Prevent panic if you use API in a wrong way
2013-11-08 09:09:03 -08:00
Guillaume J. Charmes
5cf6ad4565 Merge pull request #2584 from dotcloud/docker-ci
docker-ci production sync
2013-11-08 08:24:09 -08:00
Mark Allen
bf8e0277bb Add ImageInsert tests 2013-11-08 00:16:45 -06:00
David Sissitka
5957dd9091 Make "docker insert" errors obvious
Closes #1130
See also #1942
2013-11-08 00:15:19 -06:00
Michael Crosby
51c93c0f33 Fix aufs error at startup
Add String methods to other drivers
2013-11-07 19:02:15 -08:00
Victor Vieux
49d7b87cfc prevent panic if you use API in a wrong way 2013-11-07 18:54:00 -08:00
Solomon Hykes
8c21d2acd3 Set DOCKER_DRIVER to override the choice of driver (aufs, devicemapper or dummy) 2013-11-08 02:49:32 +00:00
Solomon Hykes
1e5c61041f Don't hardcode dependency on aufs in the tests 2013-11-08 02:49:08 +00:00
Solomon Hykes
99210c9c6e Don't rely on drivers for diff and export 2013-11-08 02:48:52 +00:00
Solomon Hykes
1764cf1990 Fix a bug which caused Graph.Register to fail when Graph.Mktemp() returns an existing directory. 2013-11-08 02:13:11 +00:00
Victor Vieux
f417c4b099 Merge branch '1887-allow_ro_volumes-from' of https://github.com/daniel-garcia/docker into daniel-garcia-1887-allow_ro_volumes-from 2013-11-07 17:59:55 -08:00
Solomon Hykes
9afe475edb Merge pull request #8 from crosbymichael/improve-aufs-detection
aufs: Improve aufs detection by looking at proc fs
2013-11-07 17:59:24 -08:00
Michael Crosby
043a576171 Improve aufs detection by looking at proc fs 2013-11-07 17:57:14 -08:00
Solomon Hykes
81674fbbdf New 'dummy' driver uses plain directories and regular copy 2013-11-08 01:52:56 +00:00
Solomon Hykes
0a9df6bc1a Merge pull request #7 from crosbymichael/updated-interfaces
Updated aufs driver for new interface
2013-11-07 17:43:31 -08:00
Guillaume J. Charmes
ef57752bce Deprecate old tagging format 2013-11-07 17:30:51 -08:00
Michael Crosby
12ffead71a Fix test for aufs graph and add aufs driver import 2013-11-07 17:01:57 -08:00
Michael Crosby
b8b509e1c8 Update aufs driver to new interface spec 2013-11-07 16:46:47 -08:00
Solomon Hykes
01990b65a3 Move Change to the archive package 2013-11-07 16:46:47 -08:00
Solomon Hykes
9ae4bcaaf8 Move Change to the archive package, and fix a leftover merge in
Container.Inject()
2013-11-08 00:45:07 +00:00
Solomon Hykes
f1127b9308 gofmt 2013-11-07 23:58:03 +00:00
Guillaume J. Charmes
4f8b6c3283 Merge pull request #2348 from SvenDowideit/2328-docker-events-since-date-string
Use string timestamp for docker events -since
2013-11-07 15:47:41 -08:00
Sven Dowideit
01fea3cf11 Closes #2328 - allow the user to specify a string timestamp (not just a unix epoch) in the string format that the docker cli shows to the user 2013-11-08 09:32:13 +10:00
Solomon Hykes
165d1bdbc0 Merge branch 'master' into 0.6.5-dm-plugin
Conflicts:
	container.go
	runtime.go
2013-11-07 23:26:52 +00:00
Roberto Gandolfo Hashioka
eba3c36b38 - Included the sudo alternative as an example_header 2013-11-07 14:44:07 -08:00
Solomon Hykes
4a8a7d4edd devmapper: port to the new driver API and reactivate driver 2013-11-07 22:41:55 +00:00
Solomon Hykes
f2bab1557c Simplify graphdriver interface: Create, Get. No more external mounting or Dir/Image interface 2013-11-07 22:38:50 +00:00
Victor Vieux
49c4231f07 fix mergeConfig with new ports 2013-11-07 14:31:25 -08:00
Josh Poimboeuf
ec4657b28a network: add iptables rules to explicitly allow forwarding
Explicitly enable container networking for Fedora and other distros that
have a REJECT all rule at the end of their FORWARD table.
2013-11-07 16:23:39 -06:00
Roberto Gandolfo Hashioka
304d39cc50 - Fix the attach examples according to the new attach behavior
- Add the option of adding the user to docker's group and avoid the usage of "sudo" before each command
2013-11-07 14:06:49 -08:00
Alexander Larsson
484804abff archive.ApplyLayer() remove files recursively
Some aufs metadata are directories, and whiteouts can be for
directories, so use os.RemoveAll() for these.
2013-11-07 22:46:44 +01:00
Michael Crosby
cd4f7321c9 Merge pull request #2589 from dotcloud/gofmt
Go fmt
2013-11-07 12:32:58 -08:00
Solomon Hykes
a63ff8da46 Fix a crash in graphdriver init 2013-11-07 20:31:50 +00:00
Solomon Hykes
77ae9789d3 Internal cleanup: use the mounted container filesystem instead of manipulating the aufs layers directly 2013-11-07 20:30:56 +00:00
Michael Crosby
132db329d4 Merge pull request #2591 from dotcloud/fix_Assign_id_as_name_when_all_else_fails
Fix Assign id as name when all else fails
2013-11-07 12:29:02 -08:00
Guillaume J. Charmes
6998c3c387 go fmt 2013-11-07 12:27:33 -08:00
Victor Vieux
26f846bf77 fix Assign id as name when all else fails 2013-11-07 12:23:29 -08:00
Andy Rothfusz
97c3de7e6b Fix 2585 and clean up warning in contributing.rst 2013-11-07 12:20:23 -08:00
Michael Crosby
b5c984f9b4 Merge pull request #2561 from dotcloud/add_iptabled_errors
Make iptable return an error in case of output
2013-11-07 09:15:09 -08:00
Daniel Mizyrycki
249f76bebd docker-ci 0.4.5: Sync tests with progress in docker and docker-registry. Use revamped shiny DinD. 2013-11-06 20:05:26 -08:00
Daniel Mizyrycki
e7df38dbd0 docker-ci 0.40. Migrate docker-ci to Digital Ocean. 2013-11-06 19:13:58 -08:00
Daniel Mizyrycki
efb4c800a7 docker-ci 0.37. Patch hack/dind with latest code for docker-test. 2013-11-06 19:13:58 -08:00
Daniel Mizyrycki
0cbeda7391 docker-ci 0.36. Patch hack/dind with latest code for nightly release to work. 2013-11-06 19:13:58 -08:00
Daniel Mizyrycki
1717227636 docker-ci 0.35. Push docker coverage and testing into docker-ci production. Update docker nightlyrelease 2013-11-06 19:13:58 -08:00
Daniel Mizyrycki
50dd9791f7 testing infrastructure, issue #1800: Refactor docker testing using Docker in Docker 2013-11-06 19:13:58 -08:00
Andy Rothfusz
9990db2f5a Fix bold 2013-11-06 18:07:55 -08:00
andy diller
2d1155407a updated create, showing how to set expose port and bind to public port for ssh 2013-11-06 18:07:55 -08:00
Andy Rothfusz
37dcff0c13 Merge pull request #2557 from jamtur01/new_redis
Updated Redis service example to use links. Removed "Linking Redis" example as redundant.
2013-11-06 17:54:34 -08:00
Andy Rothfusz
38f1838e82 Merge pull request #2567 from mck-/patch-1
Add -p when running the container (node example)
2013-11-06 17:34:11 -08:00
Andy Rothfusz
807a305f36 Merge pull request #1794 from justone/add-images-tree
add -tree option to images
2013-11-06 16:12:36 -08:00
Victor Vieux
cb1c90975b Merge pull request #2577 from dotcloud/bump_v0.6.6
Bump v0.6.6
2013-11-06 13:41:52 -08:00
Nate Jones
363738b8f2 updating cli help doc for images 2013-11-06 12:03:45 -08:00
Victor Vieux
6d420407ca Merge pull request #2577 from dotcloud/bump_v0.6.6
Bump v0.6.6
2013-11-06 12:03:03 -08:00
Alexander Larsson
157d99a727 lxc: Work around lxc-start need for private mounts
lxc-start requires / to be mounted private, otherwise the changes
it does inside the container (both mounts and unmounts) will propagate
out to the host.

We work around this by starting up lxc-start in its own namespace where
we set / to rshared.

Unfortunately go can't really execute any code between clone and exec,
so we can't do this in a nice way. Instead we have a horrible hack that
use the unshare command, the shell and the mount command...
2013-11-06 20:43:06 +01:00
Victor Vieux
360a694c52 Bump version to v0.6.6 2013-11-06 11:43:02 -08:00
Alexander Larsson
c5bc7d5158 Utils: Add ShellQuoteArguments 2013-11-06 20:39:09 +01:00
Nate Jones
16eba6bbb5 fix /images/json doc for 1.7 2013-11-06 11:30:04 -08:00
Victor Vieux
0dd6c6645b Merge pull request #2568 from mrallen1/fix/1965
See if a path exists before injecting Reader there
2013-11-06 10:57:06 -08:00
Michael Crosby
70f44d5531 Update documentation to reflect changes in Config and HostConfig 2013-11-06 10:01:58 -08:00
Guillaume J. Charmes
45aba3dc95 Merge pull request #2334 from SvenDowideit/2149-small-cli-usability-change
change ID to CONTAINER ID/IMAGE ID
2013-11-06 09:45:23 -08:00
Guillaume J. Charmes
c22ff0296e Merge pull request #1577 from mrallen1/fix/1502
Prevent DNS server conflicts in CreateBridgeIface
2013-11-06 07:52:50 -08:00
Guillaume J. Charmes
00f1398f7a Add debug to iptables 2013-11-06 07:37:43 -08:00
Mark Allen
74f853a2ae See if a path exists before injecting Reader there
Closes #1965
2013-11-05 23:44:52 -06:00
Daniel Norberg
20881f1f78 gograph: allow Walk() reentrance
Hold the read lock while reading the child graph,
then walk over the children without any lock, in
order to avoid deadlock.
2013-11-06 00:18:45 -05:00
Marc Kuo
3108f0526e Add -p when running the container
Without it, docker was not mapping/exposing the private port

Docker version 0.6.5, build 3ff8459
2013-11-05 20:48:16 -08:00
Nate Jones
22ef38ee79 fixup for rebase 2013-11-06 04:23:07 +00:00
Nate Jones
6d5b73c2a6 update "images" documentation 2013-11-06 04:23:07 +00:00
Nate Jones
b7d1d35c27 add image size to -tree 2013-11-06 04:23:07 +00:00
Nate Jones
f1aeac361a adding test for "images -tree" 2013-11-06 04:23:02 +00:00
Nate Jones
d9fe0647cb adding test for "images -viz" 2013-11-06 04:04:24 +00:00
Nate Jones
059bb7a262 make existing tests pass 2013-11-06 03:58:16 +00:00
Nate Jones
ec9a9a08b8 implement "images -tree" 2013-11-06 03:58:16 +00:00
Nate Jones
8f64759881 bring back /images/viz, but 404 for latest 2013-11-06 03:58:15 +00:00
Nate Jones
2a5998baf1 move "images -viz" to client 2013-11-06 03:58:15 +00:00
Nate Jones
dcf0279a50 fix "images -a" 2013-11-06 03:58:15 +00:00
Nate Jones
d7928b9a67 bump api version and ensure backward compat 2013-11-06 03:58:15 +00:00
Nate Jones
15867ff430 rework images JSON 2013-11-06 03:58:15 +00:00
Mark Allen
3560c922b1 Prevent DNS server conflicts in CreateBridgeIface
Retrieve /etc/resolv.conf data (if available)

Add checkNameserverOverlaps and call it to
make sure there are no conflicts

Add utils.GetNameserversAsCIDR and tests

Read /etc/resolv.conf and pull out nameservers,
formatting them as a CIDR block ("1.2.3.4/32")
2013-11-05 21:24:37 -06:00
Daniel Norberg
04aca7c9e3 gograph: Use RWMutex to allow concurrent readers 2013-11-05 22:07:14 -05:00
Guillaume J. Charmes
6113e1d62d Merge pull request #2566 from unclejack/fix_commands_test
fix build for commands_test
2013-11-05 15:45:22 -08:00
unclejack
cdf0cf495d fix build for commands_test 2013-11-06 01:41:54 +02:00
Daniel Norberg
1dc34e2b96 lock around read operations in graph
Writes and reads will fail with ErrBusy if there's
concurrent reads or writes, respectively. It is
not sufficient to only lock around writes.
2013-11-05 18:26:07 -05:00
Solomon Hykes
4d90e91243 Merge branch 'finalize-interfaces' into 0.6.5-dm-plugin 2013-11-05 23:24:46 +00:00
Solomon Hykes
8d6df3a7e2 Remove debug messages 2013-11-05 23:00:20 +00:00
Solomon Hykes
e5f8ab6160 Engine: 'create' creates a container and prints its ID on stdout 2013-11-05 23:00:20 +00:00
Solomon Hykes
5c42b2b512 Fix main() 2013-11-05 23:00:20 +00:00
Solomon Hykes
d3f074494a Better error reporting in engine logs and unit tests 2013-11-05 23:00:20 +00:00
Solomon Hykes
434f06d03d Engine: fix a bug when encoding a job environment to json 2013-11-05 23:00:20 +00:00
Solomon Hykes
5a85456d48 Hack: simplify the creation of test directories 2013-11-05 23:00:16 +00:00
Andy Rothfusz
980eda4c25 Merge pull request #2562 from tchaudhri/patch-1
(doc) Update ubuntulinux.rst
2013-11-05 14:52:07 -08:00
Andy Rothfusz
bf05eb8ac0 Merge pull request #2423 from rogaha/volumes_doc
Added volumes documentation
2013-11-05 14:38:28 -08:00
Tianon Gravi
f3f9f652e1 Merge pull request #2563 from mzdaniel/desktop-integration
contrib: Desktop integration. Firefox usecase.
2013-11-05 14:02:13 -08:00
Victor Vieux
2205bb43ea Merge pull request #2298 from unclejack/2070-validate_src_for_bind_mounts
validate source for bind mounts
2013-11-05 13:31:10 -08:00
Daniel Mizyrycki
5af87d1475 contrib: Desktop integration. Firefox usecase. 2013-11-05 13:21:52 -08:00
unclejack
35430e8920 test: error out when bind mount source doesn't exist
This adds a test to verify that the server is checking whether the path
to be bind mounted actually exists on the server.
2013-11-05 22:54:24 +02:00
unclejack
4d2ba779e1 validate bind mounts on the server side
This changes the server side code to make sure that:
1) the source of a bind mount isn't /
   The bind mount "/:/foo" isn't allowed.
2) Check that the source exists
   The source to be bind mounted must exist.

This fixes issue #2070.
2013-11-05 22:54:24 +02:00
unclejack
f1f39616eb add test to ensure / can't be bind mounted
This adds a test which checks that we're erroring out when we attempt
to bind mount root in a container.
2013-11-05 22:54:24 +02:00
unclejack
4b8c41c4a2 disallow / as source for bind mount in the cli
This makes the docker cli reject docker run commands which include bind
mounts like "/:/some/path/in/the/container".
Bind mounting the root directory is a bad idea and the cli should throw
an error right away.

The same check will also be made by the remote API via another commit.
2013-11-05 22:52:54 +02:00
James Turnbull
e88368b34c Removed redundant linking example 2013-11-05 14:28:57 -06:00
Tehmasp Chaudhri
4d5ecdbeb4 (doc) Update ubuntulinux.rst
small grammar changes - hopefully not worse than original :)
2013-11-05 12:08:56 -07:00
Victor Vieux
114e01cdc1 Merge pull request #2554 from dotcloud/copy-config-on-build
Use parent image config in buildfile
2013-11-05 10:54:49 -08:00
Victor Vieux
7f7926525a Merge pull request #2517 from gurjeet/patch-2
Add gurjeet  as an author
2013-11-05 10:52:54 -08:00
Solomon Hykes
02ddaad5d9 Engine: optional environment variable 'Logging' in 'serveapi' 2013-11-05 18:39:59 +00:00
Solomon Hykes
4e7cb37dcc Engine: improved logging and identification of jobs 2013-11-05 18:39:59 +00:00
Solomon Hykes
ca6f0aa107 Engine: don't export private testing utilities 2013-11-05 18:39:59 +00:00
Solomon Hykes
847411a1ee Engine: fix a bug which caused handlers to be shared between multiple engine instances 2013-11-05 18:39:59 +00:00
Solomon Hykes
7b17d55599 httpapi: don't create a pidfile if it isn't set in the configuration 2013-11-05 18:39:59 +00:00
Solomon Hykes
958b4a8757 Engine: 'start' starts the specified container 2013-11-05 18:39:59 +00:00
Andy Rothfusz
714acf5ade Merge pull request #2559 from pattichen/master
Fix typo
2013-11-05 10:30:15 -08:00
Andy Rothfusz
962a66cd36 Merge pull request #2460 from SvenDowideit/2294-use-repo-colon-tag-everywhere
covert docker (commit|import|tag) to use REPOSITORY[:TAG]
2013-11-05 10:29:54 -08:00
Daniel Garcia
f9cb6ae46a Add ability to mount volumes in readonly mode using -volumes-from 2013-11-05 11:58:51 -06:00
Solomon Hykes
433c8e9c7d Separate a) initialization of the http api and b) actually serving the api into 2 distinct jobs 2013-11-05 17:41:37 +00:00
Solomon Hykes
140da580d4 Merge pull request #2 from tianon/dm-plugin-dockerfile
Hack: Add lvm2 static compilation to Dockerfile
2013-11-05 09:35:03 -08:00
Guillaume J. Charmes
ff8a4ba0aa Check the output of iptables command. 2013-11-05 08:33:13 -08:00
Victor Vieux
dcaaecc815 Merge pull request #2558 from tianon/go-bump
Bump Dockerfile to go1.2rc3
2013-11-04 23:39:10 -08:00
pattichen
2cac813937 Fix typo 2013-11-04 22:36:57 -08:00
Michael Crosby
ed572b457d Finalize driver interfaces 2013-11-04 20:51:12 -08:00
Tianon Gravi
fcc0ac6109 Bump Dockerfile to go1.2rc3 2013-11-04 21:12:18 -07:00
Victor Vieux
c5d4459a02 Merge pull request #2502 from hamo/unlink_err_v4
rewrite protocol check with switch-case in Server.Daemon
2013-11-04 17:46:46 -08:00
James Turnbull
1182797c6d Updated Redis service example to use links 2013-11-04 19:18:37 -06:00
Victor Vieux
a482bfd715 Merge pull request #2382 from dotcloud/reflect_future_changes_search_api
Update docker search to reflect future changes of the api
2013-11-04 16:14:14 -08:00
Solomon Hykes
66bf395e4d Merge branch 'dm-plugin-dockerfile' into 0.6.5-dm-plugin 2013-11-04 23:41:23 +00:00
Tianon Gravi
8ad46ef401 Merge pull request #2365 from tianon/sysvinit-consistency
Update sysvinit script to fix a few inconsistencies and be more useful/correct downstream
2013-11-04 15:34:51 -08:00
Victor Vieux
854cc5f559 remove column size hack 2013-11-04 15:34:51 -08:00
Solomon Hykes
5bad7d7229 Merge pull request #1 from crosbymichael/register-plugins
Add graph driver registration
2013-11-04 15:25:57 -08:00
Michael Crosby
752bfba2c5 Add graph driver registration 2013-11-04 15:22:34 -08:00
Tianon Gravi
d11f75b505 Add libdevmapper static compilation to Dockerfile for device-mapper 2013-11-04 16:11:33 -07:00
Tianon Gravi
24dd838aee Update Dockerfile to consistently use tabs as the command argument separator 2013-11-04 15:39:16 -07:00
Michael Crosby
57cd17f656 Merge pull request #2499 from dotcloud/2414-logs_tty-fix
Fix logs with tty
2013-11-04 14:22:08 -08:00
Michael Crosby
99141ea3ca Use parent image config in buildfile 2013-11-04 13:20:14 -08:00
Roberto Gandolfo Hashioka
3061e9f374 - Removed some unconfirmed info
- Added reference to the index.rst
2013-11-04 13:16:51 -08:00
Andy Rothfusz
19ad299600 Merge pull request #2534 from jamtur01/examples_fixes
A variety of syntax and style fixes for the Docker examples
2013-11-04 12:35:57 -08:00
Victor Vieux
177a2f5946 add CmdLogs test 2013-11-04 12:23:35 -08:00
Victor Vieux
1f44fd8624 Fix logs with tty 2013-11-04 12:19:20 -08:00
Guillaume J. Charmes
c065e564fb Merge pull request #2549 from dotcloud/ensure-container-name
Ensure container name on register
2013-11-04 12:12:42 -08:00
Guillaume J. Charmes
342bd43b76 Merge pull request #2525 from dotcloud/fix_hostnames
Fix regression in /etc/hosts
2013-11-04 11:26:27 -08:00
Guillaume J. Charmes
b380866f44 Merge pull request #2551 from dotcloud/concurrent-db-access
Add lock around write operations in graph
2013-11-04 11:24:59 -08:00
Andy Rothfusz
dc333878d2 Merge pull request #2533 from jamtur01/add_sudo
Some format and syntax changes.
2013-11-04 11:24:51 -08:00
Guillaume J. Charmes
261c2e23d3 Merge pull request #2501 from dotcloud/2480-check_port-fix
check port is valid
2013-11-04 11:23:55 -08:00
Michael Crosby
957db15ef4 Add lock around write operations in graph
The graph uses a persistent database connection so
a lock is required because our current sqlite3 driver
does not implement retry logic when the ErrBusy is received.
2013-11-04 10:28:38 -08:00
Michael Crosby
a9ed238bb7 Ensure container name on register 2013-11-04 09:28:40 -08:00
Solomon Hykes
98c3693acf Integrate devmapper and aufs into the common "graphdriver" framework.
aufs is still enabled by default, no mechanism for switching drivers
yet.
2013-11-04 17:28:35 +00:00
Solomon Hykes
6c77f2c189 devmapper: rename plugin*.go to driver*.go 2013-11-04 17:23:46 +00:00
Solomon Hykes
b77c5c5984 devmapper: renamed DMBackend to Driver 2013-11-04 17:22:43 +00:00
Michael Crosby
35690e76b4 Merge pull request #2409 from pnasrat/2089-fix-restart-runtime-error
Fix restart runtime error with ghost container networking
2013-11-04 08:55:11 -08:00
Michael Crosby
2a0efb2324 Merge pull request #2427 from thequux/send-headers-immediately
Make /events API send headers immediately
2013-11-04 08:49:27 -08:00
Michael Crosby
a4ccbc6e95 Merge pull request #2542 from oguzbilgic/changelog-0.6.5
Remove duplicate titles in changelog entries of v0.6.5
2013-11-04 08:25:22 -08:00
Michael Crosby
2824b05235 Merge pull request #2537 from jamtur01/more_names
Added some more colors and animals to increase the pool
2013-11-04 08:23:23 -08:00
Michael Crosby
3cd4232e52 Merge pull request #2541 from shykes/graph-backend-rename
Rename graph backends to 'drivers' which is probably more self-explanatory
2013-11-04 08:22:07 -08:00
Oguz Bilgic
fbfb7595b1 Remove duplicate titles in changelog entries of v0.6.5 2013-11-04 08:20:05 -05:00
Sven Dowideit
b840b73b08 tiny table heading tweak for #2149 - change ID to CONTAINER ID/IMAGE ID or IMAGE (the later if it could be an ID or a repo:tag 2013-11-04 22:10:51 +10:00
Sven Dowideit
1f3cdc11ee conert docker (commit|import|tag) to use REPOSITORY[:TAG] (and repove support for REPOSITORY TAG) 2013-11-04 22:07:55 +10:00
Solomon Hykes
ff42748bc5 Rename graph backends to 'drivers' which is probably more self-explanatory 2013-11-04 01:54:51 +00:00
Paul Nasrat
95708dd35c Create new network on dead ghosts on restart.
Fixes #2089
2013-11-03 14:13:18 -05:00
James Turnbull
a51fb4dd35 Added some more colors and animals to increase the pool 2013-11-03 11:49:29 -06:00
Paul Nasrat
4cbb6ce13b Introduce failing test case for #2089 2013-11-03 11:14:59 -05:00
James Turnbull
1cb4557cc8 A variety of syntax and style fixes for the Docker examples
* Made Docker a proper noun when needed.
* Fixed code syntax
* Fixed some whitespace issues
* Fixed some typos and grammar
* Tidied up some examples
2013-11-02 18:26:52 -07:00
James Turnbull
c33d26a8da Some format and syntax changes.
* Added sudo as per convention to docker commands
* Break the Dockerfile block up
* Redis is a proper noun
* Minor whitespace fixes
2013-11-02 17:53:44 -07:00
Solomon Hykes
d23b9e8734 devmapper: implement OnRemove 2013-11-02 21:25:06 +00:00
Andy Rothfusz
5a9adfe9fb Add known issues. Fix build warnings. 2013-11-01 16:06:46 -07:00
Victor Vieux
f3685333c0 fix regression in /etc/hosts 2013-11-01 15:46:26 -07:00
Victor Vieux
fc45535197 Merge pull request #2503 from dotcloud/2500-inspect-fix
Client: Inspect fix
2013-11-01 15:24:05 -07:00
Victor Vieux
8f27e23b4b Merge pull request #2457 from dotcloud/2454_do_not_split_last_column
RemoteAPI: Do not split last column docker top
2013-11-01 15:21:47 -07:00
Andy Rothfusz
4194617bfe Add known issues to sections via new "issues" extension. 2013-11-01 15:15:06 -07:00
Victor Vieux
d8bcd1c231 Merge pull request #2497 from dotcloud/jpetazzo-escape-apparmor-confinement
Runtime: escape apparmor confinement
2013-11-01 15:07:54 -07:00
Andy Rothfusz
f6b4a1ec95 Merge pull request #2521 from jamtur01/porttypo
Fixed 127.0.0.0 typo in cli.rst
2013-11-01 14:08:27 -07:00
Victor Vieux
7ddd4fe66a rebase 2013-11-01 14:01:32 -07:00
James Turnbull
dcf4633e95 Fixed 127.0.0.0 typo in cli.rst 2013-11-01 14:00:02 -07:00
Andy Rothfusz
b30dc8c3ea Merge pull request #2510 from GrilloPress/patch-1
Update windows.rst
2013-11-01 13:56:23 -07:00
Andy Rothfusz
feef16bd88 Merge pull request #2512 from dudebout/correct-basics-doc
Corrects the TCP section of the basics use
2013-11-01 13:55:28 -07:00
Victor Vieux
f9901ead06 use a symlink instead of a copy 2013-11-01 13:55:19 -07:00
Jérôme Petazzoni
31638ab2ad Refactor HostConfig and escape apparmor confinement 2013-11-01 13:55:19 -07:00
Andy Rothfusz
33d8c736fc Merge pull request #2479 from dudebout/port-redirection-doc
Port redirection doc
2013-11-01 13:43:53 -07:00
Solomon Hykes
d2c2c2c116 devmapper: rename Create() to OnCreate(), cleanup tests 2013-11-01 19:30:30 +00:00
Solomon Hykes
d64df7c765 Work In Progress: fix devmapper plugin, first independent test passes. 2013-11-01 19:04:08 +00:00
Gurjeet Singh
9ebac49be0 Add myself as an author 7e09c633
One of my patches was incorporated into Docker, and at that time I didn't know that I was supposed to add myself into this list of contributors.

Commit ID: 7e09c6332d

And a few other patches are already in the pipeline.
2013-11-01 12:31:50 -05:00
Michael Crosby
65ba2868d7 Merge pull request #2492 from dotcloud/publish-all-flag
Add -P flag to publish all exposed ports
2013-11-01 10:21:02 -07:00
Dan Hirsch
a963ff5d8d Added explicit Flush method to utils.WriteFlusher 2013-11-01 13:11:21 -04:00
Nicolas Dudebout
c0e51a8f27 Rework the port direction documentation
+ remove PUBLIC and PRIVATE keywords
+ add the <host_interface>
+ add the -expose flag through a simple link example
+ update the meaning of the EXPOSE command
2013-11-01 12:18:04 -04:00
Nicolas Dudebout
f2ebccb5aa Corrects the TCP section of the basics use 2013-11-01 12:14:43 -04:00
Andrew Duckworth
db2e2e831b Update windows.rst
Added further information regarding how to access BIOS menus on Windows machines (laptops). My laptop required restarting to find the options and this information will undoubtedly help other users.
2013-11-01 13:59:25 +00:00
Aanand Prasad
9ee9d2f995 Container memory limit can be specified in kilobytes, megabytes or gigabytes
-m 10  # 10 bytes
    -m 10b # 10 bytes
    -m 10k # 10240 bytes (10 * 1024)
    -m 10m # 10485760 bytes (10 * 1024 * 1024)
    -m 10g # 10737418240 bytes (10 * 1024 * 1024 * 1024)

Units are case-insensitive, and 'kb', 'mb' and 'gb' are equivalent to 'k', 'm' and 'g'.
2013-11-01 12:00:17 +00:00
Solomon Hykes
86dd2473c1 Work In Progress: devmapper backend plugin 2013-11-01 05:06:49 +00:00
Solomon Hykes
318dd33fb7 archive.ApplyLayer(): parse a tar archive as a standard aufs-compatible diff, and apply it on a directory 2013-11-01 05:06:35 +00:00
Solomon Hykes
a5031d47d9 Re-incorporate ChangesDirs() for the use of the devmapper backend,
without changing existing prototypes.

This is a neutral change. The primary aufs backend is still in place
and not affected.
2013-11-01 04:52:39 +00:00
Solomon Hykes
36c7a7ae94 Partial merge of devmapper/ in order to integrate it as a backend
plugin.

The merge is inert, in other words the devmapper code is not called
and the primary aufs backend is untouched.
2013-11-01 04:24:17 +00:00
Solomon Hykes
4dc156252b Merge pull request #2498 from dotcloud/move-archive
Move archive.go to sub package
2013-10-31 20:33:53 -07:00
Victor Vieux
747967b4a4 rebase and add some filters 2013-10-31 19:25:55 -07:00
Victor Vieux
02b5202432 update docker search to reflect future changes of the api 2013-10-31 19:14:11 -07:00
Victor Vieux
7f07ae9e42 check port is valid 2013-10-31 19:00:14 -07:00
Victor Vieux
a89a98e594 fix inspect error message 2013-10-31 18:50:58 -07:00
Yang Bai
7848007c3a rewrite protocol check with switch-case in Server.Daemon 2013-11-01 09:42:44 +08:00
Victor Vieux
40ed10cc32 fix inspect when it returns nothing valid 2013-10-31 18:39:44 -07:00
Michael Crosby
699a1074fb Initial work on moving aufs to a subpackage 2013-10-31 18:07:54 -07:00
Michael Crosby
96d1e9bb5a Move archive.go to sub package 2013-10-31 16:57:45 -07:00
Victor Vieux
e3c49843d7 Merge pull request #2494 from shykes/engine-links
Engine: Minimal, unintrusive implementation of a cleaner Job API.
2013-10-31 16:32:49 -07:00
Tianon Gravi
3e7b9763aa Merge pull request #2496 from philips/patch-1
Update systemd service file with a better description
2013-10-31 14:55:30 -07:00
Brandon Philips
393562340c fix(systemd): provide a better description
Fix-up the docker service file description to declare what the service is not what it does.

When a systemd machine starts up the Description of each unit scrolls by instead of the service's filename. Because the current description doesn't say what it is it isn't very friendly:

```
Oct 31 20:40:49 localhost systemd[1]: Started Update Engine.
Oct 31 20:40:49 localhost systemd[1]: Starting Multi-User System.
Oct 31 20:40:49 localhost systemd[1]: Reached target Multi-User System.
Oct 31 20:40:49 localhost systemd[1]: Starting Easily create lightweight, portable, self-sufficient containers from any application!...
Oct 31 20:40:49 localhost systemd[1]: Started Easily create lightweight, portable, self-sufficient containers from any application!.
```
2013-10-31 14:41:49 -07:00
Andy Rothfusz
d5891f9fb0 Merge pull request #2482 from elee/patch-1
correct assignment of $PORT from docker port output
2013-10-31 12:18:24 -07:00
Andy Rothfusz
09607bb8f6 Merge pull request #2475 from dudebout/patch-2
Fixes the password value in the redis/links example
2013-10-31 12:17:43 -07:00
Andy Rothfusz
35044efce5 Merge pull request #2477 from dudebout/patch-3
Fixes typo in the CLI documentation
2013-10-31 12:17:06 -07:00
Michael Crosby
652f07bb59 Add -P flag to publish all exposed ports 2013-10-31 11:28:30 -07:00
Andy Rothfusz
54024ddd8a Merge pull request #2462 from tlunter/fix_remote_api_doc
Fix formatting on build-an-image-from-dockerfile-via-stdin
2013-10-31 10:56:38 -07:00
Zilin Du
b543516556 Merge remote-tracking branch 'upstream/master'
Conflicts:
	container.go
2013-10-31 10:53:40 -07:00
Michael Crosby
e37a7d4981 Merge pull request #2305 from mzdaniel/1800-testing-dind
Testing infrastructure, issue #1800: Refactor docker testing using Docker in Docker
2013-10-31 09:42:19 -07:00
Nicolas Dudebout
7e7c931d2b Fixes another instant of the password 2013-10-31 08:55:14 -04:00
Todd Lunter
3a14d4c923 Fixed the quoted text 2013-10-31 08:46:16 -04:00
Victor Vieux
15457febbb Merge pull request #2481 from tmc/patch-1
Fix typo in redis doc
2013-10-31 01:24:04 -07:00
Eric Lee
df1621914b correct assignment of $PORT from docker port output
in the example, PORT is assigned to "0.0.0.0:<port>" vs "<port>" as in previous versions of docker (I encountered this documentation discrepancy tonight after installing docker v0.6.5)
2013-10-31 01:08:16 -04:00
Travis Cline
f77bbfca56 Fix typo 2013-10-31 00:07:58 -05:00
Nicolas Dudebout
87a250b711 Fixes typo in the CLI documentation 2013-10-30 23:09:02 -04:00
Nicolas Dudebout
ccc1a5dcfb Fixes the password value in the redis/links example 2013-10-30 22:52:47 -04:00
Victor Vieux
ca2bbe716c add 0.6.5 2013-10-30 19:30:32 -07:00
Oguz Bilgic
13ab83a8a5 Reformat CHANGELOG.md
* Add line after headers
* Remove space before bullet points
* Fix ' character
* Create sub-headers
* Group add fix etc. Upper-case
* Use head to trac current progress
2013-10-30 19:30:32 -07:00
Victor Vieux
429c3108da Merge pull request #2473 from dotcloud/remove-panic-from-name
Assign id as name when all else fails
2013-10-30 19:22:57 -07:00
Victor Vieux
bdbb0371a7 Merge pull request #1536 from griff/envfile
Runtime: Keep env variables out of the command line
2013-10-30 19:20:29 -07:00
Victor Vieux
c1c65f972a Merge pull request #2470 from metalivedev/2369-docuncompress
Documenting decompression behavior.
2013-10-30 19:14:51 -07:00
Victor Vieux
4b8a176ee0 Merge pull request #2432 from SvenDowideit/doc-stop-kill-details
IRC: add SIGTERM and SIGKILL details to docker stop and kill docco
2013-10-30 18:57:07 -07:00
Victor Vieux
4dfa28fb95 Merge pull request #2299 from tmc/master
Client: Add -notrunc and -q flags to docker history
RemoteAPI: Add size to history
2013-10-30 18:52:18 -07:00
Michael Crosby
8227ea35cf Assign id as name when all else fails 2013-10-30 18:31:18 -07:00
Travis Cline
1099d172a2 Add flags to history, add size flag 2013-10-30 19:41:20 -05:00
Brian Olsen
1c3a674444 Fixed problem with variables containing \n.
The /.dockerenv file is now a marshalled json array so that environment
variables with \n and other weird values are supported.
2013-10-31 01:19:32 +01:00
Brian Olsen
25c4c87c86 Support copying value from env with -e option. 2013-10-31 01:19:09 +01:00
Andy Rothfusz
26f4d6bf59 Fix #2369 by documenting decompression behavior. 2013-10-30 16:50:58 -07:00
Brian Olsen
be7eb4bfcb Set environment variables using a file. 2013-10-31 00:48:12 +01:00
Michael Crosby
5eb472025a Merge pull request #2456 from dotcloud/update_release_checklist.md
Update RELEASE-CHECKLIST.md to reflect new changes
2013-10-30 16:38:09 -07:00
Andy Rothfusz
bdd12bb703 Merge pull request #2274 from peterbraden/2137-docs
Re #2137 Note about vagrant dns in the test documentation
2013-10-30 16:32:35 -07:00
Michael Crosby
ef00317a70 Merge branch 'release' back to master 2013-10-30 16:09:02 -07:00
Victor Vieux
3ff845904d set containers comm to true by default 2013-10-30 15:06:28 -07:00
Victor Vieux
ec488fa123 fix warning in build 2013-10-30 15:06:01 -07:00
Michael Crosby
d7fac67e0a Merge pull request #2469 from dotcloud/hotfix_release2
Hotfix changes for default values in 0.6.5
2013-10-30 15:04:38 -07:00
Victor Vieux
f7c40a87f3 set containers comm to true by default 2013-10-30 14:48:19 -07:00
Victor Vieux
ee81405567 fix warning in build 2013-10-30 14:36:38 -07:00
Michael Crosby
23b3747945 Merge pull request #2467 from dotcloud/release_hotfix
0.6.5 hotfixes
2013-10-30 13:21:20 -07:00
Victor Vieux
1c7ca51f32 fix typos 2013-10-30 13:18:48 -07:00
Michael Crosby
1edde0e8a3 Update links and host integration documentation 2013-10-30 13:11:02 -07:00
Victor Vieux
596facd124 fix typos 2013-10-30 13:06:47 -07:00
Victor Vieux
4fd389eee5 fix remove root name and fix error messages 2013-10-30 13:06:43 -07:00
Victor Vieux
6a9fb81c57 improve error message 2013-10-30 13:06:39 -07:00
Victor Vieux
5fb6d6e47c continue build on expose with :, but displays a warning 2013-10-30 13:06:34 -07:00
Michael Crosby
a4d97a4e80 Update links and host integration documentation 2013-10-30 11:59:05 -07:00
Victor Vieux
3362aaa4df fix remove root name and fix error messages 2013-10-30 11:45:11 -07:00
Victor Vieux
8fa6e2b103 improve error message 2013-10-30 11:24:50 -07:00
Victor Vieux
b2503a72f1 continue build on expose with :, but displays a warning 2013-10-30 11:13:10 -07:00
Michael Crosby
bb662bc12c Merge pull request #2466 from dotcloud/hot-fix-restart-public-mappings
Hotfix: Migrate public mappings after upgrade
2013-10-30 09:35:56 -07:00
Michael Crosby
79bf2c2b0e Hotfix: Migrate public mappings after upgrade 2013-10-30 09:02:23 -07:00
Michael Crosby
746ba127bf Hotfix: Migrate public mappings after upgrade 2013-10-30 08:15:12 -07:00
Todd Lunter
e7402ed9cc Fix formatted on build 2013-10-30 08:50:21 -04:00
Victor Vieux
fb4672c52c do not split last column docker top 2013-10-29 19:03:41 -07:00
Victor Vieux
9420e8def7 update RELEASE-CHECKLIST.md to reflect new changes 2013-10-29 15:34:33 -07:00
Michael Crosby
4f6ce1ba9e Merge pull request #2428 from dotcloud/bump_0.6.5
Bump to version 0.6.5
2013-10-29 14:56:54 -07:00
Victor Vieux
2a9c18af52 Merge pull request #2453 from dotcloud/remove_logs_from_tests
Testing: remove some logs from tests
2013-10-29 14:43:37 -07:00
Victor Vieux
86970d00bb remove some logs from tests 2013-10-29 14:42:34 -07:00
Michael Crosby
da054148dc Bump to version 0.6.5 2013-10-29 14:42:20 -07:00
Michael Crosby
0174951195 Merge branch 'master' into bump_0.6.5 2013-10-29 14:41:47 -07:00
Michael Crosby
caa7cf14c0 Merge pull request #2426 from dotcloud/enable_sigproxy_default
Enable sig-proxy by default in run and attach
2013-10-29 14:39:17 -07:00
Victor Vieux
700a71e6b6 stop proxy at one point 2013-10-29 14:29:01 -07:00
Andy Rothfusz
02e0fdee57 Merge pull request #2429 from SvenDowideit/add-more-doc-pointers
tell potential doc updaters and contributors more details
2013-10-29 14:07:12 -07:00
Andy Rothfusz
baf23d3c3e Merge pull request #2443 from tlunter/fix_remote_api_doc
Container commit doesn't use a query parameter, uses POST body
2013-10-29 14:04:22 -07:00
Michael Crosby
5b75aea704 Merge pull request #2449 from tianon/remove-stackbrew-remnants
Remove old remnants of stackbrew now that it's a separate project
2013-10-29 14:00:33 -07:00
Michael Crosby
d91e145332 Merge pull request #2448 from keeb/fix-dsfg-readme
Fix export clause in readme
2013-10-29 13:44:03 -07:00
Michael Crosby
1384db5e7f Merge pull request #2451 from tianon/clarify-go-requirement
Clarify Go 1.2rc2 / Go 1.1.2 requirements in hack/PACKAGERS.md
2013-10-29 13:41:01 -07:00
Tianon Gravi
ff147707b2 Clarify Go 1.2rc2 / Go 1.1.2 requirements in hack/PACKAGERS.md 2013-10-29 13:41:26 -06:00
Tianon Gravi
05430c7170 Merge pull request #2433 from tianon/sqlite-dep
Add SQLite dep to hack/PACKAGERS.md
2013-10-29 12:27:26 -07:00
Tianon Gravi
eb79e8c5dd Remove old remnants of stackbrew now that it's a separate project 2013-10-29 13:14:15 -06:00
Nick Stinemates
b48fc96579 Fix export clause
This makes our clause DSFG acceptable.
2013-10-29 12:06:48 -07:00
Victor Vieux
e0b59ab52b Enable sig-proxy by default in run and attach 2013-10-29 11:18:34 -07:00
Michael Crosby
a6a274f312 Merge pull request #2431 from relateiq/2430-links-ip-env
Expose addr, port, proto env variables when linking, Closes #2430
2013-10-29 11:02:46 -07:00
Todd Lunter
4f5790d104 Update all older docs too 2013-10-29 13:57:42 -04:00
Todd Lunter
70c976de03 Doesn't use a query parameter, uses POST body 2013-10-29 10:17:12 -04:00
Julien Barbier
4947f61c20 Updated dotCloud,Inc. to Docker, Inc. 2013-10-29 06:11:36 -07:00
Scott Bessler
1de23f1b81 Expose IP, port, proto as sep. env vars when linking, Closes #2430 2013-10-28 23:02:28 -07:00
Tianon Gravi
b283900764 Add SQLite dep to hack/PACKAGERS.md and clean up a few other tiny inconsistencies 2013-10-28 21:57:20 -06:00
Sven Dowideit
82f1514895 docker stop sends SIGTERM and SIGKILL, docker kill sends SIGKILL 2013-10-29 13:37:43 +10:00
Sven Dowideit
e47f9984f8 add links to the Dockerfiles as canonical external requirements, add example of building and exposing the docs and simplify the Dockerfile for cacheability 2013-10-29 12:58:58 +10:00
Michael Crosby
b038b0cd44 Merge pull request #2162 from dotcloud/links
Links and Container Naming
2013-10-28 19:24:10 -07:00
Michael Crosby
7e8b2c3836 Make sure only links are removed and not names 2013-10-28 19:19:31 -07:00
Dan Hirsch
dd9f4524d1 Make /events API send headers immediately
Go's net/http API does not send headers until the first call to
ResponseWriter.Write().  Ordinarily, this is fine, because in most
cases, responses are returned immediately.  However, for the events
API, nothing is written until some event is sent, which causes
timeouts and/or hangs in some HTTP client APIs, which wait for headers
before returning from the "make request" call.
2013-10-28 21:39:21 -04:00
Michael Crosby
a52e23c5e4 Merge pull request #2425 from dotcloud/links-allow-name
Add -name for docker run
2013-10-28 18:16:06 -07:00
Michael Crosby
0d2924408b Add -name for docker run
Remove docker link
Do not add container id as default name
Create an auto generated container name if not
specified at runtime.
2013-10-28 18:09:08 -07:00
rogaha
91d721aaf4 - Added volumes documentation 2013-10-28 17:24:03 -07:00
Andy Rothfusz
76afb6e73d Merge pull request #2421 from dudebout/patch-1
Fixes the flags for nc in example
2013-10-28 17:01:53 -07:00
Victor Vieux
c0662488c7 Merge pull request #2422 from dotcloud/links_names_generator
Add name generator for container without -name
2013-10-28 15:34:16 -07:00
Victor Vieux
971cf56d89 add name generator 2013-10-28 15:19:52 -07:00
Tianon Gravi
865649d7ac Update sysvinit script to fix a few inconsistencies and be more useful/correct downstream 2013-10-28 14:08:21 -06:00
Nicolas Dudebout
50bb4a1636 Fixes the flags for nc
The `-p` flag for `nc` should not be used with `-l`.
2013-10-28 15:48:18 -04:00
Andy Rothfusz
3c0c75bbf9 Merge pull request #2413 from rutsky/patch-1
Fix typo
2013-10-28 12:08:04 -07:00
Andy Rothfusz
7f95c7aeec Merge pull request #2417 from rutsky/patch-2
fix typo
2013-10-28 12:07:46 -07:00
Vladimir Rutsky
395a24ffd5 fix typo 2013-10-28 09:35:09 +03:00
Vladimir Rutsky
45d94944f3 Fix typo 2013-10-28 02:45:12 +03:00
Solomon Hykes
a13241d370 Engine: Engine.Job() never fails, to mimic the os/exec API (and make usage less verbose) 2013-10-26 17:49:16 -07:00
Solomon Hykes
e8491ae54c Engine: cleanly log the start and end of each engine job 2013-10-26 17:17:45 -07:00
Solomon Hykes
464ded79fc Close sqlite persistent connection on SIGINT, SITERM or SIGKILL 2013-10-26 14:28:53 -07:00
Solomon Hykes
c1ae1a0e1c Setup daemon pidfile/cleanup in Server.Daemon() instead of main() 2013-10-26 14:26:07 -07:00
Solomon Hykes
c542b2f873 Rename ConfigGetenv to ConfigFromJob 2013-10-26 14:24:25 -07:00
Solomon Hykes
7e691e11b0 Rename 'GraphPath' to the more logical 'Root'. This does not affect users except for a slight text change in the usage messge 2013-10-26 14:24:13 -07:00
Solomon Hykes
1b8eef4efb Engine: centralize checks for supported architectures and kernel versions 2013-10-26 14:21:04 -07:00
Solomon Hykes
2a29bf6245 Engine: basic testing harness 2013-10-26 14:18:28 -07:00
Solomon Hykes
0d1a825137 Minimal, unintrusive implementation of a cleaner Job API.
* Implement a new package: engine. It exposes a useful but minimalist job API.
* Refactor main() to instanciate an Engine instead of a Server directly.
* Refactor server.go to register an engine job.

This is the smallest possible refactor which can include the new Engine design
into master. More gradual refactoring will follow.
2013-10-26 14:18:13 -07:00
Solomon Hykes
60b97576cf Fix build on darwin 2013-10-26 14:14:50 -07:00
Victor Vieux
54d3b4dd28 Merge pull request #2400 from dotcloud/remove_newline_debugf
Removes \n from debugf calls
2013-10-25 18:01:19 -07:00
Victor Vieux
8f39f0b57d Removes \\n from debugf calls 2013-10-25 17:50:40 -07:00
Victor Vieux
d5c7e92a9a fix docker ps display 2013-10-25 17:36:23 -07:00
Michael Crosby
110b944f45 Merge pull request #2399 from dotcloud/fix_race_stdin_cli
Only pass stdin to hijack when needed
2013-10-25 17:32:36 -07:00
Victor Vieux
13c521526d only pass stdin to hijack when needed 2013-10-25 17:17:33 -07:00
Victor Vieux
516cf54843 prevent default name to be deleted and return an error on invalid link 2013-10-25 16:49:49 -07:00
Michael Crosby
356af1540f Ensure child containers are started before parents 2013-10-25 15:13:26 -07:00
Michael Crosby
2e6b241dc7 Add default entity and edge to graph on runtime load 2013-10-25 15:13:26 -07:00
Michael Crosby
94e5081bac Move iptable rules outside of create bridge
This allows the user to toggle enabling and
disabling intercontainer communication when
they run the daemon.
2013-10-25 15:13:26 -07:00
Michael Crosby
e179a24ad5 Update TestLinkEnv for default port 2013-10-25 15:13:25 -07:00
Victor Vieux
da864a845b Remove proto frpm default port 2013-10-25 15:13:25 -07:00
Tianon Gravi
640682d56c Fix "go test -i" to include the proper LDFLAGS and BUILDFLAGS 2013-10-25 15:13:25 -07:00
Victor Vieux
66a159342b update docker port command 2013-10-25 15:13:25 -07:00
Michael Crosby
7c882a8003 Move name parsing logic to GetByName method 2013-10-25 15:13:25 -07:00
Michael Crosby
7d440f70fd Add missing else when checking for linkgraph.db 2013-10-25 15:13:25 -07:00
Solomon Hykes
0c9b319dd0 Hack: fix test and dyntest to correctly use $TESTFLAGS 2013-10-25 15:13:25 -07:00
Michael Crosby
7c08aeeba4 Use persistent connection for links database
Add close method to Runtime and Server to make sure
that any underlying connections are cleaned up
2013-10-25 15:13:25 -07:00
Michael Crosby
7072d2aaca Close connection in Get method 2013-10-25 15:13:25 -07:00
Tianon Gravi
21161dbd51 Add dynbinary and dyntest scripts for building/testing a separate static dockerinit binary
After a nice long brainstorming session with @shykes on IRC, we decided on using a SHA1 hash of dockerinit compiled into the dynamic docker binary to ensure that we always use the two in a perfect pair, and never mix and match.
2013-10-25 15:13:25 -07:00
Tianon Gravi
cf86e2bb22 Rename all cases of "docker-init" to "dockerinit" for consistency 2013-10-25 15:13:25 -07:00
Tianon Gravi
d789750851 Refactor the handling of static-related build flags
This is as discussed with @shykes on IRC
2013-10-25 15:13:25 -07:00
Tianon Gravi
fb8d488896 Add a few small consistency tweaks in hack 2013-10-25 15:13:25 -07:00
Victor Vieux
dbe7d67c18 fix tests 2013-10-25 15:13:25 -07:00
Victor Vieux
6c863b49ef remove docker ls and add docker link in usage and switch to go1.2rc2 2013-10-25 15:13:25 -07:00
Victor Vieux
89fb51f606 fix merge issue and gofmt 2013-10-25 15:13:25 -07:00
Victor Vieux
256b7537e3 no more name encoding 2013-10-25 15:13:25 -07:00
Victor Vieux
c4923757f1 replace == by HasPrefix for names and improve error message 2013-10-25 15:13:25 -07:00
Victor Vieux
387aeb78fb refactor notrunc in commands.go to add names support 2013-10-25 15:13:24 -07:00
Victor Vieux
99a9783abc fix typo in docs 2013-10-25 15:13:24 -07:00
Michael Crosby
0e24db3a68 Updated fixes post rebase from master
Removed test cases that are no longer
applicable with links and the port changes.
Remove test case where a test was hitting an
external ip.
2013-10-25 15:13:24 -07:00
Alexander Larsson
db99966724 Move SysInit to a submodule
This allows docker-init to not import the main docker
module, which means it won't e.g. pick up any sqlite
dependencies.
2013-10-25 15:13:24 -07:00
Alexander Larsson
d063c8d941 Move ListOps to utils submodule
This will be needed for later use in docker-init without a docker
dependency
2013-10-25 15:13:24 -07:00
Alexander Larsson
249f5a65a5 Add a network test
This just tries pinging first 127.0.0.1 and then 8.8.8.8.

We can't ping via a dns name, because libresolv.so is missing
from the test image, so dns resolving doesn't work.
2013-10-25 15:13:24 -07:00
Alexander Larsson
494cd07f72 network: Stop shelling out to /sbin/ip
We have our own netlink version of all the required calls now, so
we can just skip the /sbin/ip dependency.
2013-10-25 15:13:24 -07:00
Alexander Larsson
607c1a520e Use netlink directly instead of /bin/ip in Sysinit
The sysinit code only uses /bin/ip to set a default gateway. This
is pretty easy to do via netlink directly, so we can avoid
the ip dependency.
2013-10-25 15:13:24 -07:00
Alexander Larsson
bf61d41d6c Add netlink submodule
This contains various operations that can replace the use of
shelling out to "ip".
2013-10-25 15:13:24 -07:00
Michael Crosby
ce965b8c43 Add flag for inter-container communication 2013-10-25 15:13:24 -07:00
Solomon Hykes
f7a2f0b937 Typos and FIXMEs 2013-10-25 15:13:24 -07:00
Solomon Hykes
4576d0f802 gograph: fix a bug which caused the unicity of (parent, name) to not be enforced 2013-10-25 15:13:24 -07:00
Michael Crosby
515070d513 Remove docker ls from docs and cli usage 2013-10-25 15:13:24 -07:00
Michael Crosby
1cbdaebaa1 Add links for container relationships and introspection 2013-10-25 15:13:24 -07:00
Michael Crosby
ff567f8729 Merge pull request #2385 from dotcloud/suppress_even_more_warnings_test
Improve tests again, remove warnings and prevent some mount issues
2013-10-25 15:04:56 -07:00
Jérôme Petazzoni
279791bc74 Merge pull request #2378 from tianon/linkify-github-ids
Linkify @github references in the infrastructure README.md
2013-10-25 11:30:25 -07:00
Mathieu Le Marec - Pasquet
b64ce8e33c Do not drop sys_boot
This fixes #2391
2013-10-25 18:41:03 +02:00
Andy Rothfusz
1e704a4ddc Merge pull request #2355 from xdissent/patch-1
Typo in host integration docs
2013-10-24 19:05:22 -07:00
Victor Vieux
31111f61e0 Merge pull request #1963 from rogpeppe/master
Client: Use less reflection in command-line method invocation
2013-10-24 18:03:20 -07:00
Michael Crosby
217b6070f0 Merge pull request #2383 from jpetazzo/cleanup-errclosedpipe-for-stdin
Ignore ErrClosedPipe for stdin in Container.Attach.
2013-10-24 17:18:28 -07:00
Michael Crosby
36c26a0f0f Merge pull request #2384 from dotcloud/suppress_warning_tty_tests
Change logic for tty resize to avoid warning in tests
2013-10-24 16:59:13 -07:00
Victor Vieux
a675e249b1 fix workdir, hostname tests and a bunch on mount issue 2013-10-24 16:57:35 -07:00
Victor Vieux
acc2aec988 remove log 2013-10-24 15:13:47 -07:00
Victor Vieux
0e021ed470 swap cat by top to prevent 2 warnings 2013-10-24 15:06:10 -07:00
Jérôme Petazzoni
b9eb5e04ae Ignore ErrClosedPipe for stdin in Container.Attach.
But pass `err` in the error channel anyway; don't ignore it anymore.
2013-10-24 15:04:58 -07:00
Victor Vieux
0e44864b66 change logic for tty resize to avoid warning in tests 2013-10-24 14:54:04 -07:00
Michael Crosby
e661473bcd Merge pull request #2379 from dotcloud/2377-remove_resize_race-fix
Monitor the tty after starting the container
2013-10-24 12:31:31 -07:00
Tianon Gravi
98c94dd4db Merge pull request #2364 from tianon/sudo-modprobe
Fix install.sh with $sh_c to get sudo/su for modprobe
2013-10-24 11:24:23 -07:00
Victor Vieux
656b66e51b monitor the tty after starting the container 2013-10-24 11:19:06 -07:00
Tianon Gravi
c9375d14fc Linkify @github references in the infrastructure README.md 2013-10-24 11:54:06 -06:00
Michael Crosby
489c370fcc Merge pull request #2367 from dotcloud/remove_useless_exit
Remove useless os.Exit() after log.Fatalf
2013-10-24 09:18:45 -07:00
Tianon Gravi
aa6c99aff6 Merge pull request #2363 from tianon/mkimage-numeric-owner
Update all the mkimage scripts to use --numeric-owner as a tar argument
2013-10-24 06:42:52 -07:00
Victor Vieux
92384649cf remove useless os.Exit() after log.Fatalf 2013-10-24 00:25:55 -07:00
Victor Vieux
c2413889bb Merge pull request #2354 from hamo/refac_parsehost
refactor utils.ParseHost with switch-case, so we can add other proto support easily
2013-10-24 00:22:50 -07:00
Yang Bai
e81da876df let utils.ParseHost return err when errors happen 2013-10-24 13:23:02 +08:00
Tianon Gravi
f0dbdba5c0 Merge pull request #2263 from tianon/hack-release
Update hack/release.sh process to automatically invoke hack/make.sh and bail on building/testing issues
2013-10-23 15:31:16 -07:00
Tianon Gravi
0324e567ad Fix install.sh with $sh_c to get sudo/su for modprobe 2013-10-23 15:48:30 -06:00
Tianon Gravi
ef5cf6c1ec Merge pull request #2226 from tianon/init
Add initial init scripts library and better/safer Ubuntu packaging that works for Debian, too
2013-10-23 14:29:41 -07:00
Tianon Gravi
afaddd04f7 Merge pull request #2306 from tianon/fix-ubuntu-install-aufs
Update hack/install.sh with some more Ubuntu-specific installation stuff...
2013-10-23 14:22:55 -07:00
Tianon Gravi
8e43db95f2 Update all the mkimage scripts to use --numeric-owner as a tar argument to properly preserve ownership 2013-10-23 14:08:16 -06:00
Victor Vieux
7a116220e7 Merge pull request #2327 from dotcloud/2325_fix_untag_rmi
fix wrong untag while docker rmi
2013-10-23 10:24:20 -07:00
Victor Vieux
894a68d2ee Merge pull request #2349 from shykes/runtime-cleanup
Runtime: remove unused field kernelVersion
2013-10-23 09:54:00 -07:00
Tianon Gravi
dc57d4ca26 Merge pull request #2353 from wrouesnel/mkimage-debootstrap-improvements
mkimage-debootstrap.sh: Add -p option to invoke debootstrap with http_proxy
2013-10-23 09:26:45 -07:00
Will Rouesnel
bc8a1081b0 mkimage-debootstrap.sh: Add -p option to invoke debootstrap with http_proxy.
This patch allows debootstrap to be run with the http_proxy environment
variable. This is principally useful when you're using apt-cacher and
apt-cacher-ng locally.
2013-10-24 03:21:10 +11:00
Greg Thornton
33ccd29ae7 Typo in host integration docs 2013-10-23 10:19:12 -05:00
Tianon Gravi
2aaaf90320 Update hack/make/ubuntu to make less ubuntu-centric packages, to fix the issue of deleting the docker group on every upgrade, to use the new init library scripts for upstart and sysvinit, and to include the dependency on iptables 2013-10-23 07:38:12 -06:00
Yang Bai
99f1675566 refactor utils.ParseHost with switch-case, so we can add other proto support easily 2013-10-23 18:29:35 +08:00
Solomon Hykes
7e4d008403 Runtime: remove unused field kernelVersion 2013-10-23 00:44:57 -06:00
Victor Vieux
b0515a7016 Merge pull request #2279 from dotcloud/fix_docker_inspect
Client: improve docker inspect
2013-10-22 17:17:35 -07:00
Victor Vieux
8ff7b70c91 Merge pull request #2341 from dotcloud/1327-race_build_verbose-fix
fix race condition in docker build with verbose + cleanup hostIntegration debug
2013-10-22 16:46:36 -07:00
Victor Vieux
01284cbf73 fix status code 2013-10-22 15:39:51 -07:00
Victor Vieux
10e10c9573 fix race condition in docker build with verbose + cleanup hostIntegration debug 2013-10-22 15:01:06 -07:00
Michael Crosby
b73065ab33 Merge pull request #2338 from proppy/patch-1
Registry: Fix content-type for PushImageJSONIndex
2013-10-22 14:48:12 -07:00
Johan Euphrosine
d93023daa9 registry: fix content-type for PushImageJSONIndex 2013-10-22 11:56:48 -07:00
Andy Rothfusz
81866087fe Merge pull request #2261 from edmund-wagner/master
make copy paste user friendly
2013-10-22 11:31:49 -07:00
Michael Crosby
e70030a0c3 Merge pull request #2150 from pnasrat/fix-mnt-subdir-volumes
Fixes issues with mounting subdirectories of /mnt in container.
2013-10-22 11:26:50 -07:00
Victor Vieux
1fe08e0046 Merge pull request #2330 from alexlarsson/dm-fix-change-detection
Fix typo that made change detection break
2013-10-22 10:20:53 -07:00
Andy Rothfusz
3bd45824da Merge pull request #2318 from Tranquility/master
Fix github link in docs
2013-10-22 09:55:33 -07:00
Victor Vieux
13c913d883 Merge pull request #2198 from hamo/hamo/chdir_error
check return value of syscall.Chdir when changing working directory
2013-10-22 09:54:25 -07:00
Alexander Larsson
bc1c5ddf2e Fix typo that made change detection break
We were comparing the old and old mtimes rather than the old and
the new. This meant we missed some file changes where only the mtime
changed.
2013-10-22 11:13:24 +02:00
Tianon Gravi
92beaed066 Merge pull request #2326 from justinforce/commentstring
Set commentstring in Vim syntax plugin
2013-10-22 00:41:34 -07:00
Victor Vieux
6b04913e73 Merge pull request #2307 from gurjeet/sorted_commands_in_help
Place 'top' subcommand's help in proper order.
2013-10-21 18:07:39 -07:00
Victor Vieux
93810b289c fix wrong untag while docker rmi 2013-10-21 17:03:32 -07:00
Justin Force
ea59ce60c5 Set commentstring in Vim syntax plugin
By setting the commentstring, you support commenting with plugins like tComment.
Now Vim won't default to incorrect `/* */` comments.
2013-10-21 16:15:10 -07:00
Andy Rothfusz
a1fc8e17a7 Clean up level 3 headers. 2013-10-21 14:03:09 -07:00
Ole Reifschneider
f903feee03 Fix github link in docs 2013-10-21 22:58:56 +02:00
Andy Rothfusz
26adda6c31 Merge pull request #2303 from metalivedev/2302-fixintro
Fix #2302
2013-10-21 09:39:34 -07:00
Gurjeet Singh
7e09c6332d Place 'top' subcommand's help in proper order. 2013-10-20 02:15:36 -04:00
Tianon Gravi
3b0cbc59ea Update hack/install.sh with some more Ubuntu-specific installation stuff while we're still on AUFS (installing linux-image-extra-$(uname -r) when we can't find AUFS to try to find AUFS) 2013-10-19 23:56:14 -06:00
Daniel Mizyrycki
95f3f77fc4 testing infrastructure, issue #1800: Refactor docker testing using Docker in Docker 2013-10-18 22:33:16 -07:00
Andy Rothfusz
bba5fd4555 Fix #2302 2013-10-18 18:00:44 -07:00
Guillaume J. Charmes
9bceae2440 Add a chan to hijack() to block until the hijack is completed 2013-10-18 16:26:29 -07:00
Guillaume J. Charmes
e7269b9841 Fix issue with autoremove 2013-10-18 16:26:29 -07:00
Andy Rothfusz
8cf0f2dbe5 Update documentation 2013-10-18 16:26:29 -07:00
Guillaume J. Charmes
3e014aa662 Fix attach race condition, improve unit tests, make sure the container is started before unblocking Start 2013-10-18 16:26:16 -07:00
Guillaume J. Charmes
333bc23f21 Fix issue killing container while sending signal
Fix rebase issue
Update docs
2013-10-18 16:19:27 -07:00
Tianon Gravi
7cf1877098 Add POSIX shell version of host_integration/manager.go in the style of hack/make.sh
Rename host_integration to host-integration for consistency
2013-10-18 16:16:29 -07:00
Guillaume J. Charmes
4918769b1a Add -nostdin and -proxy to docker attach, allow arbirary signal to be sent via docker kill api endpoint
Allow attach from `docker start`
Add host integration script generation
Update doc with host integration
2013-10-18 16:16:29 -07:00
Tianon Gravi
4b7c071e9c Merge pull request #2222 from tianon/debootstrap
Renamed and refactored mkimage-debian to mkimage-debootstrap to more clearly reflect its true function
2013-10-18 14:46:14 -07:00
Guillaume J. Charmes
e9ee860c91 Merge branch 'master' into dm
Conflicts:
	Dockerfile
	buildfile.go
	container.go
	hack/make/test
	runtime_test.go
	utils/utils.go
2013-10-18 12:38:29 -07:00
Guillaume J. Charmes
c2175ae736 Switch back some Errorf to Debugf. 2013-10-18 12:29:16 -07:00
Andy Rothfusz
ad7c6bc950 Merge pull request #2281 from metalivedev/cleanupformat
Clean up build warnings. Remove redundant files.
2013-10-18 11:39:46 -07:00
Victor Vieux
2e4ee72201 Merge pull request #2282 from shykes/fix-tests
Tests: Cleanup the test suite
2013-10-18 11:31:13 -07:00
Tianon Gravi
4870265a9f Add "vendor/pkg/" to .gitignore now that we "go test -i" 2013-10-18 12:18:13 -06:00
Alexander Larsson
2812baf395 devmapper: Fix prefix name to work with udev
Udev escapes "," used in device names to 0\x2c which breaks libdevmapper.
Instead use : to escape minor and minor which works.
2013-10-18 11:39:47 +02:00
Alexander Larsson
572b1fd9be devmapper: Fix major/minor extraction
The way devices are mapped is a bit more complex than before.
This implements the method from new_decode_dev in:
https://github.com/mirrors/linux-2.6/blob/master/include/linux/kdev_t.h

Which is what is needed on kernels > 2.6
2013-10-18 11:38:21 +02:00
Solomon Hykes
4756ad248a devmapper: use major,minor of underlying device in devmapper device name, for readability. 2013-10-18 08:30:53 +00:00
Solomon Hykes
dfb77274ce devmapper: clearer make the 'unknown base hash' error message more understandable 2013-10-18 08:22:42 +00:00
Roger Peppe
43fd85eb8f Merge remote-tracking branch 'upstream/master'
Conflicts:
	commands.go
2013-10-18 09:22:20 +01:00
Solomon Hykes
b629810fe0 hack: encode the name of the current test in temporary directories, for easier tracking
Conflicts:
	utils_test.go
2013-10-18 07:29:07 +00:00
Solomon Hykes
07d9e4353b Increase readbility of unit tests by using mkRuntime everywhere 2013-10-18 07:20:39 +00:00
Solomon Hykes
73545199a8 Merge remote-tracking branch 'alexlarsson/dm-status' into dm
Conflicts:
	devmapper/deviceset.go
2013-10-18 07:17:13 +00:00
Solomon Hykes
0ad35c6746 devmapper: cleanup error reporting 2013-10-18 07:09:13 +00:00
Solomon Hykes
5e363072f5 Merge branch 'dm' of ssh://github.com/dotcloud/docker into dm 2013-10-18 06:51:50 +00:00
Solomon Hykes
cad913c57b devmapper: the tests are fast enough that we no longer need a workaround to avoid timeouts 2013-10-18 06:48:20 +00:00
Solomon Hykes
5f58a1fbe4 hack: encode the name of the current test in temporary directories, for easier tracking 2013-10-18 06:47:08 +00:00
Solomon Hykes
07e09d57af Increase readbility of unit tests by using mkRuntime everywhere 2013-10-18 06:44:30 +00:00
Tianon Gravi
ac5bc86771 Merge pull request #1 from jpetazzo/cherry-on-top-of-hack-release
Cherry on top of hack release
2013-10-17 23:21:41 -07:00
Jérôme Petazzoni
85956c70b5 Change bundle order, and fix shell array expansion.
I believe that it is helpful to build the binary first. That way,
if you interrupt the tests, you still get a binary to play with.
If you run the tests first and interrupt them, no binary for you!

Also, the second part of this commit is an undeniable proof that
Bash array syntax is nothing else than an elaborate troll by Bash
authors.
2013-10-17 23:20:18 -07:00
Jérôme Petazzoni
8c38c30985 Remove spurious messages, and use proper args expansion.
Also, display some (hopefully helpful) message when no command was given.
2013-10-17 23:19:36 -07:00
Tianon Gravi
89a2c8e2cd Merge pull request #2283 from tmc/master
Make mkimage-arch.sh a little more clear
2013-10-17 23:05:01 -07:00
Solomon Hykes
9f85a967bb Merge pull request #2269 from alexlarsson/dm-blocksize
devmapper: Use a smaller blocksize for the thin-pool
2013-10-17 22:50:33 -07:00
Travis Cline
f34a62ea19 Use heredoc to make expect script more clear 2013-10-18 00:35:12 -05:00
Solomon Hykes
85a36b3b53 devmapper: rename deviceset_devmapper.go to deviceset.go 2013-10-18 05:19:22 +00:00
Jérôme Petazzoni
255b6aadfa Work around an exotic bug affecting Docker-in-Docker + systemd. 2013-10-17 20:42:11 -07:00
Solomon Hykes
d3505d836a Merge remote-tracking branch 'alexlarsson/dm-readonly-images' into dm
Conflicts:
	devmapper/deviceset_devmapper.go
2013-10-18 03:40:46 +00:00
Solomon Hykes
c47e93fcbe Merge remote-tracking branch 'alexlarsson/fix-tar-leak' into dm-correct 2013-10-18 03:32:47 +00:00
Solomon Hykes
5cd7de5de8 hack: fail tests if there are leftover temp files before or after 2013-10-18 03:31:21 +00:00
Solomon Hykes
5c175357aa Hack: fix tests which didn't cleanup properly 2013-10-18 02:13:36 +00:00
Solomon Hykes
240d5b3fa1 Hack: don't run integration tests in /var/lib/docker/unit-tests; add missing cleanups in a few tests 2013-10-18 02:13:36 +00:00
Solomon Hykes
d034aafac7 devicemapper: Add fixme 2013-10-18 00:58:20 +00:00
Andy Rothfusz
689bcd1dc3 Clean up build warnings. Remove redundant files. 2013-10-17 17:57:01 -07:00
Solomon Hykes
4bd6021806 devmapper: Rename DeviceSetDM to DeviceSet 2013-10-18 00:07:56 +00:00
Solomon Hykes
ed03dbfe82 Don't add /.docker-id to the container filesystem 2013-10-18 00:07:46 +00:00
Solomon Hykes
330062ef72 Remove race condition caused by double-destroy in 2 tests 2013-10-17 23:59:59 +00:00
Victor Vieux
8bce284496 clean split between errors and output. JSON output always valid 2013-10-17 23:40:43 +00:00
Jérôme Petazzoni
95ccb78aa7 Merge pull request #2253 from jpetazzo/infrastructure-docs
Try a different presentation of infrastructure documentation.
2013-10-17 16:17:32 -07:00
Tianon Gravi
83a2e92d47 Update hack/release.sh process to automatically invoke hack/make.sh and bail on building/testing issues 2013-10-17 16:49:35 -06:00
Guillaume J. Charmes
31b883b076 Add error checking and error messages 2013-10-17 15:04:14 -07:00
Jérôme Petazzoni
d401e9d3ac Add Stackbrew. 2013-10-17 14:11:10 -07:00
Peter Braden
3db381bf08 Re #2137 Note about vagrant dns in the test documentation 2013-10-17 13:38:39 -07:00
Guillaume J. Charmes
bdb3b2a88c Merge pull request #2262 from alexlarsson/dm-dind-use-root-dir
devicemapper: Use device/inode of the root dir, not the image
2013-10-17 11:54:40 -07:00
Victor Vieux
f248a8e13c Update CHANGELOG.md 2013-10-17 11:27:44 -07:00
Victor Vieux
47cc6c8081 Update CHANGELOG.md 2013-10-17 11:26:17 -07:00
Tianon Gravi
c405d53b6e Add initial init scripts library, including systemd, sysvinit, upstart, and openrc 2013-10-17 12:03:49 -06:00
Alexander Larsson
a14496ce89 Devmapper: Mount images readonly when calculating changes
There is no need to have this be writable, and there is a chance
that e.g. atime updates will cause writes to the image which is
bad for disk use wrt sharing between all containers.
2013-10-17 16:14:53 +02:00
Alexander Larsson
8abcc8e713 devmapper: Use a smaller blocksize for the thin-pool
As per the thin provisioning docs for creating the pool:

   $data_block_size gives the smallest unit of disk space that can be
   allocated at a time expressed in units of 512-byte sectors.
   $data_block_size must be between 128 (64KB) and 2097152 (1GB) and a
   multiple of 128 (64KB). $data_block_size cannot be changed after the
   thin-pool is created. People primarily interested in thin provisioning
   may want to use a value such as 1024 (512KB). People doing lots of
   snapshotting may want a smaller value such as 128 (64KB).

The switch from 512 (which we used before) to 128 (recommended above
for lots of snapshoting) means a simple container creation (based on the
mattdm/fedora:f19 image) adds 1 MB of diskspace rather than 3.6.
This seems more in tune with how docker is typically used.
2013-10-17 15:33:00 +02:00
Alexander Larsson
d733cdcebb Show devicemapper status in "docker info"
This shows the current global diskspace use in "docker info"
2013-10-17 15:32:07 +02:00
Alexander Larsson
0aee096fd7 TarFilter: Fix leak of tmpfiles
We were leaking the temporary directory that we create in TarFilter,
because the "tmpDir, err := ioutil.TempDir()" call overrides the
tmpDir in the outer scope with a new locally scoped variable.
This means tmpDir is always "" when the cleanup function is called.

Also, we did not call the atExit() function if CmdStream had an
error early on.

On errors in CmdStream(),
2013-10-17 14:46:58 +02:00
Edmund Wagner
bc39ac71e6 c&p improvement for 13.04
first line killed sources list
2013-10-17 10:07:12 +02:00
Alexander Larsson
e6a73e65a2 devicemapper: Use device/inode of the root dir, not the image
This way the devicemapper prefix stays stable even if we're not
using loopback mounted devices.
2013-10-17 09:53:09 +02:00
Edmund Wagner
2110b3cca8 make copy paste user friendly
copying only the first line killed my sources.list file
2013-10-17 09:31:35 +02:00
Solomon Hykes
ad2fbd9e87 devmapper: error reporting workaround in waitRemove() 2013-10-17 01:49:51 +00:00
Solomon Hykes
e5d7472a0d devmapper: small fixes in error reporting 2013-10-17 01:49:27 +00:00
Solomon Hykes
7d3c7e2b29 devmapper: debug messages 2013-10-17 01:47:03 +00:00
Solomon Hykes
f1d07e2dbe devmapper: prefix device names with the dev_id+inode of the data image 2013-10-17 01:46:28 +00:00
Solomon Hykes
ad968ef3ef devmapper: add useful comments 2013-10-17 01:42:05 +00:00
Michael Crosby
414795856a Merge branch 'release' 2013-10-16 18:20:04 -07:00
Michael Crosby
2f74b1c84b Merge pull request #2255 from dotcloud/bump_0.6.4
Bump to 0.6.4
2013-10-16 17:59:45 -07:00
Michael Crosby
e8da76605f Bump version to 0.6.4 2013-10-16 17:50:08 -07:00
Michael Crosby
f16e60665b Merge branch 'master' into bump_0.6.4 2013-10-16 17:48:17 -07:00
Michael Crosby
3ba9893786 Merge pull request #2242 from jpetazzo/remove-spurious-errors-and-errclosedpipe
Fix error/debug messages in Container.Attach and recover from ErrClosedPipe
2013-10-16 17:27:23 -07:00
Jérôme Petazzoni
7b1c6ccabd Try a different presentation of infrastructure documentation. 2013-10-16 17:11:21 -07:00
Solomon Hykes
c688e9b5a6 devmapper: debug messages 2013-10-16 23:27:33 +00:00
Solomon Hykes
f3e6d34df2 hack: cleanup devicemapper at the last test 2013-10-16 23:27:00 +00:00
Solomon Hykes
ea04f3de72 devmapper: wait for devices to be effectively removed before returning a successful remove 2013-10-16 23:26:37 +00:00
Solomon Hykes
153248b60f devicemapper: remove unused code 2013-10-16 23:23:35 +00:00
Guillaume J. Charmes
6ee2964a4f Merge pull request #2256 from dotcloud/discard_errno_0_errors
- Runtime: discard errno = 0 errors
2013-10-16 16:22:03 -07:00
Solomon Hykes
1711de4b09 devmapper: wait for devices to be effectively unmounted before removing them 2013-10-16 23:06:07 +00:00
Victor Vieux
49c62879b8 discard errno = 0 errors 2013-10-16 23:05:50 +00:00
Michael Crosby
34745ee0f4 Merge pull request #2246 from dotcloud/clean_when_start_fail
Add cleanup when container.Start fails
2013-10-16 15:06:08 -07:00
Victor Vieux
d21bd5b964 Merge pull request #2251 from dotcloud/skip_autoremove_test
skip auto-remove test for now
2013-10-16 14:59:08 -07:00
Michael Crosby
82220ea2ad Merge pull request #2249 from jpetazzo/cleanup-errclosing-in-proxy
Catch errClosing error when TCP and UDP proxies are terminated.
2013-10-16 14:51:43 -07:00
Victor Vieux
655b16c712 skip auto-remove test for now 2013-10-16 21:47:20 +00:00
Michael Crosby
eb2d0d4bf5 Merge pull request #2250 from dotcloud/revert-07-doc-changes
Revert "Fix #2115 Clean AUFS references. Also fixes some links to client...
2013-10-16 14:44:53 -07:00
Jérôme Petazzoni
cc851dbb3f Catch errClosing error when TCP and UDP proxies are terminated. 2013-10-16 14:43:20 -07:00
Victor Vieux
e40fd1e3e1 fix panic 2013-10-16 21:39:03 +00:00
Michael Crosby
dab84f7e8b Revert "Fix #2115 Clean AUFS references. Also fixes some links to client libraries and mongo example."
This reverts commit f4c17a202b.
2013-10-16 14:38:24 -07:00
Daniel Mizyrycki
7df8ec2093 Merge pull request #2195 from mzdaniel/report
Add aggregated docker-ci email report
2013-10-16 14:29:24 -07:00
Solomon Hykes
11d695a297 Add debug messages while testing devicemapper 2013-10-16 20:45:59 +00:00
Solomon Hykes
acf58362cb Hack: fix tests which didn't cleanup properly 2013-10-16 20:44:15 +00:00
Guillaume J. Charmes
3a246ac3d1 Change default values for devicemapper as variable instead of env 2013-10-16 20:42:50 +00:00
Daniel Mizyrycki
a2ffa637ce testing infrastructure, PR #2195: Add aggregated docker-ci email report 2013-10-16 13:30:15 -07:00
Guillaume J. Charmes
ed6ca109bf Refactor container.Start() 2013-10-16 13:12:56 -07:00
Solomon Hykes
1da335f784 Hack: don't run integration tests in /var/lib/docker/unit-tests; add missing cleanups in a few tests 2013-10-16 20:10:20 +00:00
Victor Vieux
6e48b73955 Merge pull request #2247 from dotcloud/improve_tests_error_messages
Tests: Remove a few errors
2013-10-16 12:50:15 -07:00
Victor Vieux
664acd2971 Add clean if start fail 2013-10-16 19:48:24 +00:00
Victor Vieux
3acfc60028 change an errorf to a debugf 2013-10-16 19:45:10 +00:00
Victor Vieux
0e64a4d7e7 remove false alarm error 2013-10-16 19:38:12 +00:00
Victor Vieux
104a86936a api.go:108 Error parsing media type: error: mime: no media type
fix
2013-10-16 19:32:03 +00:00
Victor Vieux
df697b4318 use httpError in a separate test 2013-10-16 19:23:47 +00:00
Tianon Gravi
27fc01271e Merge pull request #2219 from tianon/completion
Reorganize contributed completion scripts to add zsh completion
2013-10-16 11:40:56 -07:00
Tianon Gravi
97ab118fbb Merge pull request #2220 from tianon/vim
Add vim syntax highlighting for Dockerfiles from @honza
2013-10-16 11:40:42 -07:00
Jérôme Petazzoni
fc659b68e4 Fix error/debug messages in Container.Attach and recover from ErrClosedPipe conditions. 2013-10-16 11:35:45 -07:00
Guillaume J. Charmes
99f6b43f4f Merge pull request #2243 from jpetazzo/comments-stdcopy
Add better comments to utils/stdcopy.go.
2013-10-16 11:17:15 -07:00
Victor Vieux
2b92aa71f9 Merge pull request #2244 from dotcloud/add_cleanup_leftover_container_tests
Tests: add cleanup to remove leftover containers
2013-10-16 11:09:48 -07:00
Victor Vieux
f854529ae8 add cleanupin tests to remove leftover containers 2013-10-16 18:06:37 +00:00
Jérôme Petazzoni
e32debcf5f Add better comments to utils/stdcopy.go. 2013-10-16 10:58:53 -07:00
Andy Rothfusz
0e08e1d695 Merge pull request #2236 from SvenDowideit/2209-comments-doc
#2209 - add the example @tianon gave to elaborate on the Comment docume...
2013-10-16 10:51:15 -07:00
Andy Rothfusz
65b62307c3 Merge pull request #2231 from metalivedev/1919-docreleaseinfo
Fix #1919 document how to edit and release docs.
2013-10-16 10:45:01 -07:00
Andy Rothfusz
03e5d94b12 Merge pull request #2090 from kencochrane/master
added initial draft of the Docker infrastructure doc
2013-10-16 10:44:22 -07:00
Tianon Gravi
0ca533ca35 Merge pull request #2233 from tmc/master
Add mkimage-arch.sh
2013-10-15 19:27:45 -07:00
Travis Cline
d94a027da6 Add mkimage-arch.sh 2013-10-16 02:26:15 +00:00
Sven Dowideit
7250f94874 #2209 - add the example @tianon gave to elaborate on the Comment documentation 2013-10-16 11:12:47 +10:00
Michael Crosby
4196c704f0 Merge pull request #1943 from dotcloud/1940-prevent_crash_parseNat_build-fix
Abort build if mergeConfig returns an error and fix duplicate error message
2013-10-15 17:40:48 -07:00
Victor Vieux
adb48ef319 Merge pull request #2235 from dotcloud/update_dockerfile
Update Dockerfile test comment
2013-10-15 17:32:48 -07:00
Victor Vieux
ee7d9b0bde Update Dockerfile test comment 2013-10-16 00:31:34 +00:00
Victor Vieux
2f4526d5c4 Merge pull request #2221 from flavio/fix_broken_tests
Fixed broken tests
2013-10-15 17:26:19 -07:00
Victor Vieux
261285c2c2 Merge pull request #2232 from shykes/error-should-be-debug
Remove error messages which are not actually errors
2013-10-15 17:12:51 -07:00
Solomon Hykes
cd61fb2e6f WIP: debugging dm-base-hash + dm-refactor-init 2013-10-15 23:56:04 +00:00
Solomon Hykes
fdba1aeed8 Merge branch 'dm-refactor-init' into dm
Conflicts:
	runtime_test.go
2013-10-15 23:27:28 +00:00
Solomon Hykes
cbc49d7d76 Remove error messages which are not actually errors 2013-10-15 23:12:27 +00:00
Solomon Hykes
c9f3e54c31 Merge branch 'dm-base-hash' into dm 2013-10-15 23:09:26 +00:00
Solomon Hykes
3997b8a923 hack: don't set DEBUG when running tests 2013-10-15 23:07:26 +00:00
Solomon Hykes
ec885d9180 hack: only run certain tests with TESTFLAGS='-run TestName' make.sh 2013-10-15 23:06:41 +00:00
Solomon Hykes
4dc90405e3 Merge pull request #2230 from shykes/hack-select-test
hack: only run certain tests with TESTFLAGS='-run TestName' make.sh
2013-10-15 15:58:54 -07:00
Solomon Hykes
b7abe9dab5 hack: only run certain tests with TESTFLAGS='-run TestName' make.sh 2013-10-15 22:57:40 +00:00
Andy Rothfusz
cd455ca6fa Fix #1919 document how to edit and release docs. 2013-10-15 15:52:21 -07:00
Solomon Hykes
54b0cd7cd1 Merge branch 'dm-missing-mapper' into dm 2013-10-15 22:51:20 +00:00
Solomon Hykes
66db2ac9d8 Merge branch 'dm-fix-test-2' into dm 2013-10-15 22:42:49 +00:00
Alexander Larsson
5ebaca7e55 devmapper: create device nodes 'on create' instead of 'on resume' 2013-10-15 21:27:47 +00:00
Solomon Hykes
432ff7e3c3 Merge pull request #2227 from dotcloud/dm-rename-loopback
Rename loopback dir to devicemapper
2013-10-15 12:23:43 -07:00
Michael Crosby
80bd64245f Add filesystemtype for containers
If no type is specified then assume aufs.
2013-10-15 11:49:13 -07:00
Michael Crosby
4431e9edb7 Rename loopback dir to devicemapper 2013-10-15 11:30:06 -07:00
Flavio Castelli
ca56b35e53 Fixed broken tests
Some tests failed because the `auplink` binary was not found inside of the
"docker" container.
2013-10-15 11:44:56 +02:00
Tianon Gravi
095aab9d97 Refactor mkimage-debootstrap.sh to be much more full-featured
This includes the following:
- options to control certain parameters
- an option specifically for creating tarballs directly, esp. for dockerbrew
- the addition of the updates and security repositories for Debian images
- the addition of the universe, updates, and security repositories for Ubuntu images
- more correct tagging of Debian images
- tagging of Ubuntu image versions (12.04, 12.10, etc) and latest tag for LTS
2013-10-15 03:44:03 -06:00
Tianon Gravi
ace059e409 Add vim syntax highlighting for Dockerfiles from @honza
See https://github.com/honza/dockerfile.vim
See also https://twitter.com/_honza/status/390046317579620352
2013-10-15 03:35:13 -06:00
Tianon Gravi
9da2b3590e Add zsh completion from @felixr with permission
See https://github.com/felixr/docker-zsh-completion for the original.
See also https://github.com/dotcloud/docker/issues/2202#issuecomment-26313287

Fixes #2202
2013-10-15 03:04:06 -06:00
Tianon Gravi
e99ab1df97 Move contrib/docker.bash to contrib/completion/bash/docker for better organization 2013-10-15 03:02:31 -06:00
Tianon Gravi
4967f9f19c Rename mkimage-debian.sh to mkimage-debootstrap.sh to more clearly reflect its true function 2013-10-15 02:26:10 -06:00
Solomon Hykes
fde157425c Merge pull request #2218 from tianon/ksid
Remove @KSid from contrib maintainers for now
2013-10-15 00:13:58 -07:00
Tianon Gravi
a0e5657cb6 Remove @KSid from contrib maintainers for now
His availability has been very limited, so I'll take over completely for the short term until he can find more time to help out.
2013-10-15 00:58:34 -06:00
Solomon Hykes
7093411a8d Initialize devicemapper in NewRuntimeFromDIrectory 2013-10-15 03:53:48 +00:00
Guillaume J. Charmes
5778ed7db2 Make sure the base device is well created before running the tests 2013-10-14 18:36:18 -07:00
Michael Crosby
3455c1a098 Use incrementing prefix on pool and loopback to allow dind 2013-10-14 17:48:43 -07:00
Michael Crosby
5dd12ba20a Ignore cleanup with /dev/mapper does not exist 2013-10-14 14:23:58 -07:00
Daniel Mizyrycki
f4a98b4598 Merge pull request #2211 from mzdaniel/2190-docker-ci
Prevent docker-ci to test closing PRs
2013-10-14 14:12:23 -07:00
Daniel Mizyrycki
53a07d5475 Prevent docker-ci to test closing PRs 2013-10-14 14:00:06 -07:00
Solomon Hykes
5892c8e469 Merge pull request #2199 from alexlarsson/dm-docs
Add some docs for newly exported functions
2013-10-14 13:33:21 -07:00
Solomon Hykes
20e3e8c07d Merge pull request #2200 from alexlarsson/dm-remove-unused
Runtime: Remove unused funtion hasFilesystemSupport()
2013-10-14 13:24:53 -07:00
Solomon Hykes
79c0c4470f Merge pull request #2182 from dotcloud/cleanup-dm-unittests
Clean up better from previous unit-test runs
2013-10-14 12:29:59 -07:00
Solomon Hykes
4dedd9a9aa Merge pull request #2183 from dotcloud/migrate-aufs
Migrate aufs to new device mapper backend
2013-10-14 12:28:28 -07:00
Solomon Hykes
063ebbab68 Merge pull request #2184 from dotcloud/dm-rmi
Do not allow image to be deleted when containers are dependent
2013-10-14 12:27:19 -07:00
Guillaume J. Charmes
ea92dc2e8c Add error return to cleanup, use os.OpenFile instead of syscall.Open, Make sure the pools are removed after all other devices 2013-10-14 12:26:46 -07:00
Andy Rothfusz
93b258413f Merge pull request #2160 from iffy/patch-1
Minor updates to postgresql_service.rst
2013-10-14 11:59:57 -07:00
Andy Rothfusz
c0bfb75e5f Merge pull request #2142 from SvenDowideit/patch-1
tell the new developer how they can replace the real docker binary with ...
2013-10-14 11:55:42 -07:00
Michael Crosby
7f429e0ceb Do not allow image to be deleted when containers are dependent 2013-10-14 09:47:01 -07:00
Alexander Larsson
bb42801cdc Runtime: Remove unused funtion hasFilesystemSupport()
This used to be used to be used to detect AUFS support, but is not
used anymore.
2013-10-14 10:54:50 +02:00
Alexander Larsson
8e4b3a3390 Add some docs for newly exported functions 2013-10-14 10:53:12 +02:00
Yang Bai
1043055b10 check return value of syscall.Chdir when changing working directory 2013-10-14 15:27:38 +08:00
Solomon Hykes
48070274ee Change the base filesystem size in unit tests 2013-10-12 15:06:53 -07:00
Michael Crosby
c3f1bb3287 Allow loopback and base fs sizes set by env var 2013-10-11 20:37:11 -07:00
Daniel Mizyrycki
620bc5b9e1 Merge pull request #1823 from dotcloud/1766-nightly-release
testing, issue #1766: Add nightly release to docker-ci
2013-10-11 17:38:06 -07:00
Michael Crosby
562e4f1e23 Verbose migration add warning for running container
Conflicts:
	hack/make.sh
	runtime.go
	runtime_test.go
2013-10-11 17:11:18 -07:00
Michael Crosby
a263e07678 Migrate AUFS containers to devmapper
Conflicts:
	hack/make.sh
	runtime.go
2013-10-11 16:54:08 -07:00
Alexander Larsson
e7986da531 Clean up better from previous unit-test runs
This makes sure we unmount existing mounts (as well as removing the
devmapper devices), and it fails with proper logs rather than just
panic()ing.
2013-10-11 16:42:11 -07:00
Alexander Larsson
b440ec0136 device-mapper: Move all devicemapper spew to log through utils.Debugf(). 2013-10-11 16:31:06 -07:00
Alexander Larsson
c77697a45c devmapper: Move all "raw" libdevmapper wrappers to devmapper.go
This separates out the DeviceSet logic a bit better from the raw
device mapper operations.

devicemapper: Serialize addess to the devicemapper deviceset

This code is not safe to run in multiple threads at the same time,
and neither is libdevmapper.

DeviceMapper: Move deactivate into UnmountDevice

This way the deactivate is atomic wrt othe device mapper operations
and will not fail with EBUSY if someone else starts a devicemapper
operation inbetween unmount and deactivate.

devmapper: Fix loopback mounting regression

Some changes were added to attach_loop_device which added
a perror() in a place that caused it to override errno so that
a later errno != EBUSY failed. This fixes that and cleans up
the error reporting a bit.

devmapper: Build on old kernels without LOOP_CTL_GET_FREE define
2013-10-11 16:30:02 -07:00
Daniel Mizyrycki
6d6097cddf Merge pull request #1813 from doubleyou/patch-1
Improve network performance for VirtualBox
2013-10-11 16:23:19 -07:00
Daniel Mizyrycki
42277d0329 Merge pull request #2178 from tianon/vagrant-docker-group
Add vagrant user to the docker group
2013-10-11 15:10:50 -07:00
Tianon Gravi
d62df6b2b5 Add vagrant user to the docker group 2013-10-11 11:00:04 -06:00
Michael Crosby
97779ff7cf Merge pull request #2118 from karlgrz/936-enhance-logging
Add utils.Errorf for error logging
2013-10-11 08:51:37 -07:00
Michael Crosby
9afa48a92f Merge pull request #2169 from dotcloud/remove-deprecated-packaging
Remove deprecated packaging directory
2013-10-11 08:44:34 -07:00
Karl Grzeszczak
ad723bbfe7 Initial steps to fix Issue #936
Use utils.Errorf instead of utils.Debugf
2013-10-11 08:04:40 -05:00
Solomon Hykes
f15cd71bb8 Merge pull request #2037 from tianon/install-script-revamp
Revamp install.sh to be usable by more people, and to use official install methods whenever possible (apt repo, portage tree, etc.)
2013-10-10 23:56:13 -07:00
Tianon Gravi
94bf5b0011 Revamp install.sh to be usable by more people, and to use official install methods whenever possible (apt repo, portage tree, etc.), thus making it an official script and moving it to hack/ 2013-10-11 00:53:15 -06:00
Daniel Mizyrycki
d542318d63 testing infrastructure, issue #1766: Dockerize deployment of docker-ci 2013-10-10 18:29:10 -07:00
Daniel Mizyrycki
6e3068700f testing infrastructure, issue #1766: Temporarily install docker with proper apparmor handling 2013-10-10 18:29:10 -07:00
Daniel Mizyrycki
fac190959f testing, issue #1766: Upgrade tooling for Docker nightly release 2013-10-10 18:29:10 -07:00
Daniel Mizyrycki
1dcdc3deb7 testing, issue #1766: Add nightly release to docker-ci 2013-10-10 18:29:10 -07:00
Solomon Hykes
ee256ce6bf Merge pull request #2038 from tianon/mkimage-debian-fixes
Fix contrib/mkimage-debian.sh apt caching prevention
2013-10-10 17:59:17 -07:00
Solomon Hykes
5fe699f813 Merge pull request #2166 from pnasrat/document-approval
Clarify LGTM process to contributors.
2013-10-10 17:55:32 -07:00
Solomon Hykes
7561e2570c Merge pull request #2159 from nathankleyn/fix-references-to-param-names
Small fixes to parameter names in docs for ADD command.
2013-10-10 17:53:57 -07:00
Guillaume J. Charmes
640ca68e4f Merge pull request #2128 from titanous/update-authors
Update AUTHORS
2013-10-10 16:40:33 -07:00
Guillaume J. Charmes
f9b9dfc82d Merge pull request #2164 from pnasrat/add-finished-time
* Runtime: Record termination time in state.
2013-10-10 16:29:07 -07:00
Guillaume J. Charmes
c978f0fa5c Merge pull request #2165 from jrydberg/master
- Registry: Use correct auth config when logging in.
2013-10-10 16:28:46 -07:00
Sven Dowideit
d91bf33df3 tell the new developer how they can replace the real docker binary with the one they've been hacking on (#2142) 2013-10-11 08:47:32 +10:00
Paul Nasrat
310a174260 Clarify LGTM process to contributors. 2013-10-10 18:32:33 -04:00
Solomon Hykes
1804fcba93 Merged master into device-mapper branch 2013-10-10 12:50:30 -07:00
Paul Nasrat
2eb404ab14 Record termination time in state.
Supercedes pull #1946
2013-10-10 14:47:25 -04:00
Ken Cochrane
60e426938e Merge pull request #2155 from jdubois/patch-1
- Documentation: Corrected error in the package name
2013-10-10 11:19:22 -07:00
Zilin Du
c2912c82aa change 127.0.0.1 -> 127.0.1.1 & remove ::1 -> hostname mapping 2013-10-10 09:44:48 -07:00
Matt Haggard
9041d6a47b Minor updates to postgresql_service.rst
I've added the steps that were missing/wrong for me when I went through this just now.
2013-10-10 10:23:24 -06:00
Nathan Kleyn
8abd328f53 Small fixes to parameter names in docs for ADD command. 2013-10-10 12:14:18 +01:00
Solomon Hykes
ae780fb5ea Remove deprecated packaging directory (distro-specific packaging is now managed downstream by their respective package maintainers) 2013-10-10 03:54:10 -07:00
Julien Dubois
152037f011 Corrected error in the package name 2013-10-10 10:10:33 +02:00
Andy Rothfusz
0367032bd1 Merge pull request #2144 from shamrin/patch-5
document what `vagrant up` is actually doing
2013-10-09 17:42:37 -07:00
Andy Rothfusz
edca9f7e9c Merge pull request #2139 from metalivedev/2115-AUFScleanup
Fix #2115 Clean AUFS references.
2013-10-09 17:35:05 -07:00
Guillaume J. Charmes
e19cc1e843 Merge pull request #2125 from dotcloud/2099_rm-v_fix
- Runtime: fix `docker rm` with volumes
2013-10-09 16:01:51 -07:00
Guillaume J. Charmes
feabce3bcc Merge pull request #2119 from SvenDowideit/2117-hardcoded-tmp-dir
use empty string so TempDir uses the OS's temp dir automatically (Closes...
2013-10-09 16:00:40 -07:00
Michael Crosby
ded74b0bb3 Merge pull request #2133 from dotcloud/improve_tests
Make sure to close the network allocators
2013-10-09 15:45:16 -07:00
Guillaume J. Charmes
ffee5faae8 Merge pull request #2145 from dotcloud/remove-panic-test
* Runtime: replace panic by log.Fatal in tests
2013-10-09 15:37:08 -07:00
Paul Nasrat
aa3697520a Fixes issues with mounting subdirectories of /mnt in container.
Tested with
mkdir /mnt/data
docker run -v /mnt/data:/mnt/data  -t ubuntu:12.10 touch /mnt/data/bar

Expected /mnt/data/bar on host.
2013-10-09 16:40:46 -04:00
Andy Rothfusz
c1bb33ea4d Merge pull request #2114 from metalivedev/2113-searchbump
Fix #2113 improve doc search results
2013-10-09 12:24:33 -07:00
Andy Rothfusz
6545e53803 Clean up javascript comment. 2013-10-09 12:22:14 -07:00
Victor Vieux
d30806590c Merge pull request #2127 from titanous/close-body
Fix some error cases where a HTTP body might not be closed
2013-10-09 06:52:03 -07:00
Victor Vieux
823174de4d replace panic by log.Fatal in tests 2013-10-09 13:47:49 +00:00
Tianon Gravi
d5f9160441 Merge pull request #1956 from tianon/bash-completion
Add proper bash completion for "docker push"
2013-10-09 05:47:55 -07:00
Alexey Shamrin
37df1d92d8 document what vagrant up is actually doing
* don't mention outdated PPA that Vagrantfile doesn't use
* point to official Ubuntu installation instructions that Vagrant appears to be following; should be future proof
2013-10-09 15:05:09 +04:00
Jonathan Rudenberg
dabac81824 Update AUTHORS 2013-10-08 23:51:38 -04:00
Guillaume J. Charmes
bb62c281f5 Merge pull request #2130 from tianon/swap-contrib-maintainers
Swap contrib MAINTAINERS
2013-10-08 17:57:52 -07:00
Andy Rothfusz
3565bf8d00 Merge pull request #2134 from tianon/contributing
Add devenvironment link to CONTRIBUTING.md
2013-10-08 17:36:56 -07:00
Andy Rothfusz
f4c17a202b Fix #2115 Clean AUFS references. Also fixes some links to client libraries and mongo example. 2013-10-08 17:33:19 -07:00
Tianon Gravi
9a4b0b9823 Add devenvironment link to CONTRIBUTING.md 2013-10-08 16:48:19 -06:00
Guillaume J. Charmes
9107565d06 Make sure to close the network allocators 2013-10-08 15:42:02 -07:00
Zilin Du
7d95d300ab replace 127.0.0.1 by the assigned IP address in the container's /etc/hosts file. 2013-10-08 14:29:22 -07:00
Tianon Gravi
4fda3314d8 Swap contrib MAINTAINERS 2013-10-08 15:15:58 -06:00
Jonathan Rudenberg
e906485b07 Fix some error cases where a HTTP body might not be closed
Refs #2126
2013-10-08 15:35:00 -04:00
Victor Vieux
1daf242c8b fix rm -v 2013-10-08 16:35:47 +00:00
Johan Rydberg
967010ae8c Use correct auth config when logging in. 2013-10-08 06:46:29 +02:00
Sven Dowideit
d03022b9ca use empty string so TempDir uses the OS's temp dir automatically (Closes #2117) 2013-10-08 13:24:20 +10:00
Andy Rothfusz
6d67ac2a1b Insert popularity and boost docs results. 2013-10-07 17:51:07 -07:00
Solomon Hykes
2d425af1b1 Merge pull request #2103 from tianon/clean-out-fixme
Clean out a few outdated FIXME items
2013-10-07 15:19:01 -07:00
Andy Rothfusz
ed19693f50 Merge pull request #2106 from mastahyeti/api_1.5_docs_whitespace
Cleanup whitespace in API 1.5 docs
2013-10-07 13:23:55 -07:00
Tianon Gravi
ee27444098 Fix contrib/mkimage-debian.sh apt caching prevention 2013-10-07 13:41:10 -06:00
Andy Rothfusz
194c1dbbd8 Merge pull request #2109 from shamrin/patch-4
[docs] use angle brackets in MAINTAINER example email
2013-10-07 12:18:44 -07:00
Alexey Shamrin
a9eac7eab4 [docs] use angle brackets in MAINTAINER example email 2013-10-07 20:29:54 +04:00
Ben Toews
7c28683f08 Cleanup whitespace in API 1.5 docs
remove whitespace on blank lines
2013-10-06 19:52:18 -06:00
Daniel Mizyrycki
c18e849451 Merge pull request #2061 from dotcloud/1948-test-detach
testing, issue #1948: Increase TestRunDetach timeout
2013-10-06 13:26:44 -07:00
Tianon Gravi
a665517151 Clean out a few outdated FIXME items 2013-10-06 13:55:26 -06:00
Nick Stinemates
821a82ac6c Add Developer Certificate of Origin Text
We purposely chose to license Docker under the Apache 2.0 license. This is a well-known
license, which is popular for its permissive and flexible properties, while still
encouraging a collaborative community. It also makes certain representations with regard
to contributions, and the rights given to contributors, the project, people who use Docker,
people who modify Docker, etc.

This approach to contributions is inspired by the popular Linux Developer
"Certificate of Origin". This approach makes it simple for new contributors to get started,
and avoids bureaucracy in tracking contributions and contributors.

To indicate accordance, each individual contribution to the Project is signed off by the
developer, using his or her real name, email address, and github handle in the format below:

	Docker-DCO-1.0-Signed-off-by: Joe Smith <joe.smith@email.com>
2013-10-04 14:27:26 -07:00
Ken Cochrane
0d3c899528 added initial draft of the Docker infrastructure doc 2013-10-04 15:12:40 -04:00
Andy Rothfusz
863eebe7bd Merge pull request #2084 from makeusabrew/patch-1
Fix help text for -v option
2013-10-04 09:29:56 -07:00
Victor Vieux
f6913592a1 Merge pull request #2087 from alexlarsson/device-mapper-test
Device mapper test branch update
2013-10-04 07:54:43 -07:00
Alexander Larsson
aaf1f73bcc Tests: Initialize devicemapper early to avoid it happening in a test
This can take a while and may cause some tests to timeout
2013-10-04 15:47:43 +02:00
Alexander Larsson
9b65c7cf49 hack: Don't just run the "TestRunHostname" test 2013-10-04 15:38:47 +02:00
Alexander Larsson
f7e374fb3a Remove overly spewy Debugf 2013-10-04 15:36:30 +02:00
Nick Payne
3c5350ba92 Fix help text for -v option 2013-10-04 10:26:57 +01:00
Tianon Gravi
c52c95f97f Merge pull request #1876 from asbjornenge/master
Added Dockerfile.tmLanguage to contrib
2013-10-03 23:52:37 -07:00
Asbjørn Enge
85a5139665 Added Dockerfile.tmLanguage to contrib 2013-10-04 08:45:15 +02:00
Guillaume J. Charmes
f29c500d8d Small fixes 2013-10-03 18:05:07 -07:00
Guillaume J. Charmes
b843998718 Small fixes 2013-10-03 18:04:14 -07:00
Michael Crosby
ad4b09cdb8 Merge pull request #1832 from dotcloud/26-default_r_flag
Autorestart containers by default
2013-10-03 15:59:58 -07:00
Victor Vieux
e594c788e4 keep -r, but default true 2013-10-03 22:42:35 +00:00
Victor Vieux
f84dc1e908 add missing error check 2013-10-03 22:33:00 +00:00
Michael Crosby
826aaa0e9b Merge pull request #1990 from modcloth-labs/more-tests-for-auth-registry-resolution
Adding more tests around `auth.ResolveAuthConfig`
2013-10-03 14:45:02 -07:00
Alexander Larsson
1a1be5a87c Make sure we mark the libdevmapper /dev/mapper/control fd CLOEXEC
We do a hack to mark it such, because otherwise lxc-start will not
work.
2013-10-03 21:00:16 +02:00
Alexander Larsson
7b58e15b08 Be better at cleaning up leftover from earlier test runs
When running the test inside a docker container we sometimes are left with
leftover device nodes for device mapper devices that no longer exist.
We were panic:ing in this case, but with this change we just remove such
nodes.
2013-10-03 19:54:14 +02:00
Victor Vieux
1328be7c29 Add test 2013-10-03 15:21:14 +00:00
Guillaume J. Charmes
8b2f4aab23 Random improvments 2013-10-02 20:18:15 -07:00
Tianon Gravi
06d0843a61 Update Dockerfile and hack to support compiling device-mapper code statically (using go1.2rc1) 2013-10-03 10:32:47 -06:00
Victor Vieux
deb05a36e8 rebase 2013-10-03 15:49:28 +00:00
Victor Vieux
55189307d0 disable: don't create device nodes manually if udev is not availabile as we don't have it in dind 2013-10-03 15:47:38 +00:00
Andy Rothfusz
ff4f32d58f Fix #2017 Merge branch '2017-api-details' 2013-10-02 18:20:44 -07:00
Andy Rothfusz
462ac1efcf Merge branch 'hint-api-details' of git://github.com/cdunklau/docker into 2017-api-details
Conflicts:
	docs/sources/api/docker_remote_api.rst
2013-10-02 18:18:46 -07:00
Solomon Hykes
1332f400f7 Merge pull request #2015 from dsissitka/1927
Configured FPM to make /etc/init/docker.conf a config file.
2013-10-02 18:18:16 -07:00
Solomon Hykes
a292c04ddb Merge pull request #2069 from philips/add-xz-to-runtime-dependencies
fix(hack/PACKAGERS): add xz utils as a runtime dep
2013-10-02 17:37:56 -07:00
Andy Rothfusz
37c4513cf9 Merge pull request #2060 from mastahyeti/patch-1
Add `apt-get install curl` to Ubuntu docs
2013-10-02 16:46:00 -07:00
Andy Rothfusz
b584c21ca4 Merge pull request #2063 from dhrp/doc-template-fix
Doc template fix
2013-10-02 16:31:47 -07:00
Andy Rothfusz
c92507341d Merge pull request #2073 from tianon/gentoo-no-more-1422-hack
Remove Gentoo install notes about #1422 workaround
2013-10-02 16:24:11 -07:00
Andy Rothfusz
9f0feaa2e1 Merge pull request #2065 from kyleconroy/fix_ping_endpoint
Fix Ping endpoint documentation
2013-10-02 16:22:49 -07:00
Ben Toews
0f830aa431 Update ubuntu docs to use wget instead of curl
Ubuntu doesn't come with curl.

wget instead of curl

nicer wget syntax

remove /dev/null
2013-10-02 16:27:34 -06:00
Tianon Gravi
5f05cb4817 Remove Gentoo install notes about #1422 workaround 2013-10-02 16:06:22 -06:00
Michael Crosby
4778039dd2 Merge pull request #2066 from tianon/vendor-bump-kr-pty
Bump vendor kr/pty to commit 3b1f6487b (syscall.O_NOCTTY)
2013-10-02 14:44:07 -07:00
Guillaume J. Charmes
b180770b1d Merge pull request #2014 from alexlarsson/allow_set_file_cap
* Runtime: lxc: Allow set_file_cap capability in container
2013-10-02 14:38:50 -07:00
Brandon Philips
4f5c2cbccc fix(hack/PACKAGERS): add xz utils as a runtime dep 2013-10-02 12:06:19 -07:00
Andy Rothfusz
c3acd9bece Merge pull request #2047 from Thermionix/patch-1
Update archlinux.rst
2013-10-02 10:57:48 -07:00
Tianon Gravi
cb21a40490 Bump vendor kr/pty to commit 3b1f6487b (syscall.O_NOCTTY) 2013-10-01 19:48:50 -06:00
Thatcher Peskens
5025b4d094 Cleanup 2013-10-01 16:32:56 -07:00
Thatcher Peskens
509e25cf04 Add/modified the canonical link to work with all /index/ links. Added style for "danger' 2013-10-01 16:26:14 -07:00
Daniel Mizyrycki
135c1fce90 testing, issue #1948: Increase TestAttachDetach and TestRunDetach timeout 2013-10-01 15:59:52 -07:00
Kyle Conroy
d517fd3d77 Fix Ping endpoint documentation 2013-10-01 15:49:32 -07:00
Michael Crosby
b4e1b8d2e2 Merge pull request #2058 from marcusramberg/patch-1
Fix ironic typo in changelog
2013-10-01 09:58:32 -07:00
Marcus Ramberg
45bd52d472 Fix ironic typo in changelog 2013-10-01 18:16:10 +02:00
Andy Rothfusz
534a991cff fix logo path 2013-09-30 16:54:04 -07:00
Alexander Larsson
55e1782d66 Image: Fix time setting for old kernels
This is a better fix for futimes() on kernels not supporting O_PATH.
The previous fix broke when copying a device, as it tried to open it
and got and error.
2013-09-30 17:35:02 -06:00
Victor Vieux
152302e379 go fmt and aufs support removed 2013-09-30 17:35:02 -06:00
Victor Vieux
72a08a5458 Revert "add a -mount-method flag"
This reverts commit e52d756f40c9ccf8b37ca496cb72be057c909ed7.
2013-09-30 17:35:02 -06:00
Victor Vieux
aeb89ffbba add a -mount-method flag 2013-09-30 17:35:02 -06:00
Alexander Larsson
0484b2c325 RootIsShared: Fix root detection
Column 4 is the mount position, column 3 will not always be
"/" for the root. On one of my system its "/root".
2013-09-30 17:35:02 -06:00
Alexander Larsson
be6fef0254 Tests: Clean up any old devmapper leftovers before starting tests 2013-09-30 17:35:02 -06:00
Alexander Larsson
071cc18b58 Image.Changes: Deactivate image device after unmounting it
There is no need to keep the image device around if we were the
onces creating the device.
2013-09-30 17:35:02 -06:00
Alexander Larsson
6ec5585501 Add DeviceSet.HasActivatedDevice()
This lets you see if a device has been activated
2013-09-30 17:35:02 -06:00
Alexander Larsson
6f57e8025a image: Unmount before removing device in error paths
The device remove fails unless we unmount first
2013-09-30 17:35:02 -06:00
Alexander Larsson
b0a9147fd5 runtime test: Ensure all containers are unmounted at nuke()
Otherwise we may leave around e.g. devmapper mounts
2013-09-30 17:35:02 -06:00
Alexander Larsson
a7e876e357 ShellQuoteArguments: Fix quoting
This accidentally used two quotes to start/end each quoted string.
2013-09-30 17:35:01 -06:00
Alexander Larsson
ecdbdfdaea Image: unmount device before removing it on failures
If we don't do this the remove will fail due to EBUSY
2013-09-30 17:35:01 -06:00
Alexander Larsson
2c71710b74 image: Handle systems that don't support O_PATH when updating timestamp
Older kernel can't handle O_PATH in open() so this will
fail on dirs and symlinks. For dirs wa can fallback to
the normal Utimes, but for symlinks there is not much to do
but ignore their timestamps.
2013-09-30 17:35:01 -06:00
Alexander Larsson
bbc72c85f7 devmapper: Fix loopback mount code
Typo in the loop-control code made it always fall back to the
old method of opening loopback devices.
2013-09-30 17:35:01 -06:00
Alexander Larsson
1a082ed245 applyLayer() use btrfs reflinks if availible
We use the new file copy helper which uses btrfs reflinks if availible.
2013-09-30 17:35:01 -06:00
Alexander Larsson
86421e8b5e Add CopyFile that can use btrfs reflinks if availible 2013-09-30 17:35:01 -06:00
Alexander Larsson
91c69fd353 Remove accidental commit that enabled MountMethodFilesystem 2013-09-30 17:35:01 -06:00
Alexander Larsson
43a7d3d0e9 Add trivial copy-based CoW backend
This creates a container by copying the corresponding files
from the layers into the containers. This is not gonna be very useful
on a developer setup, as there is no copy-on-write or general diskspace
sharing. It also makes container instantiation slower.

However, it may be useful in deployment where we don't always have a lot
of containers running (long-running daemons) and where we don't
do a lot of docker commits.
2013-09-30 17:35:01 -06:00
Alexander Larsson
60f552cac3 Add Changes.ChangesLayers()
This calculates the difference between a set of layers and a
directory tree.
2013-09-30 17:35:01 -06:00
Alexander Larsson
ad402763e1 Changes: Better metadata comparison
Change the comparison to better handle files that are copied during
container creation but not actually changed:

* Inode - this will change during a copy
* ctime - this will change during a copy (as we can't set it back)
* blocksize - this will change for sparse files during copy
* size for directories - this can change anytime but doesn't
  necessarily reflect an actual contents change
* Compare mtimes at microsecond precision (as this is what utimes has)
2013-09-30 17:35:01 -06:00
Alexander Larsson
5d2ace3424 Image.applyLayer: Be better at creating identical files
There are some changes here that make the file metadata better match
the layer files:

* Set the mode of the file after the chown, as otherwise the per-group/uid
  specific flags and e.g. sticky bit is lost
* Use lchown instead of chown
* Delay mtime updates to after all other changes so that later file
  creation doesn't change the mtime for the parent directory
* Use Futimes in combination with O_PATH|O_NOFOLLOW to set mtime on symlinks
2013-09-30 17:35:01 -06:00
Alexander Larsson
727e7fccca Change how ChangesDirs() works
Rather than scan the files in the old directory twice to detect the
deletions we now scan both directories twice and then do all the
diffing on the in-memory structure.

This is more efficient, but it also lets us diff more complex things
later that are not exact on-disk trees.
2013-09-30 17:35:01 -06:00
Alexander Larsson
7d566b4f76 RootIsShared() - Fix array out of bounds error
This happened for me on the last (empty) line, but better safe than sorry
so we make the check general.
2013-09-30 17:35:01 -06:00
Alexander Larsson
fdbc2695fe devmapper: Move init layer to top rather than bottom
The init layer needs to be topmost to make sure certain files
are always there (for instance, the ubuntu:12.10 image wrongly
has /dev/shm being a symlink to /run/shm, and we need to override
that). However, previously the devmapper code implemented the
init layer by putting it in the base devmapper device, which meant
layers above it could override these files (so that ubuntu:12.10
broke).

So, instead we put the base layer in *each* images devmapper device.
This is "safe" because we still have the pristine layer data
in the layer directory. Also, it means we diff the container
against the image with the init layer applied, so it won't show
up in diffs/commits.
2013-09-30 17:35:01 -06:00
Alexander Larsson
429587779a lxc: Work around lxc-start need for private mounts
lxc-start requires / to be mounted private, otherwise the changes
it does inside the container (both mounts and unmounts) will propagate
out to the host.

We work around this by starting up lxc-start in its own namespace where
we set / to rprivate.

Unfortunately go can't really execute any code between clone and exec,
so we can't do this in a nice way. Instead we have a horrible hack that
use the unshare command, the shell and the mount command...
2013-09-30 17:35:01 -06:00
Alexander Larsson
145024c6cc Utils: Add ShellQuoteArguments 2013-09-30 17:35:01 -06:00
Alexander Larsson
c138801073 Container: Inject into the mount, not the rwPath
For device-mapper setups we can't just push the file into the rwPath.
2013-09-30 17:35:01 -06:00
Alexander Larsson
0722786600 api_test: Fix PostContainersCreate
We can't look for the created file in the rwpath, because that
doesn't exist in the device-mapper world, instead look in the
RootfsPath.
2013-09-30 17:35:01 -06:00
Alexander Larsson
5f8e24f842 Runtime: Only remove device on destroy if it exists 2013-09-30 17:35:01 -06:00
Alexander Larsson
0d7ab8db03 graph test: Unmount image via image.Unmount()
This helps us track the unmount
2013-09-30 17:35:01 -06:00
Alexander Larsson
ed741f7b27 deviceset: Cleanup device sets on test end
We unmount all mounts and deactivate all device mapper devices to
make sure we're left with no leftovers after the test.
2013-09-30 17:35:01 -06:00
Alexander Larsson
9e64ebb295 DeviceSet: Add UnmountDevice()
Right now this does nothing but add a new layer, but it means
that all DeviceMounts are paired with DeviceUnmounts so that we
can track (and cleanup) active mounts.
2013-09-30 17:35:01 -06:00
Alexander Larsson
d951911b23 Always start tests from a clean set of loopback images
This way we don't get any issues with leftovers
2013-09-30 17:35:01 -06:00
Alexander Larsson
7fb60caa5d tests: Store the loopback images for test outside unit-tests
This directory is copied to each test prefix which is really
slow with the large loopback mounts.
2013-09-30 17:35:01 -06:00
Alexander Larsson
76a2ab6e34 Allow specifying the docker client path in _DOCKER_INIT_PATH
I currently need this to get the tests running, otherwise it will
mount the docker.test binary inside the containers, which doesn't
work due to the libdevmapper.so dependency.
2013-09-30 17:35:00 -06:00
Alexander Larsson
6094257b28 Limit the amount of prints during normal runs
This removes some Debugf() calls and chages some direct prints to
Debugf(). This means we don't get a bunch of spew when running the
tests.
2013-09-30 17:35:00 -06:00
Alexander Larsson
52294192b2 Reuse a single DeviceSetDM for all the tests
We wrap the "real" DeviceSet for each test so that we get only
a single device-mapper pool and loopback mounts, but still
separate out the IDs in the tests. This makes the test run
much faster.
2013-09-30 17:35:00 -06:00
Alexander Larsson
381ce94ef4 Add DeviceSetWrapper
This wraps an existing DeviceSet and just adds a prefix to all ids in
it. This will be useful for reusing a single DeviceSet for all the tests
(but with separate ids)
2013-09-30 17:35:00 -06:00
Alexander Larsson
99393cf3cf Delete corresponding Devices when deleting Images
If an image is deleted and there is a corresponding device
for that image we also delete the image.
2013-09-30 17:35:00 -06:00
Alexander Larsson
30890c7763 Runtime: Delete corresponding devices when deleting container 2013-09-30 17:35:00 -06:00
Alexander Larsson
b0626f403b Implement container.ExportRW() on device-mapper 2013-09-30 17:34:59 -06:00
Alexander Larsson
fda6ff9c27 Make TarFilter more useful
There are a few changes:
* Callers can specify if they want recursive behaviour or not
* All file listings to tar are sent on stdin, to handle long lists better
* We can pass in a list of filenames which will be created as empty
  files in the tarball

This is exactly what we want for the creation of layer tarballs given
a container fs, a set of files to add and a set of whiteout files to create.
2013-09-30 17:34:59 -06:00
Alexander Larsson
b86f67126c Archive: Fix up tar commandline arguments in TarFilter()
There is no need to duplicate the compression flags for
every element in the filter.
2013-09-30 17:34:59 -06:00
Alexander Larsson
1c5dc26a7c Implement docker diff for device-mapper
To do diffing we just compare file metadata, so this relies
on things like size and mtime/ctime to catch any changes.
Its *possible* to trick this by updating a file without
changing the size and setting back the mtime/ctime, but
that seems pretty unlikely to happen in reality, and lets
us avoid comparing the actual file data.
2013-09-30 17:34:59 -06:00
Alexander Larsson
8e7cbbff50 devmapper: Base the device-mapper names on the root dir name
This means the default is "docker-*", but for tests we get separate
prefixes for each test.
2013-09-30 17:34:59 -06:00
Alexander Larsson
074f38d493 Image: Always create a .docker-id file in the devices we create
Without this there is really no way to map back from the device-mapper
devices to the actual docker image/container ids in case the json file
somehow got lost
2013-09-30 17:34:59 -06:00
Alexander Larsson
a9ec1dbc9b Image: Deactivate image device when unmounting container
There is no need to keep all the device-mapper devices active, we
can just activate them on demand if needed.
2013-09-30 17:34:59 -06:00
Alexander Larsson
d2ba3e2005 Image: Initial support for device-mapper mounts
This supports creating images from layers and mounting them
for running a container.

Not supported yet are:
* Creating diffs between images/containers
* Creating layers for new images from a device-mapper container
2013-09-30 17:34:59 -06:00
Alexander Larsson
8f7361279c Runtime: Add MountMethod to allow AUFS and device-mapper to coexist 2013-09-30 17:34:59 -06:00
Alexander Larsson
ca2f7f955e Runtime: Add DeviceSet singleton
This adds a DeviceSet singleton to the Runtime object which will be used for
any DeviceMapper dependent code.
2013-09-30 17:34:59 -06:00
Alexander Larsson
1d36b8c7b7 Server: Pass in device-mapper DeviceSet to server
This makes docker (but not docker-init) link to libdevmapper and will
allow it to use the DeviceSet
2013-09-30 17:34:59 -06:00
Alexander Larsson
e6216793d9 Add DeviceSet interface
This interface matches the device-mapper implementation (DeviceSetDM)
but is free from any dependencies. This allows core docker code
to refer to a DeviceSet without having an explicit dependency on
the devmapper package.

This is important, because the devmapper package has external
dependencies which are not wanted in the docker client app, as it
needs to run with minimal dependencies in the docker image.
2013-09-30 17:34:58 -06:00
Alexander Larsson
e368c8bb01 Image: Add runtime and container id args to Mount()
We will later need the runtime to get access to the VolumeSet
singleton, and the container id to have a name for the volume
for the container
2013-09-30 17:34:58 -06:00
Alexander Larsson
167601e858 Runtime: Automatically use docker-init if it exists
In some builds the main docker binary is not statically linked,
and as such not usable in as the .dockerinit binary, for those
cases we look for a separately shipped docker-init binary and
use that instead.
2013-09-30 17:34:58 -06:00
Alexander Larsson
b8dc7b5f1a Add a separate docker-init binary
This may be used for the .dockerinit case if the main binary is not
statically linked.
2013-09-30 17:34:58 -06:00
Alexander Larsson
7fb3bfed03 devmapper: Add simple tool to test the DeviceSet commands 2013-09-30 17:34:58 -06:00
Alexander Larsson
374a5e9913 devmapper: Add DeviceSet device-mapper helper
This is a module that uses the device-mapper create CoW snapshots
You instantiate a DeviceSetDM object on a specified root (/var/lib/docker),
and it will create a subdirectory there called "loopback". It will
contain two sparse files which are loopback mounted into
a thin-pool device-mapper device called "docker-pool".

We then create a base snapshot in the pool with an empty filesystem
which can be used as a base for docker snapshots. It also keeps track
of the mapping between docker image ids and the snapshots in the pool.

Typical use of is something like (without error checking):

devices = NewDeviceSetDM("/var/lib/docker")
devices.AddDevice(imageId, "") // "" is the base image id
devices.MountDevice(imageId, "/mnt/image")
 ... extract base image to /mnt/image
devices.AddDevice(containerId, imageId)
devices.MountDevice(containerId, "/mnt/container")
... start container at /mnt/container
2013-09-30 17:34:58 -06:00
Alexander Larsson
459bac7127 Add libdevmapper wrapper 2013-09-30 17:34:58 -06:00
Solomon Hykes
23015fa14d Merge pull request #1994 from metalivedev/1993-legalcontext
Fix #1993: add explanation for export restrictions
2013-09-30 16:33:46 -07:00
Thermionix
fb46d911c2 Update archlinux.rst 2013-10-01 09:33:12 +10:00
Tianon Gravi
85b776995c Merge pull request #2051 from tianon/hack-dockerfile-refactor
Add cleanup/refactor portion of #2010 for hack and Dockerfile updates
2013-09-30 16:29:32 -07:00
Thatcher
fa44555fb4 Merge pull request #2035 from dhrp/style-revamp
Changes to a new style for the docs. Includes version switcher.
2013-09-30 15:51:43 -07:00
Andy Rothfusz
3e7c50e8a1 Merge pull request #2033 from metalivedev/1969-cherrypick-fixcommitformat
Fix #1969 formatting, add information about multiline json
2013-09-30 14:55:11 -07:00
Tianon Gravi
ccefe47897 Add cleanup/refactor portion of #2010 for hack and Dockerfile updates 2013-09-30 13:57:30 -06:00
Tianon Gravi
ff85031980 Merge pull request #2039 from tianon/mkimage-centos
Add contrib/mkimage-centos.sh back (from #1621), and associated documentation link
2013-09-30 10:51:06 -07:00
Guillaume J. Charmes
017ecefd66 Merge pull request #2046 from dotcloud/2030-dockercfg_panic_err-fix
- Runtime: fix panic with wrong dockercfg file
2013-09-30 10:02:12 -07:00
Thermionix
88f710f0e7 Update archlinux.rst
The /etc/sysctl.conf file is deprecated
https://www.archlinux.org/news/deprecation-of-etcsysctlconf/
2013-09-30 22:44:09 +10:00
Victor Vieux
6496059154 fix panic with wrong dockercfg file 2013-09-30 11:07:32 +00:00
Victor Vieux
bcce3cbdd1 Merge pull request #1995 from dotcloud/fix_attach_2
Fix the attach behavior with -i
2013-09-30 03:29:19 -07:00
Victor Vieux
bbf644ed62 Merge pull request #2025 from dotcloud/2020_add_dockercfg_doc
add .dockercfg doc
2013-09-30 03:21:46 -07:00
Tianon Gravi
d89ce09a76 Add contrib/mkimage-centos.sh back (from #1621), and associated documentation link 2013-09-28 07:54:34 -06:00
Thatcher Peskens
e3e041b6bf Changes to a new style for the docs. Includes version switcher.
* added link to edit on GitHub
* Changed image source on homepage
* Made some changes to the structure, added the ability to have l3 navigation. Added warning, note and other styles.
* Fixed an image link, removed the .. :content: links because they were quicky and didn't look good, added pagelinks to current page of other versions.
* Moved the remote client api's to their own doc
2013-09-27 19:54:52 -07:00
Andy Rothfusz
0a35b1fb36 Added more context. 2013-09-27 19:07:12 -07:00
Andy Rothfusz
3894add8a9 Merge pull request #2034 from metalivedev/1969-cherrypick-fixcommitformat
Fix #1969 formatting, add information about multiline json
2013-09-27 18:19:55 -07:00
Andy Rothfusz
74d54b9b2e Fix #1969 formatting, add information about multiline json 2013-09-27 18:16:00 -07:00
Michael Crosby
31fd11860b Merge pull request #2032 from dotcloud/move-rm-to-client
Move run -rm to the cli only
2013-09-27 17:19:01 -07:00
Daniel Mizyrycki
b081a740b3 Merge pull request #2006 from jo-m/master
Enable SSH Agent forwarding in Vagrant VM
2013-09-27 12:07:44 -07:00
Michael Crosby
db869ecce5 Merge pull request #1589 from unclejack/479-add_rm_support_to_docker_run
Add -rm to docker run for removing a container on exit
2013-09-27 11:45:32 -07:00
Guillaume J. Charmes
537149829a Fix the attach behavior with -i 2013-09-27 11:10:55 -07:00
Andy Rothfusz
ba10e28927 Merge pull request #2009 from kyleconroy/master
Improve registry and index REST API documentation
2013-09-27 10:56:21 -07:00
Victor Vieux
f4855a7cf0 add .dockercfg doc 2013-09-27 18:19:17 +02:00
unclejack
22e7e107ad automatically remove container via -rm
add AutoRemove to HostConfig
add -rm flag to docker run
add TestRunAutoRemove to test -rm
docs: add -rm to commandline/command/run
add hostConfig to container monitor
make monitor destroy the container via -rm

This adds support for automatically removing a container after it
exits. The removal of the container is handled on the server side.
2013-09-27 17:43:12 +03:00
Colin Dunklau
edd90d46c7 Clearly point at detailed docs 2013-09-27 08:32:55 -05:00
Victor Vieux
514886c73d Merge pull request #2023 from alexlarsson/old_kernel
Image: Fix time setting for old kernels
2013-09-27 05:25:13 -07:00
Guillaume J. Charmes
f435970695 Merge pull request #1842 from dotcloud/split_stdout_stderr
* Runtime: Split stdout stderr
2013-09-26 18:05:24 -07:00
Guillaume J. Charmes
cb18a6e1b9 Update docs + fix endian issue 2013-09-26 17:36:21 -07:00
Alexander Larsson
75e958bf48 Image: Fix time setting for old kernels
This is a better fix for futimes() on kernels not supporting O_PATH.
The previous fix broke when copying a device, as it tried to open it
and got and error.
2013-09-26 23:59:37 +02:00
Kyle Conroy
ce05083d4b Fix copypasta errors 2013-09-26 14:57:02 -07:00
Michael Crosby
723de87681 Move run -rm to the cli only 2013-09-26 14:52:37 -07:00
David Sissitka
c22e377a6d Used tabs for alignment when I should've used spaces. Fixed. 2013-09-26 13:56:59 -07:00
Colin Dunklau
3f0d0075f8 Hint for Remote API doc details in header links 2013-09-26 15:30:26 -05:00
David Sissitka
f8c9f11f06 Configured FPM to make /etc/init/docker.conf a config file. 2013-09-26 12:52:43 -07:00
Alexander Larsson
80319add55 lxc: Allow set_file_cap capability in container
This means you're able to set the bits for capabilities on files
inside the container. This is needed for e.g. many fedora packages
as they use finegrained capabilities rather than setuid binaries.

This is safe as we're not adding capabilities really, since the
container is already allowed to create setuid binaries. Setuid
binaries are strictly more powerful that any capabilities (as root implies
all capabilities).

This doesn't mean the container can *gain* capabilities that it
doesn't already have though. The actual set of caps are strictly
decreasing.
2013-09-26 21:41:45 +02:00
Victor Vieux
ebfa24acb0 go fmt and aufs support removed 2013-09-26 15:40:13 +00:00
Victor Vieux
5e1d540209 Revert "add a -mount-method flag"
This reverts commit e52d756f40c9ccf8b37ca496cb72be057c909ed7.
2013-09-26 15:14:03 +00:00
Victor Vieux
c1e25d7273 add a -mount-method flag 2013-09-26 15:10:01 +00:00
Alexander Larsson
d263aa6ca9 RootIsShared: Fix root detection
Column 4 is the mount position, column 3 will not always be
"/" for the root. On one of my system its "/root".
2013-09-26 15:09:33 +00:00
Alexander Larsson
03320f0d1c Tests: Clean up any old devmapper leftovers before starting tests 2013-09-26 15:09:33 +00:00
Alexander Larsson
6c7ae06435 Image.Changes: Deactivate image device after unmounting it
There is no need to keep the image device around if we were the
onces creating the device.
2013-09-26 15:09:33 +00:00
Alexander Larsson
395bce4c41 Add DeviceSet.HasActivatedDevice()
This lets you see if a device has been activated
2013-09-26 15:09:33 +00:00
Alexander Larsson
41399ac005 image: Unmount before removing device in error paths
The device remove fails unless we unmount first
2013-09-26 15:09:33 +00:00
Alexander Larsson
67788723c9 runtime test: Ensure all containers are unmounted at nuke()
Otherwise we may leave around e.g. devmapper mounts
2013-09-26 15:09:33 +00:00
Alexander Larsson
f99f39abaa ShellQuoteArguments: Fix quoting
This accidentally used two quotes to start/end each quoted string.
2013-09-26 15:09:33 +00:00
Alexander Larsson
009d0f9d81 Image: unmount device before removing it on failures
If we don't do this the remove will fail due to EBUSY
2013-09-26 15:09:32 +00:00
Alexander Larsson
ed65815613 image: Handle systems that don't support O_PATH when updating timestamp
Older kernel can't handle O_PATH in open() so this will
fail on dirs and symlinks. For dirs wa can fallback to
the normal Utimes, but for symlinks there is not much to do
but ignore their timestamps.
2013-09-26 15:09:32 +00:00
Alexander Larsson
cc28829429 devmapper: Fix loopback mount code
Typo in the loop-control code made it always fall back to the
old method of opening loopback devices.
2013-09-26 15:09:32 +00:00
Alexander Larsson
062a2b32e9 applyLayer() use btrfs reflinks if availible
We use the new file copy helper which uses btrfs reflinks if availible.
2013-09-26 15:09:32 +00:00
Alexander Larsson
cda8754013 Add CopyFile that can use btrfs reflinks if availible 2013-09-26 15:09:32 +00:00
Alexander Larsson
5415804c9d Remove accidental commit that enabled MountMethodFilesystem 2013-09-26 15:09:32 +00:00
Alexander Larsson
adae684987 Add trivial copy-based CoW backend
This creates a container by copying the corresponding files
from the layers into the containers. This is not gonna be very useful
on a developer setup, as there is no copy-on-write or general diskspace
sharing. It also makes container instantiation slower.

However, it may be useful in deployment where we don't always have a lot
of containers running (long-running daemons) and where we don't
do a lot of docker commits.
2013-09-26 15:09:32 +00:00
Alexander Larsson
ad0a6a03e3 Add Changes.ChangesLayers()
This calculates the difference between a set of layers and a
directory tree.
2013-09-26 15:09:32 +00:00
Alexander Larsson
36603e68e3 Changes: Better metadata comparison
Change the comparison to better handle files that are copied during
container creation but not actually changed:

* Inode - this will change during a copy
* ctime - this will change during a copy (as we can't set it back)
* blocksize - this will change for sparse files during copy
* size for directories - this can change anytime but doesn't
  necessarily reflect an actual contents change
* Compare mtimes at microsecond precision (as this is what utimes has)
2013-09-26 15:09:32 +00:00
Alexander Larsson
99c7d129f4 Image.applyLayer: Be better at creating identical files
There are some changes here that make the file metadata better match
the layer files:

* Set the mode of the file after the chown, as otherwise the per-group/uid
  specific flags and e.g. sticky bit is lost
* Use lchown instead of chown
* Delay mtime updates to after all other changes so that later file
  creation doesn't change the mtime for the parent directory
* Use Futimes in combination with O_PATH|O_NOFOLLOW to set mtime on symlinks
2013-09-26 15:09:32 +00:00
Alexander Larsson
02b5f1369c Change how ChangesDirs() works
Rather than scan the files in the old directory twice to detect the
deletions we now scan both directories twice and then do all the
diffing on the in-memory structure.

This is more efficient, but it also lets us diff more complex things
later that are not exact on-disk trees.
2013-09-26 15:09:32 +00:00
Alexander Larsson
d478a4bb54 RootIsShared() - Fix array out of bounds error
This happened for me on the last (empty) line, but better safe than sorry
so we make the check general.
2013-09-26 15:09:32 +00:00
Alexander Larsson
c199ed228b devmapper: Move init layer to top rather than bottom
The init layer needs to be topmost to make sure certain files
are always there (for instance, the ubuntu:12.10 image wrongly
has /dev/shm being a symlink to /run/shm, and we need to override
that). However, previously the devmapper code implemented the
init layer by putting it in the base devmapper device, which meant
layers above it could override these files (so that ubuntu:12.10
broke).

So, instead we put the base layer in *each* images devmapper device.
This is "safe" because we still have the pristine layer data
in the layer directory. Also, it means we diff the container
against the image with the init layer applied, so it won't show
up in diffs/commits.
2013-09-26 15:09:32 +00:00
Alexander Larsson
e40f5c7cb9 lxc: Work around lxc-start need for private mounts
lxc-start requires / to be mounted private, otherwise the changes
it does inside the container (both mounts and unmounts) will propagate
out to the host.

We work around this by starting up lxc-start in its own namespace where
we set / to rprivate.

Unfortunately go can't really execute any code between clone and exec,
so we can't do this in a nice way. Instead we have a horrible hack that
use the unshare command, the shell and the mount command...
2013-09-26 15:09:32 +00:00
Alexander Larsson
d80be57c15 Utils: Add ShellQuoteArguments 2013-09-26 15:09:32 +00:00
Alexander Larsson
20bac716b5 Container: Inject into the mount, not the rwPath
For device-mapper setups we can't just push the file into the rwPath.
2013-09-26 15:09:32 +00:00
Alexander Larsson
2566e2604c api_test: Fix PostContainersCreate
We can't look for the created file in the rwpath, because that
doesn't exist in the device-mapper world, instead look in the
RootfsPath.
2013-09-26 15:09:32 +00:00
Alexander Larsson
e1c418cac3 Runtime: Only remove device on destroy if it exists 2013-09-26 15:09:32 +00:00
Alexander Larsson
3343b3f8f8 graph test: Unmount image via image.Unmount()
This helps us track the unmount
2013-09-26 15:09:32 +00:00
Alexander Larsson
c6e8813c97 deviceset: Cleanup device sets on test end
We unmount all mounts and deactivate all device mapper devices to
make sure we're left with no leftovers after the test.
2013-09-26 15:09:32 +00:00
Alexander Larsson
251a7ed437 DeviceSet: Add UnmountDevice()
Right now this does nothing but add a new layer, but it means
that all DeviceMounts are paired with DeviceUnmounts so that we
can track (and cleanup) active mounts.
2013-09-26 15:09:31 +00:00
Alexander Larsson
261b0b01df Always start tests from a clean set of loopback images
This way we don't get any issues with leftovers
2013-09-26 15:09:31 +00:00
Alexander Larsson
a7fd1fce5d tests: Store the loopback images for test outside unit-tests
This directory is copied to each test prefix which is really
slow with the large loopback mounts.
2013-09-26 15:09:31 +00:00
Alexander Larsson
6938a36c69 Allow specifying the docker client path in _DOCKER_INIT_PATH
I currently need this to get the tests running, otherwise it will
mount the docker.test binary inside the containers, which doesn't
work due to the libdevmapper.so dependency.
2013-09-26 15:09:31 +00:00
Alexander Larsson
bc7fa7b957 Limit the amount of prints during normal runs
This removes some Debugf() calls and chages some direct prints to
Debugf(). This means we don't get a bunch of spew when running the
tests.
2013-09-26 15:09:31 +00:00
Alexander Larsson
d47c18c5fb Reuse a single DeviceSetDM for all the tests
We wrap the "real" DeviceSet for each test so that we get only
a single device-mapper pool and loopback mounts, but still
separate out the IDs in the tests. This makes the test run
much faster.
2013-09-26 15:09:31 +00:00
Alexander Larsson
0e686fa2f4 Add DeviceSetWrapper
This wraps an existing DeviceSet and just adds a prefix to all ids in
it. This will be useful for reusing a single DeviceSet for all the tests
(but with separate ids)
2013-09-26 15:09:31 +00:00
Alexander Larsson
3f3f5f0bba Delete corresponding Devices when deleting Images
If an image is deleted and there is a corresponding device
for that image we also delete the image.
2013-09-26 15:09:31 +00:00
Alexander Larsson
19ba0b851b Runtime: Delete corresponding devices when deleting container 2013-09-26 15:08:55 +00:00
Alexander Larsson
94fa3c7bb5 Implement container.ExportRW() on device-mapper 2013-09-26 15:08:55 +00:00
Alexander Larsson
223280f319 Make TarFilter more useful
There are a few changes:
* Callers can specify if they want recursive behaviour or not
* All file listings to tar are sent on stdin, to handle long lists better
* We can pass in a list of filenames which will be created as empty
  files in the tarball

This is exactly what we want for the creation of layer tarballs given
a container fs, a set of files to add and a set of whiteout files to create.
2013-09-26 15:08:55 +00:00
Alexander Larsson
8f23945f7f Archive: Fix up tar commandline arguments in TarFilter()
There is no need to duplicate the compression flags for
every element in the filter.
2013-09-26 15:08:55 +00:00
Alexander Larsson
8e8ef7cb5b Implement docker diff for device-mapper
To do diffing we just compare file metadata, so this relies
on things like size and mtime/ctime to catch any changes.
Its *possible* to trick this by updating a file without
changing the size and setting back the mtime/ctime, but
that seems pretty unlikely to happen in reality, and lets
us avoid comparing the actual file data.
2013-09-26 15:08:55 +00:00
Alexander Larsson
8f343ea65a devmapper: Base the device-mapper names on the root dir name
This means the default is "docker-*", but for tests we get separate
prefixes for each test.
2013-09-26 15:08:55 +00:00
Alexander Larsson
b125f2334c Image: Always create a .docker-id file in the devices we create
Without this there is really no way to map back from the device-mapper
devices to the actual docker image/container ids in case the json file
somehow got lost
2013-09-26 15:08:55 +00:00
Alexander Larsson
a89a51128e Image: Deactivate image device when unmounting container
There is no need to keep all the device-mapper devices active, we
can just activate them on demand if needed.
2013-09-26 15:08:54 +00:00
Alexander Larsson
fcd41fe51a Image: Initial support for device-mapper mounts
This supports creating images from layers and mounting them
for running a container.

Not supported yet are:
* Creating diffs between images/containers
* Creating layers for new images from a device-mapper container
2013-09-26 15:08:54 +00:00
Alexander Larsson
53851474c0 Runtime: Add MountMethod to allow AUFS and device-mapper to coexist 2013-09-26 15:08:54 +00:00
Alexander Larsson
f317a6b6fe Runtime: Add DeviceSet singleton
This adds a DeviceSet singleton to the Runtime object which will be used for
any DeviceMapper dependent code.
2013-09-26 15:08:54 +00:00
Alexander Larsson
87e248f524 Server: Pass in device-mapper DeviceSet to server
This makes docker (but not docker-init) link to libdevmapper and will
allow it to use the DeviceSet
2013-09-26 15:08:54 +00:00
Alexander Larsson
ac194fc696 Add DeviceSet interface
This interface matches the device-mapper implementation (DeviceSetDM)
but is free from any dependencies. This allows core docker code
to refer to a DeviceSet without having an explicit dependency on
the devmapper package.

This is important, because the devmapper package has external
dependencies which are not wanted in the docker client app, as it
needs to run with minimal dependencies in the docker image.
2013-09-26 15:08:54 +00:00
Alexander Larsson
8637ba710e Image: Add runtime and container id args to Mount()
We will later need the runtime to get access to the VolumeSet
singleton, and the container id to have a name for the volume
for the container
2013-09-26 15:08:54 +00:00
Alexander Larsson
0f5ccf934e Runtime: Automatically use docker-init if it exists
In some builds the main docker binary is not statically linked,
and as such not usable in as the .dockerinit binary, for those
cases we look for a separately shipped docker-init binary and
use that instead.
2013-09-26 15:08:54 +00:00
Alexander Larsson
250bc3f615 Add a separate docker-init binary
This may be used for the .dockerinit case if the main binary is not
statically linked.
2013-09-26 15:08:54 +00:00
Alexander Larsson
2b1dc8a8a3 devmapper: Add simple tool to test the DeviceSet commands 2013-09-26 15:08:54 +00:00
Alexander Larsson
0b12702c0c devmapper: Add DeviceSet device-mapper helper
This is a module that uses the device-mapper create CoW snapshots
You instantiate a DeviceSetDM object on a specified root (/var/lib/docker),
and it will create a subdirectory there called "loopback". It will
contain two sparse files which are loopback mounted into
a thin-pool device-mapper device called "docker-pool".

We then create a base snapshot in the pool with an empty filesystem
which can be used as a base for docker snapshots. It also keeps track
of the mapping between docker image ids and the snapshots in the pool.

Typical use of is something like (without error checking):

devices = NewDeviceSetDM("/var/lib/docker")
devices.AddDevice(imageId, "") // "" is the base image id
devices.MountDevice(imageId, "/mnt/image")
 ... extract base image to /mnt/image
devices.AddDevice(containerId, imageId)
devices.MountDevice(containerId, "/mnt/container")
... start container at /mnt/container
2013-09-26 15:08:54 +00:00
Alexander Larsson
739af0a17f Add libdevmapper wrapper 2013-09-26 15:08:54 +00:00
Kyle Conroy
818ec10da3 Fix Authorization headers 2013-09-26 01:19:49 -07:00
Kyle Conroy
34e28ccc88 Remove smart quotes. Add the X-Docker-Token header
Also fix the /layer endpoint, which had incorrect information
2013-09-26 01:15:36 -07:00
Kyle Conroy
792403f2dc Add the X-Docker-Registry header and /v1/_ping endpoint 2013-09-26 00:16:15 -07:00
Jonathan Mueller
8f5c33dc1f Enable SSH Agent forwarding in Vagrant VM, so one is able to clone repos from private git repos etc. 2013-09-25 22:57:04 +02:00
Andy Rothfusz
06c1f000e8 Merge pull request #2000 from tianon/deprecated-docker-latest-tgz
Replace deprecated upgrading reference to docker-latest.tgz, which hasn't been updated since 0.5.3
2013-09-25 13:47:48 -07:00
Andy Rothfusz
00b3acb8ab Merge pull request #2001 from tianon/gentoo-tree
Update Gentoo installation documentation now that we're in the portage tree proper
2013-09-25 13:45:51 -07:00
Victor Vieux
420ba9c85a Merge pull request #2004 from kencochrane/master
fix the error message so it is the same as the regex issue #1999
2013-09-25 09:46:15 -07:00
Ken Cochrane
0f829bf5cf fix the error message so it is the same as the regex issue #1999 2013-09-25 11:33:09 -04:00
Victor Vieux
1363de0934 Merge pull request #1989 from alexlarsson/setsid
Container: Always create a new session for the container
2013-09-25 07:40:51 -07:00
Tianon Gravi
d06116d2e8 Update Gentoo installation documentation now that we're in the portage tree proper
We're officially a first-class Gentoo citizen now, which is very exciting.  Many thanks to @gregkh for helping us get here.

I started just adapting sections of language in this document, and realized several bits needed to just be rewritten entirely to be more clear.
2013-09-24 23:26:36 -06:00
Tianon Gravi
595210a370 Replace deprecated upgrading reference to docker-latest.tgz, which hasn't been updated since 0.5.3 2013-09-24 21:25:45 -06:00
Michael Crosby
c9b916b293 Update VERSION to 0.6.3-dev 2013-09-24 19:54:13 -07:00
Michael Crosby
1e6370fd4b Merge branch 'release' 2013-09-24 19:54:06 -07:00
Solomon Hykes
a59a66528b Merge pull request #1968 from tianon/hack-build-instructions
* Hack: Add several of the small make.sh fixes from #1920, and make the output more consistent and contributor-friendly
2013-09-24 17:38:39 -07:00
Andy Rothfusz
b048e9dffc Merge pull request #1983 from blissdev/patch-1
various command fixes in postgres example
2013-09-24 14:03:48 -07:00
blissdev
c000e6a7fc revert removal of slash betwixt user/repo 2013-09-24 15:51:21 -05:00
Tianon Gravi
aa3de0b849 Add several of the small make.sh fixes from #1920, and make the output more consistent and contributor-friendly, since release instructions already exist in release.sh 2013-09-24 14:36:20 -06:00
Michael Crosby
648d759517 Merge pull request #1972 from dotcloud/bump_0.6.3
Bump to version v0.6.3
2013-09-24 11:20:27 -07:00
Andy Rothfusz
5c190fa926 Fix #1993: add explanation for export restrictions 2013-09-24 11:04:08 -07:00
Solomon Hykes
03fe5632d0 Merge pull request #1970 from dotcloud/cleanup-hack
Cleanup and reorganize docs and tooling for contributors and maintainers
2013-09-24 10:38:21 -07:00
Dan Buch
edde4f55e0 Adding more tests around auth.ResolveAuthConfig
mostly because I've been failing at getting docker `0.6.2` working with
docker-registry `0.6.0` with regard to login and push.  I suspect there
may be some mismatched expectations between `auth.ResolveAuthConfig` and
`registry.ResolveRepositoryName`, but I haven't done enough research or
experimentation to think it's anything more than user error.  More tests
are good, no?
2013-09-24 12:36:50 -04:00
Victor Vieux
7447867edd Merge pull request #1982 from modcloth-labs/spelling-fix-for-the-word-protocol
Minor spelling correction of protocoll -> protocol
2013-09-24 07:40:21 -07:00
Alexander Larsson
c1c74cb0b1 Container: Always create a new session for the container
We never want the container to be in the same process group as the
daemon, as then the container will receive signals sent to the
process group of the container.
2013-09-24 14:57:29 +02:00
blissdev
17b7194d91 use su instead of sudo 2013-09-24 02:25:16 -05:00
Jordan Arentsen
15ad2915b9 various command fixes
Indicating the repository and tag should be separated by a space and not a '/'. Also fixed a quote typo.
2013-09-24 02:12:24 -05:00
Tianon Gravi
d6887b769c Merge pull request #1883 from tianon/mkimage-debian
Several small tweaks/fixes for contrib/mkimage-debian.sh
2013-09-23 22:44:16 -07:00
Tianon Gravi
10362870db Add a few tweaks and fixes to contrib/mkimage-debian.sh
Add simple workaround for #1755 to contrib/mkimage-debian.sh

Add simple echo patch in contrib/mkimage-debian.sh to prevent init scripts from running during apt-get installs/updates

Add `apt-get clean` to mkimage-debian.sh for slightly smaller images

Add more small apt tweaks to mkimage-debian.sh thanks to @jpetazzo and @spahl
2013-09-23 22:39:57 -06:00
Dan Buch
a7db125480 Minor spelling correction of protocoll -> protocol 2013-09-23 23:14:42 -04:00
Solomon Hykes
f6c64827c8 Hack: correct typo in release checklist 2013-09-23 18:43:08 -07:00
Andy Rothfusz
30b759ffa9 Merge pull request #1973 from metalivedev/1969-formatfix
Fix #1969 formatting, add information about multiline json
2013-09-23 13:17:55 -07:00
Michael Crosby
35ca35ffb6 Merge pull request #1975 from tianon/patch-1
Add @tianon to hack/MAINTAINERS
2013-09-23 12:21:36 -07:00
Tianon Gravi
a4067b1b44 Add @tianon to hack/MAINTAINERS 2013-09-23 12:39:14 -06:00
Michael Crosby
b0a49a30c7 Bump to version v0.6.3 2013-09-23 11:29:11 -07:00
Andy Rothfusz
6097644e4b Fix #1969 formatting, add information about multiline json 2013-09-23 11:29:08 -07:00
Solomon Hykes
fa3837abf1 Hack: update README 2013-09-23 11:26:05 -07:00
Solomon Hykes
baff72bc82 Update maintainer's manual: every change should be done in a pull request. 2013-09-23 11:26:05 -07:00
Solomon Hykes
99377de7d2 Hack: update release checklist and reference it in REAMDE 2013-09-23 11:26:04 -07:00
Solomon Hykes
0ef5bcb17d hack/MAINTAINERS.md: a maintainer's manual. 2013-09-23 11:26:04 -07:00
Solomon Hykes
fd1c43f0e0 Hack: remove deprecated files 2013-09-23 11:26:03 -07:00
Michael Crosby
dc06496dc8 Merge pull request #1967 from dotcloud/vendor-update-tar
Update tar dependency to newest version
2013-09-23 10:44:42 -07:00
Michael Crosby
cfbe76e559 Update tar dependency to newest version 2013-09-23 09:59:04 -07:00
Victor Vieux
2fafe1efce Merge pull request #1948 from dotcloud/fix_attach
Fix attach issue
2013-09-23 02:15:51 -07:00
Roger Peppe
181b9baddd use less reflection in command line method invocation 2013-09-23 01:06:31 +01:00
Daniel Mizyrycki
8240e37b87 Merge pull request #1820 from dotcloud/1647-api-group
packaging, issue #1647: Add docker groupname on the package release
2013-09-22 14:21:26 -07:00
Michael Crosby
23cf3c7a33 Merge pull request #1934 from dotcloud/host-permissions
Only copy files and change permissions with non bindmount
2013-09-22 09:40:52 -07:00
Tianon Gravi
e37bb50628 Add proper bash completion for "docker push" 2013-09-20 21:22:51 -06:00
Andy Rothfusz
2819cfb3f3 Merge pull request #1954 from metalivedev/1901-cherrypick-builddocker
1901 1929 1932 cherrypick to release and docs
2013-09-20 18:13:11 -07:00
Andy Rothfusz
a479f7659d Merge pull request #1929 from tianon/gentoo-docs
Simplified Gentoo install instructions now that our overlay is in the official layman repositories.xml list
2013-09-20 18:06:27 -07:00
Andy Rothfusz
b02a591f57 Merge pull request #1932 from jcassee/patch-1
Download Ubuntu 13.04 repository key over HTTPS
2013-09-20 18:02:40 -07:00
Andy Rothfusz
c654075654 Merge pull request #1901 from jalateras/update-contributring-docs
Fix #1664
2013-09-20 17:55:15 -07:00
Andy Rothfusz
5a3dcbb3f6 Merge pull request #1952 from metalivedev/1909-cherrypick
Fix minor typo
2013-09-20 16:56:07 -07:00
Nick Stinemates
cce6f00c0c Fix minor typo
Changed  to
2013-09-20 16:31:57 -07:00
Michael Crosby
4db64111bd Merge pull request #1949 from dotcloud/1895-registry-regex
Modify repository name regex to match index
2013-09-20 14:03:50 -07:00
Guillaume J. Charmes
e97364ecd7 Improve detach unit tests 2013-09-20 13:36:19 -07:00
Guillaume J. Charmes
2bd089dadb Fix attach issue 2013-09-20 11:31:00 -07:00
Victor Vieux
5bd0437eed abord build if mergeConfig returns an error and fix duplicate error message 2013-09-20 12:46:24 +00:00
Victor Vieux
a81393787f Merge pull request #1889 from dsissitka/fixhttpimport
Fixed HTTP imports.
2013-09-20 03:06:04 -07:00
Michael Crosby
b45e280ee8 Only copy files and change permissions with non bindmount 2013-09-19 20:35:05 -07:00
Michael Crosby
5867f9e761 Modify repository name regex to match index 2013-09-19 20:25:00 -07:00
Andy Rothfusz
6132f378e0 Merge pull request #1901 from jalateras/update-contributring-docs
Fix #1664
2013-09-19 18:00:23 -07:00
Jim Alateras
3cf4b2c7c1 Updated the section about extracting the binary 2013-09-20 10:00:30 +10:00
Jim Alateras
d70cbbf1fc Updated the section about extracting the binary 2013-09-20 09:58:12 +10:00
Jim Alateras
b7e7104e92 Updated the section about extracting the binary 2013-09-20 09:49:20 +10:00
Andy Rothfusz
7e60a6b1ea Merge pull request #1932 from jcassee/patch-1
Download Ubuntu 13.04 repository key over HTTPS
2013-09-19 13:41:51 -07:00
Andy Rothfusz
45979a7ef7 Merge pull request #1929 from tianon/gentoo-docs
Simplified Gentoo install instructions now that our overlay is in the official layman repositories.xml list
2013-09-19 13:41:29 -07:00
Joost Cassee
5c9213258a Download Ubuntu 13.04 repository key over HTTPS 2013-09-19 21:14:39 +02:00
Guillaume J. Charmes
68074fce68 Merge pull request #1886 from dotcloud/multi-volumes-from
* Runtime: Allow multiple volumes-from
2013-09-19 12:01:12 -07:00
Andy Rothfusz
c42056b969 Merge pull request #1914 from tianon/base-repository-is-deprecated
Removing the deprecated `base` repository from more docs
2013-09-19 11:04:11 -07:00
Tianon Gravi
341addeccd Simplify install instructions now that our overlay is in the official repositories.xml list, and add note about hacky #1422 workaround 2013-09-19 11:49:43 -06:00
Tianon Gravi
47904290a5 Remove many remaining docs references to the deprecated base repository and several other minor doc cleanups 2013-09-19 10:27:08 -06:00
Solomon Hykes
a18c26392f Docs: remove reference to deprecated 'base' image 2013-09-19 10:25:30 -06:00
Andy Rothfusz
77ad95d372 Merge pull request #1913 from metalivedev/1654-registryexamples
Fix #1654 Improve the introduction to repositories flow.
2013-09-18 17:53:13 -07:00
Guillaume J. Charmes
fee61895f2 Update VERSION 2013-09-18 12:06:29 -07:00
Guillaume J. Charmes
f6a78f89ba Merge remote-tracking branch 'origin/release' 2013-09-18 12:06:10 -07:00
Daniel Mizyrycki
081543c49a Merge pull request #1908 from dotcloud/bump_v0.6.2
Bump v0.6.2
2013-09-18 11:21:51 -07:00
Jim Alateras
4054f31471 Updated the dev environment document 2013-09-18 14:18:05 +10:00
Jim Alateras
76a07371c5 Further updates to the dev environment document 2013-09-18 14:18:05 +10:00
Jim Alateras
5d364fda3c Further updates to the dev environment document 2013-09-18 14:18:05 +10:00
Jim Alateras
28311f61be Update the devenvironment document 2013-09-18 14:18:05 +10:00
Jim Alateras
70b731735c Updated the dev environment document 2013-09-18 12:41:12 +10:00
Andy Rothfusz
67453d6b48 Fix #1654 Improve the introduction to repositories flow. 2013-09-17 19:01:11 -07:00
Andy Rothfusz
c14450ae5c Merge pull request #1909 from dotcloud/fix-typo-docs
Fix minor typo
2013-09-17 18:25:59 -07:00
Nick Stinemates
593566438d Fix minor typo
Changed  to
2013-09-17 18:49:47 +00:00
Guillaume J. Charmes
ca5913ff3e Bump version to 0.6.2 2013-09-17 11:11:39 -07:00
Solomon Hykes
85f3ec88a6 Merge pull request #1893 from dotcloud/add-tianon-maintainer
Add Tianon to contrib/ maintainers
2013-09-17 11:00:48 -07:00
Michael Crosby
b2707dccc1 Merge pull request #1898 from dotcloud/smallfix_registry
Prevent panic upon error pulling registry
2013-09-17 10:27:19 -07:00
Michael Crosby
b826351337 Merge pull request #1897 from dotcloud/update_doc
Update the commit documentation with better example
2013-09-17 10:21:45 -07:00
Jim Alateras
5797e7e34e Further updates to the dev environment document 2013-09-17 21:05:55 +10:00
Jim Alateras
089a60c2cf Further updates to the dev environment document 2013-09-17 21:02:57 +10:00
Jim Alateras
a99a8386fd Update the devenvironment document 2013-09-17 19:29:13 +10:00
Daniel Mizyrycki
dfd0deefbb packaging, issue #1647: Add docker groupname on the package release 2013-09-16 23:00:54 -07:00
Andy Rothfusz
2183644578 Information about data persistence 2013-09-16 16:44:54 -07:00
Guillaume J. Charmes
e836b0064b Prevent panic upon error pulling registry 2013-09-16 16:18:25 -07:00
Michael Crosby
986906cd7b Merge pull request #1892 from dotcloud/fix-maintainers-files
Add MAINTAINERS
2013-09-16 14:41:36 -07:00
Michael Crosby
8d48119340 Merge pull request #1894 from dotcloud/1891-remove_useless_warnings
Don't show network related warnings when networking is disabled
2013-09-16 13:48:17 -07:00
Michael Crosby
cdce873ea0 Merge pull request #1896 from dotcloud/1885-missing-hostfile
Only mount hostname files if config exists
2013-09-16 11:29:52 -07:00
Michael Crosby
5a01f7485c Only mount hostname files if config exists 2013-09-16 17:53:24 +00:00
Michael Crosby
45b50730e3 Merge pull request #1849 from dotcloud/better_handle_hostConfig
Improved hostConfig reload
2013-09-16 10:48:53 -07:00
Victor Vieux
40eaa82fc6 Don't show network related warnings when networking is disabled 2013-09-16 15:58:44 +00:00
Nick Stinemates
9946981c61 Add Tianon to contrib/ maintainers
He's awesome and always contributing to this area.
2013-09-16 04:50:53 +00:00
Nick Stinemates
d6cf41cbe6 Add MAINTAINERS
Making sure we're consistent across our project.
2013-09-16 04:45:01 +00:00
David Sissitka
c6b4076125 Fixed HTTP imports. 2013-09-15 18:40:29 -07:00
Michael Crosby
b79bd4e864 Allow multiple volumes-from 2013-09-14 20:09:15 +00:00
Solomon Hykes
2f24b9e05c Merge pull request #1884 from dotcloud/update-vendored-deps
* Hack: Update vendored dependendies
2013-09-13 20:55:06 -07:00
Solomon Hykes
a63cfe7153 Merge pull request #1847 from dotcloud/test-docker-in-docker
* Hack: make the build tool more dev-friendly and packager-friendly
2013-09-13 20:19:37 -07:00
Andy Rothfusz
cd289cc10c clarify "use" 2013-09-13 17:22:53 -07:00
Andy Rothfusz
894eff64b4 Merge pull request #1880 from getvictor/patch-api
Fixed LxcConf example in Remote API v1.4 and v1.5
2013-09-13 13:28:26 -07:00
Andy Rothfusz
71e15d1c3c Merge pull request #1881 from dotcloud/ubuntu-install-instructions
Change apt source to http
2013-09-13 13:27:58 -07:00
Michael Crosby
74daeccec5 Change apt source to http 2013-09-13 19:21:43 +00:00
getvictor
102522bcd1 Fixing LxcConf example in docker_remote_api_v1.4.rst 2013-09-13 14:10:05 -05:00
getvictor
b3cbf424ec Fixed LxcConf example for docker_remote_api_v1.5.rst
Based on how command line docker sends the request.
2013-09-13 14:09:05 -05:00
Michael Crosby
33972627b7 Merge pull request #1848 from dotcloud/build-clean
Add rm option to docker build to remove intermediate containers
2013-09-13 10:58:59 -07:00
Michael Crosby
4234fc699f Merge pull request #1716 from eliasp/fixme
Added FIXME for iproute → netlink as advised in issue #925.
2013-09-13 10:58:28 -07:00
Solomon Hykes
4a707a8800 Add go.net to vendored dependencies 2013-09-13 10:24:38 -07:00
Michael Crosby
b986fd00e0 Merge pull request #1846 from dotcloud/fix_return_error
Fix wrong return error
2013-09-13 09:44:38 -07:00
Daniel Mizyrycki
f368fd9f9f Merge pull request #1862 from dotcloud/dockerfile-multiline-space
Replace multiline with empty string not space
2013-09-13 08:52:57 -07:00
Solomon Hykes
6c1c404501 Updated vendored dependencies 2013-09-12 20:42:26 -07:00
Guillaume J. Charmes
796d7a49f0 Update the commit documentation with better example 2013-09-12 13:26:31 -07:00
Michael Crosby
ffc850244f Merge pull request #1741 from griff/1737_fix_volume_uid_gid
Transfer uid and gid from image to volume
2013-09-12 10:38:37 -07:00
Andy Rothfusz
83623675ce Merge pull request #1593 from kyleconroy/master
Enable mobile view for website.
2013-09-12 10:30:16 -07:00
Andy Rothfusz
46f644c074 Merge pull request #1865 from lgp171188/patch-1
Fixed a minor typo
2013-09-12 10:11:18 -07:00
Andy Rothfusz
1bc2ab05ec Merge pull request #1859 from Bachmann1234/patch-1
Fix typo in hello_world.rst
2013-09-12 10:10:49 -07:00
Michael Crosby
1d935c6307 Update docker.bash script for build -rm 2013-09-12 16:57:10 +00:00
Michael Crosby
b7a3fc687e Add rm option to docker build to remove intermediate containers 2013-09-12 16:55:36 +00:00
Guruprasad
718b1f9fe7 Fixed a minor typo
Changed "You need to enable namespaces and cgroups, to the extend of what is needed to run LXC containers" to "You need to enable namespaces and cgroups, to the extent of what is needed to run LXC containers"
2013-09-12 13:25:05 +05:30
Solomon Hykes
45cedefadb hack/vendor.sh: overwrite existing dependencies and remove .git so they can be checked in 2013-09-11 18:38:09 -07:00
Michael Crosby
1e723bc95a Replace multiline with empty string not space 2013-09-11 23:43:55 +00:00
Guillaume J. Charmes
082d142024 Add documentation 2013-09-11 15:41:44 -07:00
Kyle Conroy
9dd98df1a3 Merge branch 'master' of https://github.com/dotcloud/docker 2013-09-11 15:38:52 -07:00
Guillaume J. Charmes
e854b7b2e6 Make StdCopy works with huge amount of data 2013-09-11 14:49:33 -07:00
Guillaume J. Charmes
289350e633 Add stderr unit test 2013-09-11 14:48:22 -07:00
Guillaume J. Charmes
8ae5348a51 Split stdout stderr for non-tty commands 2013-09-11 14:48:22 -07:00
Andy Rothfusz
557e3ec88e Merge pull request #1851 from metalivedev/1601-ec2install
Fix #1601 and #1845
2013-09-11 14:41:43 -07:00
Matt Bachmann
dfe45e1ad5 Update hello_world.rst
Small typo
2013-09-11 15:35:05 -04:00
Victor Vieux
d5480fb78d Merge pull request #1857 from shin-/master
Fixed push bug
2013-09-11 10:52:05 -07:00
shin-
c6dc90ccb9 Fixed push bug 2013-09-11 19:39:33 +02:00
Michael Crosby
02037a9b53 Merge pull request #1726 from dsissitka/1615-2
Updated "POST /containers/create" to return the right Content-Type. Fixes #1615.
2013-09-11 09:09:48 -07:00
David Sissitka
71d46eaf02 Fixed a bug I created when rebasing. 2013-09-11 01:39:55 -07:00
David Sissitka
f4ba0d4267 Replaced leading spaces with tabs. Again. 2013-09-11 01:28:20 -07:00
David Sissitka
d48ea32186 Updated postContainersCreate to use writeJSON. 2013-09-11 01:26:26 -07:00
David Sissitka
33e4d73629 Replaced leading spaces with tabs. 2013-09-11 01:07:05 -07:00
David Sissitka
07324a37eb Rebased. 2013-09-11 01:03:17 -07:00
David Sissitka
dd49cc45c8 Added a status code argument to writeJSON. 2013-09-11 00:23:53 -07:00
Andy Rothfusz
21be3b76e9 Fix #1601 with vagrantless installation instructions. 2013-09-10 18:54:13 -07:00
Brian Olsen
9cfbaecfe5 Transfer uid and gid to volume. Fixes #1737. 2013-09-11 03:17:42 +02:00
Solomon Hykes
ebee8f28ac hack/make.sh print a warning but don't exit if called outside a correct build environment. 2013-09-10 18:08:02 -07:00
Solomon Hykes
03e36caeb1 Fix typo and add dependency details in hack/PACKAGERS.md 2013-09-10 18:02:33 -07:00
Victor Vieux
f482432a76 improved hostConfig reload 2013-09-10 22:13:15 +00:00
Andy Rothfusz
c75926be4f Fix #1845 lxc typo in images 2013-09-10 14:54:35 -07:00
Michael Crosby
bd0e4fde9a Merge pull request #1838 from jmcvetta/multiline_dockerfile
Implementation of multiline syntax for Dockerfile
2013-09-10 14:22:34 -07:00
Andy Rothfusz
de75241b62 Merge pull request #1835 from metalivedev/1821-exampleslanding
fix #1821 landing page for examples
2013-09-10 14:14:00 -07:00
Solomon Hykes
228b7af516 Remove fixed FIXMEs 2013-09-10 11:33:37 -07:00
Solomon Hykes
d14058bc29 Update usage comments in hack/make.sh 2013-09-10 11:33:26 -07:00
Solomon Hykes
5b361f31f7 Packager's manual: official build vs distro build 2013-09-10 11:30:14 -07:00
Kyle Conroy
c24c5c3b60 Merge branch 'master' of https://github.com/dotcloud/docker 2013-09-10 10:57:33 -07:00
Victor Vieux
44d0f941f2 fix wrong return error 2013-09-10 17:16:59 +00:00
Victor Vieux
b7826f5666 add Brian Olsen to AUTHORS 2013-09-10 16:55:27 +00:00
Victor Vieux
27ca0c225a Merge branch '1582_fix_volume_content' of https://github.com/griff/docker into griff-1582_fix_volume_content 2013-09-10 16:52:46 +00:00
Michael Crosby
ad152efbed Merge pull request #1759 from bdon/graph-map
Minor refactor of Graph; replace uses of Graph.All (slice) with Graph.Map (map)
2013-09-10 08:49:11 -07:00
Solomon Hykes
14bbbcd571 PACKAGERS.md: a guide to packaging Docker for your favorite distro 2013-09-09 23:39:55 -07:00
Solomon Hykes
3d39336a46 Break down hack/make.sh into small scripts, one per 'bundle': test, binary, ubuntu etc. 2013-09-09 18:45:40 -07:00
Jason McVetta
6a4afb7f8e stricter regexp for Dockerfile line continuations 2013-09-09 18:23:57 -07:00
Jason McVetta
c01f6df43e Test dockerfile with line containing literal "\n" 2013-09-09 18:23:17 -07:00
Michael Crosby
e89396809f Merge pull request #1735 from dotcloud/1301-support-domainname
Add domain name support
2013-09-09 17:21:11 -07:00
Jason McVetta
4f3b8033f2 cruft removal 2013-09-09 17:17:09 -07:00
Jason McVetta
ebb934c1b0 line continuation regex 2013-09-09 17:02:45 -07:00
Victor Vieux
2801624462 Merge pull request #1796 from shin-/api_1_5
*Remote API: Bumped API version to 1.5
*Registry: Implement login with private registry
*Remote API: Improve port mapping information
2013-09-09 16:58:54 -07:00
Jason McVetta
6921ca4813 read Dockerfile into memory before parsing, to facilitate regexp preprocessing 2013-09-09 16:42:04 -07:00
Solomon Hykes
59856a20bf Add the output of the tests to each release 2013-09-09 16:30:24 -07:00
Solomon Hykes
b187cc40cd Integrate unit tests into hack/make.sh 2013-09-09 16:20:30 -07:00
Victor Vieux
58281b4f18 Merge pull request #1793 from reds/master
From FIXME: local path for ADD
2013-09-09 16:14:59 -07:00
Jason McVetta
672f1e0683 failing test case for multiline command in dockerfile 2013-09-09 15:21:04 -07:00
Victor Vieux
dd806b4ecd add Martin Redmond to AUTHORS 2013-09-09 22:19:28 +00:00
Victor Vieux
843f9091f2 Merge branch 'filter' of https://github.com/reds/docker into reds-filter 2013-09-09 22:16:16 +00:00
Victor Vieux
53da0507e4 Merge pull request #1837 from dotcloud/fix-tests-1812
only os.Exits on error
2013-09-09 15:12:32 -07:00
Victor Vieux
bd847f66c6 rebase master 2013-09-09 22:11:53 +00:00
Solomon Hykes
e503f6a878 Merge pull request #1825 from dotcloud/merge-builder-runtime
Refactor to merge builder.go into runtime.go
2013-09-09 15:11:41 -07:00
Jason McVetta
6678a26d1c gofmt 2013-09-09 15:11:30 -07:00
Solomon Hykes
e37dcd726f Hack: use vendored dependencies in-place, for less moving parts when developing 2013-09-09 15:05:25 -07:00
Andy Rothfusz
8ddfb4d6aa Merge pull request #1828 from mmikulicic/patch-1
Please add go-dockerclient to docker API clients doc
2013-09-09 14:51:28 -07:00
Andy Rothfusz
28f2fe9167 Merge pull request #1836 from srid/patch-2
remove docker-ruby from docs
2013-09-09 14:50:36 -07:00
Sridhar Ratnakumar
3c90e96b6d remove docker-ruby from docs
we don't maintain it anymore as we now recommend proper HTTP api based clients instead.
2013-09-09 14:42:45 -07:00
Victor Vieux
46a1cd69a9 only os.Exits on error 2013-09-09 21:26:35 +00:00
Victor Vieux
9b088ada7e Merge pull request #1812 from dotcloud/return-run-exit-code
*Client: Return the process exit code for run commands
2013-09-09 14:10:46 -07:00
Andy Rothfusz
0508bd8da7 Merge pull request #1773 from hectcastro/hc-riak-example
Add a Docker example for running Riak
2013-09-09 13:31:41 -07:00
Victor Vieux
446ca4b57b fix init layer 2013-09-09 20:29:57 +00:00
Victor Vieux
4f2e59f94a bind mount /etc/hosts and /etc/hostname 2013-09-09 20:29:57 +00:00
Victor Vieux
0a436e03b8 add domainname support 2013-09-09 20:29:06 +00:00
Andy Rothfusz
c66a827c98 Merge pull request #1807 from tianon/gentoo-docs
Update Gentoo docs to reflect the package name change from app-emulation/lxc-docker to app-emulation/docker
2013-09-09 13:27:48 -07:00
Andy Rothfusz
fe99e51634 Created a little landing page for the examples, combined first two. 2013-09-09 13:19:07 -07:00
Joffrey F
49b5c44ee9 Merge pull request #1833 from shin-/1815-always-push-tags
Push tags to registry even if images are already uploaded
2013-09-09 13:10:40 -07:00
shin-
64bc08f1c4 Push tags to registry even if images are already uploaded 2013-09-09 21:02:37 +02:00
Andy Rothfusz
2d4ac06426 Merge pull request #1831 from brianshumate/jbs-docs-edits
Hello World Daemon edits
2013-09-09 11:48:12 -07:00
Brian Shumate
9749d94fb0 note about exiting from attachment prior to running 2013-09-09 10:30:06 -04:00
Brian Shumate
630ae43e7d improve sentence readabilty 2013-09-09 10:19:45 -04:00
Marko Mikulicic
268928ab35 Please add go-dockerclient to docker API clients doc 2013-09-09 11:01:15 +01:00
Solomon Hykes
4cd59b96ed Hack: we no longer need to generate test binaries. 2013-09-08 18:45:23 -07:00
Solomon Hykes
055bbb79c1 vendor.sh can cleanly update vendored dependencies 2013-09-07 17:48:52 -07:00
Brandon Philips
19dc3b0792 gitignore: ignore bundles directory 2013-09-07 17:35:49 -07:00
Wes Morgan
20d24a450c move deps installation to vendor.sh script 2013-09-07 17:35:48 -07:00
Solomon Hykes
eca861a99d Add missing package import 2013-09-07 17:03:40 -07:00
Solomon Hykes
d757bd0904 Document using the Dockerfile for interactive dev/test cycles 2013-09-06 20:16:13 -07:00
Solomon Hykes
47838051be Hack: improve the Dockerfile for an easier development workflow. Build dev container once, run a shell with source mount-binded, run tests as you edit. LIKE A BOSS. 2013-09-06 20:14:03 -07:00
Solomon Hykes
fa806f26af Add usage instructions to the Dockerfile. Build, test and release docker using docker. 2013-09-06 19:58:05 -07:00
Solomon Hykes
34eab42833 Adapt Dockerfile to run docker tests inside docker 2013-09-06 19:27:49 -07:00
Solomon Hykes
3c80bd76cf Adapt the original dind script and add a description 2013-09-06 19:27:48 -07:00
Solomon Hykes
c983023661 Copy dind wrapper script from github.com/jpetazzo/dind 2013-09-06 19:27:48 -07:00
Solomon Hykes
6a9f4ecf9b Add missing comments to runtime.go 2013-09-06 17:43:34 -07:00
Solomon Hykes
24e02043a2 Merge builder.go into runtime.go 2013-09-06 17:33:05 -07:00
Guillaume J. Charmes
c8f885a4d0 Merge pull request #1822 from dotcloud/remove_os_user
Remove os user
2013-09-06 16:30:54 -07:00
Guillaume J. Charmes
b07314e2e0 Remove import os/user 2013-09-06 23:00:21 +00:00
Solomon Hykes
eed00a4afd README: remove original shipping containers 'manifesto'. It's a little long to stay here. 2013-09-06 15:09:40 -07:00
Solomon Hykes
6679f3b053 README: replace 'install instructions' and 'usage examples' with references to the website and docs 2013-09-06 15:09:04 -07:00
Solomon Hykes
70ab25a5db README: harmonize intro with website 2013-09-06 15:08:01 -07:00
Solomon Hykes
bcb8d3fd86 README: refer to the docs for install instructions to remove duplication. 2013-09-06 14:52:14 -07:00
Solomon Hykes
b9ca311008 Update roadmap 2013-09-06 14:48:06 -07:00
Thatcher
37186d9ef4 Merge pull request #1818 from metalivedev/655-searchswiftype
Add Swiftype search to docs
2013-09-06 13:46:50 -07:00
Andy Rothfusz
03a28da5f7 Add Swiftype search to docs 2013-09-06 13:34:24 -07:00
Martin Redmond
b44d113120 filter image listing using path.Match 2013-09-06 16:16:10 -04:00
Martin Redmond
35bcba8011 improve image listing 2013-09-06 15:51:49 -04:00
Daniel Mizyrycki
f2bc7ebf1e Merge pull request #1777 from dotcloud/1620-index-test
testing, issue #1620: Add index functional test on docker-ci
2013-09-06 09:21:05 -07:00
Dmitry Demeshchuk
e5239b9859 Improve network performance for VirtualBox
Without those lines, VitrualBox machines are being very slow with all network operations (tested only in OS X Lion, but they are supposed to work everywhere). See https://github.com/mitchellh/vagrant/issues/1807
2013-09-05 21:05:23 -07:00
Joffrey F
8a2fd914b2 Merge pull request #1780 from shin-/1218-push-dependencies
Respect dependency graph when pushing a repository
2013-09-05 17:32:45 -07:00
Michael Crosby
f3d51bb3d5 Merge pull request #1810 from dotcloud/1798-inspect-fix
Detect images/containers conflicts in docker inspect
2013-09-05 17:17:09 -07:00
Michael Crosby
d06a0ba1a7 Merge pull request #1811 from dotcloud/672-remove_getcache
Remove unused getCache endpoint
2013-09-05 17:07:49 -07:00
Martin Redmond
8374dac021 From FIXME: local path for ADD 2013-09-05 20:05:36 -04:00
Michael Crosby
3bc73fa21e Return the process exit code for run commands 2013-09-05 23:54:03 +00:00
Victor Vieux
0d7044955a remove unused getCache endpoint 2013-09-05 23:00:52 +00:00
Victor Vieux
20a763e519 fix indent in doc 2013-09-05 22:33:04 +00:00
Victor Vieux
5ec2fea6dd Detect images/containers conflicts in docker inspect 2013-09-05 22:31:17 +00:00
Victor Vieux
908bb65dcf Merge pull request #1803 from dotcloud/1802-skip-TestGetContainersTop
testing, issue #1802: Temporarily skip TestGetContainersTop
2013-09-05 14:44:47 -07:00
Tianon Gravi
d368c2dee9 Update Gentoo docs to reflect the package name change from app-emulation/lxc-docker to app-emulation/docker as discussed in today's #docker-meeting 2013-09-05 13:36:56 -06:00
Tianon Gravi
82dd417ef6 Reformat Gentoo install instructions to 80 columns 2013-09-05 13:36:16 -06:00
Andy Rothfusz
b57d7dca9d Merge pull request #1804 from Bouke/patch-1
Fix memory recommendations (Byte, not bit)
2013-09-05 11:52:00 -07:00
Michael Crosby
8e41181591 Merge pull request #1772 from dotcloud/update-tar-revision
Update tar pkg revision number
2013-09-05 10:32:53 -07:00
Bouke Haarsma
fdf1fccd3e Fix memory recommendations (Byte, not bit) 2013-09-05 10:40:11 +02:00
Daniel Mizyrycki
bf6e241d97 testing, issue #1802: Temporarily skip TestGetContainersTop 2013-09-04 18:20:49 -07:00
Andy Rothfusz
f0cdbaa6c8 Merge pull request #1801 from vcoisne/master
Add step to docker installation using vagrant (Mac, Linux)
2013-09-04 18:15:22 -07:00
Andy Rothfusz
e0d6bae1eb Merge pull request #1789 from tommyblue/patch-1
Adds instruction about UDP port redirection
2013-09-04 18:14:34 -07:00
Andy Rothfusz
d6ff912917 Merge pull request #1797 from denibertovic/docs
fixed docs for installing binary
2013-09-04 18:13:25 -07:00
Victor Coisne
ad04cacd28 Add step to docker installation using vagrant (Mac, Linux) 2013-09-04 17:47:18 -07:00
Deni Bertovic
62823cfb97 fixed docs for installing binary 2013-09-05 00:06:41 +02:00
shin-
9ae5054c34 Bumped API version in api.go ; added <1.5 behavior to getContainersJSON 2013-09-04 23:41:44 +02:00
Daniel Mizyrycki
8878943ac9 deployment, issue #1578: Avoid pinning kernel headers. Add Vagrantfile assumptions 2013-09-04 14:41:09 -07:00
Daniel Mizyrycki
8e3844cd34 Merge pull request #1578 from jimmycuadra/vagrant-provider-detection
Better VirtualBox detection in Vagrantfile
2013-09-04 14:40:32 -07:00
Andy Rothfusz
1a32c4a1df Merge pull request #1795 from eliasp/patch-1
Typo
2013-09-04 14:13:52 -07:00
shin-
98edd0e751 Updated docs for API v1.5 2013-09-04 22:58:58 +02:00
shin-
98a1314251 Merge branch 'mhennings-1357-implement-login-with-private-registry' into api_1_5 2013-09-04 22:27:04 +02:00
shin-
34edbd4f7e Merge branch '1357-implement-login-with-private-registry' of git://github.com/mhennings/docker into mhennings-1357-implement-login-with-private-registry 2013-09-04 22:26:55 +02:00
shin-
2ea52dddec Merge branch 'better_api_ports' of git://github.com/shin-/docker into shin--better_api_ports 2013-09-04 22:25:01 +02:00
Elias Probst
396274fa6d Typo 2013-09-04 21:56:51 +02:00
Jimmy Cuadra
28e75b23b3 Don't install VirtualBox Guest Additions if VAGRANT_DEFAULT_PROVIDER is set. 2013-09-04 11:21:24 -07:00
Tommaso Visconti
ad5796de9f Adds instruction about UDP port redirection 2013-09-04 19:17:10 +02:00
Daniel Mizyrycki
3a6868bc2f Merge pull request #1788 from dotcloud/1787-deprecate-port-forwarding
deployment, issue #1787: Remove deprecated port forwarding from /Vagrantfile
2013-09-04 10:11:12 -07:00
Daniel Mizyrycki
34145f9840 deployment, issue #1787: Remove deprecated port forwarding from /Vagrantfile 2013-09-04 10:05:54 -07:00
Andy Rothfusz
58ea690b41 Merge pull request #1784 from proger/patch-1
add new docker api client for erlang, erldocker
2013-09-04 10:01:29 -07:00
Andy Rothfusz
3b92ab3465 Merge pull request #1783 from briehanlombaard/typos
Fixed typos
2013-09-04 10:00:10 -07:00
Andy Rothfusz
76f97a64fa Merge pull request #1785 from thijsterlouw/update_commandline_cli
Fix documentation index for cli
2013-09-04 09:59:30 -07:00
Andy Rothfusz
5974794942 Merge pull request #1782 from tianon/gentoo-docs
Added Gentoo Documentation
2013-09-04 09:58:36 -07:00
Thijs Terlouw
368d0385e1 Fix documentation index for cli 2013-09-04 13:21:44 +02:00
Vladimir Kirillov
58ffd03bf1 add new docker api client for erlang, erldocker 2013-09-04 12:53:38 +03:00
Tianon Gravi
9ce1d02ef6 Add Gentoo documentation 2013-09-04 02:59:18 -06:00
Briehan Lombaard
251d1261b0 Fixed typos 2013-09-04 10:52:53 +02:00
Daniel Mizyrycki
a0a5170991 Merge pull request #1449 from spkane/honor-ENV-VAGRANT_DEFAULT_PROVIDER
Assume that if VAGRANT_DEFAULT_PROVIDER is set we shouldn't install vbox tools
2013-09-03 17:38:03 -07:00
shin-
b3a70d767d Compute dependency graph and upload layers in the right order when pushing 2013-09-04 02:21:40 +02:00
Daniel Mizyrycki
91ee679549 pr #1718: Fetch docker gpg over https 2013-09-03 17:14:49 -07:00
Markus Fix
52fe452497 Changed docker apt repo URI from https to http because the http driver for apt is not installed by default 2013-09-03 17:10:03 -07:00
Daniel Mizyrycki
846524115b testing, issue #1620: Add index functional test on docker-ci 2013-09-03 15:38:06 -07:00
Hector Castro
fac4cedcc1 Add a Docker example for running Riak. 2013-09-03 16:30:40 -04:00
Marco Hennings
ded973219e Move auth header on run cmd 2013-09-03 20:59:48 +02:00
shin-
dd4aab8411 Use base64 encoding 2013-09-03 20:59:48 +02:00
shin-
d04beb7f43 Pass auth config through headers rather than as URL param 2013-09-03 20:59:48 +02:00
Marco Hennings
a2603477dd Merge on current master 2013-09-03 20:59:48 +02:00
Marco Hennings
ad322d7cca Send corrent endpoint authentication when an image is pulled during the run
cmd.
2013-09-03 20:59:48 +02:00
Marco Hennings
da3bb9a7c6 Move authConfig to a Parameter on postImagePush, too 2013-09-03 20:59:48 +02:00
Daniel Mizyrycki
0e6ee9632c Merge pull request #1603 from dotcloud/773-docker-ci-pr
773 docker-ci github pull request
2013-09-03 11:46:34 -07:00
Marco Hennings
fcee6056dc Login against private registry
To improve the use of docker with a private registry the login
command is extended with a parameter for the server address.

While implementing i noticed that two problems hindered authentication to a
private registry:

1. the resolve of the authentication did not match during push
   because the looked up key was for example localhost:8080 but
   the stored one would have been https://localhost:8080

   Besides The lookup needs to still work if the https->http fallback
   is used

2. During pull of an image no authentication is sent, which
   means all repositories are expected to be private.

These points are fixed now. The changes are implemented in
a way to be compatible to existing behavior both in the
API as also with the private registry.

Update:

- login does not require the full url any more, you can login
  to the repository prefix:

  example:
  docker logon localhost:8080

Fixed corner corner cases:

- When login is done during pull and push the registry endpoint is used and
  not the central index

- When Remote sends a 401 during pull, it is now correctly delegating to
  CmdLogin

- After a Login is done pull and push are using the newly entered login data,
  and not the previous ones. This one seems to be also broken in master, too.

- Auth config is now transfered in a parameter instead of the body when
  /images/create is called.
2013-09-03 20:45:49 +02:00
Michael Crosby
ea813d8593 Update tar pkg revision number 2013-09-03 18:30:32 +00:00
Michael Crosby
d13c2ed24e Merge pull request #1317 from calavera/login_signal
Exit from `docker login` on SIGTERM and SIGINT.
2013-09-03 11:16:05 -07:00
Andy Rothfusz
75df4953f4 Merge pull request #1758 from mattapperson/patch-1
Added NodeJS library
2013-09-03 11:02:34 -07:00
Andy Rothfusz
f703b8b839 Merge pull request #1771 from thijsterlouw/missing_cli_docs
Add 2 missing cli commands to docs (events + insert)
2013-09-03 10:41:05 -07:00
Thijs Terlouw
6380b42edb Add 2 missing cli commands to docs (events + insert) and alphabetically order docker output 2013-09-03 16:35:22 +02:00
David Calavera
ce53e21ea6 Read the stdin line properly.
Load the auth config before it's used.
2013-09-01 16:12:07 -07:00
David Calavera
35fef275b3 Merge branch 'login_signal' of https://github.com/calavera/docker into login_signal
* 'login_signal' of https://github.com/calavera/docker:
  Use flag.StringVar to capture the command line flags.
  Fix syscall name.
  Remove unused imports.
  Simplify term signal handler.
  Add the ISIG syscall back to not kill the client withing a shell with ctrl+c.
  Print a new line after getting the password from stdin.
  Exit if there is any error reading from stdin.
  Stop making a raw terminal to ask for registry login credentials.
  Allow to generate signals when termios is in raw mode.
  Use a more idiomatic syntax to capture the exit.
  Exit from `docker login` on SIGTERM and SIGINT.
2013-09-01 16:10:53 -07:00
David Calavera
fa3266efa5 Merge branch 'master' into login_signal
* master: (23 commits)
  Made calling changelog before run return empty. Fixes #1705.
  fix error in docker build when param is not a directory
  Document FROM <image>:<tag> Dockerfile instruction.
  Install Ubuntu raring backported kernel from official archives directly.
  Updated "Use -> The Basics" to use ubuntu:12.10.
  hide version when not available
  added a Dockerfile which installs all deps and builds the docs.
  Unable to find image error should print to stderr
  remove message during tests
  use init function
  add TEST env var during tests and silenced parserun during tests
  Update python_web_app.rst
  Update remaining upstart scripts to wait for lxc-net
  Fixed a minor syntax error.
  Add privileged flag in documentation for container creation
  Fix #1685: Notes on production use. General installation cleanup.
  Fix bash completion, remove have
  added apt-key finger tip and fingerprint in ubuntu installation page
  Improve formatting with 'go fmt' as stated in CONTRIBUTING.md
  Start docker after lxc-net to prevent ip forwarding race
  ...
2013-09-01 15:56:59 -07:00
Brandon Liu
113bb396cd Don't export Graph.walkAll. 2013-08-31 20:44:49 -07:00
Brandon Liu
1fca99ad90 Replace Graph.All with Graph.Map 2013-08-31 20:44:42 -07:00
Matt Apperson
e42d3a1bfa Added NodeJS library 2013-08-31 22:13:15 -04:00
Victor Vieux
3528990c73 Merge pull request #1665 from dotcloud/ksid-contrib-maintainer
Make Kawsar Saiyeed @KSid the maintainer for contributed tools
2013-08-30 17:07:03 -07:00
Andy Rothfusz
8ee4473d92 Merge pull request #1704 from dhrp/ubuntu-install-finger-fingerprint
added apt-key finger tip and fingerprint in ubuntu installation page
2013-08-30 16:15:19 -07:00
Daniel Mizyrycki
212b582362 Merge pull request #1673 from xdissent/1659-upstart-order
Start docker after lxc-net to prevent ip forwarding race
2013-08-30 16:05:40 -07:00
Guillaume J. Charmes
969e48dd5a Merge pull request #1752 from dotcloud/1750-build_error-fix
fix error in docker build when param is not a directory
2013-08-30 16:05:23 -07:00
Guillaume J. Charmes
d9b7ec6458 Merge pull request #1754 from griff/1705_changelog_fails_before_run
- Runtime: Made calling change log before run return empty list.
2013-08-30 16:02:46 -07:00
Brian Olsen
46c9c5c843 Made calling changelog before run return empty. Fixes #1705. 2013-08-30 22:46:07 +02:00
Brian Olsen
7a9c711832 Copies content from image to volumne if non-empty. Fixes #1582. 2013-08-30 22:02:05 +02:00
Brian Olsen
6756e786ac Just fixing gofmt issues in other people's code. 2013-08-30 22:02:05 +02:00
Michael Crosby
84431ec03c Merge pull request #1613 from thijsterlouw/proper_resolvconf_parsing
Proper resolv.conf parsing
2013-08-30 12:10:45 -07:00
Victor Vieux
d605e82bad fix error in docker build when param is not a directory 2013-08-30 18:08:29 +00:00
Andy Rothfusz
2ea19238ff Merge pull request #1744 from dsissitka/patch-7
Updated "Use -> The Basics" to use ubuntu:12.10.
2013-08-30 10:44:54 -07:00
Andy Rothfusz
df36f9db05 Merge pull request #1749 from msiebuhr/doc-from-tags
Document FROM <image>:<tag> Dockerfile instruction.
2013-08-30 10:44:36 -07:00
Michael Crosby
74982bda32 Merge pull request #1738 from jonasi/error-to-stderr
Unable to find image error should print to stderr
2013-08-30 10:43:45 -07:00
Michael Crosby
6d769f4b9b Merge pull request #1743 from dotcloud/fix_version
Hide version when not available
2013-08-30 10:39:48 -07:00
Morten Siebuhr
1a8a540209 Document FROM <image>:<tag> Dockerfile instruction. 2013-08-30 15:23:32 +02:00
Shih-Yuan Lee (FourDollars)
6c206f7d78 Install Ubuntu raring backported kernel from official archives directly. 2013-08-30 14:12:13 +08:00
Andy Rothfusz
110d3b7794 Merge pull request #1736 from ramonvanalteren/patch-1
Update python_web_app.rst
2013-08-29 18:36:53 -07:00
dsissitka
c0e95fa68a Updated "Use -> The Basics" to use ubuntu:12.10.
ubuntu:latest doesn't have nc. ubuntu:12.10 does.
2013-08-29 21:05:18 -04:00
Victor Vieux
e3b58d3027 hide version when not available 2013-08-30 00:46:43 +00:00
Andy Rothfusz
9b029a0854 Merge pull request #1739 from dotcloud/add-docs-dockerfile
Added a Dockerfile which installs all deps and builds the Docs
2013-08-29 17:42:17 -07:00
Victor Vieux
49d35cc0ae Merge pull request #1690 from jbbarth/code-formatting
go fmt
2013-08-29 17:13:37 -07:00
Nick Stinemates
c6702bebe1 added a Dockerfile which installs all deps and builds the docs. 2013-08-30 00:13:32 +00:00
Michael Crosby
690c3839fd Merge pull request #1710 from thomasf/master
Fix bash completion.
2013-08-29 17:08:14 -07:00
Victor Vieux
050cf70136 Merge pull request #1721 from andrewmunsell/patch-2
Add privileged flag in documentation for container creation
2013-08-29 17:05:40 -07:00
Guillaume J. Charmes
df8f95ac74 Merge pull request #1591 from dotcloud/1557_fix_docker_run_useage
add TEST env var during tests and silenced parserun during tests
2013-08-29 16:51:34 -07:00
Andy Rothfusz
0f91418b26 Merge pull request #1729 from dsissitka/patch-6
Fixed a minor syntax error.
2013-08-29 16:27:22 -07:00
Isao Jonas
4ff649ce85 Unable to find image error should print to stderr 2013-08-29 18:25:11 -05:00
Andy Rothfusz
c4394decf8 Merge pull request #1717 from metalivedev/1685-updateinstallation
Fix #1685: Notes on production use. General installation cleanup.
2013-08-29 16:06:00 -07:00
Victor Vieux
f159f4710b remove message during tests 2013-08-29 22:59:34 +00:00
Victor Vieux
740a97f1a8 use init function 2013-08-29 22:55:29 +00:00
Victor Vieux
eee6d3dae9 add TEST env var during tests and silenced parserun during tests 2013-08-29 22:55:29 +00:00
Ramon van Alteren
559724ac35 Update python_web_app.rst
Fixed typo in the WEB_PORT command, missing sudo in front of docker command
2013-08-30 00:37:47 +02:00
Greg Thornton
3f141e1fd3 Update remaining upstart scripts to wait for lxc-net 2013-08-29 14:06:24 -05:00
David Calavera
9f8e5a93b4 Use flag.StringVar to capture the command line flags. 2013-08-29 11:46:42 -07:00
David Calavera
78d995bbd6 Fix syscall name. 2013-08-29 11:46:42 -07:00
David Calavera
e7ee2f443a Remove unused imports. 2013-08-29 11:46:42 -07:00
David Calavera
b8a8962833 Simplify term signal handler. 2013-08-29 11:46:42 -07:00
David Calavera
b54ba5095b Add the ISIG syscall back to not kill the client withing a shell with ctrl+c. 2013-08-29 11:46:41 -07:00
David Calavera
f18889bf67 Print a new line after getting the password from stdin. 2013-08-29 11:46:41 -07:00
David Calavera
6e4a818ee6 Exit if there is any error reading from stdin. 2013-08-29 11:46:41 -07:00
David Calavera
2357fecc92 Stop making a raw terminal to ask for registry login credentials.
It only disables echo asking for the password and lets the terminal to handle everything else.
It fixes #1392 since blank spaces are not discarded as they did before.
It also cleans the login code a little bit to improve readability.
2013-08-29 11:46:41 -07:00
David Calavera
23dc52f528 Allow to generate signals when termios is in raw mode. 2013-08-29 11:45:04 -07:00
David Calavera
c3154fdf4d Use a more idiomatic syntax to capture the exit. 2013-08-29 11:45:03 -07:00
David Calavera
f1d0625cf8 Exit from docker login on SIGTERM and SIGINT.
Fixes #1299.
2013-08-29 11:45:03 -07:00
Andy Rothfusz
230dc07d37 fix logo path 2013-08-29 11:24:59 -07:00
Andy Rothfusz
c46d9933ec Merge pull request #1727 from dsissitka/patch-5
Fixed a minor syntax error.
2013-08-29 11:05:22 -07:00
Andy Rothfusz
bcb081a269 Merge pull request #1708 from nexxy/patch-1
Update docker_remote_api_v1.4.rst
2013-08-29 10:22:05 -07:00
dsissitka
57892365ef Fixed a minor syntax error. 2013-08-29 12:35:37 -04:00
dsissitka
075253238d Fixed a minor syntax error. 2013-08-29 12:27:35 -04:00
David Sissitka
f6b56e996d Updated "POST /containers/create" to return the right Content-Type. 2013-08-29 09:14:14 -07:00
Emily Rose
18d572abb4 Added Emily Rose to AUTHORS. 2013-08-28 22:28:31 -07:00
Andrew Munsell
37a236947e Add privileged flag in documentation for container creation 2013-08-28 22:18:47 -07:00
Emily Rose
c1f6914e43 Correct number of asterisks. 2013-08-28 20:01:18 -07:00
Andy Rothfusz
b1eae313ad Fix #1685: Notes on production use. General installation cleanup. 2013-08-28 17:26:10 -07:00
Elias Probst
a359e52f29 Added FIXME for iproute → netlink as advised in issue #925. 2013-08-29 01:50:37 +02:00
Andy Rothfusz
bf98fff925 Merge pull request #1674 from jbbarth/docs
Add mercurial to the list of packages needed in a dev environment
2013-08-28 11:10:45 -07:00
Michael Crosby
e6c3da42e7 Merge pull request #1696 from daniel-garcia/1448-add_newline_every_logmessage
Write newline after every log message
2013-08-28 10:00:38 -07:00
Victor Vieux
d5220bc081 Merge pull request #1711 from dotcloud/1709-start_doc-fix
fix start documentation
2013-08-28 09:51:20 -07:00
Victor Vieux
66ef6c0f6e fix start doc 2013-08-28 16:40:00 +00:00
Thomas Frössman
20772f90ff Fix bash completion, remove have
Should solve #1639.
2013-08-28 18:38:06 +02:00
Kyle Conroy
9a60f36ccc Merge branch 'master' of https://github.com/dotcloud/docker 2013-08-28 06:44:21 -07:00
Emily Rose
69a93b36d5 Update docker_remote_api_v1.4.rst
Fixed a (very serious) typo.
2013-08-28 04:12:37 -07:00
Thatcher Peskens
466a88b9a8 added apt-key finger tip and fingerprint in ubuntu installation page 2013-08-27 19:59:36 -07:00
Andy Rothfusz
f0620da74a Merge pull request #1703 from metalivedev/621-usebaseimages
Fix #621: add new use/base images section. Include examples.
2013-08-27 18:53:40 -07:00
Andy Rothfusz
dffb72ca89 Fix #621: add new use/base images section. Include examples. 2013-08-27 18:49:43 -07:00
Andy Rothfusz
128893062b Merge pull request #1698 from metalivedev/1684-Cleanup
Fix #1684: Cleanup introduction, working with repos, "use" index.
2013-08-27 18:15:06 -07:00
shin-
98018df078 More descriptive, easier to process container portmappings information in the API 2013-08-28 00:20:35 +02:00
Andy Rothfusz
4a3b039c2a Merge pull request #1694 from dotcloud/troubleshoot_windows_installation
Troubleshooting windows installation section
2013-08-27 14:48:15 -07:00
Andy Rothfusz
c627ff6e20 Fix #1684: Old Welcome is now Introduction. Working with Repos now follows Builder.
Clean up some doc build errors. Removed old Manifesto. Tweaked layout javascript
to allow direct link from first and last index elements.
2013-08-27 14:29:49 -07:00
daniel-garcia
d593f57952 write newline after every log message. 2013-08-27 14:09:26 -05:00
Michael Crosby
c2b273df5d Merge pull request #1611 from pysqz/master
Make sure 'Ghost' container is available with allocated IP
2013-08-27 11:30:00 -07:00
pysqz
cc18a9c650 Also reuse forwarding ports 2013-08-28 03:14:21 +08:00
Daniel Mizyrycki
f861c493bf Troubleshooting windows installation section 2013-08-27 11:19:32 -07:00
jbbarth
d80b50d4b4 Improve formatting with 'go fmt' as stated in CONTRIBUTING.md
As 'go fmt' doesn't support verifying files in multiple directories,
it's probably a good idea to run it on all '*.go' files from time to
time with something like this:

  find . -name "*.go" | xargs dirname | sort -u | xargs -n 1 echo go fmt
2013-08-27 10:05:25 +02:00
Andy Rothfusz
5b84252c73 Merge pull request #1622 from TylerBrock/patch-2
Some fixes for MongoDB example
2013-08-26 17:28:38 -07:00
Tyler Brock
f352ec945f ENTRYPOINT fixups 2013-08-26 19:17:26 -04:00
Daniel Mizyrycki
714e424d74 Merge pull request #1656 from KSid/vagrantfile-0.6
Update Vagrantfile to use docker apt repository
2013-08-26 14:59:40 -07:00
Andy Rothfusz
f7fa6c2b0b Merge pull request #1671 from kim0/patch-3
Don't force a non-existent npm version, use latest from epel
2013-08-26 14:33:07 -07:00
Michael Crosby
b866254a19 Merge pull request #1636 from unclejack/1594-return_non_zero_when_encountering_error
1594 - return non-zero exit code if at least one container has failed to start
2013-08-26 13:20:31 -07:00
Michael Crosby
108b6c644b Merge pull request #1678 from dotcloud/remove-incorrect-build-instructions
Remove incorrect build instructions
2013-08-26 12:56:08 -07:00
Guillaume J. Charmes
9ce7b1c009 Merge pull request #1663 from KSid/1661-cp-parsing-error
- Runtime: Display error if docker cp resource not specified
2013-08-26 12:51:43 -07:00
Solomon Hykes
076434ef10 Remove incorrect build instructions 2013-08-26 12:06:56 -07:00
Andy Rothfusz
f2807042c2 Merge pull request #1670 from tobstarr/patch-1
Change fetching of gpg key from http to https
2013-08-26 12:00:54 -07:00
Guillaume J. Charmes
d4c7340131 Merge pull request #1646 from mohitsoni/master
- Runtime: Fix uname -r kernel version parsing
2013-08-26 11:49:00 -07:00
Greg Thornton
331f983593 Start docker after lxc-net to prevent ip forwarding race 2013-08-26 09:43:49 -05:00
jbbarth
1adbadde80 Add mercurial to the list of packages needed in a dev environment
The dev environment setup procedure fails if mercurial is not installed
on the machine, it cannot download stuff from
http://code.google.com/p/go.net for instance.
2013-08-26 16:39:38 +02:00
kim0
843ef645d2 Don't force a non-existent npm version, use latest from epel
Not the smartest thing to do
2013-08-26 12:54:15 +03:00
Tobias Schwab
4440bde0eb Change fetching of gpg key from http to https
Or was there any reason to fetch using http?
2013-08-26 11:45:15 +02:00
Solomon Hykes
f83d556bc0 Make Kawsar Saiyeed @KSid the maintainer for contributed tools 2013-08-24 17:16:52 -07:00
Kawsar Saiyeed
d8a18ea3ae Display error if resource not specified
Display an error message if a container resource is not supplied to
'docker cp'.

Fixes error in #1661
2013-08-25 00:28:36 +01:00
Nick Stinemates
c864647721 Merge pull request #1658 from jamescarr/patch-1
Update for new mailing list
2013-08-24 10:28:26 -07:00
Nick Stinemates
2891e828bd Merge pull request #1657 from KSid/bash-completion-0.6
Add latest docker options to docker.bash
2013-08-24 10:27:25 -07:00
James Carr
465d5313c5 Update for new mailing list 2013-08-24 10:26:54 -07:00
Kawsar Saiyeed
02d1d238cd Add latest docker options to docker.bash
Adds bash completion options for the latest docker release (0.6.1)
2013-08-24 18:04:40 +01:00
Kawsar Saiyeed
1f85ed6825 Update Vagrantfile to use docker apt repository 2013-08-24 16:49:55 +01:00
Mohit Soni
ef82690144 Merge remote-tracking branch 'upstream/master' 2013-08-24 00:33:01 -07:00
Mohit Soni
f4432d50c3 Refactored code and added unit tests
- Extracted ParseRelease method from GetKernelVersion to make code
  more testable
- Added tests for ParseRelease method
2013-08-24 00:24:40 -07:00
Andy Rothfusz
820a3b962a Merge pull request #1634 from songgao/patch-1
Added utils/utils.go : CopyEscapable escale sequence to tutorial.
2013-08-23 18:52:17 -07:00
Michael Crosby
99a8306898 Merge release 0.6.1 back to master
Conflicts:
	VERSION
2013-08-23 22:59:29 +00:00
Michael Crosby
bd16107e97 Merge pull request #1648 from dotcloud/bump_0.6.1
Bump to 0.6.1
2013-08-23 15:49:28 -07:00
Michael Crosby
5105263dac Bump to v0.6.1 2013-08-23 22:23:30 +00:00
Michael Crosby
7b5c579b77 Use correct upstart script with new build tool 2013-08-23 22:20:36 +00:00
Michael Crosby
dcfb993ac7 Merge pull request #1642 from dotcloud/upstart-exec
Use correct upstart script with new build tool
2013-08-23 15:18:58 -07:00
Andy Rothfusz
dd9ee039a6 Merge pull request #1633 from abhirajbutala/patch-1
Update docker_remote_api.rst
2013-08-23 15:17:21 -07:00
Kawsar Saiyeed
15d658d36b Removed duplicate mercurial install command 2013-08-23 22:16:49 +00:00
unclejack
59281d6f80 use libffi-dev, don't build it from sources 2013-08-23 22:16:23 +00:00
shin-
29be20f987 Fixed: ImagePull in runtime test 2013-08-23 22:16:11 +00:00
shin-
5a8c32dc8e Use additional decorator in RequestFactory to pass meta headers to registry 2013-08-23 22:16:03 +00:00
Michael Crosby
3d9b4379a5 Use correct upstart script with new build tool 2013-08-23 22:10:18 +00:00
Mohit Soni
ab882da03b Fixes #1643
Changed the split statement, from SplitN to Split. Doing so takes
care of cases, when a minor version is followed by a suffix, that
starts with '.'.
2013-08-23 14:37:37 -07:00
Thatcher
e2594d162e Merge pull request #1641 from dotcloud/docs-0.6-gpg-key
Docs 0.6 gpg key
2013-08-23 13:14:21 -07:00
Thatcher Peskens
ebb9b5e85b Added adding the gpg key 2013-08-23 12:56:03 -07:00
Michael Crosby
98f9d3e81c Merge pull request #1562 from AnSavvides/contributing-link
Adding direct reference to contribution guidelines
2013-08-23 12:18:24 -07:00
Thatcher Peskens
091fb89294 Added line on top of ubuntulinux announcing change in 0.6
Added lines on top of vagrant installs
2013-08-23 11:45:52 -07:00
Michael Crosby
db91cac44f Merge pull request #1635 from unclejack/fix_main_dockerfile
Fix libffi build failure for the main Dockerfile
2013-08-23 11:31:19 -07:00
Guillaume J. Charmes
8dd3607bd1 Merge pull request #1563 from dotcloud/1073_add_loading_message
* Runtime: Add loading containers message in no debug
2013-08-23 11:20:22 -07:00
Solomon Hykes
3ebda17f0f Merge pull request #1637 from dhrp/change-docs-ubuntu-sources
Updated the docs to reflect we no longer use Launchpad and host our own
2013-08-23 11:05:59 -07:00
Michael Crosby
9149c45745 Merge pull request #1627 from shin-/registry_metaheaders
Pass "meta" headers in API calls to the registry
2013-08-23 11:05:41 -07:00
Michael Crosby
969ab9c450 Merged 0.6.0 release back to master 2013-08-23 17:50:24 +00:00
Michael Crosby
588f8e1cec Merge pull request #1628 from dotcloud/bump_0.6.0
Bump to 0.6.0
2013-08-23 10:45:14 -07:00
Thatcher Peskens
f753dfe6b3 Updated the docs to reflect we no longer use Launchpad and host our own repository. 2013-08-23 10:41:53 -07:00
unclejack
d1ad0e278d return error if at least one container fails to start
This makes docker start exit with exit code 1 if at least one container
didn't start. This also prints an error at the end.
2013-08-23 20:14:06 +03:00
unclejack
72cfa3de35 use libffi-dev, don't build it from sources 2013-08-23 19:13:30 +03:00
Abhiraj Butala
3396a183c6 Update docker_remote_api.rst 2013-08-23 01:28:58 -07:00
shin-
1c6af604e8 Fixed: ImagePull in runtime test 2013-08-23 04:32:09 +02:00
Guillaume J. Charmes
ccc2276469 Merge pull request #1630 from KSid/docker-build-dockerfile
Removed duplicate mercurial install command from Dockerfile
2013-08-22 17:31:35 -07:00
Guillaume J. Charmes
78a71b1273 Merge pull request #1587 from dotcloud/1559_improve_version
Improve version
2013-08-22 17:28:18 -07:00
Kawsar Saiyeed
2191419f4c Removed duplicate mercurial install command 2013-08-22 23:12:28 +01:00
Michael Crosby
f4a4f1ca87 Bump to 0.6.0 2013-08-22 21:09:50 +00:00
Guillaume J. Charmes
f925edd12d Merge pull request #1525 from griff/1503-fix
Don't read from stdout when only attached to stdin
2013-08-22 13:43:05 -07:00
Michael Crosby
12715c8ddc Merge pull request #1609 from jpetazzo/release-docker-with-docker
Release docker with docker
2013-08-22 13:13:06 -07:00
shin-
093b85b72f Use additional decorator in RequestFactory to pass meta headers to registry 2013-08-22 21:15:31 +02:00
Michael Crosby
326dadd224 Merge pull request #1565 from dotcloud/only_load_authconfig_when_needed
Load authConfig only when needed and fix useless WARNING
2013-08-22 11:10:16 -07:00
Michael Crosby
a3510c99f1 Merge pull request #1560 from dotcloud/439-allow-lxc-args
Add lxc-conf flag to allow custom lxc options
2013-08-22 09:34:27 -07:00
Michael Crosby
262d57e387 Merge pull request #1623 from mhennings/1592-fix-race-conditions-in-parallel-pull
Fix race conditions in parallel pull
2013-08-22 09:30:21 -07:00
Michael Crosby
551092f9c0 Add lxc-conf flag to allow custom lxc options 2013-08-22 16:05:21 +00:00
Marco Hennings
3f802f4a13 Fix race conditions in parallel pull
During parallel pull of a repostiory it can happen that the same layer
is pulled more than once.

To fix this I have extended the locking code to
- avoid multiple pulls of the same image
- avoid multiple pulls of the same layer


If an error occurs the other layers are awaited before returning as leaving
the scope before the go routines leave causes crashes of the server sometimes
if the download status is updated while the http stream is already closed


Beside this I have extended status display.
2013-08-22 13:23:43 +02:00
Tyler Brock
d6f53049c4 Some fixes for MongoDB example 2013-08-21 23:48:32 -04:00
Daniel Mizyrycki
5e3386473a testing, issue #773: Add infrastructure docker-ci PR documentation 2013-08-21 17:39:45 -07:00
Andy Rothfusz
0b9c8e2860 Merge pull request #1596 from metalivedev/1149-easyfixes
Fix #1330 and #1149. Improve CMD, ENTRYPOINT, and attach docs.
2013-08-21 14:06:41 -07:00
Andy Rothfusz
42fe550c9e Merge pull request #1614 from denibertovic/docs
Small fix to docs regarding adding docker groups
2013-08-21 12:26:56 -07:00
Andy Rothfusz
f5bd137216 Add mongodb example 2013-08-21 12:09:40 -07:00
Andy Rothfusz
348696f3fe Merge pull request #1607 from TylerBrock/mongodb
Add MongoDB image example
2013-08-21 12:07:50 -07:00
Michael Crosby
6da071985f Merge pull request #1513 from dotcloud/add_user_dockerfile
Add USER instruction do Dockerfile
2013-08-21 09:19:31 -07:00
Michael Crosby
56e02dd0c7 Merge pull request #1588 from dotcloud/1561_fix_warning_in_tests
assume ip_forwarding = 1 by default
2013-08-21 09:15:23 -07:00
Michael Crosby
e0a7013836 Merge pull request #1576 from MatthewMueller/patch-1
updated default -H docs
2013-08-21 09:09:43 -07:00
Deni Bertovic
467dbb75f1 small fix to docs regarding adding docker groups 2013-08-21 17:28:13 +02:00
pysqz
2f6ce27fde Make sure 'Ghost' container is available with allocated IP 2013-08-21 22:37:58 +08:00
Thijs Terlouw
c349b4d56c Keep linebreaks and generalize code 2013-08-21 15:48:39 +02:00
Thijs Terlouw
62e84785b6 proper resolv.conf parsing 2013-08-21 15:23:12 +02:00
Matt Mueller
215094903a update help 2013-08-21 02:08:32 -07:00
Jérôme Petazzoni
8a7c0495e0 Remove -x flag — we do not want to be *that* verbose. 2013-08-20 20:50:42 -07:00
Jérôme Petazzoni
885afebe07 Bump up VERSION file to 0.5.3-dev 2013-08-20 19:36:42 -07:00
Jérôme Petazzoni
e06372d6f4 Update packaging/README to point to hack/release 2013-08-20 19:36:06 -07:00
Jérôme Petazzoni
b5a48eaed3 Moved release scripts to hack/release and updated instructions. 2013-08-20 19:36:06 -07:00
Jérôme Petazzoni
a8059059c6 +CHANGES is now -dirty (works better in URLs), and we have postinstall and prerm jobs. 2013-08-20 19:36:06 -07:00
Jérôme Petazzoni
c8c69a1499 Bump to 0.5.3 (VERSION file) 2013-08-20 19:36:06 -07:00
Jérôme Petazzoni
0469e47674 Release script also takes care of index file (if the S3 bucket is WS-enabled) 2013-08-20 19:36:06 -07:00
Jérôme Petazzoni
5b630d436d If there are changes, add the timestamp to the package version. 2013-08-20 19:35:31 -07:00
Jérôme Petazzoni
9c06420b18 Implement apt-secure repository signing. 2013-08-20 19:35:31 -07:00
Jérôme Petazzoni
87872006ce Repository should also have i386 index, since Ubuntu is multi-arch by default 2013-08-20 19:35:31 -07:00
Jérôme Petazzoni
abfa7a204d Update to go 1.1.2. 2013-08-20 19:35:30 -07:00
Jérôme Petazzoni
5b0eaef602 Run reprepro from release, incrementally (it needs S3 credentials). Add virtual package. 2013-08-20 19:35:30 -07:00
Jérôme Petazzoni
9694fb85d7 Install python-magic (it helps s3cmd) and a convenience /src symlink 2013-08-20 19:35:30 -07:00
Jérôme Petazzoni
bfee2c726e Polish instructions a little bit. 2013-08-20 19:35:30 -07:00
Jérôme Petazzoni
ab4fb9bbfa Add a check for S3 bucket access. 2013-08-20 19:35:30 -07:00
Jérôme Petazzoni
fbd5b20c38 Running the build image will now execute release.sh automatically. 2013-08-20 19:35:30 -07:00
Jérôme Petazzoni
ff30eb96b6 Protect the release.sh script against accidental use. Infer VERSION automatically. 2013-08-20 19:35:30 -07:00
Jérôme Petazzoni
749a7d0e4f Add a check to make sure that make.sh only runs within a container. 2013-08-20 19:35:30 -07:00
Jérôme Petazzoni
d9f769930b Cosmetic changes: rewrapping, `` → $()… before starting the real work 2013-08-20 19:35:30 -07:00
Jérôme Petazzoni
d750060f0c add "|| true" otherwise "set -e" kills us if the repo is clean 2013-08-20 19:35:30 -07:00
Guillaume J. Charmes
bdbac9f7a1 Upgrade Dockerfile with new dependency 2013-08-20 19:35:30 -07:00
Solomon Hykes
13201775de Update release checklist. Still needs work. 2013-08-20 19:34:10 -07:00
Solomon Hykes
ccc3969536 release.sh: publish a full release of docker to a S3 bucket, including static binary and a full APT repository with install instructions 2013-08-20 19:34:10 -07:00
Solomon Hykes
89ee524229 Good-bye, ugly mega-Makefile. Docker can now be built with docker, with the help of a simple very simple shell script. 2013-08-20 19:34:10 -07:00
Solomon Hykes
9fce6f662a docker -v: show version and build information without making remote connections 2013-08-20 19:32:37 -07:00
Solomon Hykes
9087ef9a77 Move VERSION to a dedicated file to facilitate automated builds and releases 2013-08-20 19:32:37 -07:00
Solomon Hykes
aa2ab5143b Deprecate dockerbuilder in favor of a standard Dockerfile 2013-08-20 19:31:30 -07:00
Tyler Brock
2c147dd721 add mongodb image example 2013-08-20 18:08:15 -04:00
Daniel Mizyrycki
ee64e099e0 testing, issue #773: Automatically test pull requests on docker-ci 2013-08-20 12:32:32 -07:00
Daniel Mizyrycki
30726c3785 Improve docker-ci deployment and tests 2013-08-20 12:18:29 -07:00
Victor Vieux
41973d41e9 fix typo 2013-08-20 11:52:37 +00:00
Victor Vieux
f69c465231 rebase docs 2013-08-20 11:42:53 +00:00
Andy Rothfusz
75f4fd978d Fix #1330 and #1149. Improve CMD, ENTRYPOINT, and attach docs. 2013-08-19 19:13:26 -07:00
Kyle Conroy
e9a1246527 Enable mobile view for website.
The documentation currently uses responsive Bootstrap, but didn't
include the correct meta tag for proper display on mobile devices.
2013-08-19 11:54:51 -07:00
Andy Rothfusz
d627ff9697 Merge pull request #1590 from elmendalerenda/patch-3
fixed postgresql conf setting
2013-08-19 10:27:43 -07:00
Michael Crosby
04c16f347b Merge pull request #1396 from calavera/985-ordered-api-images
Sort APIImages by most recent creation date.
2013-08-19 09:41:39 -07:00
Michael Crosby
9c829cb5b4 Merge pull request #1581 from mhennings/workdirsupport-buildfile
Add workdir support for the Buildfile
2013-08-19 09:18:22 -07:00
elmendalerenda
83acd37161 fixed postgresql conf setting
small typo, changed listen_address to listen_addresses
2013-08-19 14:20:25 +01:00
Victor Vieux
b21f898620 assume ip_forwarding = 1 by default 2013-08-19 12:34:30 +00:00
Victor Vieux
646afab28d improve version 2013-08-19 12:07:49 +00:00
Victor Vieux
f6653c3fa5 Merge pull request #1553 from dotcloud/1540_fix_error_message
fix can't connect message with socket
2013-08-19 05:06:21 -07:00
Victor Vieux
18962d0ff3 load authConfig only when needed and fix useless WARNING 2013-08-19 11:42:38 +00:00
Song Gao
b22c973110 Added escape sequence to tutorial 2013-08-18 21:44:46 -05:00
Marco Hennings
319988336c Add workdir support for the Buildfile
For consistency the Buildfile should have the option to
set the working directory.

Of course that is one option more to the buildfile,
so please tell me if we really want this to happen.
2013-08-18 20:30:19 +02:00
Michael Crosby
67c9ce6dd1 Merge pull request #1459 from mhennings/set-working-directory
Add an option to set the working directory
2013-08-18 11:23:34 -07:00
Marco Hennings
687d27ab57 Add an option to set the working directory.
This makes it possible to simply wrap a command inside a container. This makes
it easier to use a container as an unified build environment.

Examples:

~/workspace/docker
$ docker  run  -v `pwd`:`pwd` -w `pwd` -i -t  ubuntu ls
AUTHORS		 Makefile	archive.go	   changes.go	      docker
[...]


docker  run  -v `pwd`:`pwd` -w `pwd` -i -t  ubuntu pwd
/home/marco/workspace/docker
2013-08-18 19:34:01 +02:00
David Calavera
6aff117164 Use flag.StringVar to capture the command line flags. 2013-08-17 22:28:05 -07:00
David Calavera
e69f714219 Fix syscall name. 2013-08-17 22:22:49 -07:00
David Calavera
276d2bbf1d Remove unused imports. 2013-08-17 22:22:11 -07:00
David Calavera
e6affb1b1a Sort images by tag name when the creation date is the same.
This establishes a strict alphabetical order for tags with the same creation date.
2013-08-17 22:11:34 -07:00
Matt Mueller
f409c11916 add to cli 2013-08-17 22:10:06 -07:00
Michael Crosby
3885ee00c5 Merge pull request #1575 from evanphx/tags
Show tag used when image is missing
2013-08-17 22:05:58 -07:00
Matthew Mueller
5325703c27 updated default 2013-08-17 21:54:10 -07:00
David Calavera
45543d012e Simplify term signal handler. 2013-08-17 21:29:37 -07:00
David Calavera
8a18999d23 Add the ISIG syscall back to not kill the client withing a shell with ctrl+c. 2013-08-17 21:08:00 -07:00
Evan Phoenix
07a887032a Show tag used when image is missing 2013-08-17 20:03:54 -07:00
Andy Rothfusz
1843a71911 Merge pull request #1550 from dotcloud/update-dependencies-in-readme
Update readme with dependencies for building
2013-08-16 17:46:25 -07:00
Guillaume J. Charmes
9ce577782c Merge pull request #1572 from dotcloud/1431-disable-TestContainerTop
Tests: testing, issue #1431: Temporarely disable TestContainerTop from the testsuite
2013-08-16 14:49:02 -07:00
Daniel Mizyrycki
422d4afdd5 testing, issue #1431: Temporarely disable TestContainerTop from the testsuite 2013-08-16 14:47:39 -07:00
Andy Rothfusz
09a08e0a9f Merge pull request #1569 from TylerBrock/patch-1
Add instructions for creating and using the docker group
2013-08-16 14:30:00 -07:00
Michael Crosby
5142e83d93 Merge pull request #1473 from shin-/978-opaque-v2
Reworking opaque requests in registry module
2013-08-16 12:24:51 -07:00
shin-
0418702cfc registry: removing opaqueRequest 2013-08-16 19:33:59 +02:00
Tyler Brock
674e5c8503 remove extraneous step and stupid whitespace 2013-08-16 13:30:54 -04:00
Tyler Brock
2ec141da54 Add instructions for creating and using the docker group 2013-08-16 13:19:59 -04:00
Victor Vieux
20b1e19641 add loading message 2013-08-16 13:43:09 +00:00
Andreas Savvides
f11fb706f6 Adding direct reference to contribution guidelines 2013-08-16 12:07:37 +01:00
Michael Crosby
bca19a22c5 Update readme with dependencies for building
Closes #915
2013-08-15 17:26:07 +00:00
Victor Vieux
62b45f0827 fix can't connect message
with socket
2013-08-15 13:48:08 +00:00
Victor Vieux
92a2b635a3 Merge pull request #1551 from dotcloud/hotfix_parallel_pull_display
hot fix display in parallel pull and gofmt
2013-08-15 04:43:26 -07:00
Victor Vieux
d7979ef2d0 hot fix display in parallel pull and go fmt 2013-08-15 11:42:40 +00:00
Michael Crosby
c5d8844d80 Merge pull request #1495 from bdon/master
Fix Graph ByParent() to generate list of child images per parent image.
2013-08-14 20:42:34 -07:00
Brian Olsen
c7cda86e84 Don't read from stdout in hijack unless attached. Fixes #1503 2013-08-15 02:54:06 +02:00
Guillaume J. Charmes
4caa604793 Merge pull request #1549 from dotcloud/fix-logevent-tests
Add imagename to LogEvent tests
2013-08-14 17:02:53 -07:00
Michael Crosby
7f9ba14b18 Add imagename to LogEvent tests 2013-08-14 23:43:43 +00:00
Andy Rothfusz
72660a1a2f Merge pull request #1537 from metalivedev/1517-sudodocker
Fix #1517, #1521 by adding sudo to examples and installation.
2013-08-14 16:34:00 -07:00
Andy Rothfusz
d4eab77f0c Fix #1517, #1521 by adding sudo to examples and installation. 2013-08-14 16:21:36 -07:00
Michael Crosby
9708597b0b Merge pull request #1538 from KSid/bash-completion-limit-containers
Bash Completion: Limit commands to containers of a relevant state
2013-08-14 16:16:25 -07:00
Michael Crosby
15bc2240ac Merge pull request #1505 from dotcloud/improve_events
Add image name in /events
2013-08-14 15:40:36 -07:00
Guillaume J. Charmes
631c449183 Merge pull request #1496 from xdissent/1351-volumes-from-before-volumes
* Runtime: Apply volumes-from before creating volumes
2013-08-14 15:10:41 -07:00
Michael Crosby
84a0274885 Merge pull request #1249 from unclejack/507-add_sigterm_sigint_handling_to_docker_run
#507 - make docker run handle SIGINT/SIGTERM
2013-08-14 15:00:19 -07:00
Guillaume J. Charmes
5ad8840024 Merge pull request #1541 from dotcloud/1528-fix_panic
prevent crash when .dockercfg not readable
2013-08-14 14:51:01 -07:00
Guillaume J. Charmes
8dfc47307d Merge pull request #1543 from dotcloud/fix_rmi_parse_repo_tag
add missing ParseRepositoryTag
2013-08-14 14:42:41 -07:00
shin-
aae04def7b Merge branch 'master' of https://github.com/dotcloud/docker 2013-08-14 23:32:56 +02:00
Daniel Mizyrycki
f51eb0e4b3 Merge pull request #1546 from dotcloud/1542-coverage-dependencies
testing, issue #1542: Add docker dependencies coverage testing into docker-ci
2013-08-14 14:32:15 -07:00
shin-
8b6b187a8d Merge branch 'master' of https://github.com/dotcloud/docker 2013-08-14 23:31:58 +02:00
shin-
8b26e4ea3c brew: docker-py requirement points to git repository 2013-08-14 23:31:18 +02:00
Daniel Mizyrycki
1d8562b290 testing, issue #1542: Add docker dependencies coverage testing into docker-ci 2013-08-14 14:27:46 -07:00
Michael Crosby
9662f9e56a Merge pull request #1478 from jpetazzo/929-insecure-flag
add -privileged flag and relevant tests, docs, and examples
2013-08-14 13:55:18 -07:00
Michael Crosby
25d71fb01b Merge pull request #1509 from dotcloud/1359-tar-pkg-ref
Add import for dotcloud/tar to replace std tar pkg
2013-08-14 11:26:49 -07:00
Joffrey F
12ffb522a6 Merge pull request #1519 from shin-/brew-more
Docker-brew 0.5.2 support and memory footprint reduction
2013-08-14 10:40:05 -07:00
Michael Crosby
0077678844 Merge pull request #1539 from fkautz/https-install-script
Install script should be fetched over https, not http.
2013-08-14 10:32:29 -07:00
Daniel Mizyrycki
53f2c5d6e8 Merge pull request #1545 from dotcloud/1544-docker-ci-dependencies
testing, issue #1544: Add new docker dependencies into docker-ci
2013-08-14 10:23:08 -07:00
Daniel Mizyrycki
49597f0f52 testing, issue #1544: Add new docker dependencies into docker-ci 2013-08-14 10:12:08 -07:00
Victor Vieux
c84d74df8c add missing ParseRepositoryTag 2013-08-14 16:59:21 +00:00
Victor Vieux
3c9f9945c9 prevent crash when .dockercfg not readable 2013-08-14 10:26:18 +00:00
Frederick F. Kautz IV
80ebff0fa4 Install script should be fetched over https, not http. 2013-08-13 22:28:41 -07:00
Joffrey F
62c0f433fa brew: Fixed a bug with remote repository builds 2013-08-14 05:05:44 +02:00
Kawsar Saiyeed
44eb1b3892 Limit commands to containers of a relevant state 2013-08-14 02:45:03 +01:00
Andy Rothfusz
4cb57a5438 Merge pull request #1533 from dhrp/docs-ux-changes
Docs ux changes
2013-08-13 18:03:49 -07:00
Andy Rothfusz
2e5642452b Merge pull request #1523 from dotcloud/docker-group-docs
Update docs for docker group
2013-08-13 18:02:30 -07:00
Michael Crosby
4947e32acb Merged 0.5.3 hotfix release back to master
Conflicts:
	api.go
	commands.go
	network.go
2013-08-13 23:47:29 +00:00
Thatcher Peskens
6c87db97a6 Resolved conflict in conf.py
ps. also changed navigation (swapped community and getting started)
2013-08-13 16:28:24 -07:00
Thatcher Peskens
f127c471a1 Merge remote-tracking branch 'dotcloud/master' into docs-smart-changes
Conflicts:
	docs/sources/conf.py
2013-08-13 16:25:58 -07:00
Jérôme Petazzoni
280901e5fb add -insecure flag and relevant tests 2013-08-13 16:20:22 -07:00
Thatcher Peskens
f14db49346 [docs] Some user-friendly changes to the documentation.
- Added parmalinks (closes #1527)
 - Changed the 'fork us on github' button to 'Edit this page on github', so people can edit quickly (closes #1532)
- Changed the favicon
2013-08-13 16:18:32 -07:00
Michael Crosby
f1cdba2937 Merge pull request #1516 from unclejack/up_hack_dockerfile_go_version_to_1.1.2
use Go 1.1.2 for dockerbuilder
2013-08-13 14:50:12 -07:00
Andy Rothfusz
0794f0b518 Merge pull request #1526 from metalivedev/1522-faqupdate
Added information about Docker's high level tools over LXC.
2013-08-13 13:57:47 -07:00
Andy Rothfusz
e2409ad337 Added information about Docker's high level tools over LXC. Formatting cleanup. Mailing list cleanup. 2013-08-13 13:45:07 -07:00
Guillaume J. Charmes
ca92bc7798 Merge pull request #1501 from KSid/vagrant-dev-dockerfile
Install websocket library before building docker
2013-08-13 12:16:30 -07:00
Michael Crosby
e4f35dd4cf Update docs for docker group 2013-08-13 12:05:27 -07:00
shin-
2cebe09924 brew: Display a clear error message when the path is invalid 2013-08-13 20:28:15 +02:00
shin-
e5f1b6b9a4 brew: Updated requirements 2013-08-13 20:13:39 +02:00
shin-
79fc90b646 brew: Don't build if docker daemon can't be reached 2013-08-13 20:13:39 +02:00
shin-
fb7c4214ce brew: Reuse repositories when possible 2013-08-13 20:13:39 +02:00
Michael Crosby
06a092bdb5 Merge pull request #1510 from dotcloud/bump_0.5.3
Bump to 0.5.3
2013-08-13 10:41:57 -07:00
Michael Crosby
5d25f3232c Update changelog to include hostname commit 2013-08-13 17:36:24 +00:00
Guillaume J. Charmes
1a1c89556f Fix TestEnv 2013-08-13 17:34:35 +00:00
Nolan
05219d6b52 Add hostname to the container environment. 2013-08-13 17:30:21 +00:00
Guillaume J. Charmes
9cc3d7a18b Merge pull request #1515 from dotcloud/rework_auth_push
* Registry: Improve auth push
2013-08-13 10:15:59 -07:00
unclejack
e09863fedb use Go 1.1.2 for dockerbuilder 2013-08-13 19:48:30 +03:00
Victor Vieux
2ba1300773 remove checkIfLogged 2013-08-13 14:02:49 +00:00
Victor Vieux
6cb908bb82 fix merge issue 2013-08-13 13:35:34 +00:00
Victor Vieux
5ee3c58d25 Add USER instruction 2013-08-13 12:02:17 +00:00
Michael Crosby
c3773740d9 Bump to 0.5.3 2013-08-12 23:55:42 +00:00
Steeve Morin
0ca133dd76 Handle ip route showing mask-less IP addresses
Sometimes `ip route` will show mask-less IPs, so net.ParseCIDR will fail. If it does we check if we can net.ParseIP, and fail only if we can't.
Fixes #1214
Fixes #362
2013-08-12 23:46:26 +00:00
Guillaume J. Charmes
68934878f1 Make sure ENV instruction within build perform a commit each time 2013-08-12 23:43:53 +00:00
Michael Crosby
ef1d1aefa7 Revert "docker.upstart: avoid spawning a sh process"
This reverts commit 24dd50490a.
2013-08-12 23:35:23 +00:00
Daniel Mizyrycki
c015d26e96 API, issue 1471: Allow users belonging to the docker group to use the docker client 2013-08-12 23:33:42 +00:00
Guillaume J. Charmes
f6760fca88 Merge pull request #1485 from dotcloud/1471-unixsocket-group
* Runtime: API, issue 1471: Use groups for socket permissions
2013-08-12 16:21:53 -07:00
Michael Crosby
ec61c46bf7 Add import for dotcloud/tar to replace std tar pkg 2013-08-12 22:42:29 +00:00
Andy Rothfusz
90cb66f08d Merge pull request #1508 from pborreli/typos
Fixed typos
2013-08-12 15:17:02 -07:00
Daniel Mizyrycki
999a8d7249 API, issue 1471: Allow users belonging to the docker group to use the docker client 2013-08-12 15:16:49 -07:00
Andy Rothfusz
13acf72a3e Merge pull request #1504 from zaiste/docs/postgresql-service
docs/postgresql: PostgreSQL service on Docker example
2013-08-12 14:47:19 -07:00
Solomon Hykes
aa213b48a4 Merge pull request #1488 from KSid/336-bash-completion
* Contrib: bash completion script
2013-08-12 11:50:25 -07:00
Pascal Borreli
9b2a5964fc Fixed typos 2013-08-12 18:53:06 +01:00
Guillaume J. Charmes
1110bb8e98 Merge pull request #1476 from dotcloud/improve_TestKillDifferentUser
* Tests: Improve TestKillDifferentUser to prevent timeout on buildbot
2013-08-12 10:23:08 -07:00
Victor Vieux
168e2f8c49 Merge pull request #1491 from titanous/gitignore-test
gitignore all test files
2013-08-12 09:18:31 -07:00
Michael Crosby
86ef6422f3 Merge pull request #1487 from titanous/maintainer-usernames
Add GitHub usernames to MAINTAINERS
2013-08-12 09:07:10 -07:00
Zaiste!
3af60bf375 fix/docs: ubuntu instead of base, note about root-only 2013-08-12 15:30:52 +02:00
Victor Vieux
123c80467b Added docs 2013-08-12 11:55:23 +00:00
Ken Cochrane
edba1af304 Merge pull request #1494 from KSid/typo-docs-run-command
* Documentation: Fix typo in docs for docker run -dns
2013-08-12 04:51:56 -07:00
Ken Cochrane
875e16c11b Merge pull request #1499 from seldo/master
* Documentation: Adding a reference to ps -a
2013-08-12 04:51:17 -07:00
Victor Vieux
703905d7ec ensure the use oh IDs and add image's name in /events 2013-08-12 11:50:03 +00:00
Zaiste!
d52c149075 docs/postgresql: PostgreSQL service on Docker example 2013-08-12 12:03:43 +02:00
Victor Vieux
3f95d1b9bf Merge pull request #1497 from vincentbernat/fix/ipv4-forwarding-detection
runtime: correctly detect IPv4 forwarding
2013-08-12 02:07:03 -07:00
Kawsar Saiyeed
def9598ed9 Install websocket library before building docker 2013-08-12 05:22:33 +01:00
Laurie Voss
529ee848da Adding a reference to ps -a
It was confusing to me as a first-time user that my docker attach command failed; I was expecting the container to run continuously, and when I couldn't attach to it, I assumed something was wrong. ps -a shows that the container still exists, which gives the user confidence to go to the next step.
2013-08-11 17:27:47 -07:00
Vincent Bernat
64b817a5c1 runtime: correctly detect IPv4 forwarding
When memory cgroup is absent, there was not attempt to detect if IPv4
forwarding was enabled and therefore, docker was printing a warning
for each command spawning a new container. The test for IPv4
forwarding was guarded by the test for memory cgroup.
2013-08-11 11:52:16 +02:00
Brandon Liu
02b8d14bdd Add test case for Graph ByParent(). 2013-08-11 01:24:21 -07:00
Brandon Liu
025c759e44 Fix Graph ByParent() to generate list of child images per parent image. 2013-08-11 00:37:16 -07:00
Michael Crosby
940d58806c Merge pull request #1483 from titanous/update-authors
Update AUTHORS
2013-08-10 21:16:34 -07:00
Kawsar Saiyeed
a2fb870ce3 Fix typo in docs for docker run -dns 2013-08-11 02:04:04 +01:00
Kawsar Saiyeed
e737856a7f Still missed -entrypoint from 'docker run' 2013-08-11 01:29:22 +01:00
Kawsar Saiyeed
ae1909b482 Clarified bash completion limitations 2013-08-11 01:08:47 +01:00
Kawsar Saiyeed
d75282eb14 Missed -entrypoint from 'docker run' options 2013-08-11 00:57:18 +01:00
Daniel Mizyrycki
cd9886f0a8 Merge pull request #1489 from dotcloud/1422-revert-upstart
Revert "docker.upstart: avoid spawning a `sh` process"
2013-08-10 11:07:21 -07:00
Jonathan Rudenberg
a43bae4c0b gitignore all test files 2013-08-10 13:48:24 -04:00
Kawsar Saiyeed
91ae135896 Add description and usage information 2013-08-10 13:05:31 +01:00
Greg Thornton
57b49efc98 Skip existing volumes in volumes-from
Removes the error when a container already has a volume that would otherwise
be created by `Config.VolumesFrom`. Allows restarting containers with a
`Config.VolumesFrom` set.
2013-08-10 06:37:57 +00:00
Greg Thornton
3bd73a9633 Apply volumes-from before creating volumes
Copies the volumes from the container specified in `Config.VolumesFrom` before
creating volumes from `Config.Volumes`. Skips any preexisting volumes when
processing `Config.Volumes`. Fixes #1351
2013-08-10 04:55:23 +00:00
Michael Crosby
e3acbff2ed Revert "docker.upstart: avoid spawning a sh process"
This reverts commit 24dd50490a.
2013-08-10 03:06:08 +00:00
Kawsar Saiyeed
d6e5c2c276 Add initial bash completion script
The script can be used to auto-complete commands, image names and
container ids from within a bash prompt.

This partially resolves #336.
2013-08-10 02:38:11 +01:00
Jonathan Rudenberg
4dc04d7690 Add GitHub usernames to MAINTAINERS 2013-08-09 21:16:44 -04:00
Michael Crosby
3e12349831 Merge pull request #1484 from titanous/use-range
Use ranged for loop on channels
2013-08-09 18:06:12 -07:00
Jonathan Rudenberg
7c50221de5 Use ranged for loop on channels 2013-08-09 20:42:20 -04:00
Michael Crosby
3d63087f78 Merge pull request #1481 from titanous/fix-sprint
Fix typo: fmt.Sprint -> fmt.Sprintf
2013-08-09 17:28:59 -07:00
Jonathan Rudenberg
1408f08c40 Update AUTHORS 2013-08-09 20:09:42 -04:00
Jonathan Rudenberg
3b23f02229 Fix typo: fmt.Sprint -> fmt.Sprintf 2013-08-09 19:52:05 -04:00
Guillaume J. Charmes
fd5099c9fe Merge pull request #1479 from jpetazzo/fix-testbindmounts-typo
- Tests: fix typo in TestBindMounts (runContainer called without image)
2013-08-09 16:20:24 -07:00
Jérôme Petazzoni
68b09cbe3d fix typo in TestBindMounts (runContainer called without image) 2013-08-09 16:03:05 -07:00
Guillaume J. Charmes
92cd2f5bad Merge pull request #1146 from benoitc/feature/attach_ws
* Runtime: add websocket support to /container/<name>/attach/ws
2013-08-09 15:38:24 -07:00
Guillaume J. Charmes
8d1cd63dfa Merge pull request #1460 from dotcloud/patch1
* Runtime: Mount /dev/shm as a tmpfs
2013-08-09 15:18:22 -07:00
Michael Crosby
2c4c10fb4a Merge pull request #1477 from kevinclark/builder-fixme
Only count known instructions as build steps
2013-08-09 14:45:06 -07:00
Kevin Clark
722d4e916a Add myself to AUTHORS 2013-08-09 14:39:03 -07:00
Kevin Clark
4ff649a4ea Only count known instructions as build steps
stepN is only used in the log line, so if we only produce the log line
when there's a message, it should do the right thing.

If it's *not* a valid instruction, it gets a line as well, so there's no
reason to double up.
2013-08-09 14:38:29 -07:00
unclejack
641ddaeb03 add formatting directive to failure to stop container error 2013-08-09 23:27:34 +03:00
unclejack
2ba5c91547 minor cleanup for signal handling 2013-08-09 23:23:27 +03:00
Michael Crosby
25e7227c81 Merge pull request #1462 from dotcloud/fix_build_events_output
Fix docker build and docker events output
2013-08-09 12:41:18 -07:00
Jérôme Petazzoni
04cd0a392b Merge pull request #1463 from jpetazzo/https-get-docker-io
switch from http to https for get.docker.io
2013-08-09 11:26:56 -07:00
Guillaume J. Charmes
db9d68c3e4 Improve TestKillDifferentUser to prevent timeout on buildbot 2013-08-09 10:50:58 -07:00
unclejack
88cb9f3116 keep processing signals after the first one 2013-08-09 20:33:17 +03:00
Guillaume J. Charmes
55f9610cde Merge pull request #1452 from dotcloud/improve_TestGetContainersTop
* Tests: Improve TestGetContainersTop so it does not rely on sleep
2013-08-09 10:28:34 -07:00
shin-
6178dc7f1b brew: added safeguards in script and changed default branch to 'master' 2013-08-09 16:40:28 +02:00
Solomon Hykes
b8f8f9d07e Merged 0.5.2 hotfix release back to master 2013-08-08 19:45:57 -07:00
Michael Crosby
1643943402 Merge pull request #1464 from dotcloud/bump_0.5.2
Bump to 0.5.2
2013-08-08 17:36:53 -07:00
Michael Crosby
e99a99eb6e Bump to v0.5.2 2013-08-09 00:17:35 +00:00
Michael Crosby
df9712f1c8 Change daemon to listen on unix socket by default
Conflicts:
	docs/sources/api/docker_remote_api.rst
2013-08-09 00:16:43 +00:00
Michael Crosby
28d38620f0 Merge pull request #1417 from crosbymichael/root-socket
Change daemon to listen on unix socket by default
2013-08-08 17:06:49 -07:00
Jérôme Petazzoni
1ce9b3ca9c switch from http to https 2013-08-08 17:02:59 -07:00
Jérôme Petazzoni
5c56b597a9 change network range to avoid conflict with EC2 DNS 2013-08-08 23:27:55 +00:00
Michael Crosby
f712e10cb2 Forbid certain paths within docker build ADD
Conflicts:
	buildfile_test.go
2013-08-08 23:22:14 +00:00
Victor Vieux
213365c2d2 fix docker build and docker events output 2013-08-08 22:51:39 +00:00
Sam Alba
7f02bd3b7a Merge pull request #1361 from dotcloud/library
Docker-brew and Docker standard library
2013-08-08 14:22:20 -07:00
Guillaume J. Charmes
ceb33818cd Improve TestGetContainersTop so it does not rely on sleep 2013-08-08 11:51:31 -07:00
Guillaume J. Charmes
18fc707fdf Make sure all needed mountpoint are present 2013-08-08 11:25:02 -07:00
Michael Crosby
c3027fa9ac Merge pull request #1216 from dotcloud/add_some_tests
Add some tests in server and utils
2013-08-08 09:57:18 -07:00
Victor Vieux
4249867e5b rebase 2013-08-08 14:58:52 +00:00
Victor Vieux
c804a5f827 rebase master 2013-08-08 14:56:37 +00:00
Victor Vieux
be77ee33bc Merge branch 'master' into add_some_tests 2013-08-08 14:44:56 +00:00
Victor Vieux
5928ed5d45 Merge pull request #1456 from dotcloud/1455-force_commit_build_env
Make sure ENV instruction within build perform a commit each time
2013-08-08 07:37:51 -07:00
Karan Lyons
075d30dbce Mount /dev/shm as a tmpfs
Fixes #1122.
2013-08-07 17:44:33 -07:00
Guillaume J. Charmes
6a6a2ad8a4 Make sure ENV instruction within build perform a commit each time 2013-08-07 17:23:49 -07:00
Guillaume J. Charmes
279fe144e1 Merge pull request #1420 from jpetazzo/fix-get-docker-io-upstart-script
* Packaging: Fix the upstart script generated by get.docker.io
2013-08-07 17:13:54 -07:00
Daniel Mizyrycki
cc80bd41c4 Merge pull request #1423 from krautcomputing/fix_indentation_in_vagrantfile
Fix indentation in Vagrantfile
2013-08-07 17:10:40 -07:00
Andy Rothfusz
06183e6cdc Merge pull request #1447 from kermit666/image-tag-doc
doc: syntax to run a specific image tag
2013-08-07 16:23:45 -07:00
Guillaume J. Charmes
6249cc3373 Merge pull request #1425 from dotcloud/simplify_ProgressReader
- Runtime: fix small \n error un docker build
2013-08-07 16:19:42 -07:00
Solomon Hykes
80f34c6aeb Merge pull request #1451 from dotcloud/michael-maintainer
Add Michael Crosby to core maintainers
2013-08-07 15:53:29 -07:00
Guillaume J. Charmes
a2f526dadc Merge pull request #1435 from jpetazzo/userland-proxy-should-listen-on-inaddr-any
* Runtime: Let userland proxy handle container-bound traffic
2013-08-07 15:48:17 -07:00
Guillaume J. Charmes
429d2f85cb Merge pull request #1445 from dsissitka/host
* Runtime: Updated the Docker CLI to specify a value for the "Host" header.
2013-08-07 15:38:50 -07:00
Guillaume J. Charmes
2ca018b2eb Merge pull request #1395 from c00w/490-warn-ipv4forwarding-disabled
* Runtime: Add warning when net.ipv4.ip_forwarding = 0
2013-08-07 15:31:12 -07:00
Guillaume J. Charmes
3e6e08ce00 Merge pull request #1362 from dotcloud/registry_test
* Registry: Registry unit tests + mock registry
2013-08-07 15:30:07 -07:00
Colin Rice
3e491f8698 Fix reversed IPv4Forwarding check in api.go 2013-08-07 18:28:40 -04:00
Colin Rice
ccffa69766 Add Colin Rice to AUTHORS file 2013-08-07 18:28:39 -04:00
Colin Rice
10190be5d7 Add warning when net.ipv4.ip_forwarding = 0
Added warnings to api.go, container.go, commands.go, and runtime.go
Also updated APIInfo to return whether IPv4Forwarding is enabled
2013-08-07 18:28:39 -04:00
Guillaume J. Charmes
65a4e30825 Merge pull request #1093 from monnand/910-login-info
* Runtime: fixed #910. print user name to docker info output
2013-08-07 15:09:55 -07:00
Guillaume J. Charmes
e63960caae Merge pull request #1450 from dotcloud/add-sandbox
- Builder: Forbid certain paths within docker build ADD
2013-08-07 15:04:36 -07:00
benoitc
e2ca600fd8 Merge branch 'feature/attach_ws' into feature/attach_ws2
Conflicts:
	api.go
2013-08-07 23:30:28 +02:00
Solomon Hykes
4860df1689 Add Michael Crosby to core maintainers 2013-08-07 21:24:41 +00:00
Michael Crosby
ced93bcabd Modify test to accept error from mkContainer 2013-08-07 19:07:39 +00:00
Sean P. Kane
0e21de9a25 Assume that if VAGRANT_DEFAULT_PROVIDER is set we shouldn't install vbox tools 2013-08-07 09:38:49 -07:00
Michael Crosby
3104fc8d33 Forbid certain paths within docker build ADD 2013-08-07 16:05:30 +00:00
Victor Vieux
2409df9285 Merge pull request #1434 from jpetazzo/fix-ec2-dns-conflict
change network range to avoid conflict with EC2 DNS
2013-08-07 08:43:53 -07:00
Victor Vieux
2e37be973f Merge pull request #1436 from jpetazzo/fix-loopback-interface-test-index
relax the lo interface test to allow iface index != 1
2013-08-07 08:40:55 -07:00
Dražen Lučanin
6115348dd9 doc: syntax to run a specific image tag 2013-08-07 13:57:31 +02:00
David Sissitka
416d098688 Updated my last commit to use tabs instead of spaces. 2013-08-07 05:35:38 -04:00
David Sissitka
6bbe66d2e6 Updated the Docker CLI to specify a value for the "Host" header. 2013-08-07 05:33:03 -04:00
Andy Rothfusz
3782e34e67 Merge pull request #1430 from metalivedev/1031-linuxheaders
Suggest installing linux-headers by default. Address #1187 and #1031
2013-08-06 18:56:34 -07:00
Jérôme Petazzoni
84790aafd8 relax the lo interface test to allow iface index != 1 2013-08-06 18:31:05 -07:00
Jérôme Petazzoni
fea2d5f2fe Let userland proxy handle container-bound traffic 2013-08-06 17:44:39 -07:00
Jérôme Petazzoni
9f1c9686e0 change network range to avoid conflict with EC2 DNS 2013-08-06 17:24:10 -07:00
Andy Rothfusz
e0a6f27d1b Suggest installing linux-headers by default. Address #1187 and #1031 2013-08-06 13:56:29 -07:00
Andy Rothfusz
9130ee7513 Merge pull request #1428 from dhrp/twitterhandle
changed the twitter handle
2013-08-06 13:38:22 -07:00
shin-
65c8e9242c brew: added support for push on private registries. 2013-08-06 21:08:27 +02:00
Thatcher Peskens
1d654f6156 changed the twitter handle 2013-08-06 11:40:16 -07:00
Victor Vieux
4af24e11a4 Merge pull request #1221 from crosbymichael/cmd-cp
*Client: Add docker cp command and copy api endpoint to copy container files/folders to the host
2013-08-06 09:15:39 -07:00
Michael Crosby
583f5868c9 Move copy command docs to api 1.4 document 2013-08-06 16:09:54 +00:00
Michael Crosby
d94b186080 Strip leading forward slash from resource 2013-08-06 16:09:54 +00:00
Michael Crosby
5b8cfbe15c Add cp command and copy api endpoint
The cp command and copy api endpoint allows users
to copy files and or folders from a containers filesystem.

Closes #382
2013-08-06 16:09:54 +00:00
Victor Vieux
0dbc51f4d2 Merge pull request #1394 from crosbymichael/1391-json-requests
Use mime pkg to parse Content-Type
2013-08-06 08:59:10 -07:00
Michael Crosby
754ed9043d Use mime types to parse Content-Type 2013-08-06 15:57:13 +00:00
Victor Vieux
ba17f4a06a fix small \n error un docker build 2013-08-06 14:31:51 +00:00
Manuel Meurer
b9149f45bf Fix indentation in Vagrantfile 2013-08-06 15:21:26 +02:00
Victor Vieux
b6c4b325a4 Merge pull request #1406 from dotcloud/1363-reduce_timeout-fix
Reduce connect and read timeout when pinging the registry (fixes issue #1363)
2013-08-06 04:22:44 -07:00
Nan Monnand Deng
965de6ef50 fixing #910 2013-08-05 23:37:53 -04:00
Nan Monnand Deng
303490168f Added index address into APIInfo. 2013-08-05 23:36:55 -04:00
Michael Crosby
c7c2399be9 Merge pull request #1421 from dotcloud/fix_makefile
Make sure all sources have the wanted revision
2013-08-05 20:25:32 -07:00
Guillaume J. Charmes
120a520a22 Make sure all sources have the wanted revision 2013-08-05 19:58:48 -07:00
Andy Rothfusz
7c03bd1e7a Merge branch 'docs-example-fix' of git://github.com/faizkhan00/docker
merges #1402
2013-08-05 18:21:19 -07:00
Jérôme Petazzoni
049d28868e fix the upstart script generated by get.docker.io (it was not starting dockerd on boot) 2013-08-05 18:11:13 -07:00
Michael Crosby
8934f13615 Change daemon to listen on unix socket by default 2013-08-06 00:12:56 +00:00
Guillaume J. Charmes
dcf9dfb129 Update utils_test.go 2013-08-05 16:32:25 -07:00
Andy Rothfusz
7c9604e32b Merge pull request #1387 from joevandyk/patch-1
Update amazon.rst to explain that Vagrant is not necessary for running Docker on ec2
2013-08-05 16:14:57 -07:00
Andy Rothfusz
b302ae329c Merge pull request #1418 from dhrp/remote_api_doc_improvements
Fixed some typo's and formatting issues in remote api documentation.
2013-08-05 16:13:55 -07:00
Thatcher Peskens
ff6b6f2ce1 Fixed some typo's and formatting issues in remote api documentation. 2013-08-05 15:55:40 -07:00
Thatcher
d49f141fb3 Merge pull request #1303 from dhrp/update-spinx-for-man
Enabled the docs to generate manpages.
2013-08-05 15:31:51 -07:00
Guillaume J. Charmes
590fc58de7 Update version. 2013-08-05 14:49:37 -07:00
Guillaume J. Charmes
c03561eea8 Update CHANGELOG.md 2013-08-05 14:32:54 -07:00
Nan Monnand Deng
4179f25286 fixed #910. print user name to docker info output 2013-08-05 17:25:29 -04:00
Guillaume J. Charmes
e54e8fa920 Merge pull request #1290 from dotcloud/parallel_pull
* Runtime: Parallel pull
2013-08-05 14:17:29 -07:00
Guillaume J. Charmes
2f1c05d997 Merge pull request #1374 from dotcloud/steeve-patch-1
- Runtime: Handle ip route showing mask-less IP addresses
2013-08-05 14:13:20 -07:00
Andy Rothfusz
baa4618e57 Merge pull request #1390 from grobie/clarify-amazon-documentation
Clarify Amazon EC2 installation type
2013-08-05 13:26:28 -07:00
Andy Rothfusz
dcc1e3562f Merge pull request #1404 from dnordberg/fix-base-refs
'Base' image is depreciated and should no longer be referenced in the docs.
2013-08-05 13:24:05 -07:00
Guillaume J. Charmes
f6fa353dd8 Merge pull request #1267 from sridatta/new-clean-init
* Runtime: Fix to "Inject dockerinit at /.dockerinit"
2013-08-05 13:23:22 -07:00
Andy Rothfusz
d4fa619ed1 Merge pull request #1411 from andrewmacgregor/doc-typos
Minor typos found while reading docs
2013-08-05 13:22:53 -07:00
Michael Crosby
8a851af5e6 Merge pull request #1364 from dotcloud/bump_0.5.1
Bump to v0.5.1
2013-08-05 12:10:03 -07:00
shin-
8aa9985ad0 Adapted tests to latest registry changes 2013-08-05 20:28:05 +02:00
shin-
2c85b964e3 Cleanup 2013-08-05 19:07:23 +02:00
shin-
9159c819c3 Mock access logs don't show up in non-debug mode 2013-08-05 19:06:00 +02:00
shin-
484ba4a8c5 gofmt 2013-08-05 19:06:00 +02:00
shin-
97b7b173b9 New registry unit tests remade from scratch, using the mock registry 2013-08-05 19:06:00 +02:00
shin-
29f69211c9 Mock registry: Fixed a bug where the index validation path would return a 200 status code instead of the expected 204 2013-08-05 19:06:00 +02:00
shin-
553ce165c1 registry: Fixed a bug where token and cookie info wouldn't be sent when using LookupRemoteImage(). Fixed a bug where no error would be reported when getting a non-200 status code in GetRemoteImageLayer() 2013-08-05 19:05:14 +02:00
Sam Alba
310ddec823 Disabled test server in the tests 2013-08-05 19:02:57 +02:00
Sam Alba
6926ba558f Mocked registry: Added X-Docker-Size when fetching the layer 2013-08-05 19:02:57 +02:00
Sam Alba
97d1d6f5d2 Fixed mocked registry 2013-08-05 19:02:57 +02:00
Sam Alba
5f7abd5347 Implemented a Mocked version of the Registry server 2013-08-05 19:02:57 +02:00
Victor Vieux
946bbee39a rebase master 2013-08-05 16:25:42 +00:00
Victor Vieux
bdc0e8f825 Merge pull request #1405 from jonasi/entrypoint-noargs
*Runtime: Allow ENTRYPOINT without CMD
2013-08-05 09:00:39 -07:00
Victor Vieux
1b08ab92d1 Merge pull request #1408 from dotcloud/1407-localhost_is_a_domain-fix
Always consider localhost as a domain name when parsing the FQN repos name
2013-08-05 08:50:12 -07:00
Victor Vieux
feda3db1dd Merge pull request #1382 from monnand/650-http-utils
650 http utils and user agent field
2013-08-05 08:49:12 -07:00
Andrew Macgregor
ce97a71adf Minor typos found while reading docs 2013-08-05 22:47:16 +08:00
Isao Jonas
d00fb40967 added tests for 1405 2013-08-05 09:30:27 -05:00
Isao Jonas
0f249c85ea fix entrypoint without cmd 2013-08-05 09:07:03 -05:00
Ken Cochrane
a37b42b57c Merge pull request #1400 from gorsuch/doc-typo
* Documentation: fix a typo in the ubuntu installation guide
2013-08-05 07:05:27 -07:00
Victor Vieux
dd8c59892c Merge pull request #1182 from dotcloud/change_build_usage
change tag -> repository name (and optionally a tag) in build usage
2013-08-05 04:08:33 -07:00
Victor Vieux
a97cf23355 add docs 2013-08-05 11:07:27 +00:00
Victor Vieux
030cc8d5cc Merge pull request #1389 from dotcloud/1373-improve_checklocaldns
Consider empty /etc/resolv.conf as local dns + add unit test
2013-08-05 02:29:36 -07:00
Sam Alba
c22f2617ad Always consider localhost as a domain name when parsing the FQN repos name 2013-08-04 17:59:12 -07:00
Sam Alba
c860945be2 Reduce connect and read timeout when pinging the registry (fixes issue #1363) 2013-08-04 17:42:24 -07:00
Daniel Nordberg
51d0c9238b 'Base' is depreciated and should no longer be referenced in the docs.
https://groups.google.com/forum/\#!topic/docker-club/pEjqMgcrnqA
2013-08-05 01:34:32 +03:00
Faiz K
22df1249b5 bash commands while in the container aren't in the transcript! Added. 2013-08-04 08:26:56 -05:00
David Calavera
bdaa87ff21 Print a new line after getting the password from stdin. 2013-08-03 21:30:07 -07:00
Michael Gorsuch
db0ccaac9b typo: s/connexions/connections 2013-08-03 22:11:59 -05:00
David Calavera
4089a20cf4 Exit if there is any error reading from stdin. 2013-08-03 17:27:15 -07:00
David Calavera
75ac50a9a0 Stop making a raw terminal to ask for registry login credentials.
It only disables echo asking for the password and lets the terminal to handle everything else.
It fixes #1392 since blank spaces are not discarded as they did before.
It also cleans the login code a little bit to improve readability.
2013-08-03 16:43:20 -07:00
David Calavera
58e0c68132 Merge branch 'master' into login_signal
* master: (54 commits)
  Return JSONError for HTTPResponse error
  Fix TestEnv
  Revert "Bind daemon to 0.0.0.0 in Vagrant. Fixes #1304"
  Add unit tests for build no cache
  Add no cache for docker build
  Move note about officially supported kernel
  Solved the logo being squished in Safari
  Add hostname to the container environment.
  fix same issue in api.go
  improve tests
  Return registy status code in error
  update http://get.docker.io/latest
  Add check that the request is good
  fix tests about refactor checksums
  add ufw doc
  Fixed a couple of minor syntax errors.
  Updated the description of run -d
  Make sure the index also receives the checksums
  Switch json/payload order
  Remove unused parameter
  ...
2013-08-03 15:43:43 -07:00
David Calavera
cd6aeaf979 Sort APIImages by most recent creation date.
Fixes #985.
2013-08-03 15:35:36 -07:00
Tobias Schmidt
708cd34586 Clarify Amazon EC2 installation type
Make clear this documentation is about installing docker on EC2 with the
help of vagrant, which doesn't make it easy to start multiple instances,
instead of plain vanilla EC2 installation.
2013-08-03 17:31:20 +07:00
Guillaume J. Charmes
4dcc0f316c Merge pull request #1298 from crosbymichael/1246-auth-request
* Registry: Do not require login unless 401 is received on push
2013-08-02 17:39:54 -07:00
Michael Crosby
dae585c6e4 Return JSONError for HTTPResponse error 2013-08-03 00:27:58 +00:00
Andy Rothfusz
b1d994e3b9 Merge pull request #1375 from grobie/patch-1
Move note about officially supported kernel
2013-08-02 17:24:15 -07:00
Guillaume J. Charmes
dde8f74cea Fix TestEnv 2013-08-02 15:58:10 -07:00
Daniel Mizyrycki
9e3d18e606 Merge pull request #1388 from titanous/revert-vagrant-bind
Revert "Bind daemon to 0.0.0.0 in Vagrant. Fixes #1304"
2013-08-02 15:26:05 -07:00
Guillaume J. Charmes
3e9575e275 Consider empty /etc/resolv.conf as local dns + add unit test 2013-08-02 15:23:36 -07:00
Jonathan Rudenberg
07fee44559 Revert "Bind daemon to 0.0.0.0 in Vagrant. Fixes #1304"
This reverts commit bdc79ac8b2.
2013-08-02 19:18:02 -03:00
Joe Van Dyk
b6bff0cbb1 Update amazon.rst to explain that Vagrant is not necessary for running Docker on ec2 2013-08-02 15:10:57 -07:00
Guillaume J. Charmes
ead7eb619e Merge pull request #1384 from crosbymichael/1326-build-without-cache
* Builder: Add no cache for docker build
2013-08-02 14:38:34 -07:00
Guillaume J. Charmes
29de2432ea Merge pull request #1350 from ndarilek/1348-add-hostname-to-environment
Runtime: add hostname to environment
2013-08-02 13:58:43 -07:00
Guillaume J. Charmes
ffcba1236c Merge pull request #1117 from dotcloud/add_last_version-feature
Add last stable version in `docker version`
2013-08-02 13:53:33 -07:00
Guillaume J. Charmes
0f088d28c5 Merge pull request #1336 from dotcloud/fix_ADD_permissions
Builder: Make sure ADD will create everything in 0755
2013-08-02 13:52:19 -07:00
Daniel Mizyrycki
16917275ee Merge pull request #1346 from dotcloud/1117-update_latest_in_dockerbuilder
update http://get.docker.io/latest
2013-08-02 13:51:23 -07:00
Andy Rothfusz
09ab2bfa1d Merge pull request #1343 from dotcloud/ufw_doc
Add ufw doc
2013-08-02 13:33:26 -07:00
Michael Crosby
b9f0695924 Add unit tests for build no cache 2013-08-02 19:12:38 +00:00
Nan Monnand Deng
7bade49d4c update auth_test.go 2013-08-02 14:08:16 -04:00
Michael Crosby
3a123bc479 Add no cache for docker build
Add a new flag to disable the image cache when building images.
2013-08-02 16:18:54 +00:00
Nan Monnand Deng
5bc344ab73 factory generated from one place. 2013-08-02 04:10:26 -04:00
Nan Monnand Deng
4bd287e107 auth with user agent 2013-08-02 03:30:45 -04:00
Nan Monnand Deng
6a56b7b391 Server now use request factory 2013-08-02 03:23:46 -04:00
Nan Monnand Deng
7dac26ce69 reqFactory in Registry 2013-08-02 03:08:08 -04:00
Nan Monnand Deng
793fd983ef http utils 2013-08-02 02:47:58 -04:00
Tobias Schmidt
2424480e2c Move note about officially supported kernel
It seems this a general note about kernel issues and not specific to Cgroups or namespaces.
2013-08-02 12:24:38 +07:00
Guillaume J. Charmes
f5a8e90d10 Make sure the routes IP are taken into consideration + add unit test for network overlap detection 2013-08-01 18:12:39 -07:00
Daniel Mizyrycki
2e7df5182c testing, issue #1331: Add registry functional test to docker-ci 2013-08-01 17:48:17 -07:00
Daniel Mizyrycki
ea2486d631 Merge pull request #1333 from dotcloud/1331-testing-registry
testing, issue #1331: Add registry functional test to docker-ci
2013-08-01 16:00:29 -07:00
Steeve Morin
2e72882216 Handle ip route showing mask-less IP addresses
Sometimes `ip route` will show mask-less IPs, so net.ParseCIDR will fail. If it does we check if we can net.ParseIP, and fail only if we can't.
Fixes #1214
Fixes #362
2013-08-01 02:42:22 +02:00
Thatcher
d1e1a8e78c Merge pull request #1365 from dhrp/solve-logo-squish
Solved the logo being squished in Safari
2013-07-31 15:06:26 -07:00
Thatcher
ad3b091d53 Some more improvements on the docs readme. Removed references to website. 2013-07-31 13:59:56 -07:00
Thatcher Peskens
26229d78f2 Updated docs README with instructions to preview the generated manfile, and where to get the one generated by sphinx. 2013-07-31 13:44:10 -07:00
Thatcher Peskens
e0c24ccfc3 Solved the logo being squished in Safari 2013-07-31 12:17:42 -07:00
Guillaume J. Charmes
3b89d13aaf Bump to v0.5.1 2013-07-31 10:53:36 -07:00
Victor Vieux
108635582f rebase master 2013-07-31 15:32:08 +00:00
Victor Vieux
0c0077ed6f Merge pull request #1328 from dotcloud/1307_url_port_delete-fix
Use utils.ParseRepositoryTag instead of strings.Split(name, ":") in server.ImageDelete
2013-07-31 07:55:06 -07:00
Nolan
9a604acc23 Add hostname to the container environment. 2013-07-31 09:50:53 -05:00
Victor Vieux
cd9f7f29d1 Merge pull request #1334 from dotcloud/1314-compat_broke-fix
Discard error when loading old container format
2013-07-31 01:08:08 -07:00
Victor Vieux
a7068510a5 fix same issue in api.go 2013-07-31 08:01:20 +00:00
Victor Vieux
73c6d9f135 improve tests 2013-07-31 07:56:53 +00:00
Michael Crosby
3043c26419 Return registy status code in error
Added Details map to the JSONMessage
2013-07-30 23:24:31 +00:00
Victor Vieux
e66e0289ab update http://get.docker.io/latest 2013-07-30 17:18:19 +00:00
Victor Vieux
6166380d76 rebase master 2013-07-30 16:51:50 +00:00
Victor Vieux
e4752c8c1a Add check that the request is good 2013-07-30 16:42:32 +00:00
Victor Vieux
99c27fa0dd Merge branch 'master' into add_last_version-feature 2013-07-30 16:23:06 +00:00
Victor Vieux
d5a57a4b5e Merge pull request #1344 from dotcloud/refactor_checksum_tests
fix tests about refactor checksums
2013-07-30 06:13:49 -07:00
Victor Vieux
b14c251862 fix tests about refactor checksums 2013-07-30 13:13:18 +00:00
Victor Vieux
bcd6ca3685 Merge pull request #1268 from dotcloud/refactor_checksum
Refactor checksum
2013-07-30 06:07:54 -07:00
Victor Vieux
16225c473f Merge pull request #1291 from dotcloud/ensure_mount_commit
*Builder: Allow the commit of a non-started container
2013-07-30 05:19:17 -07:00
Victor Vieux
46f59dd933 add parallel pull to 1.4 2013-07-30 12:15:33 +00:00
Victor Vieux
e1fa989ec9 rebase master 2013-07-30 11:59:31 +00:00
Victor Vieux
dd2f0d89bf Merge pull request #1238 from dotcloud/1237-improve_docker_top-feature
*Client: add ps args to docker top
2013-07-30 04:54:44 -07:00
Victor Vieux
0b57e4483a Merge branch 'master' into 1237-improve_docker_top-feature 2013-07-30 11:51:16 +00:00
Victor Vieux
7d0b8c726c add ufw doc 2013-07-30 13:47:29 +02:00
Victor Vieux
f2dc49292f Merge pull request #1342 from dsissitka/patch-4
Fixed a couple of minor syntax errors.
2013-07-30 04:20:05 -07:00
Victor Vieux
a7ace535c3 Merge pull request #1339 from dhrp/docker-run-d-description
Updated the description of run -d
2013-07-30 04:15:41 -07:00
Victor Vieux
c99e8de5a4 Merge branch 'cleanup_signal_handling' of https://github.com/calavera/docker into calavera-cleanup_signal_handling 2013-07-30 11:14:36 +00:00
Victor Vieux
c06aa62bda Merge pull request #1306 from dotcloud/1294_fix_wrong_untag_using_id_rmi
Fix wrong untag using id rmi
2013-07-30 04:09:55 -07:00
dsissitka
9ba998312d Fixed a couple of minor syntax errors. 2013-07-30 01:39:29 -04:00
Daniel Mizyrycki
7d68afb2d2 Merge pull request #1209 from zimbatm/upstart-improvements
Upstart improvements
2013-07-29 18:28:40 -07:00
Daniel Mizyrycki
bfdf1839e0 Merge pull request #1312 from titanous/vagrant-bind
Bind daemon to 0.0.0.0 in Vagrant
2013-07-29 17:06:37 -07:00
Thatcher Peskens
5dc86d7bca Updated the description of run -d
The goal is to make it more clear this will give you the container id after run completes.

Since stdout is now standard on run, "docker run -d" is the best (or only) way to get the container ID returned from docker after a plain run, but the description (help) does not hint any such thing.
2013-07-29 14:17:15 -07:00
Guillaume J. Charmes
f35491190a Merge pull request #1233 from fmd/1136-environment-variables
+ Builder: CmdAdd and CmdEnv now respect Dockerfile-set ENV variables
2013-07-29 13:43:13 -07:00
Guillaume J. Charmes
5b27652ac6 Make sure the index also receives the checksums 2013-07-29 11:30:21 -07:00
Guillaume J. Charmes
394941b6b0 Switch json/payload order 2013-07-29 11:30:17 -07:00
Guillaume J. Charmes
0f134b4bf8 Remove unused parameter 2013-07-29 11:30:17 -07:00
Guillaume J. Charmes
0badda9f15 Refactor the image size storage 2013-07-29 11:30:17 -07:00
Guillaume J. Charmes
e3f68b22d8 Handle extra-paremeter within checksum calculations 2013-07-29 11:30:17 -07:00
Guillaume J. Charmes
8ca7b0646e Refactor checksum 2013-07-29 11:30:17 -07:00
David Calavera
10e37198aa Keep the loop to allow resizing more than once. 2013-07-29 11:13:59 -07:00
Guillaume J. Charmes
f7542664e3 Make sure ADD will create everything in 0755 2013-07-29 11:03:09 -07:00
Guillaume J. Charmes
950d0312dc Merge pull request #1322 from calavera/prompt_without_defaults
Do not show empty parenthesis if the default configuration is missing.
2013-07-29 10:53:43 -07:00
David Calavera
c8ec36d1b9 Remove unnecessary signal conditional. 2013-07-29 10:28:41 -07:00
Daniel Mizyrycki
17ffb0ac84 testing, issue #1331: Add registry functional test to docker-ci 2013-07-29 09:45:19 -07:00
Victor Vieux
b2aa877bf0 fix #1314 discard error when loading old container format 2013-07-29 16:40:35 +00:00
Victor Vieux
bb241c10e2 add regression tests 2013-07-29 12:16:14 +00:00
Victor Vieux
3852d05990 add ParseRepositoryTag tests 2013-07-29 12:16:01 +00:00
Victor Vieux
63876e7dbd use ParseRepositoryTag instead on split on : in imagedelete 2013-07-29 12:15:27 +00:00
Solomon Hykes
97a2dc96f2 Remove deprecated copy from README 2013-07-28 12:57:09 -07:00
David Calavera
88b6ea993d Remove unused argument. 2013-07-27 10:17:57 -07:00
David Calavera
d4f7039793 Do not show empty parenthesis if the default configuration is missing. 2013-07-27 10:00:36 -07:00
David Calavera
bb06fe8dd9 Allow to generate signals when termios is in raw mode. 2013-07-27 09:14:38 -07:00
Guillaume J. Charmes
4399f65fb8 Merge pull request #1318 from gaffo/compile_docs
Add required go version for compilation
2013-07-26 18:33:10 -07:00
Mike Gaffney
2d85a20c71 Add required go version for compilation 2013-07-26 18:29:27 -07:00
David Calavera
7cc90f2bc5 Use a more idiomatic syntax to capture the exit. 2013-07-26 18:12:05 -07:00
David Calavera
01ce312c2d Exit from docker login on SIGTERM and SIGINT.
Fixes #1299.
2013-07-26 17:40:45 -07:00
Guillaume J. Charmes
c01d17d77d Merge pull request #1313 from titanous/update-authors
Update AUTHORS
2013-07-26 17:04:05 -07:00
Guillaume J. Charmes
ed0ba04da6 Merge pull request #1316 from dotcloud/1295-mkdir_ADD_issue
- Builder: Create directories with 755 instead of 700 within ADD instruction
2013-07-26 15:12:45 -07:00
Guillaume J. Charmes
b15cfd3530 - Builder: Create directories with 755 instead of 700 within ADD instruction 2013-07-26 14:57:16 -07:00
Guillaume J. Charmes
a438d505ba Merge pull request #1272 from dotcloud/improve_registry_cookie
Make sure the cookie is used in all registry queries
2013-07-26 14:26:29 -07:00
Jonathan Rudenberg
5eb590e79d Update AUTHORS 2013-07-26 15:48:01 -04:00
Jonathan Rudenberg
bdc79ac8b2 Bind daemon to 0.0.0.0 in Vagrant. Fixes #1304 2013-07-26 15:45:00 -04:00
Solomon Hykes
a97d858b2a Clean up 'manifesto' in docs 2013-07-26 10:21:17 -07:00
Victor Vieux
e592f1b298 add regression test 2013-07-26 10:30:36 +00:00
Victor Vieux
513a567483 fix docs 2013-07-26 10:04:46 +00:00
Victor Vieux
faf103e6ec Merge pull request #1305 from gaffo/fix-spelling
Change reserve-compatibility to reverse-compatibility
2013-07-26 02:40:56 -07:00
Victor Vieux
e608296bc6 fix wrong untag when using rmi via id 2013-07-26 09:19:26 +00:00
Mike Gaffney
4ebe2cf348 Change reserve-compatibility to reverse-compatibility 2013-07-26 01:10:42 -07:00
Thatcher Peskens
f4b63d9eea Enabled the docs to generate manpages.
* changed conf.py to reference toctree.rst instead of index
* Added note to README to upgrade your sphinx to the latest version to prevent a bug with .. note:: blocks.
2013-07-25 17:19:58 -07:00
Andy Rothfusz
422378cb85 Merge pull request #1274 from dhrp/headings_website
Removed website and updated headings.
2013-07-25 16:43:27 -07:00
Guillaume J. Charmes
594c818d85 Merge pull request #1281 from dotcloud/505-output_after_pipe-fix
- Runtime: Fixes #505 - Make sure all output is send on the network before closing
2013-07-25 13:01:31 -07:00
Fareed Dudhia
d86898b014 Fixes 1136; Reopened from 1175 with latest changes. 2013-07-25 19:45:49 +00:00
Guillaume J. Charmes
be087c9c82 Merge pull request #1293 from dotcloud/585_use_0755_instead_of_0700
use 0755 instead of 0700
2013-07-25 12:40:44 -07:00
Guillaume J. Charmes
9cc8b72a38 Merge pull request #1288 from dlintw/1286-improve-import-txz-description
Fixes #1286 improve-import-txz-description
2013-07-25 12:37:37 -07:00
Guillaume J. Charmes
3425c1b84c Make sure the cookie is used in all registry queries 2013-07-25 12:31:23 -07:00
shin-
12d575a6b1 Script cleans up downloaded repos, uses quiet build 2013-07-25 21:00:36 +02:00
Victor Vieux
1c509f4350 use 0755 instead of 0700 2013-07-25 15:45:15 +00:00
Victor Vieux
48833c7b07 add regression test + go fmt 2013-07-25 15:20:56 +00:00
Victor Vieux
f385f1860b ensure mount in commit 2013-07-25 15:18:34 +00:00
Victor Vieux
01e98bf0dd fix errors 2013-07-25 14:32:46 +00:00
Victor Vieux
f1dd299227 Use VT100 escape codes
:
2013-07-25 14:16:36 +00:00
Victor Vieux
7df6c4b9ad Merge pull request #1283 from crosbymichael/username-not-set
Copy authConfigs on save so data is not modified
2013-07-25 06:31:34 -07:00
Daniel YC Lin
8f6b6d5784 Fixes #1286 2013-07-25 15:36:32 +08:00
Michael Crosby
0fc11699ab Add regression test for authConfig overwrite 2013-07-25 03:25:16 +00:00
Michael Crosby
9332c00ca5 Copy authConfigs on save so data is not modified
SaveConfig sets the Username and Password to an empty string
on save.  A copy of the authConfigs need to be made so that the
in memory data is not modified.
2013-07-25 00:35:52 +00:00
Guillaume J. Charmes
fd9ad1a194 Fixes #505 - Make sure all output is send on the network before closing 2013-07-24 15:48:51 -07:00
Guillaume J. Charmes
6ae3305040 Merge pull request #1277 from dotcloud/add_commands_unit_tests
* Tests: Reimplement old Commands unit tests in order to insure behavior
2013-07-24 15:24:51 -07:00
shin-
94053b4225 Brew: Added cache prefilling and build summary 2013-07-24 23:48:16 +02:00
shin-
77ff537697 Brew: Fixed docker-py requirement 2013-07-24 23:48:16 +02:00
shin-
362f1735e6 Brew: Avoid duplicate commands, added --debug option, added local repo support 2013-07-24 23:48:16 +02:00
shin-
7813f2a25e Updated git repos for precise and raring 2013-07-24 23:48:16 +02:00
shin-
3781a2cc4b Added definition file for busybox and updated ubuntu 2013-07-24 23:48:16 +02:00
shin-
d47df21a33 Add brew script to the contrib folder 2013-07-24 23:48:16 +02:00
Joffrey F
0ac672fea6 Use full hash references in library/
Brew doesn't currently support abridged hashes
2013-07-24 23:48:16 +02:00
Joffrey F
c19fa83a8a Use extended syntax (indicate what type of object needs to be checked out) 2013-07-24 23:48:16 +02:00
Solomon Hykes
844a9ab85e Define tags in the library files instead of upstream 2013-07-24 23:48:16 +02:00
Solomon Hykes
a45490243b Adding Joffrey as library maintainer 2013-07-24 23:48:16 +02:00
Solomon Hykes
b06f627139 Library: hipache and ubuntu base 2013-07-24 23:48:16 +02:00
Andy Rothfusz
cc0e091a6b Merge pull request #1278 from metalivedev/logotweaks
Cleaned up long lines, switched graphic to Docker logo. General cleanup.
2013-07-24 10:37:45 -07:00
Victor Vieux
8742649aa7 improve client output 2013-07-24 17:10:59 +00:00
Victor Vieux
0e71e368a8 Add ID to JSONMessage in pull
Use goroutines to pull in parallel
If multiple images pulled at the same time, each progress is displayed on a new line
2013-07-24 15:41:34 +00:00
Victor Vieux
dfc076a123 Merge pull request #1243 from dotcloud/add_lxc_version_docker_info
*Client: LXC and Kernel version to docker info in debug mode
2013-07-24 07:44:23 -07:00
Victor Vieux
066873ebd2 rebase master 2013-07-24 14:38:40 +00:00
Victor Vieux
f6e1055727 Merge pull request #1064 from monnand/156-user-agent-header
Add user agent when calling the registry
2013-07-24 06:40:53 -07:00
Victor Vieux
6057e6ad70 add kernel version 2013-07-24 13:36:55 +00:00
Victor Vieux
ca39f15fa3 bump master 2013-07-24 13:28:01 +00:00
Victor Vieux
7953d1becb Merge pull request #1271 from dotcloud/1246_change_cfg_format
*Auth: Change dockercfg to json and support multiple auth remote
2013-07-24 05:29:51 -07:00
Victor Vieux
f4b41e1a6c fix tests 2013-07-24 12:28:22 +00:00
Victor Vieux
4bc3328e80 bump master 2013-07-24 12:18:53 +00:00
Victor Vieux
ebe17f57ff Merge pull request #1180 from dotcloud/1167_events_endpoint-feature
*Api: Add the /events endpoint
*Client: Add the docker events command
2013-07-24 04:53:36 -07:00
Victor Vieux
ee05f97c9a Merge branch 'master' into 1167_events_endpoint-feature 2013-07-24 11:49:04 +00:00
Andy Rothfusz
78c02d038f Cleaned up long lines, switched graphic to Docker logo. General cleanup. 2013-07-23 18:13:53 -07:00
Guillaume J. Charmes
bc823acc25 Reimplement old Commands unit tests in order to insure behavior 2013-07-23 17:27:49 -07:00
Daniel Mizyrycki
c21c5afe00 Merge pull request #1147 from dotcloud/1104-testing-static
testing, issue #1104: Make the test use static flags
2013-07-23 17:07:36 -07:00
Nan Monnand Deng
1ae54707a0 versionCheckers()->versionInfos(). 2013-07-23 17:17:31 -04:00
Nan Monnand Deng
ede1e6d475 Rename: VersionChecker->VersionInfo. 2013-07-23 17:05:13 -04:00
Thatcher Peskens
e701dce339 Docs: Fixed navigaton links to about page and community page
Website: Removed the website sources from the repo. The website sources are now hosted on github.com/dotcloud/www.docker.io/
2013-07-23 13:05:06 -07:00
Victor Vieux
a93a87f64a Merge branch 'stfp-858-disable-network-configuration' 2013-07-23 19:55:50 +00:00
Victor Vieux
7aba68cd54 update AUTHORS 2013-07-23 19:55:38 +00:00
Victor Vieux
dfc64d157a Merge pull request #1241 from ryfow/patch-1
Make the ENTRYPOINT example work
2013-07-23 08:45:04 -07:00
Victor Vieux
a41384ad73 add die event 2013-07-23 15:42:34 +00:00
Victor Vieux
ed7a4236b3 Add tests for the api 2013-07-23 15:42:34 +00:00
Victor Vieux
040c3b50d0 use non-blocking channel to prevent dead-lock and add test for server 2013-07-23 15:42:34 +00:00
Victor Vieux
8b3519c5f7 getEvents a bit simpler 2013-07-23 15:42:34 +00:00
Victor Vieux
ec559c02b8 add docs 2013-07-23 15:42:34 +00:00
Victor Vieux
2e4d4c9f60 add since for polling, rename some vars 2013-07-23 15:41:19 +00:00
Victor Vieux
b8d52ec266 add timestamp and change untagged -> untag 2013-07-23 15:41:19 +00:00
Victor Vieux
b5da816487 basic version of the /events endpoint 2013-07-23 15:41:19 +00:00
Victor Vieux
3bae188b8d change dockercfg to json and support multiple auth remote 2013-07-23 15:07:18 +00:00
Victor Vieux
8165e51ecc Merge branch '858-disable-network-configuration' of https://github.com/stfp/docker into stfp-858-disable-network-configuration 2013-07-23 08:44:12 +00:00
Thatcher
9a15db21a6 Merge pull request #1269 from dhrp/new-website-links
Added new docker logo to the documentation header, and added other links to docs header. Tnx @keeb !
2013-07-22 20:48:29 -07:00
Thatcher Peskens
58a1c5720a Added new docker logo to the documentation header, and added other links. 2013-07-22 20:26:40 -07:00
Stefan Praszalowicz
bc172e5e5f Invert network disable flag and logic (unbreaks TestAllocate*PortLocalhost) 2013-07-22 19:00:35 -07:00
Solomon Hykes
6745bdd0b3 Typo in 3rd-party 2013-07-22 18:39:58 -07:00
Solomon Hykes
5714f0a74e Hack: completed step 12 of the bootcamp 2013-07-22 18:36:36 -07:00
Solomon Hykes
ce43f4af1c Hack: first draft of the maintainer boot camp. Work in progress! 2013-07-22 18:32:55 -07:00
Sridatta Thatipamala
945033f1cc change permissions of initLayer to be readable by non-root users 2013-07-22 14:55:07 -07:00
Victor Vieux
5d1609f5a2 Merge pull request #1265 from dotcloud/better-bridge-defaults
*Network: Improve default network configuration
2013-07-22 13:54:35 -07:00
Solomon Hykes
4714f102d7 Allocate a /16 IP range by default, with fallback to /24. Try a total of 12 ranges instead of 3. 2013-07-22 12:06:24 -07:00
Guillaume J. Charmes
a675da65e9 Merge pull request #1262 from dotcloud/1253_add_directory_check
* Runtime: fix error message when invalid directory
2013-07-22 11:54:22 -07:00
Victor Vieux
e39755666b Merge pull request #1236 from dotcloud/1234_overwrites_expose-fix
*Builder: fix overwrites EXPOSE
2013-07-22 09:51:11 -07:00
Victor Vieux
9adba5e2e6 Merge pull request #1264 from dotcloud/fix_tests_env
fix test env
2013-07-22 09:26:34 -07:00
Victor Vieux
5c1af383eb fix test env 2013-07-22 16:26:05 +00:00
Victor Vieux
c81662eae4 Merge branch 'master' into 1237-improve_docker_top-feature
Conflicts:
	docs/sources/api/docker_remote_api.rst
2013-07-22 16:22:11 +00:00
Victor Vieux
8ea9ccf3a7 Merge pull request #1244 from dotcloud/1020_add_variable
*Runtime: Add container=lxc in default env
2013-07-22 09:17:30 -07:00
Victor Vieux
74a2b13687 fix error message when invalid directory 2013-07-22 14:52:05 +00:00
Victor Vieux
4e7f2b757e Merge pull request #1158 from cespare/1142-docker-add-fix
*Buildfile: determine a filename from a URL if the destination is a directory
2013-07-22 07:07:04 -07:00
Ken Cochrane
2bba279cf1 Merge pull request #1259 from dsissitka/patch-3
*Documentation: Updated the stop command's docs.
2013-07-22 06:59:02 -07:00
Ken Cochrane
56da77a548 Merge pull request #1258 from dsissitka/patch-2
* Documentation: Added top to the list of commands in the sidebar.
2013-07-22 06:58:09 -07:00
Victor Vieux
494b575213 Merge pull request #1255 from dsissitka/patch-1
Fixed a couple of minor syntax errors.
2013-07-22 06:45:25 -07:00
Caleb Spare
c383d59880 Update ADD documentation to specify new behavior. 2013-07-21 23:32:06 -07:00
Caleb Spare
416fdaa3d5 Remove some trailing whitespace. 2013-07-21 23:32:06 -07:00
Caleb Spare
2b0ebf5d32 Buildfile: for ADD command, determine filename from URL.
This is used if the destination is a directory. This makes the URL
download behavior more closely match file copying.

Fixes #1142.
2013-07-21 23:32:06 -07:00
Caleb Spare
f236e62d9d Test pulling remote files using ADD in a buildfile. 2013-07-21 23:32:01 -07:00
Stefan Praszalowicz
964e826a9b Document -b none 2013-07-21 18:01:52 -07:00
Stefan Praszalowicz
49673fc45c Support completely disabling network configuration with docker -d -b none 2013-07-21 17:49:09 -07:00
Stefan Praszalowicz
3342bdb331 Support networkless containers with new docker run option '-n' 2013-07-21 17:11:47 -07:00
David Sissitka
1d02a7ffb6 Updated the stop command's docs. 2013-07-21 19:00:18 -04:00
dsissitka
788935175e Added top to the list of commands in the sidebar. 2013-07-21 18:30:51 -04:00
dsissitka
32663bf431 Fixed a couple of minor syntax errors. 2013-07-20 21:27:55 -04:00
unclejack
df86cb9a5c make docker run handle SIGINT/SIGTERM 2013-07-20 13:47:13 +03:00
Guillaume J. Charmes
e3be2e959b Merge pull request #1242 from dotcloud/remove_usage_from_test
remove usage from tests
2013-07-19 14:07:24 -07:00
Victor Vieux
67f1e3f5ed add container=lxc in default env 2013-07-19 17:22:16 +00:00
Andy Rothfusz
23ea9b8968 Merge pull request #1235 from metalivedev/cleandocbld
Make docs build without warnings or errors. Minor additional cleanup.
2013-07-19 09:44:53 -07:00
Victor Vieux
921c6994b1 add LXC version to docker info in debug mode 2013-07-19 16:36:23 +00:00
Victor Vieux
ea12588524 remove usage from tests 2013-07-19 15:56:00 +00:00
Ryan Fowler
e8ad82f9ba Make the ENTRYPOINT example work
The incantation listed in the ENTRYPOINT example didn't actually pass the arguments to your script. Changing the definition to an array fixes this.
2013-07-19 10:11:21 -05:00
Victor Vieux
6e2e4cad73 Merge pull request #1204 from dotcloud/tests-less-copypaste
Hack: use helper functions in tests for less copy-pasting
2013-07-19 07:55:04 -07:00
Victor Vieux
2e0e455fa6 rebase master 2013-07-19 14:48:32 +00:00
Victor Vieux
d93742fe9a Merge pull request #1239 from dotcloud/fix_utils_tests
fix error in utils tests
2013-07-19 06:59:07 -07:00
Victor Vieux
2e3b660dd0 fix error in utils tests 2013-07-19 13:56:36 +00:00
Victor Vieux
0bd534adcf Merge pull request #1211 from dotcloud/new_logs
*Runtime: Logs are now synchronised
2013-07-19 06:43:29 -07:00
Victor Vieux
e59dd2c62c Merge pull request #1159 from unclejack/add_container_id_file_to_run
*Client: Add support for container ID files (a la pidfile)
2013-07-19 06:11:22 -07:00
unclejack
25be79208a create the cidfile before creating the container
This change makes docker attempt to create the container ID file and
open it before attempting to create the container. This avoids leaving
a stale container behind if docker has failed to create and open the
container ID file.

The container ID is written to the file after the container is created.
2013-07-19 16:03:45 +03:00
unclejack
2a3b91e3b6 docs - add example for cidfile 2013-07-19 16:03:45 +03:00
unclejack
221ee504aa docs - add cidfile flag to run docs 2013-07-19 16:03:45 +03:00
unclejack
64e74cefb7 add support for container ID files (a la pidfile) 2013-07-19 16:03:45 +03:00
Victor Vieux
eb4a0271fb bump api version to 1.4 2013-07-19 10:34:55 +00:00
Victor Vieux
cfec1c3e1b add ps args to docker top 2013-07-19 10:06:32 +00:00
Victor Vieux
2b5386f039 add regression test from @crosbymichael 2013-07-19 03:01:39 +00:00
Victor Vieux
a0eec14c7d fix overwrites EXPOSE 2013-07-19 02:47:35 +00:00
Andy Rothfusz
54f9cdb0c3 Make docs build without warnings or errors. Minor additional cleanup. 2013-07-18 19:04:51 -07:00
Guillaume J. Charmes
d6fb313220 Merge pull request #1207 from crosbymichael/819-use-persistent-volume
* Runtime: Do not overwrite container volumes from config
2013-07-18 18:51:00 -07:00
Daniel Mizyrycki
0aa2470c76 Merge pull request #1232 from dotcloud/1217-testing-coverage
Testing, issue #1217: Add coverage testing into docker-ci
2013-07-18 14:27:37 -07:00
Victor Vieux
0afed3eded handle -dev 2013-07-18 20:56:41 +00:00
Victor Vieux
39ff542142 Merge branch 'master' into add_last_version-feature 2013-07-18 20:51:31 +00:00
Victor Vieux
edc68f84f3 Merge pull request #1230 from dotcloud/switch_dev
switch version to -dev
2013-07-18 13:50:40 -07:00
Victor Vieux
0089dd05e9 switch version to -dev 2013-07-18 20:50:04 +00:00
Victor Vieux
51f6c4a737 Merge pull request #1227 from dotcloud/bump_0.5.0
Bump to 0.5.0
2013-07-18 11:51:29 -07:00
Nan Monnand Deng
cd209f406e documentation. 2013-07-18 14:22:49 -04:00
Andy Rothfusz
f4eaec3e1e Merge pull request #1226 from metalivedev/easydockerfile
Make dockerfile docs easier to find. Clean up formatting.
2013-07-18 10:14:22 -07:00
Victor Vieux
b083418257 change -b -> -v and add udp example 2013-07-18 16:25:14 +00:00
Victor Vieux
5794857f7a Merge pull request #1169 from crosbymichael/buildfile-tests
Add unit tests for buildfile config instructions
2013-07-18 08:35:23 -07:00
Michael Crosby
e7f3f6fa5a Add unit tests for buildfile config instructions
Add tests for instructions in the buildfile that
modify the config of the resulting image.
2013-07-18 05:37:28 -09:00
Victor Vieux
1b0fd7ead3 add debug and simplify docker logs 2013-07-18 13:29:40 +00:00
Victor Vieux
a926cd4d88 add legacy support 2013-07-18 13:25:47 +00:00
Andy Rothfusz
aa5671411b Make dockerfile docs easier to find. Clean up formatting. 2013-07-17 18:56:40 -07:00
Solomon Hykes
5d8efc107d + Runtime: inject dockerinit at /.dockerinit instead of overwriting /sbin/init. This makes it possible to run /sbin/init inside a container. 2013-07-17 17:13:34 -07:00
Victor Vieux
f8dfd0aa5e Merge pull request #1225 from dotcloud/hotfix_docker_rmi
*Runtime: improve docker rmi via id
2013-07-17 14:31:56 -07:00
Victor Vieux
1a226f0e28 add VolumesFrom to MergeConfig, and test 2013-07-17 21:06:46 +00:00
Andy Rothfusz
3dbf9c6560 Merge pull request #1219 from metalivedev/docs-repoupdate
Update docs with 0.5 repository information.
2013-07-17 13:53:12 -07:00
Victor Vieux
7c00201222 add Volumes and VolumesFrom to CompareConfig 2013-07-17 20:51:25 +00:00
Victor Vieux
2db99441c8 prevent any kind of operation simultaneously 2013-07-17 20:39:36 +00:00
Guillaume J. Charmes
de563a3ea3 Merge pull request #1194 from crosbymichael/build-verbose
* Builder: Add verbose output to docker build
2013-07-17 12:53:06 -07:00
Victor Vieux
9cf2b41c05 change rm usage in docs 2013-07-17 19:24:54 +00:00
Victor Vieux
f310b875f8 Merge branch 'master' of https://github.com/kencochrane/docker into kencochrane-master 2013-07-17 19:23:06 +00:00
Solomon Hykes
ac14c463d5 Changed date on changelog 2013-07-17 11:51:26 -07:00
Guillaume J. Charmes
578e888915 Merge pull request #1212 from dotcloud/merge_v_b_options
* Runtime: Merge -b and -v options
2013-07-17 11:43:47 -07:00
Victor Vieux
5231bf3653 Merge pull request #1222 from lopter/master
Always stop the opposite goroutine in network_proxy.go (closes #1213)
2013-07-17 11:40:33 -07:00
Solomon Hykes
8af945f353 Small changes in changelog wording 2013-07-17 11:39:38 -07:00
Ken Cochrane
d0e8ca1257 updated with notes from @vieux 2013-07-17 13:46:11 -04:00
Victor Vieux
5a934fc923 fix docker rmi via id 2013-07-17 15:48:53 +00:00
Louis Opter
c766d064ac Always stop the opposite goroutine in network_proxy.go (closes #1213) 2013-07-17 01:05:11 -07:00
Andy Rothfusz
0356081c0a Update repository information. 2013-07-16 17:04:41 -07:00
Daniel Mizyrycki
6e8bfc8d12 Testing, issue #1217: Add coverage testing into docker-ci 2013-07-16 13:45:43 -07:00
Guillaume J. Charmes
18e91d5f85 Update docs 2013-07-16 10:14:21 -07:00
Victor Vieux
48a892bee5 Add CompareConfig test 2013-07-16 15:58:23 +00:00
Victor Vieux
fb005a3da8 add server.ContainerTop, server.poolAdd and ser.poolRemove tests 2013-07-16 14:38:18 +00:00
Guillaume J. Charmes
1004d57b85 Hotfix: make sure ./utils tests pass 2013-07-15 17:58:23 -07:00
Nick Stinemates
f9e4ef5eb0 Merge pull request #1210 from dotcloud/improve_configmerge
improve mergeconfig, ...
2013-07-15 18:04:12 -07:00
Guillaume J. Charmes
eefbadd230 Merge -b and -v options 2013-07-15 17:51:32 -07:00
Guillaume J. Charmes
bc21b3ebf0 Bump version to 0.5.0 2013-07-15 14:57:52 -07:00
Solomon Hykes
608fb2a21e Merge pull request #1184 from dotcloud/1176-packaging-release
Hack: document PPA release step
2013-07-15 13:59:55 -07:00
Michael Crosby
92cbb7cc80 Do not overwrite container volumes from config
Fixes #819 Use same persistent volume when a container is restarted
2013-07-15 11:59:11 -09:00
Solomon Hykes
45050d9887 Merge pull request #1188 from dotcloud/1174-packaging-binary
Packaging: add pure binary to docker release
2013-07-15 13:59:06 -07:00
Daniel Mizyrycki
75a0052e64 packaging, issue #1176: Document PPA release step 2013-07-15 12:13:51 -07:00
Guillaume J. Charmes
c8efd08384 Merge pull request #1208 from crosbymichael/1201-rw-volumes-from
- Volumes: Copy VolumesRW values when using --volumes-from
2013-07-15 10:59:51 -07:00
Guillaume J. Charmes
454cd147fb Merge pull request #1096 from dotcloud/remove_os_user
* Runtime: Remove the os.user dependency and manually lookup /etc/passwd instead
2013-07-15 10:19:09 -07:00
Guillaume J. Charmes
e41507bde2 Add unit test to check wrong uid case 2013-07-15 10:05:09 -07:00
Victor Vieux
599f85d4e4 store both logs in a same file, as JSON 2013-07-15 16:17:58 +00:00
Victor Vieux
5756ba9bc4 Merge branch 'master' into new_logs 2013-07-15 13:57:54 +00:00
Victor Vieux
193a7e1dc1 improve mergeconfig, if dns, portspec, env or volumes specify in docker run, apend and not replace 2013-07-15 13:12:33 +00:00
Jonas Pfenniger
0900d3b7a6 docker.upstart: use the same start/stop events as sshd
Is probably more solid
2013-07-15 11:41:19 +01:00
Jonas Pfenniger
24dd50490a docker.upstart: avoid spawning a sh process
start script / end script create an intermediate sh process.
2013-07-15 11:40:35 +01:00
Michael Crosby
5ae8c7a985 Copy VolumesRW values when using --volumes-from
Fixes #1201
2013-07-14 18:23:20 -09:00
benoitc
d639f61ec1 reuse the type 2013-07-13 19:19:38 +02:00
Victor Vieux
9b57f9187b Merge pull request #1200 from ToothlessGear/fix-whitespaces_progessbar
Fix progressbar, without messing up other outputs
2013-07-13 08:50:50 -07:00
Victor Vieux
50e45b485f Merge pull request #1190 from dotcloud/1189-add_debug_error
* RemoteAPI: Improve debug
2013-07-13 08:15:59 -07:00
Victor Vieux
2051ebc0eb Merge pull request #1198 from dotcloud/fix_pull_tag
Fixed tag option for "docker pull" (the option was ignored)
2013-07-13 08:14:47 -07:00
benoitc
a3b1a9f01a useless function. forgot to remove it. 2013-07-13 17:04:04 +02:00
benoitc
507cef8bce useless type 2013-07-13 17:03:04 +02:00
benoitc
166eba3e28 put the websocket route in the map containing all routes
Instead of handling the websocket differently just handle it as a normal
route and upgrade it to a websocket.
2013-07-13 17:00:40 +02:00
Solomon Hykes
080243f040 Hack: use helper functions in tests for less copy-pasting 2013-07-12 17:56:55 -07:00
Guillaume J. Charmes
933b9d44e1 Merge pull request #1054 from nickstenning/getimage-by-tag
* Runtime: Reverse priority of tag lookup in TagStore.GetImage
2013-07-12 16:15:04 -07:00
Nick Stenning
44b3e8d51b Reverse priority of tag lookup in TagStore.GetImage
Currently, if you have the following images:

    foo/bar      1       23b27d50fb49
    foo/bar      2       f2b86ec3fcc4

And you issue the following command:

    docker tag foo/bar:2 foo/bar latest

docker will tag the "wrong" image, because the image id for foo/bar:1 starts
with a "2". That is, you'll end up with the following:

    foo/bar      1       23b27d50fb49
    foo/bar      2       f2b86ec3fcc4
    foo/bar      latest  23b27d50fb49

This commit reverses the priority given to tags vs. image ids in the
construction `<user>/<repo>:<tagOrId>`, meaning that if a tag that is an exact
match for the specified `tagOrId`, it will be tagged in preference to an image
with an id that happens to start with the correct character sequence.
2013-07-12 23:56:36 +01:00
Daniel Mizyrycki
9bf8ad741f Merge pull request #1083 from hukeli/debian
Keep debian package up-to-date
2013-07-12 15:24:37 -07:00
Daniel Mizyrycki
9913ebbe21 Merge pull request #1203 from dotcloud/1202-packaging-debian
Packaging, issue #1202: Upgrade vagrantfile go in debian packaging
2013-07-12 15:11:57 -07:00
Daniel Mizyrycki
c7a48e91d8 Packaging, issue #1202: Upgrade vagrantfile go in debian packaging 2013-07-12 15:06:12 -07:00
Solomon Hykes
2cbf2200ac Merge pull request #1195 from dotcloud/tests-cleanup
* Hack: tests cleanup
2013-07-12 14:51:59 -07:00
Marcus Farkas
bac5772312 *Client: Fix the progressbar, without manipulating other outputs
Prior this commit, 'docker images' and other cmd's, which used utils.HumanSize(),
showed unnecessary whitespaces.
Formatting of progress has been moved to FormatProgess(), justifing the string
directly in the template.
2013-07-12 20:15:25 +02:00
Marcus Farkas
a6e5a397bd Revert "Client: better progressbar output"
This reverts commit 3ac68f1966.
2013-07-12 20:08:45 +02:00
Ken Cochrane
364f48d6c7 updated the rmi command docs, the had typos 2013-07-12 14:05:26 -04:00
Ken Cochrane
4174e7aa7a updated the help commands on a few commands that were not correct 2013-07-12 13:55:26 -04:00
Guillaume J. Charmes
eb38750d99 Remove the os.user dependency and manually lookup /etc/passwd instead 2013-07-12 10:49:47 -07:00
Sam Alba
cd0fef633c Fixed tag option for "docker pull" (the option was ignored) 2013-07-12 10:42:54 -07:00
Michael Crosby
d0c73c28df Add param to api docs for verbose build output 2013-07-12 06:22:56 -09:00
Victor Vieux
8e6c249e48 Merge pull request #1197 from crosbymichael/buildfile-doc-ordering
Fix Docker Builder documentation section numbers
2013-07-12 05:27:47 -07:00
Victor Vieux
752f99e8a1 Merge pull request #977 from dotcloud/966-improve_docker_login_parameters-feature
* Client: Add options to docker login to be able to use it via script
2013-07-12 05:07:25 -07:00
Victor Vieux
a909223ee2 Merge pull request #1102 from dotcloud/1098-store_hostconfig_tmp
* Runtime: bind mounts are now preserved upon container restart
2013-07-12 05:04:10 -07:00
Victor Vieux
8ff271fc74 Merge pull request #1192 from dotcloud/docker_port-fix
hotfix: fix broken docker port
2013-07-12 04:57:53 -07:00
Victor Vieux
9dfac1dd65 Merge pull request #1055 from dotcloud/list_container_processes-feature
* RemoteApi: /top to list running processes in a container
* Client: docker top to list running processes in a container
2013-07-12 04:56:12 -07:00
Victor Vieux
a8a6848ce0 fix tests regarding the new test image 2013-07-12 11:54:53 +00:00
Victor Vieux
9232d1ef62 Merge branch 'master' into list_container_processes-feature 2013-07-12 11:47:27 +00:00
Victor Vieux
e9011122fb use http://get.docker.io/latest 2013-07-12 11:45:40 +00:00
Michael Crosby
90483dc912 Fix Docker Builder documentation numbering 2013-07-11 16:41:19 -09:00
Solomon Hykes
6bdb6f226b Simplify unit tests code with mkRuntime() 2013-07-11 17:59:25 -07:00
Solomon Hykes
2ac1141980 Don't leave broken, commented out tests lying around. 2013-07-11 17:58:45 -07:00
Michael Crosby
1104d443cc Revert changes from PR 1030
With streaming output of the build
changes in 1030 are no longer required.
2013-07-11 15:52:08 -09:00
Michael Crosby
49044a9608 Fix buildfile tests after rebase 2013-07-11 15:37:26 -09:00
Guillaume J. Charmes
71d2ff4946 Hotfix: check the length of entrypoint before comparing. 2013-07-11 17:31:07 -07:00
Michael Crosby
474191dd7b Add verbose output to docker build
Verbose output is enabled by default and
the flag -q can be used to suppress the verbose output.
2013-07-11 15:27:33 -09:00
Guillaume J. Charmes
637eceb6a7 Merge pull request #1124 from crosbymichael/buildfile-volumes
+ Builder: Add VOLUME instruction to buildfile
2013-07-11 17:16:57 -07:00
Victor Vieux
976428f505 change output 2013-07-11 21:04:23 +02:00
Victor Vieux
affe7caf78 fix broken docker port 2013-07-11 19:28:15 +02:00
Victor Vieux
941e3e2ef0 wip 2013-07-11 17:18:28 +00:00
Victor Vieux
b7937e268f add debug for error in the server 2013-07-11 12:21:43 +00:00
Louis Opter
5a411fa38e Make the TestAllocate{UDP,TCP}PortLocalhost more reliable
- For the TCP test try again if socat wasn't listening yet;
- For the UDP test raise the timeout to a minute to workaround what
  seems to be an issue with Linux.
2013-07-10 18:25:53 -07:00
Daniel Mizyrycki
bf26ae03cf Packaging, issue #1174: Add pure binary to docker release 2013-07-10 17:39:00 -07:00
Andy Rothfusz
3363cd5cd0 Merge pull request #1178 from dotcloud/fix-dev-environment
Fix outdated docs explaining how to setup a dev environment
2013-07-10 16:53:22 -07:00
Daniel Mizyrycki
5c49a61353 Merge pull request #1183 from dotcloud/960-packaging-PPA
Packaging, issue #960: Document PUBLISH_PPA for staging/production release
2013-07-10 16:16:31 -07:00
Daniel Mizyrycki
f83c31e188 Packaging, issue #960: Document PUBLISH_PPA for staging/production release 2013-07-10 16:06:49 -07:00
Louis Opter
8f36467107 Raise the timeouts for the TCP/UDP localhost proxy tests
Sometimes these tests fail, let's see if that improves the situation.
2013-07-10 16:05:14 -07:00
Nan Monnand Deng
73e79a3310 reduce the number of string copy operations. 2013-07-10 18:59:43 -04:00
Nan Monnand Deng
34cf976866 format in the user agent header should follow RFC 2616 2013-07-10 18:59:43 -04:00
Nan Monnand Deng
e832b01349 Removed an unnecessary nil assignment 2013-07-10 18:56:49 -04:00
Nan Monnand Deng
26c8eae6fe Removed an unnecessary error check. 2013-07-10 18:56:49 -04:00
Nan Monnand Deng
d40efc4648 added client's kernel version 2013-07-10 18:56:49 -04:00
Nan Monnand Deng
5705a49308 Insert version checkers when call NewRegistry() 2013-07-10 18:56:49 -04:00
Nan Monnand Deng
65185a565b added APIVersion when call NewRegistry 2013-07-10 18:53:38 -04:00
Nan Monnand Deng
1bb8f60d5a inserted setUserAgent in each HTTP request 2013-07-10 18:49:01 -04:00
Nan Monnand Deng
1d01189f04 Added version checker interface 2013-07-10 18:49:01 -04:00
Victor Vieux
fc3a8e409d change tag -> repo name in build usage 2013-07-10 22:44:31 +00:00
Louis Opter
8e49cb453f Merge pull request #1181 from dotcloud/export_portmapping
Export PortMapping in container.go
2013-07-10 14:24:20 -07:00
Michael Crosby
40f1e4edbe Rebased changes buildfile_test 2013-07-10 07:12:57 -09:00
Michael Crosby
1267e15b0f Add unittest for volume config verification 2013-07-10 06:59:16 -09:00
Michael Crosby
eb9fef2c42 Add VOLUME instruction to buildfile 2013-07-10 06:59:16 -09:00
Victor Vieux
43b346d93b Merge pull request #1151 from alex/patch-1
Replaced gendered language in the README
2013-07-10 07:52:30 -07:00
Victor Vieux
d918c7d9de export portmapping in network.go 2013-07-10 14:09:35 +00:00
Victor Vieux
e962e9edcf Merge pull request #1168 from dotcloud/standalone_registry
* Server: Allow push on standalone registry
2013-07-10 04:14:23 -07:00
Victor Vieux
b7a62f1f1b Merge pull request #1177 from lopter/udp-support-final
* Network: Add UDP support
2013-07-10 03:55:18 -07:00
Victor Vieux
2e5d1a2d48 Merge pull request #1164 from dotcloud/1162-import_hangs-fix
* Runtime: Untar is now faster
2013-07-10 03:37:24 -07:00
Louis Opter
fac0d87d00 Add support for UDP (closes #33)
API Changes
-----------

The port notation is extended to support "/udp" or "/tcp" at the *end*
of the specifier string (and defaults to tcp if "/tcp" or "/udp" are
missing)

`docker ps` now shows UDP ports as "frontend->backend/udp". Nothing
changes for TCP ports.

`docker inspect` now displays two sub-dictionaries: "Tcp" and "Udp",
under "PortMapping" in "NetworkSettings".

Theses changes stand true for the values returned by the HTTP API too.

This changeset will definitely break tools built upon the API (or upon
`docker inspect`). A less intrusive way to add UDP ports in `docker
inspect` would be to simply add "/udp" for UDP ports but it will still
break existing applications which tries to convert the whole field to an
integer. I believe that having two TCP/UDP sub-dictionaries is better
because it makes the whole thing more clear and more easy to parse right
away (i.e: you don't have to check the format of the string, split it
and convert the right part to an integer)

Code Changes
------------

Significant changes in network.go:

- A second PortAllocator is instantiated for the UDP range;
- PortMapper maintains separate mapping for TCP and UDP;
- The extPorts array in NetworkInterface is now an array of Nat objects
  (so we can know on which protocol a given port was mapped when
  NetworkInterface.Release() is called);
- TCP proxying on localhost has been moved away in network_proxy.go.

localhost proxy code rewrite in network_proxy.go:

We have to proxy the traffic between localhost:frontend-port and
container:backend-port because Netfilter doesn't work properly on the
loopback interface and DNAT iptable rules aren't applied there.

- Goroutines in the TCP proxying code are now explicitly stopped when
  the proxy is stopped;
- UDP connection tracking using a map (more infos in [1]);
- Support for IPv6 (to be more accurate, the code is transparent to the
  Go net package, so you can use, tcp/tcp4/tcp6/udp/udp4/udp6);
- Single Proxy interface for both UDP and TCP proxying;
- Full test suite.

[1] https://github.com/dotcloud/docker/issues/33#issuecomment-20010400
2013-07-09 17:42:35 -07:00
Solomon Hykes
a839b36e55 Fix outdated docs explaining how to setup a dev environment. Building docker with docker ftw 2013-07-09 16:48:16 -07:00
Sam Alba
316c8328aa Hardened repos name validation 2013-07-09 16:46:55 -07:00
Sam Alba
e8db031112 Fixed tag parsing when the repos name contains both a port and a tag 2013-07-09 16:46:25 -07:00
Sam Alba
59b785a282 Fixing missing tag field when pulling containers which does not exist 2013-07-09 16:45:32 -07:00
Louis Opter
1a1daca621 Fix a typo in runtime_test.go: Availalble -> Available 2013-07-09 11:52:33 -07:00
Sam Alba
837be914ca Merge branch 'master' of github.com:dotcloud/docker into standalone_registry 2013-07-09 11:31:14 -07:00
Sam Alba
f44eac49fa Fixed potential security issue (never try http on official index when polling the endpoint). Also fixed local repos name when pulling index.docker.io/foo/bar 2013-07-09 11:30:12 -07:00
Guillaume J. Charmes
0acdef4549 Merge pull request #1166 from dotcloud/networkless_tests-2
* Tests: Remove all network dependencies from the test suite
2013-07-09 11:20:18 -07:00
Guillaume J. Charmes
7d8ef90ccb Merge pull request #1173 from dotcloud/1172-ghost_restart-fix
Make sure container is not marked as ghost when it starts
2013-07-09 10:49:17 -07:00
Guillaume J. Charmes
91520838fc Make sure container is not marked as ghost when it starts 2013-07-09 10:48:33 -07:00
Guillaume J. Charmes
ada0e1fb08 Merge pull request #1049 from dotcloud/1040_ignore_stderr_tests-fix
- Tests: Ignore stderr while doing tests
2013-07-09 10:32:24 -07:00
Sam Alba
33d97e81eb Removed DOCKER_INDEX_URL 2013-07-09 08:10:43 -07:00
Sam Alba
019324015b Moved parseRepositoryTag to the utils package 2013-07-09 08:06:10 -07:00
Victor Vieux
72d278fdac Merge pull request #1170 from dotcloud/fix_type_socket
Fix typo socket
2013-07-09 03:57:45 -07:00
Victor Vieux
05d7f85af9 fix typo 2013-07-09 10:55:28 +00:00
Solomon Hykes
7fba358ae2 Merge pull request #1013 from dotcloud/standardize-build
* Hack: standardized docker's build environment in a Dockerfile
2013-07-08 21:33:45 -07:00
Solomon Hykes
9f1fc40a64 * Hack: standardized docker's build environment in a Dockerfile 2013-07-08 21:30:29 -07:00
Sam Alba
3be7bc38e0 Fixed typo (thanks unit tests) 2013-07-08 17:42:18 -07:00
Sam Alba
31c66d5a00 Re-implemented a notion of local and private repos. This allows to consider the full qualified name of the repos as the name for the local repository without breaking the calls to the Registry API. 2013-07-08 17:26:50 -07:00
Sam Alba
e7d36c9590 It is now possible to include a ":" in a local repository name (it will not be the case for a remote name). This adds support for full qualified repository name in order to support private registry server 2013-07-08 17:22:41 -07:00
Sam Alba
3e8626c4a1 Changed the tag parsing to it will work even if there is a port in the repos registry url (full qualified name for pushing on a standalone registry) 2013-07-08 17:20:41 -07:00
Guillaume J. Charmes
e14dd4d33e Merge pull request #1157 from kstaken/1156-entrypoint-builder
Builder: Fix #1156 entrypoint override from base image
2013-07-08 16:57:26 -07:00
Kimbro Staken
87a69e6753 Merge branch '1156-entrypoint-builder' of github.com:kstaken/docker into 1156-entrypoint-builder 2013-07-08 16:06:09 -07:00
Kimbro Staken
f64dbdbe3a Override Entrypoint picked up from the base image that breaks run commands in builder 2013-07-08 16:04:39 -07:00
Kimbro Staken
2b5553144a Removing the save to disk as it was not really necessary 2013-07-08 16:03:18 -07:00
Guillaume J. Charmes
e43ef364cb Remove all network dependencies from the test suite 2013-07-08 15:23:04 -07:00
Guillaume J. Charmes
08a87d4b3b Fix #1162 - Remove bufio from Untar 2013-07-08 13:42:17 -07:00
Victor Vieux
90f372af5c Merge pull request #1163 from dotcloud/1137-change_search_size-feature
* Client : uses the terminal size to display search output, add -notrunc
2013-07-08 11:47:25 -07:00
Victor Vieux
3ec29eb5da Merge pull request #1066 from mhennings/fix-broken-streaming-result
* Server: Fix streaming status to the docker client while pushing images
2013-07-08 11:21:29 -07:00
Victor Vieux
3a20e4e15d add if to prevent crash 2013-07-08 18:19:12 +00:00
Victor Vieux
fd97190ee7 uses the terminal size to display search output, add -notrunc and fix bug in resize 2013-07-08 17:20:13 +00:00
Victor Vieux
70480ce7bc Merge pull request #1030 from dotcloud/builder_display_err_log
*Builder : Display containers logs in case of build failure
2013-07-08 07:26:46 -07:00
Victor Vieux
bf7d6cbb4a rebase master 2013-07-08 13:26:29 +00:00
Victor Vieux
c059785ffb Merge pull request #1161 from dotcloud/add_remote_addr_debug
Add remote addr in debug
2013-07-08 05:46:49 -07:00
Victor Vieux
a0f5fb7394 add remote addr in debug 2013-07-08 12:45:50 +00:00
Victor Vieux
ad33e9f388 Merge pull request #1138 from dotcloud/1123-rmi_conflict-fix
* Runtime: Fix error in rmi when conflict
2013-07-08 05:19:05 -07:00
Kimbro Staken
1d1d81b0bc Cleanup white space 2013-07-08 00:18:47 -07:00
Kimbro Staken
f3d2969560 Override Entrypoint picked up from the base image that breaks run commands in builder 2013-07-08 00:11:45 -07:00
Alex Gaynor
758ea61b77 Replaced gendered language in the README 2013-07-07 13:55:02 +10:00
benoitc
8eeff01939 add websocket support to /container/<name>/attach/ws
This function add the possibility to attach containers streams to a
websocket. When a websocket is asked the request is upgraded to this
protocol..
2013-07-06 02:05:02 +02:00
Daniel Mizyrycki
4388bef996 testing, issue #1104: Make the test use static flags 2013-07-05 16:49:55 -07:00
Sam Alba
e2b8ee2723 Fixed runtime_test (ImagePull prototyped changed) 2013-07-05 16:03:22 -07:00
Guillaume J. Charmes
07dc0a5120 Merge pull request #1144 from dotcloud/standalone_registry
* Registry: Standalone registry
2013-07-05 15:56:48 -07:00
Sam Alba
d3125d8570 Code cleaning 2013-07-05 15:26:08 -07:00
Sam Alba
283ebf3ff9 fmt.Errorf instead of errors.New 2013-07-05 14:56:56 -07:00
Sam Alba
4c174e0bfb Fixed ping URL 2013-07-05 14:55:48 -07:00
Sam Alba
57a6c83547 Allowing namespaces in standalone registry 2013-07-05 14:30:43 -07:00
Sam Alba
cfc7684b7d Restoring old changeset lost by previous merge 2013-07-05 12:37:07 -07:00
Sam Alba
be49f0a118 Merging from master 2013-07-05 12:27:10 -07:00
Sam Alba
66a9d06d9f Adding support for nicer URLs to support standalone registry (+ some registry code cleaning) 2013-07-05 12:20:58 -07:00
Guillaume J. Charmes
6940cf1ecd Merge pull request #1127 from cespare/patch-1
Typo fix
2013-07-05 10:48:59 -07:00
Guillaume J. Charmes
4e0cdc016a Revert #1126. Remove mount shm 2013-07-05 10:47:00 -07:00
Guillaume J. Charmes
8a8109648a Merge pull request #1129 from cespare/style-fixes-2
Style fixes for fmt + err usage.
2013-07-05 10:31:53 -07:00
Guillaume J. Charmes
dc8b359319 Merge pull request #1126 from karanlyons/patch-1
* Runtime: Mount /dev/shm as a tmpfs.
2013-07-05 10:31:05 -07:00
Victor Vieux
dea29e7c99 Fix error in rmi when conflict 2013-07-05 16:58:39 +00:00
Daniel Mizyrycki
ab6379b3e0 Merge pull request #1133 from dotcloud/775-testing-notifications
testing, issue #775: Add automatic testing notifications to docker-ci
2013-07-04 21:48:00 -07:00
Daniel Mizyrycki
f7fed2ea5f testing, issue #775: Add automatic testing notifications to docker-ci 2013-07-04 21:43:46 -07:00
Daniel Mizyrycki
35e87ee571 Merge pull request #1132 from dotcloud/776-testing-commit
testing, issue #776: Ensure docker-ci test docker code as it was at commit time
2013-07-04 20:37:51 -07:00
Daniel Mizyrycki
ab3893ff4d testing, issue #776: Ensure docker-ci test docker code as it was at commit time 2013-07-04 20:28:54 -07:00
Caleb Spare
1277dca335 Style fixes for fmt + err usage.
fmt.Printf and friends will automatically format using the error
interface (.Error()) preferentially; no need to do err.Error().
2013-07-04 14:33:17 -07:00
Caleb Spare
ba9aef6f2c Typo fix
Error message grammar tweak
2013-07-04 12:40:14 -07:00
Karan Lyons
dd619d2bd6 Mount /dev/shm as a tmpfs.
Fixes #1122.
2013-07-04 09:58:50 -07:00
Marco Hennings
1e2ef274cd Pushing an Image causes the docker client to give an error message instead of
writing out streamed status.

This is caused by a Buffering message that is not in the correct json format:

[...]
{"status"
:"Pushing 6bba11a28f1ca247de9a47071355ce5923a45b8fea3182389f992f4
24b93edae"}Buffering to disk 244/? (n/a)..
{"status":"Pushing",[...]

The "Buffering to disk" message is originated in
srv.runtime.graph.TempLayerArchive

I am now using the StreamFormatter provided by the context from which the
method is called.
2013-07-04 10:50:37 +02:00
Guillaume J. Charmes
bcb5e36dd9 Merge pull request #1111 from cespare/style-fixes
Style fixes
2013-07-03 14:46:05 -07:00
Caleb Spare
19121c16d9 Implement several golint suggestions, including:
* Removing type declarations where they're inferred
* Changing Url -> URL, Id -> ID in names
* Fixing snake-case names
2013-07-03 14:36:04 -07:00
Caleb Spare
27ee261e60 Simplify the NopWriter code. 2013-07-03 14:35:18 -07:00
Caleb Spare
da3962266a Gofmt -s (simplify) 2013-07-03 14:35:18 -07:00
Caleb Spare
e93afcdd2b Use fmt.Errorf when appropriate. 2013-07-03 14:35:18 -07:00
Caleb Spare
dd1b9e38e9 Typo correction: Excepted -> Expected' 2013-07-03 14:35:18 -07:00
Guillaume J. Charmes
96bc9ea7c1 Merge pull request #1112 from cespare/mutex-style
Mutex style change.
2013-07-03 10:34:32 -07:00
Guillaume J. Charmes
16c8a10ef9 Merge pull request #1053 from dynport/do-not-copy-hostname-from-image
do not merge hostname from image
2013-07-03 10:34:15 -07:00
Victor Vieux
64450ae3f8 add last version 2013-07-03 17:11:00 +00:00
Joffrey F
5dcd11be16 Merge pull request #1109 from dynport/remote-lookup-fix
Fix remote lookup when pushing into registry
2013-07-03 06:29:19 -07:00
Ken Cochrane
dc91a7b641 Merge pull request #1113 from metalivedev/docs20130702
* Documentation: fix broken link on the documentation index page
2013-07-03 05:52:25 -07:00
Andy Rothfusz
11998ae7d6 Fix installation link from welcome page. 2013-07-02 16:48:57 -07:00
Caleb Spare
1cf9c80e97 Mutex style change.
For structs protected by a single mutex, embed the mutex for more
concise usage.

Also use a sync.Mutex directly, rather than a pointer, to avoid the
need for initialization (because a Mutex's zero-value is valid and
ready to be used).
2013-07-02 15:53:08 -07:00
Andy Rothfusz
6dbcdd3ed5 Merge pull request #1095 from metalivedev/docs20130627
Docs and images updates
2013-07-02 15:13:31 -07:00
Tobias Schwab
9632cf09bf fix two obvious bugs??? 2013-07-02 22:11:03 +00:00
Andy Rothfusz
96ab3c540d Merge branch 'docs20130627' of github.com:metalivedev/docker into docs20130627
Conflicts:
	docs/sources/concepts/manifesto.rst
	docs/sources/index.rst
2013-07-02 15:10:07 -07:00
Andy Rothfusz
ff964d327d Cleaning up the welcome page, terminology, and images. 2013-07-02 15:03:29 -07:00
Andy Rothfusz
4b8688f1e5 Fix broken quickstart link 2013-07-02 14:10:06 -07:00
Andy Rothfusz
55b5889a0f Merge branch 'docs20130627' of github.com:metalivedev/docker into docs20130627
Conflicts:
	docs/sources/concepts/manifesto.rst
2013-07-02 13:00:08 -07:00
Andy Rothfusz
dd4c6f6a09 Shortened lines to 80 columns 2013-07-02 12:09:57 -07:00
Andy Rothfusz
6058261a26 Clean up image text, minor updates to docs. 2013-07-02 12:09:57 -07:00
Andy Rothfusz
b461e4607d Adding files for terms 2013-07-02 12:09:57 -07:00
Andy Rothfusz
d399f72098 Cleaning up the welcome page, terminology. 2013-07-02 12:09:57 -07:00
Guillaume J. Charmes
c9e1c65c64 Merge pull request #1107 from eliasp/issue-1020
* Runtime: Don't remove the container= environment variable.
2013-07-02 11:42:44 -07:00
Victor Vieux
3042f11666 never remove the file and try to load it in start 2013-07-02 18:02:16 +00:00
Elias Probst
e5e47c9862 Don't remove the container= environment variable, as it is crucial for a lot of tools to detect, whether they're run inside an LXC container or not. 2013-07-02 19:13:37 +02:00
Victor Vieux
1c5083315d Merge pull request #1103 from shin-/1060-pull-only-tagged-images
*Registry: When no tag is specified in docker pull, skip images that are not tagged
2013-07-02 10:08:21 -07:00
Victor Vieux
27a137ccab change file location 2013-07-02 17:02:42 +00:00
shin-
7cc294e777 When no tag is specified in docker pull, skip images that are not tagged 2013-07-02 18:25:06 +02:00
Daniel Mizyrycki
a20dcfb049 Merge pull request #987 from dotcloud/601-packaging-ubuntu
Packaging|ubuntu, issue #601: Allow packaging prerm to do its job
2013-07-02 08:51:01 -07:00
Victor Vieux
06b53e3fc7 store hostConfig to /tmp while container is running 2013-07-02 12:19:25 +00:00
Victor Vieux
8f9dd86146 Merge pull request #1101 from dotcloud/fix-unit_tests
add sleep in tests and go fmt
2013-07-02 03:48:24 -07:00
Victor Vieux
ebba0a6024 add sleep in tests and go fmt 2013-07-02 10:47:37 +00:00
Victor Vieux
c9236d99d2 Merge pull request #1099 from lopter/master
*Test :  Fix
2013-07-02 02:42:21 -07:00
Louis Opter
f03c1b8eeb More unit test fixes
- Fix TestGetImagesJSON when there is more than one image in the test
  repository;
- Remove an hardcoded constant use in TestGetImagesByName;
- Wait in a loop in TestKillDifferentUser;
- Use env instead of /usr/bin/env in TestEnv;
- Create a daemon user in contrib/mkimage-unittest.sh.
2013-07-01 17:24:21 -07:00
Guillaume J. Charmes
6f23e39e6b Merge pull request #1097 from dotcloud/bump_0.4.8
Bump version to 0.4.8
2013-07-01 17:13:19 -07:00
Solomon Hykes
fe0378e9b3 Rephrase changelog 2013-07-01 17:05:49 -07:00
Guillaume J. Charmes
96a1d7c645 Bump version to 0.4.8 2013-07-01 16:58:25 -07:00
Guillaume J. Charmes
79ee8b46f4 Merge pull request #1046 from dotcloud/1043-output_id_non_attach-fix
- Runtime: Make sure the ID is displayed usgin run -d
2013-07-01 16:49:43 -07:00
Victor Vieux
55a7a8b8c9 Merge pull request #1092 from lopter/master
Fix TestGetInfo when there is more than one image in the test repository
2013-07-01 16:41:01 -07:00
Andy Rothfusz
b47873c5ac Clean up image text, minor updates to docs. 2013-07-01 16:37:13 -07:00
Andy Rothfusz
adf75d402a Adding files for terms 2013-07-01 16:37:13 -07:00
Andy Rothfusz
cb1fdb2f03 Cleaning up the welcome page, terminology. 2013-07-01 16:37:13 -07:00
Victor Vieux
d1d66b9c5f Merge pull request #1078 from kstaken/fix_json_error
* Remote API: Small fix in /start if empty host config
2013-07-01 16:36:58 -07:00
Louis Opter
6dacbb451f Fix TestGetInfo when there is more than one image in the test repository
See also #1089, #1072.
2013-07-01 15:06:08 -07:00
Guillaume J. Charmes
ead9cefadb Merge pull request #1089 from dotcloud/multiple_test_images-fix
- Tests: Fix unit tests when there is more than one tag within the test image
2013-07-01 13:58:04 -07:00
Guillaume J. Charmes
185a2fc55e Merge pull request #1086 from crosbymichael/1008-image-entrypoint
+ Builder: Add Entrypoint to builder and container config
2013-07-01 13:33:12 -07:00
Ken Cochrane
fb8fac6c60 Merge pull request #1088 from kpelykh/master
* Documentation: Update Docker Remote API client list to include Java library
2013-07-01 12:50:31 -07:00
Guillaume J. Charmes
b6f288a1ce Fix unit tests when there is more than one tag within the test image 2013-07-01 11:45:45 -07:00
zettaset-kpelykh
aa9bec96b1 Issue #1087 Docker Java API client -- added java to Docker Remote API Client document 2013-07-01 11:28:40 -07:00
Victor Vieux
11e28842ac change to top 2013-07-01 15:19:42 +00:00
Michael Crosby
b16ff9f859 Add Entrypoint to builder and container config
By setting an entrypoint in the Dockerfile this
allows one to run an image and only pass arguments.
2013-07-01 05:34:27 -09:00
Victor Vieux
348c5c4838 Merge pull request #1085 from dotcloud/1076-doc_delete-fix
fix status code in doc
2013-07-01 06:30:21 -07:00
Victor Vieux
8dcc6a0280 fix status code in doc 2013-07-01 13:28:58 +00:00
Victor Vieux
3b5ad44647 rebase master 2013-07-01 12:31:16 +00:00
Victor Vieux
5e029f7600 Merge pull request #1061 from proppy/fix-slices-ref
api,server: slice are already refs, no need to return ptr
2013-07-01 04:51:56 -07:00
Keli Hu
52cebe19e5 Keep debian package up-to-date 2013-07-01 16:15:56 +08:00
Kimbro Staken
d8d33e8b8b Adding check for content-type header 2013-06-30 10:46:09 -07:00
Solomon Hykes
b37f7d49d8 Documented release process for maintainers in hack/RELEASE.md 2013-06-29 22:08:25 -07:00
Johan Euphrosine
54da339b2c api,server: slice are already refs, no need to return ptr 2013-06-28 12:41:09 -07:00
Victor Vieux
648c4f198b Add test 2013-06-28 16:27:00 +00:00
Victor Vieux
8589fd6db8 Add doc 2013-06-28 18:05:41 +02:00
Victor Vieux
2e79719622 add /proc to list running processes inside a container 2013-06-28 15:51:58 +00:00
Tobias Schwab
9bfec5a538 do not merge hostname from image 2013-06-28 15:22:01 +02:00
Guillaume J. Charmes
800d900688 Ignore stderr while doing tests 2013-06-27 15:25:31 -07:00
Guillaume J. Charmes
bd144a64f6 Make sure the ID is displayed usgin run -d 2013-06-27 12:48:25 -07:00
Guillaume J. Charmes
2a20e85203 Improve last log output 2013-06-27 11:10:19 -07:00
Guillaume J. Charmes
27d6777376 Display containers logs in case of build failure 2013-06-26 12:50:20 -07:00
Daniel Mizyrycki
41cdd9b27f Packaging|ubuntu, issue #601: Allow packaging prerm to do its job 2013-06-21 17:37:32 -07:00
Victor Vieux
ec6b35240e fix raw terminal 2013-06-22 00:37:02 +00:00
Victor Vieux
42bcfcc927 add options to docker login 2013-06-21 10:00:25 +00:00
804 changed files with 136812 additions and 24163 deletions

13
.gitignore vendored
View File

@@ -1,3 +1,6 @@
# Docker project generated files to ignore
# if you want to ignore files created by your editor/tools,
# please consider a global .gitignore https://help.github.com/articles/ignoring-files
.vagrant*
bin
docker/docker
@@ -5,13 +8,17 @@ docker/docker
a.out
*.orig
build_src
command-line-arguments.test
.flymake*
docker.test
auth/auth.test
.idea
.DS_Store
docs/_build
docs/_static
docs/_templates
.gopath/
.dotcloud
*.test
bundles/
.hg/
.git/
vendor/pkg/
pyenv

View File

@@ -1,9 +1,11 @@
# Generate AUTHORS: git log --all --format='%aN <%aE>' | sort -uf | grep -v vagrant-ubuntu-12
<charles.hooper@dotcloud.com> <chooper@plumata.com>
# Generate AUTHORS: git log --format='%aN <%aE>' | sort -uf
<charles.hooper@dotcloud.com> <chooper@plumata.com>
<daniel.mizyrycki@dotcloud.com> <daniel@dotcloud.com>
<daniel.mizyrycki@dotcloud.com> <mzdaniel@glidelink.net>
Guillaume J. Charmes <guillaume.charmes@dotcloud.com> <charmes.guillaume@gmail.com>
<guillaume.charmes@dotcloud.com> <guillaume@dotcloud.com>
Guillaume J. Charmes <guillaume.charmes@docker.com> <charmes.guillaume@gmail.com>
<guillaume.charmes@docker.com> <guillaume@dotcloud.com>
<guillaume.charmes@docker.com> <guillaume@docker.com>
<guillaume.charmes@docker.com> <guillaume.charmes@dotcloud.com>
<kencochrane@gmail.com> <KenCochrane@gmail.com>
<sridharr@activestate.com> <github@srid.name>
Thatcher Peskens <thatcher@dotcloud.com> dhrp <thatcher@dotcloud.com>
@@ -15,11 +17,44 @@ Joffrey F <joffrey@dotcloud.com>
Tim Terhorst <mynamewastaken+git@gmail.com>
Andy Smith <github@anarkystic.com>
<kalessin@kalessin.fr> <louis@dotcloud.com>
<victor.vieux@dotcloud.com> <victor@dotcloud.com>
<victor.vieux@dotcloud.com> <dev@vvieux.com>
<victor.vieux@docker.com> <victor.vieux@dotcloud.com>
<victor.vieux@docker.com> <victor@dotcloud.com>
<victor.vieux@docker.com> <dev@vvieux.com>
<victor.vieux@docker.com> <victor@docker.com>
<victor.vieux@docker.com> <vieux@docker.com>
<dominik@honnef.co> <dominikh@fork-bomb.org>
Thatcher Peskens <thatcher@dotcloud.com>
<ehanchrow@ine.com> <eric.hanchrow@gmail.com>
Walter Stanish <walter@pratyeka.org>
<daniel@gasienica.ch> <dgasienica@zynga.com>
Roberto Hashioka <roberto_hashioka@hotmail.com>
Konstantin Pelykh <kpelykh@zettaset.com>
David Sissitka <me@dsissitka.com>
Nolan Darilek <nolan@thewordnerd.info>
<mastahyeti@gmail.com> <mastahyeti@users.noreply.github.com>
Benoit Chesneau <bchesneau@gmail.com>
Jordan Arentsen <blissdev@gmail.com>
Daniel Garcia <daniel@danielgarcia.info>
Miguel Angel Fernández <elmendalerenda@gmail.com>
Bhiraj Butala <abhiraj.butala@gmail.com>
Faiz Khan <faizkhan00@gmail.com>
Victor Lyuboslavsky <victor@victoreda.com>
Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Matthew Mueller <mattmuelle@gmail.com>
<mosoni@ebay.com> <mohitsoni1989@gmail.com>
Shih-Yuan Lee <fourdollars@gmail.com>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com> root <root@vagrant-ubuntu-12.10.vagrantup.com>
Jean-Baptiste Dalido <jeanbaptiste@appgratis.com>
<proppy@google.com> <proppy@aminche.com>
<michael@crosbymichael.com> <crosby.michael@gmail.com>
<github@metaliveblog.com> <github@developersupport.net>
<brandon@ifup.org> <brandon@ifup.co>
<dano@spotify.com> <daniel.norberg@gmail.com>
<danny@codeaholics.org> <Danny.Yates@mailonline.co.uk>
<gurjeet@singh.im> <singh.gurjeet@gmail.com>
<shawn@churchofgit.com> <shawnlandden@gmail.com>
<sjoerd-github@linuxonly.nl> <sjoerd@byte.nl>
<solomon@dotcloud.com> <solomon.hykes@dotcloud.com>
<SvenDowideit@home.org.au> <SvenDowideit@fosiki.com>
Sven Dowideit <SvenDowideit@home.org.au> ¨Sven <¨SvenDowideit@home.org.au¨>
unclejack <unclejacksons@gmail.com> <unclejack@users.noreply.github.com>

30
.travis.yml Normal file
View File

@@ -0,0 +1,30 @@
# Note: right now we don't use go-specific features of travis.
# Later we might automate "go test" etc. (or do it inside a docker container...?)
language: go
go: 1.2
# Disable the normal go build.
install: true
before_script:
- env | sort
- sudo apt-get update -qq
- sudo apt-get install -qq python-yaml
- git remote add upstream git://github.com/dotcloud/docker.git
- upstream=master;
if [ "$TRAVIS_PULL_REQUEST" != false ]; then
upstream=$TRAVIS_BRANCH;
fi;
git fetch --append --no-tags upstream refs/heads/$upstream:refs/remotes/upstream/$upstream
# sometimes we have upstream master already as origin/master (PRs), but other times we don't, so let's just make sure we have a completely unambiguous way to specify "upstream master" from here out
# but if it's a PR against non-master, we need that upstream branch instead :)
- sudo pip install -r docs/requirements.txt
script:
- hack/travis/dco.py
- hack/travis/gofmt.py
- make -sC docs SPHINXOPTS=-q docs man
# vim:set sw=2 ts=2:

278
AUTHORS
View File

@@ -3,87 +3,341 @@
#
# For a list of active project maintainers, see the MAINTAINERS file.
#
Al Tobey <al@ooyala.com>
Aanand Prasad <aanand.prasad@gmail.com>
Aaron Feng <aaron.feng@gmail.com>
Abel Muiño <amuino@gmail.com>
Alexander Larsson <alexl@redhat.com>
Alexey Shamrin <shamrin@gmail.com>
Alex Gaynor <alex.gaynor@gmail.com>
Alexis THOMAS <fr.alexisthomas@gmail.com>
Al Tobey <al@ooyala.com>
Andrea Luzzardi <aluzzardi@gmail.com>
Andreas Savvides <andreas@editd.com>
Andreas Tiefenthaler <at@an-ti.eu>
Andrew Duckworth <grillopress@gmail.com>
Andrew Macgregor <andrew.macgregor@agworld.com.au>
Andrew Munsell <andrew@wizardapps.net>
Andrews Medina <andrewsmedina@gmail.com>
Andy Chambers <anchambers@paypal.com>
andy diller <dillera@gmail.com>
Andy Rothfusz <github@metaliveblog.com>
Andy Smith <github@anarkystic.com>
Anthony Bishopric <git@anthonybishopric.com>
Anton Nikitin <anton.k.nikitin@gmail.com>
Antony Messerli <amesserl@rackspace.com>
apocas <petermdias@gmail.com>
Asbjørn Enge <asbjorn@hanafjedle.net>
Barry Allard <barry.allard@gmail.com>
Bartłomiej Piotrowski <b@bpiotrowski.pl>
Benoit Chesneau <bchesneau@gmail.com>
Ben Sargent <ben@brokendigits.com>
Ben Toews <mastahyeti@gmail.com>
Ben Wiklund <ben@daisyowl.com>
Bhiraj Butala <abhiraj.butala@gmail.com>
Bouke Haarsma <bouke@webatoom.nl>
Brandon Liu <bdon@bdon.org>
Brandon Philips <brandon@ifup.org>
Brian Dorsey <brian@dorseys.org>
Brian Goff <cpuguy83@gmail.com>
Brian McCallister <brianm@skife.org>
Brian Olsen <brian@maven-group.org>
Brian Shumate <brian@couchbase.com>
Briehan Lombaard <briehan.lombaard@gmail.com>
Bruno Bigras <bigras.bruno@gmail.com>
Caleb Spare <cespare@gmail.com>
Calen Pennington <cale@edx.org>
Carl X. Su <bcbcarl@gmail.com>
Charles Hooper <charles.hooper@dotcloud.com>
Charles Lindsay <chaz@chazomatic.us>
Chia-liang Kao <clkao@clkao.org>
Chris St. Pierre <chris.a.st.pierre@gmail.com>
Christopher Currie <codemonkey+github@gmail.com>
Christopher Rigor <crigor@gmail.com>
Christophe Troestler <christophe.Troestler@umons.ac.be>
Clayton Coleman <ccoleman@redhat.com>
Colin Dunklau <colin.dunklau@gmail.com>
Colin Rice <colin@daedrum.net>
Cory Forsyth <cory.forsyth@gmail.com>
cressie176 <github@stephen-cresswell.net>
Dan Buch <d.buch@modcloth.com>
Dan Hirsch <thequux@upstandinghackers.com>
Daniel Exner <dex@dragonslave.de>
Daniel Garcia <daniel@danielgarcia.info>
Daniel Gasienica <daniel@gasienica.ch>
Daniel Mizyrycki <daniel.mizyrycki@dotcloud.com>
Daniel Norberg <dano@spotify.com>
Daniel Nordberg <dnordberg@gmail.com>
Daniel Robinson <gottagetmac@gmail.com>
Daniel Von Fange <daniel@leancoder.com>
Daniel YC Lin <dlin.tw@gmail.com>
Danny Yates <danny@codeaholics.org>
Darren Coxall <darren@darrencoxall.com>
David Anderson <dave@natulte.net>
David Calavera <david.calavera@gmail.com>
David Mcanulty <github@hellspark.com>
David Sissitka <me@dsissitka.com>
Deni Bertovic <deni@kset.org>
Dinesh Subhraveti <dineshs@altiscale.com>
dkumor <daniel@dkumor.com>
Dmitry Demeshchuk <demeshchuk@gmail.com>
Dominik Honnef <dominik@honnef.co>
Don Spaulding <donspauldingii@gmail.com>
Dražen Lučanin <kermit666@gmail.com>
Dr Nic Williams <drnicwilliams@gmail.com>
Dustin Sallings <dustin@spy.net>
Edmund Wagner <edmund-wagner@web.de>
Elias Probst <mail@eliasprobst.eu>
Emil Hernvall <emil@quench.at>
Emily Rose <emily@contactvibe.com>
Eric Hanchrow <ehanchrow@ine.com>
Evan Wies <evan@neomantra.net>
Eric Lee <thenorthsecedes@gmail.com>
Eric Myhre <hash@exultant.us>
Erno Hopearuoho <erno.hopearuoho@gmail.com>
eugenkrizo <eugen.krizo@gmail.com>
Evan Krall <krall@yelp.com>
Evan Phoenix <evan@fallingsnow.net>
Evan Wies <evan@neomantra.net>
Eystein Måløy Stenberg <eystein.maloy.stenberg@cfengine.com>
ezbercih <cem.ezberci@gmail.com>
Fabio Falci <fabiofalci@gmail.com>
Fabio Rehm <fgrehm@gmail.com>
Fabrizio Regini <freegenie@gmail.com>
Faiz Khan <faizkhan00@gmail.com>
Fareed Dudhia <fareeddudhia@googlemail.com>
Fernando <fermayo@gmail.com>
Flavio Castelli <fcastelli@suse.com>
Francisco Souza <f@souza.cc>
Frank Macreery <frank@macreery.com>
Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
Frederik Loeffert <frederik@zitrusmedia.de>
Freek Kalter <freek@kalteronline.org>
Gabe Rosenhouse <gabe@missionst.com>
Gabriel Monroy <gabriel@opdemand.com>
Galen Sampson <galen.sampson@gmail.com>
Gareth Rushgrove <gareth@morethanseven.net>
Guillaume J. Charmes <guillaume.charmes@dotcloud.com>
Gereon Frey <gereon.frey@dynport.de>
Gert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Graydon Hoare <graydon@pobox.com>
Greg Thornton <xdissent@me.com>
grunny <mwgrunny@gmail.com>
Guillaume J. Charmes <guillaume.charmes@docker.com>
Gurjeet Singh <gurjeet@singh.im>
Guruprasad <lgp171188@gmail.com>
Harley Laue <losinggeneration@gmail.com>
Hector Castro <hectcastro@gmail.com>
Hunter Blanks <hunter@twilio.com>
inglesp <peter.inglesby@gmail.com>
Isaac Dupree <antispam@idupree.com>
Isao Jonas <isao.jonas@gmail.com>
Jake Moshenko <jake@devtable.com>
James Allen <jamesallen0108@gmail.com>
James Carr <james.r.carr@gmail.com>
James Mills <prologic@shortcircuit.net.au>
James Turnbull <james@lovedthanlost.net>
jaseg <jaseg@jaseg.net>
Jason McVetta <jason.mcvetta@gmail.com>
Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Jean-Baptiste Dalido <jeanbaptiste@appgratis.com>
Jeff Lindsay <progrium@gmail.com>
Jeremy Grosser <jeremy@synack.me>
Joffrey F <joffrey@dotcloud.com>
John Costa <john.costa@gmail.com>
Jon Wedaman <jweede@gmail.com>
Jonas Pfenniger <jonas@pfenniger.name>
Jonathan Rudenberg <jonathan@titanous.com>
Joseph Anthony Pasquale Holsten <joseph@josephholsten.com>
Julien Barbier <write0@gmail.com>
Jérôme Petazzoni <jerome.petazzoni@dotcloud.com>
Jesse Dubay <jesse@thefortytwo.net>
Jim Alateras <jima@comware.com.au>
Jimmy Cuadra <jimmy@jimmycuadra.com>
Joe Beda <joe.github@bedafamily.com>
Joe Van Dyk <joe@tanga.com>
Joffrey F <joffrey@dotcloud.com>
Johan Euphrosine <proppy@google.com>
Johannes 'fish' Ziemke <github@freigeist.org>
Johan Rydberg <johan.rydberg@gmail.com>
John Costa <john.costa@gmail.com>
John Feminella <jxf@jxf.me>
John Gardiner Myers <jgmyers@proofpoint.com>
John Warwick <jwarwick@gmail.com>
Jonas Pfenniger <jonas@pfenniger.name>
Jonathan Mueller <j.mueller@apoveda.ch>
Jonathan Rudenberg <jonathan@titanous.com>
Jon Wedaman <jweede@gmail.com>
Joost Cassee <joost@cassee.net>
Jordan Arentsen <blissdev@gmail.com>
Jordan Sissel <jls@semicomplete.com>
Joseph Anthony Pasquale Holsten <joseph@josephholsten.com>
Joseph Hager <ajhager@gmail.com>
Josh Hawn <josh.hawn@docker.com>
Josh Poimboeuf <jpoimboe@redhat.com>
JP <jpellerin@leapfrogonline.com>
Julien Barbier <write0@gmail.com>
Julien Dubois <julien.dubois@gmail.com>
Justin Force <justin.force@gmail.com>
Justin Plock <jplock@users.noreply.github.com>
Karan Lyons <karan@karanlyons.com>
Karl Grzeszczak <karlgrz@gmail.com>
Kawsar Saiyeed <kawsar.saiyeed@projiris.com>
Keli Hu <dev@keli.hu>
Ken Cochrane <kencochrane@gmail.com>
Kevin Clark <kevin.clark@gmail.com>
Kevin J. Lynagh <kevin@keminglabs.com>
Keyvan Fatehi <keyvanfatehi@gmail.com>
kim0 <email.ahmedkamal@googlemail.com>
Kim BKC Carlbacker <kim.carlbacker@gmail.com>
Kimbro Staken <kstaken@kstaken.com>
Kiran Gangadharan <kiran.daredevil@gmail.com>
Konstantin Pelykh <kpelykh@zettaset.com>
Kyle Conroy <kyle.j.conroy@gmail.com>
Laurie Voss <github@seldo.com>
Liang-Chi Hsieh <viirya@gmail.com>
Lokesh Mandvekar <lsm5@redhat.com>
Louis Opter <kalessin@kalessin.fr>
lukaspustina <lukas.pustina@centerdevice.com>
Mahesh Tiyyagura <tmahesh@gmail.com>
Manuel Meurer <manuel@krautcomputing.com>
Manuel Woelker <github@manuel.woelker.org>
Marc Kuo <kuomarc2@gmail.com>
Marco Hennings <marco.hennings@freiheit.com>
Marcus Farkas <toothlessgear@finitebox.com>
Marcus Ramberg <marcus@nordaaker.com>
Marek Goldmann <marek.goldmann@gmail.com>
Mark Allen <mrallen1@yahoo.com>
Mark McGranaghan <mmcgrana@gmail.com>
Marko Mikulicic <mmikulicic@gmail.com>
Markus Fix <lispmeister@gmail.com>
Martijn van Oosterhout <kleptog@svana.org>
Martin Redmond <martin@tinychat.com>
Mathieu Le Marec - Pasquet <kiorky@cryptelium.net>
Matt Apperson <me@mattapperson.com>
Matt Bachmann <bachmann.matt@gmail.com>
Matt Haggard <haggardii@gmail.com>
Matthew Mueller <mattmuelle@gmail.com>
mattymo <raytrac3r@gmail.com>
Maxime Petazzoni <max@signalfuse.com>
Maxim Treskin <zerthurd@gmail.com>
meejah <meejah@meejah.ca>
Michael Crosby <crosby.michael@gmail.com>
Michael Crosby <michael@crosbymichael.com>
Michael Gorsuch <gorsuch@github.com>
Michael Stapelberg <michael+gh@stapelberg.de>
Miguel Angel Fernández <elmendalerenda@gmail.com>
Mike Gaffney <mike@uberu.com>
Mike Naberezny <mike@naberezny.com>
Mikhail Sobolev <mss@mawhrin.net>
Mohit Soni <mosoni@ebay.com>
Morten Siebuhr <sbhr@sbhr.dk>
Nan Monnand Deng <monnand@gmail.com>
Nate Jones <nate@endot.org>
Nathan Kleyn <nathan@nathankleyn.com>
Nelson Chen <crazysim@gmail.com>
Niall O'Higgins <niallo@unworkable.org>
Nick Payne <nick@kurai.co.uk>
Nick Stenning <nick.stenning@digital.cabinet-office.gov.uk>
Nick Stinemates <nick@stinemates.org>
Nicolas Dudebout <nicolas.dudebout@gatech.edu>
Nicolas Kaiser <nikai@nikai.net>
Nolan Darilek <nolan@thewordnerd.info>
odk- <github@odkurzacz.org>
Oguz Bilgic <fisyonet@gmail.com>
Ole Reifschneider <mail@ole-reifschneider.de>
O.S.Tezer <ostezer@gmail.com>
pandrew <letters@paulnotcom.se>
Pascal Borreli <pascal@borreli.com>
pattichen <craftsbear@gmail.com>
Paul Bowsher <pbowsher@globalpersonals.co.uk>
Paul Hammond <paul@paulhammond.org>
Paul Lietar <paul@lietar.net>
Paul Morie <pmorie@gmail.com>
Paul Nasrat <pnasrat@gmail.com>
Paul <paul9869@gmail.com>
Peter Braden <peterbraden@peterbraden.co.uk>
Peter Waller <peter@scraperwiki.com>
Phil Spitler <pspitler@gmail.com>
Piergiuliano Bossi <pgbossi@gmail.com>
Pierre-Alain RIVIERE <pariviere@ippon.fr>
Piotr Bogdan <ppbogdan@gmail.com>
pysqz <randomq@126.com>
Quentin Brossard <qbrossard@gmail.com>
Rafal Jeczalik <rjeczalik@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com>
Ramon van Alteren <ramon@vanalteren.nl>
Renato Riccieri Santos Zannon <renato.riccieri@gmail.com>
rgstephens <greg@udon.org>
Rhys Hiltner <rhys@twitch.tv>
Richo Healey <richo@psych0tik.net>
Rick Bradley <rick@users.noreply.github.com>
Robert Obryk <robryk@gmail.com>
Roberto G. Hashioka <roberto.hashioka@docker.com>
Roberto Hashioka <roberto_hashioka@hotmail.com>
Rodrigo Vaz <rodrigo.vaz@gmail.com>
Roel Van Nyen <roel.vannyen@gmail.com>
Roger Peppe <rogpeppe@gmail.com>
Ryan Fowler <rwfowler@gmail.com>
Ryan O'Donnell <odonnellryanc@gmail.com>
Ryan Seto <ryanseto@yak.net>
Sam Alba <sam.alba@gmail.com>
Sam J Sharpe <sam.sharpe@digital.cabinet-office.gov.uk>
Samuel Andaya <samuel@andaya.net>
Scott Bessler <scottbessler@gmail.com>
Sean Cronin <seancron@gmail.com>
Sean P. Kane <skane@newrelic.com>
Shawn Landden <shawn@churchofgit.com>
Shawn Siefkas <shawn.siefkas@meredith.com>
Shih-Yuan Lee <fourdollars@gmail.com>
shin- <joffrey@docker.com>
Silas Sewell <silas@sewell.org>
Simon Taranto <simon.taranto@gmail.com>
Sjoerd Langkemper <sjoerd-github@linuxonly.nl>
Solomon Hykes <solomon@dotcloud.com>
Song Gao <song@gao.io>
Sridatta Thatipamala <sthatipamala@gmail.com>
Sridhar Ratnakumar <sridharr@activestate.com>
Steeve Morin <steeve.morin@gmail.com>
Stefan Praszalowicz <stefan@greplin.com>
sudosurootdev <sudosurootdev@gmail.com>
Sven Dowideit <svendowideit@home.org.au>
Sylvain Bellemare <sylvain.bellemare@ezeep.com>
tang0th <tang0th@gmx.com>
Tatsuki Sugiura <sugi@nemui.org>
Tehmasp Chaudhri <tehmasp@gmail.com>
Thatcher Peskens <thatcher@dotcloud.com>
Thermionix <bond711@gmail.com>
Thijs Terlouw <thijsterlouw@gmail.com>
Thomas Bikeev <thomas.bikeev@mac.com>
Thomas Frössman <thomasf@jossystem.se>
Thomas Hansen <thomas.hansen@gmail.com>
Thomas LEVEIL <thomasleveil@gmail.com>
Tianon Gravi <admwiggin@gmail.com>
Tim Bosse <maztaim@users.noreply.github.com>
Tim Terhorst <mynamewastaken+git@gmail.com>
Tobias Bieniek <Tobias.Bieniek@gmx.de>
Tobias Schmidt <ts@soundcloud.com>
Tobias Schwab <tobias.schwab@dynport.de>
Todd Lunter <tlunter@gmail.com>
Tom Hulihan <hulihan.tom159@gmail.com>
Tommaso Visconti <tommaso.visconti@gmail.com>
Travis Cline <travis.cline@gmail.com>
Tyler Brock <tyler.brock@gmail.com>
Tzu-Jung Lee <roylee17@gmail.com>
Ulysse Carion <ulyssecarion@gmail.com>
unclejack <unclejacksons@gmail.com>
Victor Vieux <victor.vieux@dotcloud.com>
vgeta <gopikannan.venugopalsamy@gmail.com>
Victor Coisne <victor.coisne@dotcloud.com>
Victor Lyuboslavsky <victor@victoreda.com>
Victor Vieux <victor.vieux@docker.com>
Vincent Batts <vbatts@redhat.com>
Vincent Bernat <bernat@luffy.cx>
Vincent Woo <me@vincentwoo.com>
Vinod Kulkarni <vinod.kulkarni@gmail.com>
Vitor Monteiro <vmrmonteiro@gmail.com>
Vivek Agarwal <me@vivek.im>
Vladimir Kirillov <proger@wilab.org.ua>
Vladimir Rutsky <iamironbob@gmail.com>
Walter Stanish <walter@pratyeka.org>
WarheadsSE <max@warheads.net>
Wes Morgan <cap10morgan@gmail.com>
Will Dietz <w@wdtz.org>
William Delanoue <william.delanoue@gmail.com>
Will Rouesnel <w.rouesnel@gmail.com>
Xiuming Chen <cc@cxm.cc>
Yang Bai <hamo.by@gmail.com>
Yurii Rashkovskii <yrashk@gmail.com>
Zain Memon <zain@inzain.net>
Zaiste! <oh@zaiste.net>
Zilin Du <zilin.du@gmail.com>
zimbatm <zimbatm@zimbatm.com>

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,23 @@
# Contributing to Docker
Want to hack on Docker? Awesome! Here are instructions to get you started. They are probably not perfect, please let us know if anything feels
wrong or incomplete.
Want to hack on Docker? Awesome! Here are instructions to get you
started. They are probably not perfect, please let us know if anything
feels wrong or incomplete.
## Reporting Issues
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 problem if possible and applicable.
This information will help us review and fix your issue faster.
## Build Environment
For instructions on setting up your development environment, please
see our dedicated [dev environment setup
docs](http://docs.docker.io/en/latest/contributing/devenvironment/).
## Contribution guidelines
@@ -23,7 +39,7 @@ that feature *on top of* docker.
### Discuss your design on the mailing list
We recommend discussing your plans [on the mailing
list](https://groups.google.com/forum/?fromgroups#!forum/docker-club)
list](https://groups.google.com/forum/?fromgroups#!forum/docker-dev)
before starting to code - especially for more ambitious contributions.
This gives other contributors a chance to point you in the right
direction, give feedback on your design, and maybe point out if someone
@@ -31,7 +47,7 @@ else is working on the same thing.
### Create issues...
Any significant improvement should be documented as [a github
Any significant improvement should be documented as [a GitHub
issue](https://github.com/dotcloud/docker/issues) before anybody
starts working on it.
@@ -55,8 +71,10 @@ Submit unit tests for your changes. Go has a great test framework built in; use
it! Take a look at existing tests for inspiration. Run the full test suite on
your branch before submitting a pull request.
Make sure you include relevant updates or additions to documentation when
creating or modifying features.
Update the documentation when creating or modifying features. Test
your documentation changes for clarity, concision, and correctness, as
well as a clean documentation build. See ``docs/README.md`` for more
information on building the docs and how docs get released.
Write clean code. Universally formatted code promotes ease of writing, reading,
and maintenance. Always run `go fmt` before committing your changes. Most
@@ -70,6 +88,8 @@ curl -o .git/hooks/pre-commit https://raw.github.com/edsrzf/gofmt-git-hook/maste
Pull requests descriptions should be as clear as possible and include a
reference to all the issues that they address.
Pull requests mustn't contain commits from other users or branches.
Code review comments may be added to your pull request. Discuss, then make the
suggested modifications and push additional commits to your feature branch. Be
sure to post a comment after pushing. The new commits will show up in the pull
@@ -89,72 +109,78 @@ name and email address match your git configuration. The AUTHORS file is
regenerated occasionally from the git commit history, so a mismatch may result
in your changes being overwritten.
### Merge approval
## Decision process
Docker maintainers use LGTM (looks good to me) in comments on the code review
to indicate acceptance.
### How are decisions made?
A change requires LGTMs from an absolute majority of the maintainers of each
component affected. For example, if a change affects docs/ and registry/, it
needs an absolute majority from the maintainers of docs/ AND, separately, an
absolute majority of the maintainers of registry
Short answer: with pull requests to the docker repository.
For more details see [MAINTAINERS.md](hack/MAINTAINERS.md)
Docker is an open-source project with an open design philosophy. This means that the repository is the source of truth for EVERY aspect of the project,
including its philosophy, design, roadmap and APIs. *If it's part of the project, it's in the repo. It's in the repo, it's part of the project.*
### Sign your work
As a result, all decisions can be expressed as changes to the repository. An implementation change is a change to the source code. An API change is a change to
the API specification. A philosophy change is a change to the philosophy manifesto. And so on.
The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right to
pass it on as an open-source patch. The rules are pretty simple: if you
can certify the below:
All decisions affecting docker, big and small, follow the same 3 steps:
```
Docker Developer Certificate of Origin 1.1
* Step 1: Open a pull request. Anyone can do this.
By making a contribution to the Docker Project ("Project"), I represent and
warrant that:
* Step 2: Discuss the pull request. Anyone can do this.
a. The contribution was created in whole or in part by me and I have the right
to submit the contribution on my own behalf or on behalf of a third party who
has authorized me to submit this contribution to the Project; or
* Step 3: Accept or refuse a pull request. The relevant maintainer does this (see below "Who decides what?")
b. The contribution is based upon previous work that, to the best of my
knowledge, is covered under an appropriate open source license and I have the
right and authorization to submit that work with modifications, whether
created in whole or in part by me, under the same open source license (unless
I am permitted to submit under a different license) that I have identified in
the contribution; or
c. The contribution was provided directly to me by some other person who
represented and warranted (a) or (b) and I have not modified it.
d. I understand and agree that this Project and the contribution are publicly
known and that a record of the contribution (including all personal
information I submit with it, including my sign-off record) is maintained
indefinitely and may be redistributed consistent with this Project or the open
source license(s) involved.
```
then you just add a line to every git commit message:
Docker-DCO-1.1-Signed-off-by: Joe Smith <joe.smith@email.com> (github: github_handle)
using your real name (sorry, no pseudonyms or anonymous contributions.)
One way to automate this, is customise your get ``commit.template`` by adding
a ``prepare-commit-msg`` hook to your docker checkout:
```
curl -o .git/hooks/prepare-commit-msg https://raw.github.com/dotcloud/docker/master/contrib/prepare-commit-msg.hook && chmod +x .git/hooks/prepare-commit-msg
```
* Note: the above script expects to find your GitHub user name in ``git config --get github.user``
If you have any questions, please refer to the FAQ in the [docs](http://docs.docker.io)
### Who decides what?
So all decisions are pull requests, and the relevant maintainer makes the decision by accepting or refusing the pull request.
But how do we identify the relevant maintainer for a given pull request?
Docker follows the timeless, highly efficient and totally unfair system known as [Benevolent dictator for life](http://en.wikipedia.org/wiki/Benevolent_Dictator_for_Life),
with yours truly, Solomon Hykes, in the role of BDFL.
This means that all decisions are made by default by me. Since making every decision myself would be highly unscalable, in practice decisions are spread across multiple maintainers.
The relevant maintainer for a pull request is assigned in 3 steps:
* Step 1: Determine the subdirectory affected by the pull request. This might be src/registry, docs/source/api, or any other part of the repo.
* Step 2: Find the MAINTAINERS file which affects this directory. If the directory itself does not have a MAINTAINERS file, work your way up the the repo hierarchy until you find one.
* Step 3: The first maintainer listed is the primary maintainer. The pull request is assigned to him. He may assign it to other listed maintainers, at his discretion.
### I'm a maintainer, should I make pull requests too?
Primary maintainers are not required to create pull requests when changing their own subdirectory, but secondary maintainers are.
### Who assigns maintainers?
Solomon.
### How can I become a maintainer?
* Step 1: learn the component inside out
* Step 2: make yourself useful by contributing code, bugfixes, support etc.
* Step 3: volunteer on the irc channel (#docker@freenode)
* Step 4: propose yourself at a scheduled docker meeting in #docker-dev
Don't forget: being a maintainer is a time investment. Make sure you will have time to make yourself available.
You don't have to be a maintainer to make a difference on the project!
### What are a maintainer's responsibility?
It is every maintainer's responsibility to:
* 1) Expose a clear roadmap for improving their component.
* 2) Deliver prompt feedback and decisions on pull requests.
* 3) Be available to anyone with questions, bug reports, criticism etc. on their component. This includes irc, github requests and the mailing list.
* 4) Make sure their component respects the philosophy, design and roadmap of the project.
### How is this process changed?
Just like everything else: by making a pull request :)

95
Dockerfile Normal file
View File

@@ -0,0 +1,95 @@
# This file describes the standard way to build Docker, using docker
#
# Usage:
#
# # Assemble the full dev environment. This is slow the first time.
# docker build -t docker .
#
# # Mount your source in an interactive container for quick testing:
# docker run -v `pwd`:/go/src/github.com/dotcloud/docker -privileged -i -t docker bash
#
# # Run the test suite:
# docker run -privileged docker hack/make.sh test
#
# # Publish a release:
# docker run -privileged \
# -e AWS_S3_BUCKET=baz \
# -e AWS_ACCESS_KEY=foo \
# -e AWS_SECRET_KEY=bar \
# -e GPG_PASSPHRASE=gloubiboulga \
# docker hack/release.sh
#
# Note: Apparmor used to mess with privileged mode, but this is no longer
# the case. Therefore, you don't have to disable it anymore.
#
docker-version 0.6.1
FROM ubuntu:13.10
MAINTAINER Tianon Gravi <admwiggin@gmail.com> (@tianon)
# Packaged dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq \
apt-utils \
aufs-tools \
automake \
btrfs-tools \
build-essential \
curl \
dpkg-sig \
git \
iptables \
libapparmor-dev \
libcap-dev \
libsqlite3-dev \
mercurial \
reprepro \
ruby1.9.1 \
ruby1.9.1-dev \
s3cmd=1.1.0* \
--no-install-recommends
# Get and compile LXC 0.8 (since it is the most stable)
RUN git clone --no-checkout https://github.com/lxc/lxc.git /usr/local/lxc && cd /usr/local/lxc && git checkout -q lxc-0.8.0
RUN cd /usr/local/lxc && ./autogen.sh && ./configure --disable-docs && make && make install
# Get lvm2 source for compiling statically
RUN git clone --no-checkout https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 && cd /usr/local/lvm2 && git checkout -q v2_02_103
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
# note: we don't use "git clone -b" above because it then spews big nasty warnings about 'detached HEAD' state that we can't silence as easily as we can silence them using "git checkout" directly
# Compile and install lvm2
RUN cd /usr/local/lvm2 && ./configure --enable-static_link && make device-mapper && make install_device-mapper
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
# Install Go
RUN curl -s https://go.googlecode.com/files/go1.2.src.tar.gz | tar -v -C /usr/local -xz
ENV PATH /usr/local/go/bin:$PATH
ENV GOPATH /go:/go/src/github.com/dotcloud/docker/vendor
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
# Compile Go for cross compilation
ENV DOCKER_CROSSPLATFORMS linux/386 linux/arm darwin/amd64 darwin/386
# (set an explicit GOARM of 5 for maximum compatibility)
ENV GOARM 5
RUN cd /usr/local/go/src && bash -xc 'for platform in $DOCKER_CROSSPLATFORMS; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean 2>&1; done'
# Grab Go's cover tool for dead-simple code coverage testing
RUN go get code.google.com/p/go.tools/cmd/cover
# TODO replace FPM with some very minimal debhelper stuff
RUN gem install --no-rdoc --no-ri fpm --version 1.0.2
# Setup s3cmd config
RUN /bin/echo -e '[default]\naccess_key=$AWS_ACCESS_KEY\nsecret_key=$AWS_SECRET_KEY' > /.s3cfg
# Set user.email so crosbymichael's in-container merge commits go smoothly
RUN git config --global user.email 'docker-dummy@example.com'
VOLUME /var/lib/docker
WORKDIR /go/src/github.com/dotcloud/docker
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]
# Upload docker source
ADD . /go/src/github.com/dotcloud/docker

14
FIXME
View File

@@ -11,26 +11,14 @@ They are just like FIXME comments in the source code, except we're not sure wher
to put them - so we put them here :)
* Merge Runtime, Server and Builder into Runtime
* Run linter on codebase
* Unify build commands and regular commands
* Move source code into src/ subdir for clarity
* Clean up the Makefile, it's a mess
* docker build: on non-existent local path for ADD, don't show full absolute path on the host
* mount into /dockerinit rather than /sbin/init
* docker tag foo REPO:TAG
* use size header for progress bar in pull
* Clean up context upload in build!!!
* Parallel pull
* Ensure /proc/sys/net/ipv4/ip_forward is 1
* Force DNS to public!
* Always generate a resolv.conf per container, to avoid changing resolv.conf under thne container's feet
* Save metadata with import/export
* Upgrade dockerd without stopping containers
* bring back git revision info, looks like it was lost
* Simple command to remove all untagged images
* Simple command to remove all untagged images (`docker rmi $(docker images | awk '/^<none>/ { print $3 }')`)
* Simple command to clean up containers for disk space
* Caching after an ADD
* entry point config
* bring back git revision info, looks like it was lost
* Clean up the ProgressReader api, it's a PITA to use

View File

@@ -1,5 +1,9 @@
Solomon Hykes <solomon@dotcloud.com>
Guillaume Charmes <guillaume@dotcloud.com>
Victor Vieux <victor@dotcloud.com>
api.go: Victor Vieux <victor@dotcloud.com>
Vagrantfile: Daniel Mizyrycki <daniel@dotcloud.com>
Solomon Hykes <solomon@dotcloud.com> (@shykes)
Guillaume Charmes <guillaume@dotcloud.com> (@creack)
Victor Vieux <victor@dotcloud.com> (@vieux)
Michael Crosby <michael@crosbymichael.com> (@crosbymichael)
.travis.yml: Tianon Gravi <admwiggin@gmail.com> (@tianon)
api.go: Victor Vieux <victor@dotcloud.com> (@vieux)
Dockerfile: Tianon Gravi <admwiggin@gmail.com> (@tianon)
Makefile: Tianon Gravi <admwiggin@gmail.com> (@tianon)
Vagrantfile: Cristian Staretu <cristian.staretu@gmail.com> (@unclejack)

109
Makefile
View File

@@ -1,94 +1,41 @@
DOCKER_PACKAGE := github.com/dotcloud/docker
RELEASE_VERSION := $(shell git tag | grep -E "v[0-9\.]+$$" | sort -nr | head -n 1)
SRCRELEASE := docker-$(RELEASE_VERSION)
BINRELEASE := docker-$(RELEASE_VERSION).tgz
BUILD_SRC := build_src
BUILD_PATH := ${BUILD_SRC}/src/${DOCKER_PACKAGE}
.PHONY: all binary build cross default docs docs-build docs-shell shell test test-integration
GIT_ROOT := $(shell git rev-parse --show-toplevel)
BUILD_DIR := $(CURDIR)/.gopath
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
DOCKER_IMAGE := docker:$(GIT_BRANCH)
DOCKER_DOCS_IMAGE := docker-docs:$(GIT_BRANCH)
DOCKER_RUN_DOCKER := docker run -rm -i -t -privileged -e TESTFLAGS -v "$(CURDIR)/bundles:/go/src/github.com/dotcloud/docker/bundles" "$(DOCKER_IMAGE)"
GOPATH ?= $(BUILD_DIR)
export GOPATH
default: binary
GO_OPTIONS ?=
ifeq ($(VERBOSE), 1)
GO_OPTIONS += -v
endif
all: build
$(DOCKER_RUN_DOCKER) hack/make.sh
GIT_COMMIT = $(shell git rev-parse --short HEAD)
GIT_STATUS = $(shell test -n "`git status --porcelain`" && echo "+CHANGES")
binary: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary
BUILD_OPTIONS = -a -ldflags "-X main.GITCOMMIT $(GIT_COMMIT)$(GIT_STATUS) -d -w"
cross: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary cross
SRC_DIR := $(GOPATH)/src
docs: docs-build
docker run -rm -i -t -p 8000:8000 "$(DOCKER_DOCS_IMAGE)"
DOCKER_DIR := $(SRC_DIR)/$(DOCKER_PACKAGE)
DOCKER_MAIN := $(DOCKER_DIR)/docker
docs-shell: docs-build
docker run -rm -i -t -p 8000:8000 "$(DOCKER_DOCS_IMAGE)" bash
DOCKER_BIN_RELATIVE := bin/docker
DOCKER_BIN := $(CURDIR)/$(DOCKER_BIN_RELATIVE)
test: build
$(DOCKER_RUN_DOCKER) hack/make.sh test test-integration
.PHONY: all clean test hack release srcrelease $(BINRELEASE) $(SRCRELEASE) $(DOCKER_BIN) $(DOCKER_DIR)
test-integration: build
$(DOCKER_RUN_DOCKER) hack/make.sh test-integration
all: $(DOCKER_BIN)
shell: build
$(DOCKER_RUN_DOCKER) bash
$(DOCKER_BIN): $(DOCKER_DIR)
@mkdir -p $(dir $@)
@(cd $(DOCKER_MAIN); CGO_ENABLED=0 go build $(GO_OPTIONS) $(BUILD_OPTIONS) -o $@)
@echo $(DOCKER_BIN_RELATIVE) is created.
build: bundles
docker build -rm -t "$(DOCKER_IMAGE)" .
$(DOCKER_DIR):
@mkdir -p $(dir $@)
@if [ -h $@ ]; then rm -f $@; fi; ln -sf $(CURDIR)/ $@
@(cd $(DOCKER_MAIN); go get -d $(GO_OPTIONS))
docs-build:
docker build -rm -t "$(DOCKER_DOCS_IMAGE)" docs
whichrelease:
echo $(RELEASE_VERSION)
release: $(BINRELEASE)
s3cmd -P put $(BINRELEASE) s3://get.docker.io/builds/`uname -s`/`uname -m`/docker-$(RELEASE_VERSION).tgz
s3cmd -P put docker-latest.tgz s3://get.docker.io/builds/`uname -s`/`uname -m`/docker-latest.tgz
srcrelease: $(SRCRELEASE)
deps: $(DOCKER_DIR)
# A clean checkout of $RELEASE_VERSION, with vendored dependencies
$(SRCRELEASE):
rm -fr $(SRCRELEASE)
git clone $(GIT_ROOT) $(SRCRELEASE)
cd $(SRCRELEASE); git checkout -q $(RELEASE_VERSION)
# A binary release ready to be uploaded to a mirror
$(BINRELEASE): $(SRCRELEASE)
rm -f $(BINRELEASE)
cd $(SRCRELEASE); make; cp -R bin docker-$(RELEASE_VERSION); tar -f ../$(BINRELEASE) -zv -c docker-$(RELEASE_VERSION)
cd $(SRCRELEASE); cp -R bin docker-latest; tar -f ../docker-latest.tgz -zv -c docker-latest
clean:
@rm -rf $(dir $(DOCKER_BIN))
ifeq ($(GOPATH), $(BUILD_DIR))
@rm -rf $(BUILD_DIR)
else ifneq ($(DOCKER_DIR), $(realpath $(DOCKER_DIR)))
@rm -f $(DOCKER_DIR)
endif
test:
# Copy docker source and dependencies for testing
rm -rf ${BUILD_SRC}; mkdir -p ${BUILD_PATH}
tar --exclude=${BUILD_SRC} -cz . | tar -xz -C ${BUILD_PATH}
GOPATH=${CURDIR}/${BUILD_SRC} go get -d
# Do the test
sudo -E GOPATH=${CURDIR}/${BUILD_SRC} go test ${GO_OPTIONS}
testall: all
@(cd $(DOCKER_DIR); sudo -E go test ./... $(GO_OPTIONS))
fmt:
@gofmt -s -l -w .
hack:
cd $(CURDIR)/hack && vagrant up
ssh-dev:
cd $(CURDIR)/hack && vagrant ssh
bundles:
mkdir bundles

22
NOTICE
View File

@@ -1,11 +1,19 @@
Docker
Copyright 2012-2013 dotCloud, inc.
Copyright 2012-2014 Docker, Inc.
This product includes software developed at dotCloud, inc. (http://www.dotcloud.com).
This product includes software developed at Docker, Inc. (http://www.docker.com).
This product contains software (https://github.com/kr/pty) developed by Keith Rarick, licensed under the MIT License.
This product contains software (https://github.com/kr/pty) developed
by Keith Rarick, licensed under the MIT License.
Transfers of Docker shall be in accordance with applicable export controls of any country and all other applicable
legal requirements. Docker shall not be distributed or downloaded to or in Cuba, Iran, North Korea, Sudan or Syria
and shall not be distributed or downloaded to any person on the Denied Persons List administered by the U.S.
Department of Commerce.
The following is courtesy of our legal counsel:
Use and transfer of Docker may be subject to certain restrictions by the
United States and other governments.
It is your responsibility to ensure that your use and/or transfer does not
violate applicable laws.
For more information, please see http://www.bis.doc.gov
See also http://www.apache.org/dev/crypto.html and/or seek legal counsel.

434
README.md
View File

@@ -1,80 +1,129 @@
Docker: the Linux container engine
==================================
Docker is an open-source engine which automates the deployment of applications as highly portable, self-sufficient containers.
Docker is an open source project to pack, ship and run any application
as a lightweight container
Docker containers are both *hardware-agnostic* and *platform-agnostic*. This means that they can run anywhere, from your
laptop to the largest EC2 compute instance and everything in between - and they don't require that you use a particular
language, framework or packaging system. That makes them great building blocks for deploying and scaling web apps, databases
and backend services without depending on a particular stack or provider.
Docker containers are both *hardware-agnostic* and
*platform-agnostic*. This means that they can run anywhere, from your
laptop to the largest EC2 compute instance and everything in between -
and they don't require that you use a particular language, framework
or packaging system. That makes them great building blocks for
deploying and scaling web apps, databases and backend services without
depending on a particular stack or provider.
Docker is an open-source implementation of the deployment engine which powers [dotCloud](http://dotcloud.com), a popular Platform-as-a-Service.
It benefits directly from the experience accumulated over several years of large-scale operation and support of hundreds of thousands
of applications and databases.
Docker is an open-source implementation of the deployment engine which
powers [dotCloud](http://dotcloud.com), a popular
Platform-as-a-Service. It benefits directly from the experience
accumulated over several years of large-scale operation and support of
hundreds of thousands of applications and databases.
![Docker L](docs/sources/concepts/images/lego_docker.jpg "Docker")
![Docker L](docs/theme/docker/static/img/dockerlogo-h.png "Docker")
## Better than VMs
A common method for distributing applications and sandbox their execution is to use virtual machines, or VMs. Typical VM formats
are VMWare's vmdk, Oracle Virtualbox's vdi, and Amazon EC2's ami. In theory these formats should allow every developer to
automatically package their application into a "machine" for easy distribution and deployment. In practice, that almost never
happens, for a few reasons:
A common method for distributing applications and sandboxing their
execution is to use virtual machines, or VMs. Typical VM formats are
VMWare's vmdk, Oracle Virtualbox's vdi, and Amazon EC2's ami. In
theory these formats should allow every developer to automatically
package their application into a "machine" for easy distribution and
deployment. In practice, that almost never happens, for a few reasons:
* *Size*: VMs are very large which makes them impractical to store and transfer.
* *Performance*: running VMs consumes significant CPU and memory, which makes them impractical in many scenarios, for example local development of multi-tier applications, and
large-scale deployment of cpu and memory-intensive applications on large numbers of machines.
* *Portability*: competing VM environments don't play well with each other. Although conversion tools do exist, they are limited and add even more overhead.
* *Hardware-centric*: VMs were designed with machine operators in mind, not software developers. As a result, they offer very limited tooling for what developers need most:
building, testing and running their software. For example, VMs offer no facilities for application versioning, monitoring, configuration, logging or service discovery.
* *Size*: VMs are very large which makes them impractical to store
and transfer.
* *Performance*: running VMs consumes significant CPU and memory,
which makes them impractical in many scenarios, for example local
development of multi-tier applications, and large-scale deployment
of cpu and memory-intensive applications on large numbers of
machines.
* *Portability*: competing VM environments don't play well with each
other. Although conversion tools do exist, they are limited and
add even more overhead.
* *Hardware-centric*: VMs were designed with machine operators in
mind, not software developers. As a result, they offer very
limited tooling for what developers need most: building, testing
and running their software. For example, VMs offer no facilities
for application versioning, monitoring, configuration, logging or
service discovery.
By contrast, Docker relies on a different sandboxing method known as *containerization*. Unlike traditional virtualization,
containerization takes place at the kernel level. Most modern operating system kernels now support the primitives necessary
for containerization, including Linux with [openvz](http://openvz.org), [vserver](http://linux-vserver.org) and more recently [lxc](http://lxc.sourceforge.net),
Solaris with [zones](http://docs.oracle.com/cd/E26502_01/html/E29024/preface-1.html#scrolltoc) and FreeBSD with [Jails](http://www.freebsd.org/doc/handbook/jails.html).
By contrast, Docker relies on a different sandboxing method known as
*containerization*. Unlike traditional virtualization,
containerization takes place at the kernel level. Most modern
operating system kernels now support the primitives necessary for
containerization, including Linux with [openvz](http://openvz.org),
[vserver](http://linux-vserver.org) and more recently
[lxc](http://lxc.sourceforge.net), Solaris with
[zones](http://docs.oracle.com/cd/E26502_01/html/E29024/preface-1.html#scrolltoc)
and FreeBSD with
[Jails](http://www.freebsd.org/doc/handbook/jails.html).
Docker builds on top of these low-level primitives to offer developers a portable format and runtime environment that solves
all 4 problems. Docker containers are small (and their transfer can be optimized with layers), they have basically zero memory and cpu overhead,
they are completely portable and are designed from the ground up with an application-centric design.
Docker builds on top of these low-level primitives to offer developers
a portable format and runtime environment that solves all 4
problems. Docker containers are small (and their transfer can be
optimized with layers), they have basically zero memory and cpu
overhead, they are completely portable and are designed from the
ground up with an application-centric design.
The best part: because docker operates at the OS level, it can still be run inside a VM!
The best part: because ``docker`` operates at the OS level, it can
still be run inside a VM!
## Plays well with others
Docker does not require that you buy into a particular programming language, framework, packaging system or configuration language.
Docker does not require that you buy into a particular programming
language, framework, packaging system or configuration language.
Is your application a unix process? Does it use files, tcp connections, environment variables, standard unix streams and command-line
arguments as inputs and outputs? Then docker can run it.
Is your application a Unix process? Does it use files, tcp
connections, environment variables, standard Unix streams and
command-line arguments as inputs and outputs? Then ``docker`` can run
it.
Can your application's build be expressed as a sequence of such commands? Then docker can build it.
Can your application's build be expressed as a sequence of such
commands? Then ``docker`` can build it.
## Escape dependency hell
A common problem for developers is the difficulty of managing all their application's dependencies in a simple and automated way.
A common problem for developers is the difficulty of managing all
their application's dependencies in a simple and automated way.
This is usually difficult for several reasons:
* *Cross-platform dependencies*. Modern applications often depend on a combination of system libraries and binaries, language-specific packages, framework-specific modules,
internal components developed for another project, etc. These dependencies live in different "worlds" and require different tools - these tools typically don't work
well with each other, requiring awkward custom integrations.
* *Cross-platform dependencies*. Modern applications often depend on
a combination of system libraries and binaries, language-specific
packages, framework-specific modules, internal components
developed for another project, etc. These dependencies live in
different "worlds" and require different tools - these tools
typically don't work well with each other, requiring awkward
custom integrations.
* Conflicting dependencies. Different applications may depend on different versions of the same dependency. Packaging tools handle these situations with various degrees of ease -
but they all handle them in different and incompatible ways, which again forces the developer to do extra work.
* Conflicting dependencies. Different applications may depend on
different versions of the same dependency. Packaging tools handle
these situations with various degrees of ease - but they all
handle them in different and incompatible ways, which again forces
the developer to do extra work.
* Custom dependencies. A developer may need to prepare a custom version of his application's dependency. Some packaging systems can handle custom versions of a dependency,
others can't - and all of them handle it differently.
* Custom dependencies. A developer may need to prepare a custom
version of their application's dependency. Some packaging systems
can handle custom versions of a dependency, others can't - and all
of them handle it differently.
Docker solves dependency hell by giving the developer a simple way to express *all* his application's dependencies in one place,
and streamline the process of assembling them. If this makes you think of [XKCD 927](http://xkcd.com/927/), don't worry. Docker doesn't
*replace* your favorite packaging systems. It simply orchestrates their use in a simple and repeatable way. How does it do that? With layers.
Docker solves dependency hell by giving the developer a simple way to
express *all* their application's dependencies in one place, and
streamline the process of assembling them. If this makes you think of
[XKCD 927](http://xkcd.com/927/), don't worry. Docker doesn't
*replace* your favorite packaging systems. It simply orchestrates
their use in a simple and repeatable way. How does it do that? With
layers.
Docker defines a build as running a sequence of unix commands, one after the other, in the same container. Build commands modify the contents of the container
(usually by installing new files on the filesystem), the next command modifies it some more, etc. Since each build command inherits the result of the previous
commands, the *order* in which the commands are executed expresses *dependencies*.
Docker defines a build as running a sequence of Unix commands, one
after the other, in the same container. Build commands modify the
contents of the container (usually by installing new files on the
filesystem), the next command modifies it some more, etc. Since each
build command inherits the result of the previous commands, the
*order* in which the commands are executed expresses *dependencies*.
Here's a typical docker build process:
Here's a typical Docker build process:
```bash
from ubuntu:12.10
@@ -87,295 +136,66 @@ run curl -L https://github.com/shykes/helloflask/archive/master.tar.gz | tar -xz
run cd helloflask-master && pip install -r requirements.txt
```
Note that Docker doesn't care *how* dependencies are built - as long as they can be built by running a unix command in a container.
Note that Docker doesn't care *how* dependencies are built - as long
as they can be built by running a Unix command in a container.
Install instructions
==================
Getting started
===============
Quick install on Ubuntu 12.04 and 12.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.
```bash
curl get.docker.io | sudo sh -x
```
We also offer an interactive tutorial for quickly learning the basics of using Docker.
Binary installs
----------------
Docker supports the following binary installation methods.
Note that some methods are community contributions and not yet officially supported.
For up-to-date install instructions and online tutorials, see the [Getting Started page](http://www.docker.io/gettingstarted/).
* [Ubuntu 12.04 and 12.10 (officially supported)](http://docs.docker.io/en/latest/installation/ubuntulinux/)
* [Arch Linux](http://docs.docker.io/en/latest/installation/archlinux/)
* [Mac OS X (with Vagrant)](http://docs.docker.io/en/latest/installation/vagrant/)
* [Windows (with Vagrant)](http://docs.docker.io/en/latest/installation/windows/)
* [Amazon EC2 (with Vagrant)](http://docs.docker.io/en/latest/installation/amazon/)
Installing from source
----------------------
1. Make sure you have a [Go language](http://golang.org/doc/install) compiler and [git](http://git-scm.com) installed.
2. Checkout the source code
```bash
git clone http://github.com/dotcloud/docker
```
3. Build the docker binary
```bash
cd docker
make VERBOSE=1
sudo cp ./bin/docker /usr/local/bin/docker
```
Usage examples
==============
First run the docker daemon
---------------------------
Docker can be used to run short-lived commands, long-running daemons (app servers, databases etc.),
interactive shell sessions, etc.
All the examples assume your machine is running the docker daemon. To run the docker daemon in the background, simply type:
```bash
# On a production system you want this running in an init script
sudo docker -d &
```
Now you can run docker in client mode: all commands will be forwarded to the docker daemon, so the client can run from any account.
```bash
# Now you can run docker commands from any account.
docker help
```
Throwaway shell in a base ubuntu image
--------------------------------------
```bash
docker pull ubuntu:12.10
# Run an interactive shell, allocate a tty, attach stdin and stdout
# To detach the tty without exiting the shell, use the escape sequence Ctrl-p + Ctrl-q
docker run -i -t ubuntu:12.10 /bin/bash
```
Starting a long-running worker process
--------------------------------------
```bash
# Start a very useful long-running process
JOB=$(docker run -d ubuntu /bin/sh -c "while true; do echo Hello world; sleep 1; done")
# Collect the output of the job so far
docker logs $JOB
# Kill the job
docker kill $JOB
```
Running an irc bouncer
----------------------
```bash
BOUNCER_ID=$(docker run -d -p 6667 -u irc shykes/znc zncrun $USER $PASSWORD)
echo "Configure your irc client to connect to port $(docker port $BOUNCER_ID 6667) of this machine"
```
Running Redis
-------------
```bash
REDIS_ID=$(docker run -d -p 6379 shykes/redis redis-server)
echo "Configure your redis client to connect to port $(docker port $REDIS_ID 6379) of this machine"
```
Share your own image!
---------------------
```bash
CONTAINER=$(docker run -d ubuntu:12.10 apt-get install -y curl)
docker commit -m "Installed curl" $CONTAINER $USER/betterbase
docker push $USER/betterbase
```
A list of publicly available images is [available here](https://github.com/dotcloud/docker/wiki/Public-docker-images).
Expose a service on a TCP port
------------------------------
```bash
# Expose port 4444 of this container, and tell netcat to listen on it
JOB=$(docker run -d -p 4444 base /bin/nc -l -p 4444)
# Which public port is NATed to my container?
PORT=$(docker port $JOB 4444)
# Connect to the public port via the host's public address
# Please note that because of how routing works connecting to localhost or 127.0.0.1 $PORT will not work.
# Replace *eth0* according to your local interface name.
IP=$(ip -o -4 addr list eth0 | perl -n -e 'if (m{inet\s([\d\.]+)\/\d+\s}xms) { print $1 }')
echo hello world | nc $IP $PORT
# Verify that the network connection worked
echo "Daemon received: $(docker logs $JOB)"
```
You can find a [list of real-world examples](http://docs.docker.io/en/latest/examples/) in the documentation.
Under the hood
--------------
Under the hood, Docker is built on the following components:
* The [cgroup](http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage-part-24-c) and [namespacing](http://blog.dotcloud.com/under-the-hood-linux-kernels-on-dotcloud-part) capabilities of the Linux kernel;
* [AUFS](http://aufs.sourceforge.net/aufs.html), a powerful union filesystem with copy-on-write capabilities;
* The
[cgroup](http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage-part-24-c)
and
[namespacing](http://blog.dotcloud.com/under-the-hood-linux-kernels-on-dotcloud-part)
capabilities of the Linux kernel;
* [AUFS](http://aufs.sourceforge.net/aufs.html), a powerful union
filesystem with copy-on-write capabilities;
* The [Go](http://golang.org) programming language;
* [lxc](http://lxc.sourceforge.net/), a set of convenience scripts to simplify the creation of linux containers.
* [lxc](http://lxc.sourceforge.net/), a set of convenience scripts to
simplify the creation of Linux containers.
Contributing to Docker
======================
Want to hack on Docker? Awesome! There are instructions to get you started on the website: http://docs.docker.io/en/latest/contributing/contributing/
Want to hack on Docker? Awesome! There are instructions to get you
started [here](CONTRIBUTING.md).
They are probably not perfect, please let us know if anything feels wrong or incomplete.
They are probably not perfect, please let us know if anything feels
wrong or incomplete.
Note
----
We also keep the documentation in this repository. The website documentation is generated using sphinx using these sources.
Please find it under docs/sources/ and read more about it https://github.com/dotcloud/docker/tree/master/docs/README.md
Please feel free to fix / update the documentation and send us pull requests. More tutorials are also welcome.
Setting up a dev environment
----------------------------
Instructions that have been verified to work on Ubuntu 12.10,
```bash
sudo apt-get -y install lxc curl xz-utils golang git
export GOPATH=~/go/
export PATH=$GOPATH/bin:$PATH
mkdir -p $GOPATH/src/github.com/dotcloud
cd $GOPATH/src/github.com/dotcloud
git clone https://github.com/dotcloud/docker.git
cd docker
go get -v github.com/dotcloud/docker/...
go install -v github.com/dotcloud/docker/...
```
Then run the docker daemon,
```bash
sudo $GOPATH/bin/docker -d
```
Run the `go install` command (above) to recompile docker.
What is a Standard Container?
=============================
Docker defines a unit of software delivery called a Standard Container. The goal of a Standard Container is to encapsulate a software component and all its dependencies in
a format that is self-describing and portable, so that any compliant runtime can run it without extra dependencies, regardless of the underlying machine and the contents of the container.
The spec for Standard Containers is currently a work in progress, but it is very straightforward. It mostly defines 1) an image format, 2) a set of standard operations, and 3) an execution environment.
A great analogy for this is the shipping container. Just like how Standard Containers are a fundamental unit of software delivery, shipping containers (http://bricks.argz.com/ins/7823-1/12) are a fundamental unit of physical delivery.
### 1. STANDARD OPERATIONS
Just like shipping containers, Standard Containers define a set of STANDARD OPERATIONS. Shipping containers can be lifted, stacked, locked, loaded, unloaded and labelled. Similarly, standard containers can be started, stopped, copied, snapshotted, downloaded, uploaded and tagged.
### 2. CONTENT-AGNOSTIC
Just like shipping containers, Standard Containers are CONTENT-AGNOSTIC: all standard operations have the same effect regardless of the contents. A shipping container will be stacked in exactly the same way whether it contains Vietnamese powder coffee or spare Maserati parts. Similarly, Standard Containers are started or uploaded in the same way whether they contain a postgres database, a php application with its dependencies and application server, or Java build artifacts.
### 3. INFRASTRUCTURE-AGNOSTIC
Both types of containers are INFRASTRUCTURE-AGNOSTIC: they can be transported to thousands of facilities around the world, and manipulated by a wide variety of equipment. A shipping container can be packed in a factory in Ukraine, transported by truck to the nearest routing center, stacked onto a train, loaded into a German boat by an Australian-built crane, stored in a warehouse at a US facility, etc. Similarly, a standard container can be bundled on my laptop, uploaded to S3, downloaded, run and snapshotted by a build server at Equinix in Virginia, uploaded to 10 staging servers in a home-made Openstack cluster, then sent to 30 production instances across 3 EC2 regions.
### 4. DESIGNED FOR AUTOMATION
Because they offer the same standard operations regardless of content and infrastructure, Standard Containers, just like their physical counterpart, are extremely well-suited for automation. In fact, you could say automation is their secret weapon.
Many things that once required time-consuming and error-prone human effort can now be programmed. Before shipping containers, a bag of powder coffee was hauled, dragged, dropped, rolled and stacked by 10 different people in 10 different locations by the time it reached its destination. 1 out of 50 disappeared. 1 out of 20 was damaged. The process was slow, inefficient and cost a fortune - and was entirely different depending on the facility and the type of goods.
Similarly, before Standard Containers, by the time a software component ran in production, it had been individually built, configured, bundled, documented, patched, vendored, templated, tweaked and instrumented by 10 different people on 10 different computers. Builds failed, libraries conflicted, mirrors crashed, post-it notes were lost, logs were misplaced, cluster updates were half-broken. The process was slow, inefficient and cost a fortune - and was entirely different depending on the language and infrastructure provider.
### 5. INDUSTRIAL-GRADE DELIVERY
There are 17 million shipping containers in existence, packed with every physical good imaginable. Every single one of them can be loaded onto the same boats, by the same cranes, in the same facilities, and sent anywhere in the World with incredible efficiency. It is embarrassing to think that a 30 ton shipment of coffee can safely travel half-way across the World in *less time* than it takes a software team to deliver its code from one datacenter to another sitting 10 miles away.
With Standard Containers we can put an end to that embarrassment, by making INDUSTRIAL-GRADE DELIVERY of software a reality.
Standard Container Specification
--------------------------------
(TODO)
### Image format
### Standard operations
* Copy
* Run
* Stop
* Wait
* Commit
* Attach standard streams
* List filesystem changes
* ...
### Execution environment
#### Root filesystem
#### Environment variables
#### Process arguments
#### Networking
#### Process namespacing
#### Resource limits
#### Process monitoring
#### Logging
#### Signals
#### Pseudo-terminal allocation
#### Security
### Legal
Transfers of Docker shall be in accordance with applicable export controls of any country and all other applicable
legal requirements. Docker shall not be distributed or downloaded to or in Cuba, Iran, North Korea, Sudan or Syria
and shall not be distributed or downloaded to any person on the Denied Persons List administered by the U.S.
Department of Commerce.
*Brought to you courtesy of our legal counsel. For more context,
please see the Notice document.*
Use and transfer of Docker may be subject to certain restrictions by the
United States and other governments.
It is your responsibility to ensure that your use and/or transfer does not
violate applicable laws.
For more information, please see http://www.bis.doc.gov

1
VERSION Normal file
View File

@@ -0,0 +1 @@
0.8.1

218
Vagrantfile vendored
View File

@@ -4,63 +4,150 @@
BOX_NAME = ENV['BOX_NAME'] || "ubuntu"
BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64.box"
VF_BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64_vmware_fusion.box"
AWS_BOX_URI = ENV['BOX_URI'] || "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
AWS_REGION = ENV['AWS_REGION'] || "us-east-1"
AWS_AMI = ENV['AWS_AMI'] || "ami-d0f89fb9"
AWS_AMI = ENV['AWS_AMI'] || "ami-69f5a900"
AWS_INSTANCE_TYPE = ENV['AWS_INSTANCE_TYPE'] || 't1.micro'
SSH_PRIVKEY_PATH = ENV['SSH_PRIVKEY_PATH']
PRIVATE_NETWORK = ENV['PRIVATE_NETWORK']
# Boolean that forwards the Docker dynamic ports 49000-49900
# See http://docs.docker.io/en/latest/use/port_redirection/ for more
# $ FORWARD_DOCKER_PORTS=1 vagrant [up|reload]
FORWARD_DOCKER_PORTS = ENV['FORWARD_DOCKER_PORTS']
VAGRANT_RAM = ENV['VAGRANT_RAM'] || 512
VAGRANT_CORES = ENV['VAGRANT_CORES'] || 1
# You may also provide a comma-separated list of ports
# for Vagrant to forward. For example:
# $ FORWARD_PORTS=8080,27017 vagrant [up|reload]
FORWARD_PORTS = ENV['FORWARD_PORTS']
# A script to upgrade from the 12.04 kernel to the raring backport kernel (3.8)
# and install docker.
$script = <<SCRIPT
# The username to add to the docker group will be passed as the first argument
# to the script. If nothing is passed, default to "vagrant".
user="$1"
if [ -z "$user" ]; then
user=vagrant
fi
# Enable memory cgroup and swap accounting
sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"/g' /etc/default/grub
update-grub
# Adding an apt gpg key is idempotent.
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# Creating the docker.list file is idempotent, but it may overwrite desired
# settings if it already exists. This could be solved with md5sum but it
# doesn't seem worth it.
echo 'deb http://get.docker.io/ubuntu docker main' > \
/etc/apt/sources.list.d/docker.list
# Update remote package metadata. 'apt-get update' is idempotent.
apt-get update -q
# Install docker. 'apt-get install' is idempotent.
apt-get install -q -y lxc-docker
usermod -a -G docker "$user"
tmp=`mktemp -q` && {
# Only install the backport kernel, don't bother upgrading if the backport is
# already installed. We want parse the output of apt so we need to save it
# with 'tee'. NOTE: The installation of the kernel will trigger dkms to
# install vboxguest if needed.
apt-get install -q -y --no-upgrade linux-image-generic-lts-raring | \
tee "$tmp"
# Parse the number of installed packages from the output
NUM_INST=`awk '$2 == "upgraded," && $4 == "newly" { print $3 }' "$tmp"`
rm "$tmp"
}
# If the number of installed packages is greater than 0, we want to reboot (the
# backport kernel was installed but is not running).
if [ "$NUM_INST" -gt 0 ];
then
echo "Rebooting down to activate new kernel."
echo "/vagrant will not be mounted. Use 'vagrant halt' followed by"
echo "'vagrant up' to ensure /vagrant is mounted."
shutdown -r now
fi
SCRIPT
# We need to install the virtualbox guest additions *before* we do the normal
# docker installation. As such this script is prepended to the common docker
# install script above. This allows the install of the backport kernel to
# trigger dkms to build the virtualbox guest module install.
$vbox_script = <<VBOX_SCRIPT + $script
# Install the VirtualBox guest additions if they aren't already installed.
if [ ! -d /opt/VBoxGuestAdditions-4.3.6/ ]; then
# Update remote package metadata. 'apt-get update' is idempotent.
apt-get update -q
# Kernel Headers and dkms are required to build the vbox guest kernel
# modules.
apt-get install -q -y linux-headers-generic-lts-raring dkms
echo 'Downloading VBox Guest Additions...'
wget -cq http://dlc.sun.com.edgesuite.net/virtualbox/4.3.6/VBoxGuestAdditions_4.3.6.iso
echo "95648fcdb5d028e64145a2fe2f2f28c946d219da366389295a61fed296ca79f0 VBoxGuestAdditions_4.3.6.iso" | sha256sum --check || exit 1
mount -o loop,ro /home/vagrant/VBoxGuestAdditions_4.3.6.iso /mnt
/mnt/VBoxLinuxAdditions.run --nox11
umount /mnt
fi
VBOX_SCRIPT
Vagrant::Config.run do |config|
# Setup virtual machine box. This VM configuration code is always executed.
config.vm.box = BOX_NAME
config.vm.box_url = BOX_URI
config.vm.forward_port 4243, 4243
# Provision docker and new kernel if deployment was not done
if Dir.glob("#{File.dirname(__FILE__)}/.vagrant/machines/default/*/id").empty?
# Add lxc-docker package
pkg_cmd = "apt-get update -qq; apt-get install -q -y python-software-properties; " \
"add-apt-repository -y ppa:dotcloud/lxc-docker; apt-get update -qq; " \
"apt-get install -q -y lxc-docker; "
# Add X.org Ubuntu backported 3.8 kernel
pkg_cmd << "add-apt-repository -y ppa:ubuntu-x-swat/r-lts-backport; " \
"apt-get update -qq; apt-get install -q -y linux-image-3.8.0-19-generic; "
# Add guest additions if local vbox VM
is_vbox = true
ARGV.each do |arg| is_vbox &&= !arg.downcase.start_with?("--provider") end
if is_vbox
pkg_cmd << "apt-get install -q -y linux-headers-3.8.0-19-generic dkms; " \
"echo 'Downloading VBox Guest Additions...'; " \
"wget -q http://dlc.sun.com.edgesuite.net/virtualbox/4.2.12/VBoxGuestAdditions_4.2.12.iso; "
# Prepare the VM to add guest additions after reboot
pkg_cmd << "echo -e 'mount -o loop,ro /home/vagrant/VBoxGuestAdditions_4.2.12.iso /mnt\n" \
"echo yes | /mnt/VBoxLinuxAdditions.run\numount /mnt\n" \
"rm /root/guest_additions.sh; ' > /root/guest_additions.sh; " \
"chmod 700 /root/guest_additions.sh; " \
"sed -i -E 's#^exit 0#[ -x /root/guest_additions.sh ] \\&\\& /root/guest_additions.sh#' /etc/rc.local; " \
"echo 'Installation of VBox Guest Additions is proceeding in the background.'; " \
"echo '\"vagrant reload\" can be used in about 2 minutes to activate the new guest additions.'; "
end
# Activate new kernel
pkg_cmd << "shutdown -r +1; "
config.vm.provision :shell, :inline => pkg_cmd
# Use the specified private key path if it is specified and not empty.
if SSH_PRIVKEY_PATH
config.ssh.private_key_path = SSH_PRIVKEY_PATH
end
config.ssh.forward_agent = true
end
# Providers were added on Vagrant >= 1.1.0
#
# NOTE: The vagrant "vm.provision" appends its arguments to a list and executes
# them in order. If you invoke "vm.provision :shell, :inline => $script"
# twice then vagrant will run the script two times. Unfortunately when you use
# providers and the override argument to set up provisioners (like the vbox
# guest extensions) they 1) don't replace the other provisioners (they append
# to the end of the list) and 2) you can't control the order the provisioners
# are executed (you can only append to the list). If you want the virtualbox
# only script to run before the other script, you have to jump through a lot of
# hoops.
#
# Here is my only repeatable solution: make one script that is common ($script)
# and another script that is the virtual box guest *prepended* to the common
# script. Only ever use "vm.provision" *one time* per provider. That means
# every single provider has an override, and every single one configures
# "vm.provision". Much saddness, but such is life.
Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
config.vm.provider :aws do |aws, override|
aws.access_key_id = ENV["AWS_ACCESS_KEY_ID"]
aws.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
username = "ubuntu"
override.vm.box_url = AWS_BOX_URI
override.vm.provision :shell, :inline => $script, :args => username
aws.access_key_id = ENV["AWS_ACCESS_KEY"]
aws.secret_access_key = ENV["AWS_SECRET_KEY"]
aws.keypair_name = ENV["AWS_KEYPAIR_NAME"]
override.ssh.private_key_path = ENV["AWS_SSH_PRIVKEY"]
override.ssh.username = "ubuntu"
override.ssh.username = username
aws.region = AWS_REGION
aws.ami = AWS_AMI
aws.instance_type = "t1.micro"
aws.instance_type = AWS_INSTANCE_TYPE
end
config.vm.provider :rackspace do |rs|
config.ssh.private_key_path = ENV["RS_PRIVATE_KEY"]
config.vm.provider :rackspace do |rs, override|
override.vm.provision :shell, :inline => $script
rs.username = ENV["RS_USERNAME"]
rs.api_key = ENV["RS_API_KEY"]
rs.public_key_path = ENV["RS_PUBLIC_KEY"]
@@ -69,28 +156,51 @@ Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
end
config.vm.provider :vmware_fusion do |f, override|
override.vm.box = BOX_NAME
override.vm.box_url = VF_BOX_URI
override.vm.synced_folder ".", "/vagrant", disabled: true
override.vm.provision :shell, :inline => $script
f.vmx["displayName"] = "docker"
end
config.vm.provider :virtualbox do |vb|
config.vm.box = BOX_NAME
config.vm.box_url = BOX_URI
config.vm.provider :virtualbox do |vb, override|
override.vm.provision :shell, :inline => $vbox_script
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--memory", VAGRANT_RAM]
vb.customize ["modifyvm", :id, "--cpus", VAGRANT_CORES]
end
end
if !FORWARD_DOCKER_PORTS.nil?
Vagrant::VERSION < "1.1.0" and Vagrant::Config.run do |config|
(49000..49900).each do |port|
config.vm.forward_port port, port
end
end
Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
(49000..49900).each do |port|
config.vm.network :forwarded_port, :host => port, :guest => port
end
end
# If this is a version 1 config, virtualbox is the only option. A version 2
# config would have already been set in the above provider section.
Vagrant::VERSION < "1.1.0" and Vagrant::Config.run do |config|
config.vm.provision :shell, :inline => $vbox_script
end
# Setup port forwarding per loaded environment variables
forward_ports = FORWARD_DOCKER_PORTS.nil? ? [] : [*49153..49900]
forward_ports += FORWARD_PORTS.split(',').map{|i| i.to_i } if FORWARD_PORTS
if forward_ports.any?
Vagrant::VERSION < "1.1.0" and Vagrant::Config.run do |config|
forward_ports.each do |port|
config.vm.forward_port port, port
end
end
Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
forward_ports.each do |port|
config.vm.network :forwarded_port, :host => port, :guest => port, auto_correct: true
end
end
end
if !PRIVATE_NETWORK.nil?
Vagrant::VERSION < "1.1.0" and Vagrant::Config.run do |config|
config.vm.network :hostonly, PRIVATE_NETWORK
end
Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
config.vm.network "private_network", ip: PRIVATE_NETWORK
end
end

937
api.go
View File

@@ -1,937 +0,0 @@
package docker
import (
"encoding/json"
"fmt"
"github.com/dotcloud/docker/auth"
"github.com/dotcloud/docker/utils"
"github.com/gorilla/mux"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"os"
"os/exec"
"strconv"
"strings"
)
const APIVERSION = 1.3
const DEFAULTHTTPHOST string = "127.0.0.1"
const DEFAULTHTTPPORT int = 4243
func hijackServer(w http.ResponseWriter) (io.ReadCloser, io.Writer, error) {
conn, _, err := w.(http.Hijacker).Hijack()
if err != nil {
return nil, nil, err
}
// Flush the options to make sure the client sets the raw mode
conn.Write([]byte{})
return conn, conn, nil
}
//If we don't do this, POST method without Content-type (even with empty body) will fail
func parseForm(r *http.Request) error {
if err := r.ParseForm(); err != nil && !strings.HasPrefix(err.Error(), "mime:") {
return err
}
return nil
}
func parseMultipartForm(r *http.Request) error {
if err := r.ParseMultipartForm(4096); err != nil && !strings.HasPrefix(err.Error(), "mime:") {
return err
}
return nil
}
func httpError(w http.ResponseWriter, err error) {
if strings.HasPrefix(err.Error(), "No such") {
http.Error(w, err.Error(), http.StatusNotFound)
} else if strings.HasPrefix(err.Error(), "Bad parameter") {
http.Error(w, err.Error(), http.StatusBadRequest)
} else if strings.HasPrefix(err.Error(), "Conflict") {
http.Error(w, err.Error(), http.StatusConflict)
} else if strings.HasPrefix(err.Error(), "Impossible") {
http.Error(w, err.Error(), http.StatusNotAcceptable)
} else if strings.HasPrefix(err.Error(), "Wrong login/password") {
http.Error(w, err.Error(), http.StatusUnauthorized)
} else if strings.Contains(err.Error(), "hasn't been activated") {
http.Error(w, err.Error(), http.StatusForbidden)
} else {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
func writeJSON(w http.ResponseWriter, b []byte) {
w.Header().Set("Content-Type", "application/json")
w.Write(b)
}
func getBoolParam(value string) (bool, error) {
if value == "" {
return false, nil
}
ret, err := strconv.ParseBool(value)
if err != nil {
return false, fmt.Errorf("Bad parameter")
}
return ret, nil
}
func getAuth(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if version > 1.1 {
w.WriteHeader(http.StatusNotFound)
return nil
}
authConfig, err := auth.LoadConfig(srv.runtime.root)
if err != nil {
if err != auth.ErrConfigFileMissing {
return err
}
authConfig = &auth.AuthConfig{}
}
b, err := json.Marshal(&auth.AuthConfig{Username: authConfig.Username, Email: authConfig.Email})
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func postAuth(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
authConfig := &auth.AuthConfig{}
err := json.NewDecoder(r.Body).Decode(authConfig)
if err != nil {
return err
}
status := ""
if version > 1.1 {
status, err = auth.Login(authConfig, false)
if err != nil {
return err
}
} else {
localAuthConfig, err := auth.LoadConfig(srv.runtime.root)
if err != nil {
if err != auth.ErrConfigFileMissing {
return err
}
}
if authConfig.Username == localAuthConfig.Username {
authConfig.Password = localAuthConfig.Password
}
newAuthConfig := auth.NewAuthConfig(authConfig.Username, authConfig.Password, authConfig.Email, srv.runtime.root)
status, err = auth.Login(newAuthConfig, true)
if err != nil {
return err
}
}
if status != "" {
b, err := json.Marshal(&APIAuth{Status: status})
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
w.WriteHeader(http.StatusNoContent)
return nil
}
func getVersion(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
m := srv.DockerVersion()
b, err := json.Marshal(m)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func postContainersKill(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
if err := srv.ContainerKill(name); err != nil {
return err
}
w.WriteHeader(http.StatusNoContent)
return nil
}
func getContainersExport(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
if err := srv.ContainerExport(name, w); err != nil {
utils.Debugf("%s", err.Error())
return err
}
return nil
}
func getImagesJSON(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
all, err := getBoolParam(r.Form.Get("all"))
if err != nil {
return err
}
filter := r.Form.Get("filter")
outs, err := srv.Images(all, filter)
if err != nil {
return err
}
b, err := json.Marshal(outs)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func getImagesViz(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := srv.ImagesViz(w); err != nil {
return err
}
return nil
}
func getInfo(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
out := srv.DockerInfo()
b, err := json.Marshal(out)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func getImagesHistory(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
outs, err := srv.ImageHistory(name)
if err != nil {
return err
}
b, err := json.Marshal(outs)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func getContainersChanges(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
changesStr, err := srv.ContainerChanges(name)
if err != nil {
return err
}
b, err := json.Marshal(changesStr)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func getContainersJSON(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
all, err := getBoolParam(r.Form.Get("all"))
if err != nil {
return err
}
size, err := getBoolParam(r.Form.Get("size"))
if err != nil {
return err
}
since := r.Form.Get("since")
before := r.Form.Get("before")
n, err := strconv.Atoi(r.Form.Get("limit"))
if err != nil {
n = -1
}
outs := srv.Containers(all, size, n, since, before)
b, err := json.Marshal(outs)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func postImagesTag(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
repo := r.Form.Get("repo")
tag := r.Form.Get("tag")
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
force, err := getBoolParam(r.Form.Get("force"))
if err != nil {
return err
}
if err := srv.ContainerTag(name, repo, tag, force); err != nil {
return err
}
w.WriteHeader(http.StatusCreated)
return nil
}
func postCommit(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
config := &Config{}
if err := json.NewDecoder(r.Body).Decode(config); err != nil {
utils.Debugf("%s", err.Error())
}
repo := r.Form.Get("repo")
tag := r.Form.Get("tag")
container := r.Form.Get("container")
author := r.Form.Get("author")
comment := r.Form.Get("comment")
id, err := srv.ContainerCommit(container, repo, tag, author, comment, config)
if err != nil {
return err
}
b, err := json.Marshal(&APIID{id})
if err != nil {
return err
}
w.WriteHeader(http.StatusCreated)
writeJSON(w, b)
return nil
}
// Creates an image from Pull or from Import
func postImagesCreate(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
src := r.Form.Get("fromSrc")
image := r.Form.Get("fromImage")
tag := r.Form.Get("tag")
repo := r.Form.Get("repo")
if version > 1.0 {
w.Header().Set("Content-Type", "application/json")
}
sf := utils.NewStreamFormatter(version > 1.0)
if image != "" { //pull
registry := r.Form.Get("registry")
if err := srv.ImagePull(image, tag, registry, w, sf, &auth.AuthConfig{}); err != nil {
if sf.Used() {
w.Write(sf.FormatError(err))
return nil
}
return err
}
} else { //import
if err := srv.ImageImport(src, repo, tag, r.Body, w, sf); err != nil {
if sf.Used() {
w.Write(sf.FormatError(err))
return nil
}
return err
}
}
return nil
}
func getImagesSearch(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
term := r.Form.Get("term")
outs, err := srv.ImagesSearch(term)
if err != nil {
return err
}
b, err := json.Marshal(outs)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func postImagesInsert(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
url := r.Form.Get("url")
path := r.Form.Get("path")
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
if version > 1.0 {
w.Header().Set("Content-Type", "application/json")
}
sf := utils.NewStreamFormatter(version > 1.0)
imgID, err := srv.ImageInsert(name, url, path, w, sf)
if err != nil {
if sf.Used() {
w.Write(sf.FormatError(err))
return nil
}
}
b, err := json.Marshal(&APIID{ID: imgID})
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func postImagesPush(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
authConfig := &auth.AuthConfig{}
if version > 1.1 {
if err := json.NewDecoder(r.Body).Decode(authConfig); err != nil {
return err
}
} else {
localAuthConfig, err := auth.LoadConfig(srv.runtime.root)
if err != nil && err != auth.ErrConfigFileMissing {
return err
}
authConfig = localAuthConfig
}
if err := parseForm(r); err != nil {
return err
}
registry := r.Form.Get("registry")
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
if version > 1.0 {
w.Header().Set("Content-Type", "application/json")
}
sf := utils.NewStreamFormatter(version > 1.0)
if err := srv.ImagePush(name, registry, w, sf, authConfig); err != nil {
if sf.Used() {
w.Write(sf.FormatError(err))
return nil
}
return err
}
return nil
}
func postContainersCreate(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
config := &Config{}
out := &APIRun{}
if err := json.NewDecoder(r.Body).Decode(config); err != nil {
return err
}
if len(config.Dns) == 0 && len(srv.runtime.Dns) == 0 && utils.CheckLocalDns() {
out.Warnings = append(out.Warnings, fmt.Sprintf("Docker detected local DNS server on resolv.conf. Using default external servers: %v", defaultDns))
config.Dns = defaultDns
}
id, err := srv.ContainerCreate(config)
if err != nil {
return err
}
out.ID = id
if config.Memory > 0 && !srv.runtime.capabilities.MemoryLimit {
log.Println("WARNING: Your kernel does not support memory limit capabilities. Limitation discarded.")
out.Warnings = append(out.Warnings, "Your kernel does not support memory limit capabilities. Limitation discarded.")
}
if config.Memory > 0 && !srv.runtime.capabilities.SwapLimit {
log.Println("WARNING: Your kernel does not support swap limit capabilities. Limitation discarded.")
out.Warnings = append(out.Warnings, "Your kernel does not support memory swap capabilities. Limitation discarded.")
}
b, err := json.Marshal(out)
if err != nil {
return err
}
w.WriteHeader(http.StatusCreated)
writeJSON(w, b)
return nil
}
func postContainersRestart(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
t, err := strconv.Atoi(r.Form.Get("t"))
if err != nil || t < 0 {
t = 10
}
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
if err := srv.ContainerRestart(name, t); err != nil {
return err
}
w.WriteHeader(http.StatusNoContent)
return nil
}
func deleteContainers(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
removeVolume, err := getBoolParam(r.Form.Get("v"))
if err != nil {
return err
}
if err := srv.ContainerDestroy(name, removeVolume); err != nil {
return err
}
w.WriteHeader(http.StatusNoContent)
return nil
}
func deleteImages(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
imgs, err := srv.ImageDelete(name, version > 1.1)
if err != nil {
return err
}
if imgs != nil {
if len(*imgs) != 0 {
b, err := json.Marshal(imgs)
if err != nil {
return err
}
writeJSON(w, b)
} else {
return fmt.Errorf("Conflict, %s wasn't deleted", name)
}
} else {
w.WriteHeader(http.StatusNoContent)
}
return nil
}
func postContainersStart(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
hostConfig := &HostConfig{}
// allow a nil body for backwards compatibility
if r.Body != nil {
if err := json.NewDecoder(r.Body).Decode(hostConfig); err != nil {
return err
}
}
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
if err := srv.ContainerStart(name, hostConfig); err != nil {
return err
}
w.WriteHeader(http.StatusNoContent)
return nil
}
func postContainersStop(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
t, err := strconv.Atoi(r.Form.Get("t"))
if err != nil || t < 0 {
t = 10
}
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
if err := srv.ContainerStop(name, t); err != nil {
return err
}
w.WriteHeader(http.StatusNoContent)
return nil
}
func postContainersWait(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
status, err := srv.ContainerWait(name)
if err != nil {
return err
}
b, err := json.Marshal(&APIWait{StatusCode: status})
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func postContainersResize(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
height, err := strconv.Atoi(r.Form.Get("h"))
if err != nil {
return err
}
width, err := strconv.Atoi(r.Form.Get("w"))
if err != nil {
return err
}
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
if err := srv.ContainerResize(name, height, width); err != nil {
return err
}
return nil
}
func postContainersAttach(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil {
return err
}
logs, err := getBoolParam(r.Form.Get("logs"))
if err != nil {
return err
}
stream, err := getBoolParam(r.Form.Get("stream"))
if err != nil {
return err
}
stdin, err := getBoolParam(r.Form.Get("stdin"))
if err != nil {
return err
}
stdout, err := getBoolParam(r.Form.Get("stdout"))
if err != nil {
return err
}
stderr, err := getBoolParam(r.Form.Get("stderr"))
if err != nil {
return err
}
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
if _, err := srv.ContainerInspect(name); err != nil {
return err
}
in, out, err := hijackServer(w)
if err != nil {
return err
}
defer func() {
if tcpc, ok := in.(*net.TCPConn); ok {
tcpc.CloseWrite()
} else {
in.Close()
}
}()
defer func() {
if tcpc, ok := out.(*net.TCPConn); ok {
tcpc.CloseWrite()
} else if closer, ok := out.(io.Closer); ok {
closer.Close()
}
}()
fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
if err := srv.ContainerAttach(name, logs, stream, stdin, stdout, stderr, in, out); err != nil {
fmt.Fprintf(out, "Error: %s\n", err)
}
return nil
}
func getContainersByName(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
container, err := srv.ContainerInspect(name)
if err != nil {
return err
}
b, err := json.Marshal(container)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func getImagesByName(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if vars == nil {
return fmt.Errorf("Missing parameter")
}
name := vars["name"]
image, err := srv.ImageInspect(name)
if err != nil {
return err
}
b, err := json.Marshal(image)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func postImagesGetCache(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
apiConfig := &APIImageConfig{}
if err := json.NewDecoder(r.Body).Decode(apiConfig); err != nil {
return err
}
image, err := srv.ImageGetCached(apiConfig.ID, apiConfig.Config)
if err != nil {
return err
}
if image == nil {
w.WriteHeader(http.StatusNotFound)
return nil
}
apiID := &APIID{ID: image.ID}
b, err := json.Marshal(apiID)
if err != nil {
return err
}
writeJSON(w, b)
return nil
}
func postBuild(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if version < 1.3 {
return fmt.Errorf("Multipart upload for build is no longer supported. Please upgrade your docker client.")
}
remoteURL := r.FormValue("remote")
repoName := r.FormValue("t")
tag := ""
if strings.Contains(repoName, ":") {
remoteParts := strings.Split(repoName, ":")
tag = remoteParts[1]
repoName = remoteParts[0]
}
var context io.Reader
if remoteURL == "" {
context = r.Body
} else if utils.IsGIT(remoteURL) {
if !strings.HasPrefix(remoteURL, "git://") {
remoteURL = "https://" + remoteURL
}
root, err := ioutil.TempDir("", "docker-build-git")
if err != nil {
return err
}
defer os.RemoveAll(root)
if output, err := exec.Command("git", "clone", remoteURL, root).CombinedOutput(); err != nil {
return fmt.Errorf("Error trying to use git: %s (%s)", err, output)
}
c, err := Tar(root, Bzip2)
if err != nil {
return err
}
context = c
} else if utils.IsURL(remoteURL) {
f, err := utils.Download(remoteURL, ioutil.Discard)
if err != nil {
return err
}
defer f.Body.Close()
dockerFile, err := ioutil.ReadAll(f.Body)
if err != nil {
return err
}
c, err := mkBuildContext(string(dockerFile), nil)
if err != nil {
return err
}
context = c
}
b := NewBuildFile(srv, utils.NewWriteFlusher(w))
id, err := b.Build(context)
if err != nil {
fmt.Fprintf(w, "Error build: %s\n", err)
return err
}
if repoName != "" {
srv.runtime.repositories.Set(repoName, tag, id, false)
}
return nil
}
func optionsHandler(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
w.WriteHeader(http.StatusOK)
return nil
}
func writeCorsHeaders(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Access-Control-Allow-Origin", "*")
w.Header().Add("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept")
w.Header().Add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, OPTIONS")
}
func createRouter(srv *Server, logging bool) (*mux.Router, error) {
r := mux.NewRouter()
m := map[string]map[string]func(*Server, float64, http.ResponseWriter, *http.Request, map[string]string) error{
"GET": {
"/auth": getAuth,
"/version": getVersion,
"/info": getInfo,
"/images/json": getImagesJSON,
"/images/viz": getImagesViz,
"/images/search": getImagesSearch,
"/images/{name:.*}/history": getImagesHistory,
"/images/{name:.*}/json": getImagesByName,
"/containers/ps": getContainersJSON,
"/containers/json": getContainersJSON,
"/containers/{name:.*}/export": getContainersExport,
"/containers/{name:.*}/changes": getContainersChanges,
"/containers/{name:.*}/json": getContainersByName,
},
"POST": {
"/auth": postAuth,
"/commit": postCommit,
"/build": postBuild,
"/images/create": postImagesCreate,
"/images/{name:.*}/insert": postImagesInsert,
"/images/{name:.*}/push": postImagesPush,
"/images/{name:.*}/tag": postImagesTag,
"/images/getCache": postImagesGetCache,
"/containers/create": postContainersCreate,
"/containers/{name:.*}/kill": postContainersKill,
"/containers/{name:.*}/restart": postContainersRestart,
"/containers/{name:.*}/start": postContainersStart,
"/containers/{name:.*}/stop": postContainersStop,
"/containers/{name:.*}/wait": postContainersWait,
"/containers/{name:.*}/resize": postContainersResize,
"/containers/{name:.*}/attach": postContainersAttach,
},
"DELETE": {
"/containers/{name:.*}": deleteContainers,
"/images/{name:.*}": deleteImages,
},
"OPTIONS": {
"": optionsHandler,
},
}
for method, routes := range m {
for route, fct := range routes {
utils.Debugf("Registering %s, %s", method, route)
// NOTE: scope issue, make sure the variables are local and won't be changed
localRoute := route
localMethod := method
localFct := fct
f := func(w http.ResponseWriter, r *http.Request) {
utils.Debugf("Calling %s %s", localMethod, localRoute)
if logging {
log.Println(r.Method, r.RequestURI)
}
if strings.Contains(r.Header.Get("User-Agent"), "Docker-Client/") {
userAgent := strings.Split(r.Header.Get("User-Agent"), "/")
if len(userAgent) == 2 && userAgent[1] != VERSION {
utils.Debugf("Warning: client and server don't have the same version (client: %s, server: %s)", userAgent[1], VERSION)
}
}
version, err := strconv.ParseFloat(mux.Vars(r)["version"], 64)
if err != nil {
version = APIVERSION
}
if srv.enableCors {
writeCorsHeaders(w, r)
}
if version == 0 || version > APIVERSION {
w.WriteHeader(http.StatusNotFound)
return
}
if err := localFct(srv, version, w, r, mux.Vars(r)); err != nil {
httpError(w, err)
}
}
if localRoute == "" {
r.Methods(localMethod).HandlerFunc(f)
} else {
r.Path("/v{version:[0-9.]+}" + localRoute).Methods(localMethod).HandlerFunc(f)
r.Path(localRoute).Methods(localMethod).HandlerFunc(f)
}
}
}
return r, nil
}
func ListenAndServe(proto, addr string, srv *Server, logging bool) error {
log.Printf("Listening for HTTP on %s (%s)\n", addr, proto)
r, err := createRouter(srv, logging)
if err != nil {
return err
}
l, e := net.Listen(proto, addr)
if e != nil {
return e
}
//as the daemon is launched as root, change to permission of the socket to allow non-root to connect
if proto == "unix" {
os.Chmod(addr, 0777)
}
httpSrv := http.Server{Addr: addr, Handler: r}
return httpSrv.Serve(l)
}

1246
api/api.go Normal file

File diff suppressed because it is too large Load Diff

65
api/api_unit_test.go Normal file
View File

@@ -0,0 +1,65 @@
package api
import (
"fmt"
"net/http"
"net/http/httptest"
"testing"
)
func TestJsonContentType(t *testing.T) {
if !MatchesContentType("application/json", "application/json") {
t.Fail()
}
if !MatchesContentType("application/json; charset=utf-8", "application/json") {
t.Fail()
}
if MatchesContentType("dockerapplication/json", "application/json") {
t.Fail()
}
}
func TestGetBoolParam(t *testing.T) {
if ret, err := getBoolParam("true"); err != nil || !ret {
t.Fatalf("true -> true, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("True"); err != nil || !ret {
t.Fatalf("True -> true, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("1"); err != nil || !ret {
t.Fatalf("1 -> true, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam(""); err != nil || ret {
t.Fatalf("\"\" -> false, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("false"); err != nil || ret {
t.Fatalf("false -> false, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("0"); err != nil || ret {
t.Fatalf("0 -> false, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("faux"); err == nil || ret {
t.Fatalf("faux -> false, err | got %t %s", ret, err)
}
}
func TesthttpError(t *testing.T) {
r := httptest.NewRecorder()
httpError(r, fmt.Errorf("No such method"))
if r.Code != http.StatusNotFound {
t.Fatalf("Expected %d, got %d", http.StatusNotFound, r.Code)
}
httpError(r, fmt.Errorf("This accound hasn't been activated"))
if r.Code != http.StatusForbidden {
t.Fatalf("Expected %d, got %d", http.StatusForbidden, r.Code)
}
httpError(r, fmt.Errorf("Some error"))
if r.Code != http.StatusInternalServerError {
t.Fatalf("Expected %d, got %d", http.StatusInternalServerError, r.Code)
}
}

2412
api/client.go Normal file

File diff suppressed because it is too large Load Diff

18
api/container.go Normal file
View File

@@ -0,0 +1,18 @@
package api
import (
"github.com/dotcloud/docker/nat"
"github.com/dotcloud/docker/runconfig"
)
type Container struct {
Config runconfig.Config
HostConfig runconfig.HostConfig
State struct {
Running bool
ExitCode int
}
NetworkSettings struct {
Ports nat.PortMap
}
}

View File

@@ -1,80 +0,0 @@
package docker
type APIHistory struct {
ID string `json:"Id"`
Tags []string `json:",omitempty"`
Created int64
CreatedBy string `json:",omitempty"`
}
type APIImages struct {
Repository string `json:",omitempty"`
Tag string `json:",omitempty"`
ID string `json:"Id"`
Created int64
Size int64
VirtualSize int64
}
type APIInfo struct {
Debug bool
Containers int
Images int
NFd int `json:",omitempty"`
NGoroutines int `json:",omitempty"`
MemoryLimit bool `json:",omitempty"`
SwapLimit bool `json:",omitempty"`
}
type APIRmi struct {
Deleted string `json:",omitempty"`
Untagged string `json:",omitempty"`
}
type APIContainers struct {
ID string `json:"Id"`
Image string
Command string
Created int64
Status string
Ports string
SizeRw int64
SizeRootFs int64
}
type APISearch struct {
Name string
Description string
}
type APIID struct {
ID string `json:"Id"`
}
type APIRun struct {
ID string `json:"Id"`
Warnings []string `json:",omitempty"`
}
type APIPort struct {
Port string
}
type APIVersion struct {
Version string
GitCommit string `json:",omitempty"`
GoVersion string `json:",omitempty"`
}
type APIWait struct {
StatusCode int
}
type APIAuth struct {
Status string
}
type APIImageConfig struct {
ID string `json:"Id"`
*Config
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,299 +0,0 @@
package docker
import (
"archive/tar"
"bufio"
"bytes"
"errors"
"fmt"
"github.com/dotcloud/docker/utils"
"io"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
)
type Archive io.Reader
type Compression uint32
const (
Uncompressed Compression = iota
Bzip2
Gzip
Xz
)
func DetectCompression(source []byte) Compression {
for _, c := range source[:10] {
utils.Debugf("%x", c)
}
sourceLen := len(source)
for compression, m := range map[Compression][]byte{
Bzip2: {0x42, 0x5A, 0x68},
Gzip: {0x1F, 0x8B, 0x08},
Xz: {0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00},
} {
fail := false
if len(m) > sourceLen {
utils.Debugf("Len too short")
continue
}
i := 0
for _, b := range m {
if b != source[i] {
fail = true
break
}
i++
}
if !fail {
return compression
}
}
return Uncompressed
}
func (compression *Compression) Flag() string {
switch *compression {
case Bzip2:
return "j"
case Gzip:
return "z"
case Xz:
return "J"
}
return ""
}
func (compression *Compression) Extension() string {
switch *compression {
case Uncompressed:
return "tar"
case Bzip2:
return "tar.bz2"
case Gzip:
return "tar.gz"
case Xz:
return "tar.xz"
}
return ""
}
// Tar creates an archive from the directory at `path`, and returns it as a
// stream of bytes.
func Tar(path string, compression Compression) (io.Reader, error) {
return TarFilter(path, compression, nil)
}
// Tar creates an archive from the directory at `path`, only including files whose relative
// paths are included in `filter`. If `filter` is nil, then all files are included.
func TarFilter(path string, compression Compression, filter []string) (io.Reader, error) {
args := []string{"tar", "--numeric-owner", "-f", "-", "-C", path}
if filter == nil {
filter = []string{"."}
}
for _, f := range filter {
args = append(args, "-c"+compression.Flag(), f)
}
return CmdStream(exec.Command(args[0], args[1:]...))
}
// Untar reads a stream of bytes from `archive`, parses it as a tar archive,
// and unpacks it into the directory at `path`.
// The archive may be compressed with one of the following algorithgms:
// identity (uncompressed), gzip, bzip2, xz.
// FIXME: specify behavior when target path exists vs. doesn't exist.
func Untar(archive io.Reader, path string) error {
if archive == nil {
return fmt.Errorf("Empty archive")
}
bufferedArchive := bufio.NewReaderSize(archive, 10)
buf, err := bufferedArchive.Peek(10)
if err != nil {
return err
}
compression := DetectCompression(buf)
utils.Debugf("Archive compression detected: %s", compression.Extension())
cmd := exec.Command("tar", "--numeric-owner", "-f", "-", "-C", path, "-x"+compression.Flag())
cmd.Stdin = bufferedArchive
// Hardcode locale environment for predictable outcome regardless of host configuration.
// (see https://github.com/dotcloud/docker/issues/355)
cmd.Env = []string{"LANG=en_US.utf-8", "LC_ALL=en_US.utf-8"}
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("%s: %s", err, output)
}
return nil
}
// TarUntar is a convenience function which calls Tar and Untar, with
// the output of one piped into the other. If either Tar or Untar fails,
// TarUntar aborts and returns the error.
func TarUntar(src string, filter []string, dst string) error {
utils.Debugf("TarUntar(%s %s %s)", src, filter, dst)
archive, err := TarFilter(src, Uncompressed, filter)
if err != nil {
return err
}
return Untar(archive, dst)
}
// UntarPath is a convenience function which looks for an archive
// at filesystem path `src`, and unpacks it at `dst`.
func UntarPath(src, dst string) error {
if archive, err := os.Open(src); err != nil {
return err
} else if err := Untar(archive, dst); err != nil {
return err
}
return nil
}
// CopyWithTar creates a tar archive of filesystem path `src`, and
// unpacks it at filesystem path `dst`.
// The archive is streamed directly with fixed buffering and no
// intermediary disk IO.
//
func CopyWithTar(src, dst string) error {
srcSt, err := os.Stat(src)
if err != nil {
return err
}
if !srcSt.IsDir() {
return CopyFileWithTar(src, dst)
}
// Create dst, copy src's content into it
utils.Debugf("Creating dest directory: %s", dst)
if err := os.MkdirAll(dst, 0700); err != nil && !os.IsExist(err) {
return err
}
utils.Debugf("Calling TarUntar(%s, %s)", src, dst)
return TarUntar(src, nil, dst)
}
// CopyFileWithTar emulates the behavior of the 'cp' command-line
// for a single file. It copies a regular file from path `src` to
// path `dst`, and preserves all its metadata.
//
// If `dst` ends with a trailing slash '/', the final destination path
// will be `dst/base(src)`.
func CopyFileWithTar(src, dst string) error {
utils.Debugf("CopyFileWithTar(%s, %s)", src, dst)
srcSt, err := os.Stat(src)
if err != nil {
return err
}
if srcSt.IsDir() {
return fmt.Errorf("Can't copy a directory")
}
// Clean up the trailing /
if dst[len(dst)-1] == '/' {
dst = path.Join(dst, filepath.Base(src))
}
// Create the holding directory if necessary
if err := os.MkdirAll(filepath.Dir(dst), 0700); err != nil && !os.IsExist(err) {
return err
}
buf := new(bytes.Buffer)
tw := tar.NewWriter(buf)
hdr, err := tar.FileInfoHeader(srcSt, "")
if err != nil {
return err
}
hdr.Name = filepath.Base(dst)
if err := tw.WriteHeader(hdr); err != nil {
return err
}
srcF, err := os.Open(src)
if err != nil {
return err
}
if _, err := io.Copy(tw, srcF); err != nil {
return err
}
tw.Close()
return Untar(buf, filepath.Dir(dst))
}
// CmdStream executes a command, and returns its stdout as a stream.
// If the command fails to run or doesn't complete successfully, an error
// will be returned, including anything written on stderr.
func CmdStream(cmd *exec.Cmd) (io.Reader, error) {
stdout, err := cmd.StdoutPipe()
if err != nil {
return nil, err
}
stderr, err := cmd.StderrPipe()
if err != nil {
return nil, err
}
pipeR, pipeW := io.Pipe()
errChan := make(chan []byte)
// Collect stderr, we will use it in case of an error
go func() {
errText, e := ioutil.ReadAll(stderr)
if e != nil {
errText = []byte("(...couldn't fetch stderr: " + e.Error() + ")")
}
errChan <- errText
}()
// Copy stdout to the returned pipe
go func() {
_, err := io.Copy(pipeW, stdout)
if err != nil {
pipeW.CloseWithError(err)
}
errText := <-errChan
if err := cmd.Wait(); err != nil {
pipeW.CloseWithError(errors.New(err.Error() + ": " + string(errText)))
} else {
pipeW.Close()
}
}()
// Run the command and return the pipe
if err := cmd.Start(); err != nil {
return nil, err
}
return pipeR, nil
}
// NewTempArchive reads the content of src into a temporary file, and returns the contents
// of that file as an archive. The archive can only be read once - as soon as reading completes,
// the file will be deleted.
func NewTempArchive(src Archive, dir string) (*TempArchive, error) {
f, err := ioutil.TempFile(dir, "")
if err != nil {
return nil, err
}
if _, err := io.Copy(f, src); err != nil {
return nil, err
}
if _, err := f.Seek(0, 0); err != nil {
return nil, err
}
st, err := f.Stat()
if err != nil {
return nil, err
}
size := st.Size()
return &TempArchive{f, size}, nil
}
type TempArchive struct {
*os.File
Size int64 // Pre-computed from Stat().Size() as a convenience
}
func (archive *TempArchive) Read(data []byte) (int, error) {
n, err := archive.File.Read(data)
if err != nil {
os.Remove(archive.File.Name())
}
return n, err
}

1
archive/MAINTAINERS Normal file
View File

@@ -0,0 +1 @@
Michael Crosby <michael@crosbymichael.com> (@crosbymichael)

628
archive/archive.go Normal file
View File

@@ -0,0 +1,628 @@
package archive
import (
"bytes"
"code.google.com/p/go/src/pkg/archive/tar"
"compress/bzip2"
"compress/gzip"
"errors"
"fmt"
"github.com/dotcloud/docker/utils"
"io"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"strings"
"syscall"
)
type (
Archive io.ReadCloser
ArchiveReader io.Reader
Compression int
TarOptions struct {
Includes []string
Compression Compression
}
)
var (
ErrNotImplemented = errors.New("Function not implemented")
)
const (
Uncompressed Compression = iota
Bzip2
Gzip
Xz
)
func DetectCompression(source []byte) Compression {
sourceLen := len(source)
for compression, m := range map[Compression][]byte{
Bzip2: {0x42, 0x5A, 0x68},
Gzip: {0x1F, 0x8B, 0x08},
Xz: {0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00},
} {
fail := false
if len(m) > sourceLen {
utils.Debugf("Len too short")
continue
}
i := 0
for _, b := range m {
if b != source[i] {
fail = true
break
}
i++
}
if !fail {
return compression
}
}
return Uncompressed
}
func xzDecompress(archive io.Reader) (io.ReadCloser, error) {
args := []string{"xz", "-d", "-c", "-q"}
return CmdStream(exec.Command(args[0], args[1:]...), archive)
}
func DecompressStream(archive io.Reader) (io.ReadCloser, error) {
buf := make([]byte, 10)
totalN := 0
for totalN < 10 {
n, err := archive.Read(buf[totalN:])
if err != nil {
if err == io.EOF {
return nil, fmt.Errorf("Tarball too short")
}
return nil, err
}
totalN += n
utils.Debugf("[tar autodetect] n: %d", n)
}
compression := DetectCompression(buf)
wrap := io.MultiReader(bytes.NewReader(buf), archive)
switch compression {
case Uncompressed:
return ioutil.NopCloser(wrap), nil
case Gzip:
return gzip.NewReader(wrap)
case Bzip2:
return ioutil.NopCloser(bzip2.NewReader(wrap)), nil
case Xz:
return xzDecompress(wrap)
default:
return nil, fmt.Errorf("Unsupported compression format %s", (&compression).Extension())
}
}
func CompressStream(dest io.WriteCloser, compression Compression) (io.WriteCloser, error) {
switch compression {
case Uncompressed:
return utils.NopWriteCloser(dest), nil
case Gzip:
return gzip.NewWriter(dest), nil
case Bzip2, Xz:
// archive/bzip2 does not support writing, and there is no xz support at all
// However, this is not a problem as docker only currently generates gzipped tars
return nil, fmt.Errorf("Unsupported compression format %s", (&compression).Extension())
default:
return nil, fmt.Errorf("Unsupported compression format %s", (&compression).Extension())
}
}
func (compression *Compression) Extension() string {
switch *compression {
case Uncompressed:
return "tar"
case Bzip2:
return "tar.bz2"
case Gzip:
return "tar.gz"
case Xz:
return "tar.xz"
}
return ""
}
func addTarFile(path, name string, tw *tar.Writer) error {
fi, err := os.Lstat(path)
if err != nil {
return err
}
link := ""
if fi.Mode()&os.ModeSymlink != 0 {
if link, err = os.Readlink(path); err != nil {
return err
}
}
hdr, err := tar.FileInfoHeader(fi, link)
if err != nil {
return err
}
if fi.IsDir() && !strings.HasSuffix(name, "/") {
name = name + "/"
}
hdr.Name = name
stat, ok := fi.Sys().(*syscall.Stat_t)
if ok {
// Currently go does not fill in the major/minors
if stat.Mode&syscall.S_IFBLK == syscall.S_IFBLK ||
stat.Mode&syscall.S_IFCHR == syscall.S_IFCHR {
hdr.Devmajor = int64(major(uint64(stat.Rdev)))
hdr.Devminor = int64(minor(uint64(stat.Rdev)))
}
}
if err := tw.WriteHeader(hdr); err != nil {
return err
}
if hdr.Typeflag == tar.TypeReg {
if file, err := os.Open(path); err != nil {
return err
} else {
_, err := io.Copy(tw, file)
if err != nil {
return err
}
file.Close()
}
}
return nil
}
func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader) error {
// hdr.Mode is in linux format, which we can use for sycalls,
// but for os.Foo() calls we need the mode converted to os.FileMode,
// so use hdrInfo.Mode() (they differ for e.g. setuid bits)
hdrInfo := hdr.FileInfo()
switch hdr.Typeflag {
case tar.TypeDir:
// Create directory unless it exists as a directory already.
// In that case we just want to merge the two
if fi, err := os.Lstat(path); !(err == nil && fi.IsDir()) {
if err := os.Mkdir(path, hdrInfo.Mode()); err != nil {
return err
}
}
case tar.TypeReg, tar.TypeRegA:
// Source is regular file
file, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, hdrInfo.Mode())
if err != nil {
return err
}
if _, err := io.Copy(file, reader); err != nil {
file.Close()
return err
}
file.Close()
case tar.TypeBlock, tar.TypeChar, tar.TypeFifo:
mode := uint32(hdr.Mode & 07777)
switch hdr.Typeflag {
case tar.TypeBlock:
mode |= syscall.S_IFBLK
case tar.TypeChar:
mode |= syscall.S_IFCHR
case tar.TypeFifo:
mode |= syscall.S_IFIFO
}
if err := syscall.Mknod(path, mode, int(mkdev(hdr.Devmajor, hdr.Devminor))); err != nil {
return err
}
case tar.TypeLink:
if err := os.Link(filepath.Join(extractDir, hdr.Linkname), path); err != nil {
return err
}
case tar.TypeSymlink:
if err := os.Symlink(hdr.Linkname, path); err != nil {
return err
}
case tar.TypeXGlobalHeader:
utils.Debugf("PAX Global Extended Headers found and ignored")
return nil
default:
return fmt.Errorf("Unhandled tar header type %d\n", hdr.Typeflag)
}
if err := os.Lchown(path, hdr.Uid, hdr.Gid); err != nil {
return err
}
// There is no LChmod, so ignore mode for symlink. Also, this
// must happen after chown, as that can modify the file mode
if hdr.Typeflag != tar.TypeSymlink {
if err := os.Chmod(path, hdrInfo.Mode()); err != nil {
return err
}
}
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 := UtimesNano(path, ts); err != nil {
return err
}
} else {
if err := LUtimesNano(path, ts); err != nil {
return err
}
}
return nil
}
// 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})
}
func escapeName(name string) string {
escaped := make([]byte, 0)
for i, c := range []byte(name) {
if i == 0 && c == '/' {
continue
}
// all printable chars except "-" which is 0x2d
if (0x20 <= c && c <= 0x7E) && c != 0x2d {
escaped = append(escaped, c)
} else {
escaped = append(escaped, fmt.Sprintf("\\%03o", c)...)
}
}
return string(escaped)
}
// Tar creates an archive from the directory at `path`, only including files whose relative
// paths are included in `filter`. If `filter` is nil, then all files are included.
func TarFilter(srcPath string, options *TarOptions) (io.ReadCloser, error) {
pipeReader, pipeWriter := io.Pipe()
compressWriter, err := CompressStream(pipeWriter, options.Compression)
if err != nil {
return nil, err
}
tw := tar.NewWriter(compressWriter)
go func() {
// In general we log errors here but ignore them because
// during e.g. a diff operation the container can continue
// mutating the filesystem and we can see transient errors
// from this
if options.Includes == nil {
options.Includes = []string{"."}
}
for _, include := range options.Includes {
filepath.Walk(filepath.Join(srcPath, include), func(filePath string, f os.FileInfo, err error) error {
if err != nil {
utils.Debugf("Tar: Can't stat file %s to tar: %s\n", srcPath, err)
return nil
}
relFilePath, err := filepath.Rel(srcPath, filePath)
if err != nil {
return nil
}
if err := addTarFile(filePath, relFilePath, tw); err != nil {
utils.Debugf("Can't add file %s to tar: %s\n", srcPath, err)
}
return nil
})
}
// Make sure to check the error on Close.
if err := tw.Close(); err != nil {
utils.Debugf("Can't close tar writer: %s\n", err)
}
if err := compressWriter.Close(); err != nil {
utils.Debugf("Can't close compress writer: %s\n", err)
}
if err := pipeWriter.Close(); err != nil {
utils.Debugf("Can't close pipe writer: %s\n", err)
}
}()
return pipeReader, nil
}
// Untar reads a stream of bytes from `archive`, parses it as a tar archive,
// and unpacks it into the directory at `path`.
// The archive may be compressed with one of the following algorithms:
// identity (uncompressed), gzip, bzip2, xz.
// FIXME: specify behavior when target path exists vs. doesn't exist.
func Untar(archive io.Reader, dest string, options *TarOptions) error {
if archive == nil {
return fmt.Errorf("Empty archive")
}
decompressedArchive, err := DecompressStream(archive)
if err != nil {
return err
}
defer decompressedArchive.Close()
tr := tar.NewReader(decompressedArchive)
var dirs []*tar.Header
// Iterate through the files in the archive.
for {
hdr, err := tr.Next()
if err == io.EOF {
// end of tar archive
break
}
if err != nil {
return err
}
// Normalize name, for safety and for a simple is-root check
hdr.Name = filepath.Clean(hdr.Name)
if !strings.HasSuffix(hdr.Name, "/") {
// Not the root directory, ensure that the parent directory exists
parent := filepath.Dir(hdr.Name)
parentPath := filepath.Join(dest, parent)
if _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) {
err = os.MkdirAll(parentPath, 600)
if err != nil {
return err
}
}
}
path := filepath.Join(dest, hdr.Name)
// If path exits we almost always just want to remove and replace it
// The only exception is when it is a directory *and* the file from
// the layer is also a directory. Then we want to merge them (i.e.
// just apply the metadata from the layer).
if fi, err := os.Lstat(path); err == nil {
if !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) {
if err := os.RemoveAll(path); err != nil {
return err
}
}
}
if err := createTarFile(path, dest, hdr, tr); err != nil {
return err
}
// Directory mtimes must be handled at the end to avoid further
// file creation in them to modify the directory mtime
if hdr.Typeflag == tar.TypeDir {
dirs = append(dirs, hdr)
}
}
for _, hdr := range dirs {
path := filepath.Join(dest, hdr.Name)
ts := []syscall.Timespec{timeToTimespec(hdr.AccessTime), timeToTimespec(hdr.ModTime)}
if err := syscall.UtimesNano(path, ts); err != nil {
return err
}
}
return nil
}
// TarUntar is a convenience function which calls Tar and Untar, with
// the output of one piped into the other. If either Tar or Untar fails,
// 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})
if err != nil {
return err
}
defer archive.Close()
return Untar(archive, dst, nil)
}
// UntarPath is a convenience function which looks for an archive
// at filesystem path `src`, and unpacks it at `dst`.
func UntarPath(src, dst string) error {
archive, err := os.Open(src)
if err != nil {
return err
}
defer archive.Close()
if err := Untar(archive, dst, nil); err != nil {
return err
}
return nil
}
// CopyWithTar creates a tar archive of filesystem path `src`, and
// unpacks it at filesystem path `dst`.
// The archive is streamed directly with fixed buffering and no
// intermediary disk IO.
//
func CopyWithTar(src, dst string) error {
srcSt, err := os.Stat(src)
if err != nil {
return err
}
if !srcSt.IsDir() {
return CopyFileWithTar(src, dst)
}
// Create dst, copy src's content into it
utils.Debugf("Creating dest directory: %s", dst)
if err := os.MkdirAll(dst, 0755); err != nil && !os.IsExist(err) {
return err
}
utils.Debugf("Calling TarUntar(%s, %s)", src, dst)
return TarUntar(src, dst)
}
// CopyFileWithTar emulates the behavior of the 'cp' command-line
// for a single file. It copies a regular file from path `src` to
// path `dst`, and preserves all its metadata.
//
// If `dst` ends with a trailing slash '/', the final destination path
// will be `dst/base(src)`.
func CopyFileWithTar(src, dst string) (err error) {
utils.Debugf("CopyFileWithTar(%s, %s)", src, dst)
srcSt, err := os.Stat(src)
if err != nil {
return err
}
if srcSt.IsDir() {
return fmt.Errorf("Can't copy a directory")
}
// Clean up the trailing /
if dst[len(dst)-1] == '/' {
dst = path.Join(dst, filepath.Base(src))
}
// Create the holding directory if necessary
if err := os.MkdirAll(filepath.Dir(dst), 0700); err != nil && !os.IsExist(err) {
return err
}
r, w := io.Pipe()
errC := utils.Go(func() error {
defer w.Close()
srcF, err := os.Open(src)
if err != nil {
return err
}
defer srcF.Close()
tw := tar.NewWriter(w)
hdr, err := tar.FileInfoHeader(srcSt, "")
if err != nil {
return err
}
hdr.Name = filepath.Base(dst)
if err := tw.WriteHeader(hdr); err != nil {
return err
}
if _, err := io.Copy(tw, srcF); err != nil {
return err
}
tw.Close()
return nil
})
defer func() {
if er := <-errC; err != nil {
err = er
}
}()
return Untar(r, filepath.Dir(dst), nil)
}
// CmdStream executes a command, and returns its stdout as a stream.
// If the command fails to run or doesn't complete successfully, an error
// will be returned, including anything written on stderr.
func CmdStream(cmd *exec.Cmd, input io.Reader) (io.ReadCloser, error) {
if input != nil {
stdin, err := cmd.StdinPipe()
if err != nil {
return nil, err
}
// Write stdin if any
go func() {
io.Copy(stdin, input)
stdin.Close()
}()
}
stdout, err := cmd.StdoutPipe()
if err != nil {
return nil, err
}
stderr, err := cmd.StderrPipe()
if err != nil {
return nil, err
}
pipeR, pipeW := io.Pipe()
errChan := make(chan []byte)
// Collect stderr, we will use it in case of an error
go func() {
errText, e := ioutil.ReadAll(stderr)
if e != nil {
errText = []byte("(...couldn't fetch stderr: " + e.Error() + ")")
}
errChan <- errText
}()
// Copy stdout to the returned pipe
go func() {
_, err := io.Copy(pipeW, stdout)
if err != nil {
pipeW.CloseWithError(err)
}
errText := <-errChan
if err := cmd.Wait(); err != nil {
pipeW.CloseWithError(fmt.Errorf("%s: %s", err, errText))
} else {
pipeW.Close()
}
}()
// Run the command and return the pipe
if err := cmd.Start(); err != nil {
return nil, err
}
return pipeR, nil
}
// NewTempArchive reads the content of src into a temporary file, and returns the contents
// of that file as an archive. The archive can only be read once - as soon as reading completes,
// the file will be deleted.
func NewTempArchive(src Archive, dir string) (*TempArchive, error) {
f, err := ioutil.TempFile(dir, "")
if err != nil {
return nil, err
}
if _, err := io.Copy(f, src); err != nil {
return nil, err
}
if _, err := f.Seek(0, 0); err != nil {
return nil, err
}
st, err := f.Stat()
if err != nil {
return nil, err
}
size := st.Size()
return &TempArchive{f, size}, nil
}
type TempArchive struct {
*os.File
Size int64 // Pre-computed from Stat().Size() as a convenience
}
func (archive *TempArchive) Read(data []byte) (int, error) {
n, err := archive.File.Read(data)
if err != nil {
os.Remove(archive.File.Name())
}
return n, err
}

View File

@@ -1,7 +1,8 @@
package docker
package archive
import (
"bytes"
"code.google.com/p/go/src/pkg/archive/tar"
"fmt"
"io"
"io/ioutil"
@@ -14,9 +15,9 @@ import (
func TestCmdStreamLargeStderr(t *testing.T) {
cmd := exec.Command("/bin/sh", "-c", "dd if=/dev/zero bs=1k count=1000 of=/dev/stderr; echo hello")
out, err := CmdStream(cmd)
out, err := CmdStream(cmd, nil)
if err != nil {
t.Fatalf("Failed to start command: " + err.Error())
t.Fatalf("Failed to start command: %s", err)
}
errCh := make(chan error)
go func() {
@@ -26,7 +27,7 @@ func TestCmdStreamLargeStderr(t *testing.T) {
select {
case err := <-errCh:
if err != nil {
t.Fatalf("Command should not have failed (err=%s...)", err.Error()[:100])
t.Fatalf("Command should not have failed (err=%.100s...)", err)
}
case <-time.After(5 * time.Second):
t.Fatalf("Command did not complete in 5 seconds; probable deadlock")
@@ -35,14 +36,14 @@ func TestCmdStreamLargeStderr(t *testing.T) {
func TestCmdStreamBad(t *testing.T) {
badCmd := exec.Command("/bin/sh", "-c", "echo hello; echo >&2 error couldn\\'t reverse the phase pulser; exit 1")
out, err := CmdStream(badCmd)
out, err := CmdStream(badCmd, nil)
if err != nil {
t.Fatalf("Failed to start command: " + err.Error())
t.Fatalf("Failed to start command: %s", err)
}
if output, err := ioutil.ReadAll(out); err == nil {
t.Fatalf("Command should have failed")
} else if err.Error() != "exit status 1: error couldn't reverse the phase pulser\n" {
t.Fatalf("Wrong error value (%s)", err.Error())
t.Fatalf("Wrong error value (%s)", err)
} else if s := string(output); s != "hello\n" {
t.Fatalf("Command output should be '%s', not '%s'", "hello\\n", output)
}
@@ -50,7 +51,7 @@ func TestCmdStreamBad(t *testing.T) {
func TestCmdStreamGood(t *testing.T) {
cmd := exec.Command("/bin/sh", "-c", "echo hello; exit 0")
out, err := CmdStream(cmd)
out, err := CmdStream(cmd, nil)
if err != nil {
t.Fatal(err)
}
@@ -66,12 +67,13 @@ func tarUntar(t *testing.T, origin string, compression Compression) error {
if err != nil {
t.Fatal(err)
}
defer archive.Close()
buf := make([]byte, 10)
if _, err := archive.Read(buf); err != nil {
return err
}
archive = io.MultiReader(bytes.NewReader(buf), archive)
wrap := io.MultiReader(bytes.NewReader(buf), archive)
detectedCompression := DetectCompression(buf)
if detectedCompression.Extension() != compression.Extension() {
@@ -83,12 +85,22 @@ func tarUntar(t *testing.T, origin string, compression Compression) error {
return err
}
defer os.RemoveAll(tmp)
if err := Untar(archive, tmp); err != nil {
if err := Untar(wrap, tmp, nil); err != nil {
return err
}
if _, err := os.Stat(tmp); err != nil {
return 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
}
@@ -108,11 +120,20 @@ func TestTarUntar(t *testing.T) {
for _, c := range []Compression{
Uncompressed,
Gzip,
Bzip2,
Xz,
} {
if err := tarUntar(t, origin, c); err != nil {
t.Fatalf("Error tar/untar for compression %s: %s", c.Extension(), err)
}
}
}
// Some tar archives such as http://haproxy.1wt.eu/download/1.5/src/devel/haproxy-1.5-dev21.tar.gz
// use PAX Global Extended Headers.
// Failing prevents the archives from being uncompressed during ADD
func TestTypeXGlobalHeaderDoesNotFail(t *testing.T) {
hdr := tar.Header{Typeflag: tar.TypeXGlobalHeader}
err := createTarFile("pax_global_header", "some_dir", &hdr, nil)
if err != nil {
t.Fatal(err)
}
}

363
archive/changes.go Normal file
View File

@@ -0,0 +1,363 @@
package archive
import (
"code.google.com/p/go/src/pkg/archive/tar"
"fmt"
"github.com/dotcloud/docker/utils"
"io"
"os"
"path/filepath"
"strings"
"syscall"
"time"
)
type ChangeType int
const (
ChangeModify = iota
ChangeAdd
ChangeDelete
)
type Change struct {
Path string
Kind ChangeType
}
func (change *Change) String() string {
var kind string
switch change.Kind {
case ChangeModify:
kind = "C"
case ChangeAdd:
kind = "A"
case ChangeDelete:
kind = "D"
}
return fmt.Sprintf("%s %s", kind, change.Path)
}
// Gnu tar and the go tar writer don't have sub-second mtime
// precision, which is problematic when we apply changes via tar
// files, we handle this by comparing for exact times, *or* same
// second count and either a or b having exactly 0 nanoseconds
func sameFsTime(a, b time.Time) bool {
return a == b ||
(a.Unix() == b.Unix() &&
(a.Nanosecond() == 0 || b.Nanosecond() == 0))
}
func sameFsTimeSpec(a, b syscall.Timespec) bool {
return a.Sec == b.Sec &&
(a.Nsec == b.Nsec || a.Nsec == 0 || b.Nsec == 0)
}
func Changes(layers []string, rw string) ([]Change, error) {
var changes []Change
err := filepath.Walk(rw, func(path string, f os.FileInfo, err error) error {
if err != nil {
return err
}
// Rebase path
path, err = filepath.Rel(rw, path)
if err != nil {
return err
}
path = filepath.Join("/", path)
// Skip root
if path == "/" {
return nil
}
// Skip AUFS metadata
if matched, err := filepath.Match("/.wh..wh.*", path); err != nil || matched {
return err
}
change := Change{
Path: path,
}
// Find out what kind of modification happened
file := filepath.Base(path)
// If there is a whiteout, then the file was removed
if strings.HasPrefix(file, ".wh.") {
originalFile := file[len(".wh."):]
change.Path = filepath.Join(filepath.Dir(path), originalFile)
change.Kind = ChangeDelete
} else {
// Otherwise, the file was added
change.Kind = ChangeAdd
// ...Unless it already existed in a top layer, in which case, it's a modification
for _, layer := range layers {
stat, err := os.Stat(filepath.Join(layer, path))
if err != nil && !os.IsNotExist(err) {
return err
}
if err == nil {
// The file existed in the top layer, so that's a modification
// However, if it's a directory, maybe it wasn't actually modified.
// If you modify /foo/bar/baz, then /foo will be part of the changed files only because it's the parent of bar
if stat.IsDir() && f.IsDir() {
if f.Size() == stat.Size() && f.Mode() == stat.Mode() && sameFsTime(f.ModTime(), stat.ModTime()) {
// Both directories are the same, don't record the change
return nil
}
}
change.Kind = ChangeModify
break
}
}
}
// Record change
changes = append(changes, change)
return nil
})
if err != nil && !os.IsNotExist(err) {
return nil, err
}
return changes, nil
}
type FileInfo struct {
parent *FileInfo
name string
stat syscall.Stat_t
children map[string]*FileInfo
}
func (root *FileInfo) LookUp(path string) *FileInfo {
parent := root
if path == "/" {
return root
}
pathElements := strings.Split(path, "/")
for _, elem := range pathElements {
if elem != "" {
child := parent.children[elem]
if child == nil {
return nil
}
parent = child
}
}
return parent
}
func (info *FileInfo) path() string {
if info.parent == nil {
return "/"
}
return filepath.Join(info.parent.path(), info.name)
}
func (info *FileInfo) isDir() bool {
return info.parent == nil || info.stat.Mode&syscall.S_IFDIR == syscall.S_IFDIR
}
func (info *FileInfo) addChanges(oldInfo *FileInfo, changes *[]Change) {
if oldInfo == nil {
// add
change := Change{
Path: info.path(),
Kind: ChangeAdd,
}
*changes = append(*changes, change)
}
// We make a copy so we can modify it to detect additions
// also, we only recurse on the old dir if the new info is a directory
// otherwise any previous delete/change is considered recursive
oldChildren := make(map[string]*FileInfo)
if oldInfo != nil && info.isDir() {
for k, v := range oldInfo.children {
oldChildren[k] = v
}
}
for name, newChild := range info.children {
oldChild, _ := oldChildren[name]
if oldChild != nil {
// change?
oldStat := &oldChild.stat
newStat := &newChild.stat
// Note: We can't compare inode or ctime or blocksize here, because these change
// when copying a file into a container. However, that is not generally a problem
// because any content change will change mtime, and any status change should
// be visible when actually comparing the stat fields. The only time this
// breaks down is if some code intentionally hides a change by setting
// back mtime
if oldStat.Mode != newStat.Mode ||
oldStat.Uid != newStat.Uid ||
oldStat.Gid != newStat.Gid ||
oldStat.Rdev != newStat.Rdev ||
// Don't look at size for dirs, its not a good measure of change
(oldStat.Size != newStat.Size && oldStat.Mode&syscall.S_IFDIR != syscall.S_IFDIR) ||
!sameFsTimeSpec(getLastModification(oldStat), getLastModification(newStat)) {
change := Change{
Path: newChild.path(),
Kind: ChangeModify,
}
*changes = append(*changes, change)
}
// Remove from copy so we can detect deletions
delete(oldChildren, name)
}
newChild.addChanges(oldChild, changes)
}
for _, oldChild := range oldChildren {
// delete
change := Change{
Path: oldChild.path(),
Kind: ChangeDelete,
}
*changes = append(*changes, change)
}
}
func (info *FileInfo) Changes(oldInfo *FileInfo) []Change {
var changes []Change
info.addChanges(oldInfo, &changes)
return changes
}
func newRootFileInfo() *FileInfo {
root := &FileInfo{
name: "/",
children: make(map[string]*FileInfo),
}
return root
}
func collectFileInfo(sourceDir string) (*FileInfo, error) {
root := newRootFileInfo()
err := filepath.Walk(sourceDir, func(path string, f os.FileInfo, err error) error {
if err != nil {
return err
}
// Rebase path
relPath, err := filepath.Rel(sourceDir, path)
if err != nil {
return err
}
relPath = filepath.Join("/", relPath)
if relPath == "/" {
return nil
}
parent := root.LookUp(filepath.Dir(relPath))
if parent == nil {
return fmt.Errorf("collectFileInfo: Unexpectedly no parent for %s", relPath)
}
info := &FileInfo{
name: filepath.Base(relPath),
children: make(map[string]*FileInfo),
parent: parent,
}
if err := syscall.Lstat(path, &info.stat); err != nil {
return err
}
parent.children[info.name] = info
return nil
})
if err != nil {
return nil, err
}
return root, nil
}
// Compare two directories and generate an array of Change objects describing the changes
func ChangesDirs(newDir, oldDir string) ([]Change, error) {
oldRoot, err := collectFileInfo(oldDir)
if err != nil {
return nil, err
}
newRoot, err := collectFileInfo(newDir)
if err != nil {
return nil, err
}
return newRoot.Changes(oldRoot), nil
}
func ChangesSize(newDir string, changes []Change) int64 {
var size int64
for _, change := range changes {
if change.Kind == ChangeModify || change.Kind == ChangeAdd {
file := filepath.Join(newDir, change.Path)
fileInfo, _ := os.Lstat(file)
if fileInfo != nil && !fileInfo.IsDir() {
size += fileInfo.Size()
}
}
}
return size
}
func major(device uint64) uint64 {
return (device >> 8) & 0xfff
}
func minor(device uint64) uint64 {
return (device & 0xff) | ((device >> 12) & 0xfff00)
}
func ExportChanges(dir string, changes []Change) (Archive, error) {
reader, writer := io.Pipe()
tw := tar.NewWriter(writer)
go func() {
// In general we log errors here but ignore them because
// during e.g. a diff operation the container can continue
// mutating the filesystem and we can see transient errors
// from this
for _, change := range changes {
if change.Kind == ChangeDelete {
whiteOutDir := filepath.Dir(change.Path)
whiteOutBase := filepath.Base(change.Path)
whiteOut := filepath.Join(whiteOutDir, ".wh."+whiteOutBase)
hdr := &tar.Header{
Name: whiteOut[1:],
Size: 0,
ModTime: time.Now(),
AccessTime: time.Now(),
ChangeTime: time.Now(),
}
if err := tw.WriteHeader(hdr); err != nil {
utils.Debugf("Can't write whiteout header: %s\n", err)
}
} else {
path := filepath.Join(dir, change.Path)
if err := addTarFile(path, change.Path[1:], tw); err != nil {
utils.Debugf("Can't add file %s to tar: %s\n", path, err)
}
}
}
// Make sure to check the error on Close.
if err := tw.Close(); err != nil {
utils.Debugf("Can't close layer: %s\n", err)
}
writer.Close()
}()
return reader, nil
}

301
archive/changes_test.go Normal file
View File

@@ -0,0 +1,301 @@
package archive
import (
"io/ioutil"
"os"
"os/exec"
"path"
"sort"
"testing"
"time"
)
func max(x, y int) int {
if x >= y {
return x
}
return y
}
func copyDir(src, dst string) error {
cmd := exec.Command("cp", "-a", src, dst)
if err := cmd.Run(); err != nil {
return err
}
return nil
}
// Helper to sort []Change by path
type byPath struct{ changes []Change }
func (b byPath) Less(i, j int) bool { return b.changes[i].Path < b.changes[j].Path }
func (b byPath) Len() int { return len(b.changes) }
func (b byPath) Swap(i, j int) { b.changes[i], b.changes[j] = b.changes[j], b.changes[i] }
type FileType uint32
const (
Regular FileType = iota
Dir
Symlink
)
type FileData struct {
filetype FileType
path string
contents string
permissions os.FileMode
}
func createSampleDir(t *testing.T, root string) {
files := []FileData{
{Regular, "file1", "file1\n", 0600},
{Regular, "file2", "file2\n", 0666},
{Regular, "file3", "file3\n", 0404},
{Regular, "file4", "file4\n", 0600},
{Regular, "file5", "file5\n", 0600},
{Regular, "file6", "file6\n", 0600},
{Regular, "file7", "file7\n", 0600},
{Dir, "dir1", "", 0740},
{Regular, "dir1/file1-1", "file1-1\n", 01444},
{Regular, "dir1/file1-2", "file1-2\n", 0666},
{Dir, "dir2", "", 0700},
{Regular, "dir2/file2-1", "file2-1\n", 0666},
{Regular, "dir2/file2-2", "file2-2\n", 0666},
{Dir, "dir3", "", 0700},
{Regular, "dir3/file3-1", "file3-1\n", 0666},
{Regular, "dir3/file3-2", "file3-2\n", 0666},
{Dir, "dir4", "", 0700},
{Regular, "dir4/file3-1", "file4-1\n", 0666},
{Regular, "dir4/file3-2", "file4-2\n", 0666},
{Symlink, "symlink1", "target1", 0666},
{Symlink, "symlink2", "target2", 0666},
}
now := time.Now()
for _, info := range files {
p := path.Join(root, info.path)
if info.filetype == Dir {
if err := os.MkdirAll(p, info.permissions); err != nil {
t.Fatal(err)
}
} else if info.filetype == Regular {
if err := ioutil.WriteFile(p, []byte(info.contents), info.permissions); err != nil {
t.Fatal(err)
}
} else if info.filetype == Symlink {
if err := os.Symlink(info.contents, p); err != nil {
t.Fatal(err)
}
}
if info.filetype != Symlink {
// Set a consistent ctime, atime for all files and dirs
if err := os.Chtimes(p, now, now); err != nil {
t.Fatal(err)
}
}
}
}
// Create an directory, copy it, make sure we report no changes between the two
func TestChangesDirsEmpty(t *testing.T) {
src, err := ioutil.TempDir("", "docker-changes-test")
if err != nil {
t.Fatal(err)
}
createSampleDir(t, src)
dst := src + "-copy"
if err := copyDir(src, dst); err != nil {
t.Fatal(err)
}
changes, err := ChangesDirs(dst, src)
if err != nil {
t.Fatal(err)
}
if len(changes) != 0 {
t.Fatalf("Reported changes for identical dirs: %v", changes)
}
os.RemoveAll(src)
os.RemoveAll(dst)
}
func mutateSampleDir(t *testing.T, root string) {
// Remove a regular file
if err := os.RemoveAll(path.Join(root, "file1")); err != nil {
t.Fatal(err)
}
// Remove a directory
if err := os.RemoveAll(path.Join(root, "dir1")); err != nil {
t.Fatal(err)
}
// Remove a symlink
if err := os.RemoveAll(path.Join(root, "symlink1")); err != nil {
t.Fatal(err)
}
// Rewrite a file
if err := ioutil.WriteFile(path.Join(root, "file2"), []byte("fileN\n"), 0777); err != nil {
t.Fatal(err)
}
// Replace a file
if err := os.RemoveAll(path.Join(root, "file3")); err != nil {
t.Fatal(err)
}
if err := ioutil.WriteFile(path.Join(root, "file3"), []byte("fileM\n"), 0404); err != nil {
t.Fatal(err)
}
// Touch file
if err := os.Chtimes(path.Join(root, "file4"), time.Now(), time.Now()); err != nil {
t.Fatal(err)
}
// Replace file with dir
if err := os.RemoveAll(path.Join(root, "file5")); err != nil {
t.Fatal(err)
}
if err := os.MkdirAll(path.Join(root, "file5"), 0666); err != nil {
t.Fatal(err)
}
// Create new file
if err := ioutil.WriteFile(path.Join(root, "filenew"), []byte("filenew\n"), 0777); err != nil {
t.Fatal(err)
}
// Create new dir
if err := os.MkdirAll(path.Join(root, "dirnew"), 0766); err != nil {
t.Fatal(err)
}
// Create a new symlink
if err := os.Symlink("targetnew", path.Join(root, "symlinknew")); err != nil {
t.Fatal(err)
}
// Change a symlink
if err := os.RemoveAll(path.Join(root, "symlink2")); err != nil {
t.Fatal(err)
}
if err := os.Symlink("target2change", path.Join(root, "symlink2")); err != nil {
t.Fatal(err)
}
// Replace dir with file
if err := os.RemoveAll(path.Join(root, "dir2")); err != nil {
t.Fatal(err)
}
if err := ioutil.WriteFile(path.Join(root, "dir2"), []byte("dir2\n"), 0777); err != nil {
t.Fatal(err)
}
// Touch dir
if err := os.Chtimes(path.Join(root, "dir3"), time.Now(), time.Now()); err != nil {
t.Fatal(err)
}
}
func TestChangesDirsMutated(t *testing.T) {
src, err := ioutil.TempDir("", "docker-changes-test")
if err != nil {
t.Fatal(err)
}
createSampleDir(t, src)
dst := src + "-copy"
if err := copyDir(src, dst); err != nil {
t.Fatal(err)
}
defer os.RemoveAll(src)
defer os.RemoveAll(dst)
mutateSampleDir(t, dst)
changes, err := ChangesDirs(dst, src)
if err != nil {
t.Fatal(err)
}
sort.Sort(byPath{changes})
expectedChanges := []Change{
{"/dir1", ChangeDelete},
{"/dir2", ChangeModify},
{"/dir3", ChangeModify},
{"/dirnew", ChangeAdd},
{"/file1", ChangeDelete},
{"/file2", ChangeModify},
{"/file3", ChangeModify},
{"/file4", ChangeModify},
{"/file5", ChangeModify},
{"/filenew", ChangeAdd},
{"/symlink1", ChangeDelete},
{"/symlink2", ChangeModify},
{"/symlinknew", ChangeAdd},
}
for i := 0; i < max(len(changes), len(expectedChanges)); i++ {
if i >= len(expectedChanges) {
t.Fatalf("unexpected change %s\n", changes[i].String())
}
if i >= len(changes) {
t.Fatalf("no change for expected change %s\n", expectedChanges[i].String())
}
if changes[i].Path == expectedChanges[i].Path {
if changes[i] != expectedChanges[i] {
t.Fatalf("Wrong change for %s, expected %s, got %s\n", changes[i].Path, changes[i].String(), expectedChanges[i].String())
}
} else if changes[i].Path < expectedChanges[i].Path {
t.Fatalf("unexpected change %s\n", changes[i].String())
} else {
t.Fatalf("no change for expected change %s != %s\n", expectedChanges[i].String(), changes[i].String())
}
}
}
func TestApplyLayer(t *testing.T) {
src, err := ioutil.TempDir("", "docker-changes-test")
if err != nil {
t.Fatal(err)
}
createSampleDir(t, src)
defer os.RemoveAll(src)
dst := src + "-copy"
if err := copyDir(src, dst); err != nil {
t.Fatal(err)
}
mutateSampleDir(t, dst)
defer os.RemoveAll(dst)
changes, err := ChangesDirs(dst, src)
if err != nil {
t.Fatal(err)
}
layer, err := ExportChanges(dst, changes)
if err != nil {
t.Fatal(err)
}
layerCopy, err := NewTempArchive(layer, "")
if err != nil {
t.Fatal(err)
}
if err := ApplyLayer(src, layerCopy); err != nil {
t.Fatal(err)
}
changes2, err := ChangesDirs(src, dst)
if err != nil {
t.Fatal(err)
}
if len(changes2) != 0 {
t.Fatalf("Unexpected differences after reapplying mutation: %v", changes2)
}
}

160
archive/diff.go Normal file
View File

@@ -0,0 +1,160 @@
package archive
import (
"code.google.com/p/go/src/pkg/archive/tar"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"syscall"
"time"
)
// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes.
// They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major,
// then the top 12 bits of the minor
func mkdev(major int64, minor int64) uint32 {
return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff))
}
func timeToTimespec(time time.Time) (ts syscall.Timespec) {
if time.IsZero() {
// Return UTIME_OMIT special value
ts.Sec = 0
ts.Nsec = ((1 << 30) - 2)
return
}
return syscall.NsecToTimespec(time.UnixNano())
}
// ApplyLayer parses a diff in the standard layer format from `layer`, and
// applies it to the directory `dest`.
func ApplyLayer(dest string, layer ArchiveReader) error {
// We need to be able to set any perms
oldmask := syscall.Umask(0)
defer syscall.Umask(oldmask)
layer, err := DecompressStream(layer)
if err != nil {
return err
}
tr := tar.NewReader(layer)
var dirs []*tar.Header
aufsTempdir := ""
aufsHardlinks := make(map[string]*tar.Header)
// Iterate through the files in the archive.
for {
hdr, err := tr.Next()
if err == io.EOF {
// end of tar archive
break
}
if err != nil {
return err
}
// Normalize name, for safety and for a simple is-root check
hdr.Name = filepath.Clean(hdr.Name)
if !strings.HasSuffix(hdr.Name, "/") {
// Not the root directory, ensure that the parent directory exists.
// This happened in some tests where an image had a tarfile without any
// parent directories.
parent := filepath.Dir(hdr.Name)
parentPath := filepath.Join(dest, parent)
if _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) {
err = os.MkdirAll(parentPath, 600)
if err != nil {
return err
}
}
}
// Skip AUFS metadata dirs
if strings.HasPrefix(hdr.Name, ".wh..wh.") {
// Regular files inside /.wh..wh.plnk can be used as hardlink targets
// We don't want this directory, but we need the files in them so that
// such hardlinks can be resolved.
if strings.HasPrefix(hdr.Name, ".wh..wh.plnk") && hdr.Typeflag == tar.TypeReg {
basename := filepath.Base(hdr.Name)
aufsHardlinks[basename] = hdr
if aufsTempdir == "" {
if aufsTempdir, err = ioutil.TempDir("", "dockerplnk"); err != nil {
return err
}
defer os.RemoveAll(aufsTempdir)
}
if err := createTarFile(filepath.Join(aufsTempdir, basename), dest, hdr, tr); err != nil {
return err
}
}
continue
}
path := filepath.Join(dest, hdr.Name)
base := filepath.Base(path)
if strings.HasPrefix(base, ".wh.") {
originalBase := base[len(".wh."):]
originalPath := filepath.Join(filepath.Dir(path), originalBase)
if err := os.RemoveAll(originalPath); err != nil {
return err
}
} else {
// If path exits we almost always just want to remove and replace it.
// The only exception is when it is a directory *and* the file from
// the layer is also a directory. Then we want to merge them (i.e.
// just apply the metadata from the layer).
if fi, err := os.Lstat(path); err == nil {
if !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) {
if err := os.RemoveAll(path); err != nil {
return err
}
}
}
srcData := io.Reader(tr)
srcHdr := hdr
// Hard links into /.wh..wh.plnk don't work, as we don't extract that directory, so
// we manually retarget these into the temporary files we extracted them into
if hdr.Typeflag == tar.TypeLink && strings.HasPrefix(filepath.Clean(hdr.Linkname), ".wh..wh.plnk") {
linkBasename := filepath.Base(hdr.Linkname)
srcHdr = aufsHardlinks[linkBasename]
if srcHdr == nil {
return fmt.Errorf("Invalid aufs hardlink")
}
tmpFile, err := os.Open(filepath.Join(aufsTempdir, linkBasename))
if err != nil {
return err
}
defer tmpFile.Close()
srcData = tmpFile
}
if err := createTarFile(path, dest, srcHdr, srcData); err != nil {
return err
}
// Directory mtimes must be handled at the end to avoid further
// file creation in them to modify the directory mtime
if hdr.Typeflag == tar.TypeDir {
dirs = append(dirs, hdr)
}
}
}
for _, hdr := range dirs {
path := filepath.Join(dest, hdr.Name)
ts := []syscall.Timespec{timeToTimespec(hdr.AccessTime), timeToTimespec(hdr.ModTime)}
if err := syscall.UtimesNano(path, ts); err != nil {
return err
}
}
return nil
}

39
archive/stat_linux.go Normal file
View File

@@ -0,0 +1,39 @@
package archive
import (
"syscall"
"unsafe"
)
func getLastAccess(stat *syscall.Stat_t) syscall.Timespec {
return stat.Atim
}
func getLastModification(stat *syscall.Stat_t) syscall.Timespec {
return stat.Mtim
}
func LUtimesNano(path string, ts []syscall.Timespec) error {
// These are not currently available in syscall
AT_FDCWD := -100
AT_SYMLINK_NOFOLLOW := 0x100
var _path *byte
_path, err := syscall.BytePtrFromString(path)
if err != nil {
return err
}
if _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(AT_FDCWD), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(AT_SYMLINK_NOFOLLOW), 0, 0); err != 0 && err != syscall.ENOSYS {
return err
}
return nil
}
func UtimesNano(path string, ts []syscall.Timespec) error {
if err := syscall.UtimesNano(path, ts); err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,21 @@
// +build !linux
package archive
import "syscall"
func getLastAccess(stat *syscall.Stat_t) syscall.Timespec {
return stat.Atimespec
}
func getLastModification(stat *syscall.Stat_t) syscall.Timespec {
return stat.Mtimespec
}
func LUtimesNano(path string, ts []syscall.Timespec) error {
return ErrNotImplemented
}
func UtimesNano(path string, ts []syscall.Timespec) error {
return ErrNotImplemented
}

59
archive/wrap.go Normal file
View File

@@ -0,0 +1,59 @@
package archive
import (
"bytes"
"code.google.com/p/go/src/pkg/archive/tar"
"io/ioutil"
)
// Generate generates a new archive from the content provided
// as input.
//
// `files` is a sequence of path/content pairs. A new file is
// added to the archive for each pair.
// If the last pair is incomplete, the file is created with an
// empty content. For example:
//
// Generate("foo.txt", "hello world", "emptyfile")
//
// The above call will return an archive with 2 files:
// * ./foo.txt with content "hello world"
// * ./empty with empty content
//
// FIXME: stream content instead of buffering
// FIXME: specify permissions and other archive metadata
func Generate(input ...string) (Archive, error) {
files := parseStringPairs(input...)
buf := new(bytes.Buffer)
tw := tar.NewWriter(buf)
for _, file := range files {
name, content := file[0], file[1]
hdr := &tar.Header{
Name: name,
Size: int64(len(content)),
}
if err := tw.WriteHeader(hdr); err != nil {
return nil, err
}
if _, err := tw.Write([]byte(content)); err != nil {
return nil, err
}
}
if err := tw.Close(); err != nil {
return nil, err
}
return ioutil.NopCloser(buf), nil
}
func parseStringPairs(input ...string) (output [][2]string) {
output = make([][2]string, 0, len(input)/2+1)
for i := 0; i < len(input); i += 2 {
var pair [2]string
pair[0] = input[i]
if i+1 < len(input) {
pair[1] = input[i+1]
}
output = append(output, pair)
}
return
}

View File

@@ -1 +0,0 @@
../registry/MAINTAINERS

3
auth/MAINTAINERS Normal file
View File

@@ -0,0 +1,3 @@
Sam Alba <sam@dotcloud.com> (@samalba)
Joffrey Fuhrer <joffrey@dotcloud.com> (@shin-)
Ken Cochrane <ken@dotcloud.com> (@kencochrane)

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/dotcloud/docker/utils"
"io/ioutil"
"net/http"
"os"
@@ -15,35 +16,29 @@ import (
// Where we store the config file
const CONFIGFILE = ".dockercfg"
// the registry server we want to login against
const INDEXSERVER = "https://index.docker.io/v1"
// Only used for user auth + account creation
const INDEXSERVER = "https://index.docker.io/v1/"
//const INDEXSERVER = "http://indexstaging-docker.dotcloud.com/"
//const INDEXSERVER = "https://indexstaging-docker.dotcloud.com/v1/"
var (
ErrConfigFileMissing = errors.New("The Auth config file is missing")
)
type AuthConfig struct {
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Auth string `json:"auth"`
Email string `json:"email"`
ServerAddress string `json:"serveraddress,omitempty"`
}
type ConfigFile struct {
Configs map[string]AuthConfig `json:"configs,omitempty"`
rootPath string
}
func NewAuthConfig(username, password, email, rootPath string) *AuthConfig {
return &AuthConfig{
Username: username,
Password: password,
Email: email,
rootPath: rootPath,
}
}
func IndexServerAddress() string {
if os.Getenv("DOCKER_INDEX_URL") != "" {
return os.Getenv("DOCKER_INDEX_URL") + "/v1"
}
return INDEXSERVER
}
@@ -57,61 +52,97 @@ func encodeAuth(authConfig *AuthConfig) string {
}
// decode the auth string
func decodeAuth(authStr string) (*AuthConfig, error) {
func decodeAuth(authStr string) (string, string, error) {
decLen := base64.StdEncoding.DecodedLen(len(authStr))
decoded := make([]byte, decLen)
authByte := []byte(authStr)
n, err := base64.StdEncoding.Decode(decoded, authByte)
if err != nil {
return nil, err
return "", "", err
}
if n > decLen {
return nil, fmt.Errorf("Something went wrong decoding auth config")
return "", "", fmt.Errorf("Something went wrong decoding auth config")
}
arr := strings.Split(string(decoded), ":")
arr := strings.SplitN(string(decoded), ":", 2)
if len(arr) != 2 {
return nil, fmt.Errorf("Invalid auth configuration file")
return "", "", fmt.Errorf("Invalid auth configuration file")
}
password := strings.Trim(arr[1], "\x00")
return &AuthConfig{Username: arr[0], Password: password}, nil
return arr[0], password, nil
}
// load up the auth config information and return values
// FIXME: use the internal golang config parser
func LoadConfig(rootPath string) (*AuthConfig, error) {
func LoadConfig(rootPath string) (*ConfigFile, error) {
configFile := ConfigFile{Configs: make(map[string]AuthConfig), rootPath: rootPath}
confFile := path.Join(rootPath, CONFIGFILE)
if _, err := os.Stat(confFile); err != nil {
return &AuthConfig{rootPath: rootPath}, ErrConfigFileMissing
return &configFile, nil //missing file is not an error
}
b, err := ioutil.ReadFile(confFile)
if err != nil {
return nil, err
return &configFile, err
}
arr := strings.Split(string(b), "\n")
if len(arr) < 2 {
return nil, fmt.Errorf("The Auth config file is empty")
if err := json.Unmarshal(b, &configFile.Configs); err != nil {
arr := strings.Split(string(b), "\n")
if len(arr) < 2 {
return &configFile, fmt.Errorf("The Auth config file is empty")
}
authConfig := AuthConfig{}
origAuth := strings.Split(arr[0], " = ")
if len(origAuth) != 2 {
return &configFile, fmt.Errorf("Invalid Auth config file")
}
authConfig.Username, authConfig.Password, err = decodeAuth(origAuth[1])
if err != nil {
return &configFile, err
}
origEmail := strings.Split(arr[1], " = ")
if len(origEmail) != 2 {
return &configFile, fmt.Errorf("Invalid Auth config file")
}
authConfig.Email = origEmail[1]
authConfig.ServerAddress = IndexServerAddress()
configFile.Configs[IndexServerAddress()] = authConfig
} else {
for k, authConfig := range configFile.Configs {
authConfig.Username, authConfig.Password, err = decodeAuth(authConfig.Auth)
if err != nil {
return &configFile, err
}
authConfig.Auth = ""
configFile.Configs[k] = authConfig
authConfig.ServerAddress = k
}
}
origAuth := strings.Split(arr[0], " = ")
origEmail := strings.Split(arr[1], " = ")
authConfig, err := decodeAuth(origAuth[1])
if err != nil {
return nil, err
}
authConfig.Email = origEmail[1]
authConfig.rootPath = rootPath
return authConfig, nil
return &configFile, nil
}
// save the auth config
func SaveConfig(authConfig *AuthConfig) error {
confFile := path.Join(authConfig.rootPath, CONFIGFILE)
if len(authConfig.Email) == 0 {
func SaveConfig(configFile *ConfigFile) error {
confFile := path.Join(configFile.rootPath, CONFIGFILE)
if len(configFile.Configs) == 0 {
os.Remove(confFile)
return nil
}
lines := "auth = " + encodeAuth(authConfig) + "\n" + "email = " + authConfig.Email + "\n"
b := []byte(lines)
err := ioutil.WriteFile(confFile, b, 0600)
configs := make(map[string]AuthConfig, len(configFile.Configs))
for k, authConfig := range configFile.Configs {
authCopy := authConfig
authCopy.Auth = encodeAuth(&authCopy)
authCopy.Username = ""
authCopy.Password = ""
authCopy.ServerAddress = ""
configs[k] = authCopy
}
b, err := json.Marshal(configs)
if err != nil {
return err
}
err = ioutil.WriteFile(confFile, b, 0600)
if err != nil {
return err
}
@@ -119,20 +150,34 @@ func SaveConfig(authConfig *AuthConfig) error {
}
// try to register/login to the registry server
func Login(authConfig *AuthConfig, store bool) (string, error) {
storeConfig := false
client := &http.Client{}
reqStatusCode := 0
var status string
var reqBody []byte
jsonBody, err := json.Marshal(authConfig)
func Login(authConfig *AuthConfig, factory *utils.HTTPRequestFactory) (string, error) {
var (
status string
reqBody []byte
err error
client = &http.Client{}
reqStatusCode = 0
serverAddress = authConfig.ServerAddress
)
if serverAddress == "" {
serverAddress = IndexServerAddress()
}
loginAgainstOfficialIndex := serverAddress == IndexServerAddress()
// to avoid sending the server address to the server it should be removed before being marshalled
authCopy := *authConfig
authCopy.ServerAddress = ""
jsonBody, err := json.Marshal(authCopy)
if err != nil {
return "", fmt.Errorf("Config Error: %s", err)
}
// using `bytes.NewReader(jsonBody)` here causes the server to respond with a 411 status.
b := strings.NewReader(string(jsonBody))
req1, err := http.Post(IndexServerAddress()+"/users/", "application/json; charset=utf-8", b)
req1, err := http.Post(serverAddress+"users/", "application/json; charset=utf-8", b)
if err != nil {
return "", fmt.Errorf("Server Error: %s", err)
}
@@ -144,15 +189,15 @@ func Login(authConfig *AuthConfig, store bool) (string, error) {
}
if reqStatusCode == 201 {
status = "Account created. Please use the confirmation link we sent" +
" to your e-mail to activate it."
storeConfig = true
} else if reqStatusCode == 403 {
return "", fmt.Errorf("Login: Your account hasn't been activated. " +
"Please check your e-mail for a confirmation link.")
if loginAgainstOfficialIndex {
status = "Account created. Please use the confirmation link we sent" +
" to your e-mail to activate it."
} else {
status = "Account created. Please see the documentation of the registry " + serverAddress + " for instructions how to activate it."
}
} else if reqStatusCode == 400 {
if string(reqBody) == "\"Username or email already exists\"" {
req, err := http.NewRequest("GET", IndexServerAddress()+"/users/", nil)
req, err := factory.NewRequest("GET", serverAddress+"users/", nil)
req.SetBasicAuth(authConfig.Username, authConfig.Password)
resp, err := client.Do(req)
if err != nil {
@@ -165,29 +210,92 @@ func Login(authConfig *AuthConfig, store bool) (string, error) {
}
if resp.StatusCode == 200 {
status = "Login Succeeded"
storeConfig = true
} else if resp.StatusCode == 401 {
if store {
authConfig.Email = ""
if err := SaveConfig(authConfig); err != nil {
return "", err
}
}
return "", fmt.Errorf("Wrong login/password, please try again")
} else if resp.StatusCode == 403 {
if loginAgainstOfficialIndex {
return "", fmt.Errorf("Login: Account is not Active. Please check your e-mail for a confirmation link.")
}
return "", fmt.Errorf("Login: Account is not Active. Please see the documentation of the registry %s for instructions how to activate it.", serverAddress)
} else {
return "", fmt.Errorf("Login: %s (Code: %d; Headers: %s)", body,
resp.StatusCode, resp.Header)
return "", fmt.Errorf("Login: %s (Code: %d; Headers: %s)", body, resp.StatusCode, resp.Header)
}
} else {
return "", fmt.Errorf("Registration: %s", reqBody)
}
} else if reqStatusCode == 401 {
// This case would happen with private registries where /v1/users is
// protected, so people can use `docker login` as an auth check.
req, err := factory.NewRequest("GET", serverAddress+"users/", nil)
req.SetBasicAuth(authConfig.Username, authConfig.Password)
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
if resp.StatusCode == 200 {
status = "Login Succeeded"
} else if resp.StatusCode == 401 {
return "", fmt.Errorf("Wrong login/password, please try again")
} else {
return "", fmt.Errorf("Login: %s (Code: %d; Headers: %s)", body,
resp.StatusCode, resp.Header)
}
} else {
return "", fmt.Errorf("Unexpected status code [%d] : %s", reqStatusCode, reqBody)
}
if storeConfig && store {
if err := SaveConfig(authConfig); err != nil {
return "", err
}
}
return status, nil
}
// this method matches a auth configuration to a server address or a url
func (config *ConfigFile) ResolveAuthConfig(registry string) AuthConfig {
if registry == IndexServerAddress() || len(registry) == 0 {
// default to the index server
return config.Configs[IndexServerAddress()]
}
// if it's not the index server there are three cases:
//
// 1. a full config url -> it should be used as is
// 2. a full url, but with the wrong protocol
// 3. a hostname, with an optional port
//
// as there is only one auth entry which is fully qualified we need to start
// parsing and matching
swapProtocol := func(url string) string {
if strings.HasPrefix(url, "http:") {
return strings.Replace(url, "http:", "https:", 1)
}
if strings.HasPrefix(url, "https:") {
return strings.Replace(url, "https:", "http:", 1)
}
return url
}
resolveIgnoringProtocol := func(url string) AuthConfig {
if c, found := config.Configs[url]; found {
return c
}
registrySwappedProtocol := swapProtocol(url)
// now try to match with the different protocol
if c, found := config.Configs[registrySwappedProtocol]; found {
return c
}
return AuthConfig{}
}
// match both protocols as it could also be a server name like httpfoo
if strings.HasPrefix(registry, "http:") || strings.HasPrefix(registry, "https:") {
return resolveIgnoringProtocol(registry)
}
url := "https://" + registry
if !strings.Contains(registry, "/") {
url = url + "/v1/"
}
return resolveIgnoringProtocol(url)
}

View File

@@ -1,17 +1,17 @@
package auth
import (
"crypto/rand"
"encoding/hex"
"io/ioutil"
"os"
"strings"
"testing"
)
func TestEncodeAuth(t *testing.T) {
newAuthConfig := &AuthConfig{Username: "ken", Password: "test", Email: "test@example.com"}
authStr := encodeAuth(newAuthConfig)
decAuthConfig, err := decodeAuth(authStr)
decAuthConfig := &AuthConfig{}
var err error
decAuthConfig.Username, decAuthConfig.Password, err = decodeAuth(authStr)
if err != nil {
t.Fatal(err)
}
@@ -26,48 +26,117 @@ func TestEncodeAuth(t *testing.T) {
}
}
func TestLogin(t *testing.T) {
os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com")
defer os.Setenv("DOCKER_INDEX_URL", "")
authConfig := NewAuthConfig("unittester", "surlautrerivejetattendrai", "noise+unittester@dotcloud.com", "/tmp")
status, err := Login(authConfig, false)
func setupTempConfigFile() (*ConfigFile, error) {
root, err := ioutil.TempDir("", "docker-test-auth")
if err != nil {
return nil, err
}
configFile := &ConfigFile{
rootPath: root,
Configs: make(map[string]AuthConfig),
}
for _, registry := range []string{"testIndex", IndexServerAddress()} {
configFile.Configs[registry] = AuthConfig{
Username: "docker-user",
Password: "docker-pass",
Email: "docker@docker.io",
}
}
return configFile, nil
}
func TestSameAuthDataPostSave(t *testing.T) {
configFile, err := setupTempConfigFile()
if err != nil {
t.Fatal(err)
}
if status != "Login Succeeded" {
t.Fatalf("Expected status \"Login Succeeded\", found \"%s\" instead", status)
defer os.RemoveAll(configFile.rootPath)
err = SaveConfig(configFile)
if err != nil {
t.Fatal(err)
}
authConfig := configFile.Configs["testIndex"]
if authConfig.Username != "docker-user" {
t.Fail()
}
if authConfig.Password != "docker-pass" {
t.Fail()
}
if authConfig.Email != "docker@docker.io" {
t.Fail()
}
if authConfig.Auth != "" {
t.Fail()
}
}
func TestCreateAccount(t *testing.T) {
os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com")
defer os.Setenv("DOCKER_INDEX_URL", "")
tokenBuffer := make([]byte, 16)
_, err := rand.Read(tokenBuffer)
func TestResolveAuthConfigIndexServer(t *testing.T) {
configFile, err := setupTempConfigFile()
if err != nil {
t.Fatal(err)
}
token := hex.EncodeToString(tokenBuffer)[:12]
username := "ut" + token
authConfig := NewAuthConfig(username, "test42", "docker-ut+"+token+"@example.com", "/tmp")
status, err := Login(authConfig, false)
if err != nil {
t.Fatal(err)
}
expectedStatus := "Account created. Please use the confirmation link we sent" +
" to your e-mail to activate it."
if status != expectedStatus {
t.Fatalf("Expected status: \"%s\", found \"%s\" instead.", expectedStatus, status)
}
defer os.RemoveAll(configFile.rootPath)
status, err = Login(authConfig, false)
if err == nil {
t.Fatalf("Expected error but found nil instead")
}
expectedError := "Login: Account is not Active"
if !strings.Contains(err.Error(), expectedError) {
t.Fatalf("Expected message \"%s\" but found \"%s\" instead", expectedError, err.Error())
for _, registry := range []string{"", IndexServerAddress()} {
resolved := configFile.ResolveAuthConfig(registry)
if resolved != configFile.Configs[IndexServerAddress()] {
t.Fail()
}
}
}
func TestResolveAuthConfigFullURL(t *testing.T) {
configFile, err := setupTempConfigFile()
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(configFile.rootPath)
registryAuth := AuthConfig{
Username: "foo-user",
Password: "foo-pass",
Email: "foo@example.com",
}
localAuth := AuthConfig{
Username: "bar-user",
Password: "bar-pass",
Email: "bar@example.com",
}
configFile.Configs["https://registry.example.com/v1/"] = registryAuth
configFile.Configs["http://localhost:8000/v1/"] = localAuth
validRegistries := map[string][]string{
"https://registry.example.com/v1/": {
"https://registry.example.com/v1/",
"http://registry.example.com/v1/",
"registry.example.com",
"registry.example.com/v1/",
},
"http://localhost:8000/v1/": {
"https://localhost:8000/v1/",
"http://localhost:8000/v1/",
"localhost:8000",
"localhost:8000/v1/",
},
}
for configKey, registries := range validRegistries {
for _, registry := range registries {
var (
configured AuthConfig
ok bool
)
resolved := configFile.ResolveAuthConfig(registry)
if configured, ok = configFile.Configs[configKey]; !ok {
t.Fail()
}
if resolved.Email != configured.Email {
t.Errorf("%s -> %q != %q\n", registry, resolved.Email, configured.Email)
}
}
}
}

View File

@@ -1,132 +0,0 @@
package docker
import (
"fmt"
"github.com/dotcloud/docker/utils"
"os"
"path"
"time"
)
var defaultDns = []string{"8.8.8.8", "8.8.4.4"}
type Builder struct {
runtime *Runtime
repositories *TagStore
graph *Graph
config *Config
image *Image
}
func NewBuilder(runtime *Runtime) *Builder {
return &Builder{
runtime: runtime,
graph: runtime.graph,
repositories: runtime.repositories,
}
}
func (builder *Builder) Create(config *Config) (*Container, error) {
// Lookup image
img, err := builder.repositories.LookupImage(config.Image)
if err != nil {
return nil, err
}
if img.Config != nil {
MergeConfig(config, img.Config)
}
if config.Cmd == nil || len(config.Cmd) == 0 {
return nil, fmt.Errorf("No command specified")
}
// Generate id
id := GenerateID()
// Generate default hostname
// FIXME: the lxc template no longer needs to set a default hostname
if config.Hostname == "" {
config.Hostname = id[:12]
}
container := &Container{
// FIXME: we should generate the ID here instead of receiving it as an argument
ID: id,
Created: time.Now(),
Path: config.Cmd[0],
Args: config.Cmd[1:], //FIXME: de-duplicate from config
Config: config,
Image: img.ID, // Always use the resolved image id
NetworkSettings: &NetworkSettings{},
// FIXME: do we need to store this in the container?
SysInitPath: sysInitPath,
}
container.root = builder.runtime.containerRoot(container.ID)
// Step 1: create the container directory.
// This doubles as a barrier to avoid race conditions.
if err := os.Mkdir(container.root, 0700); err != nil {
return nil, err
}
if len(config.Dns) == 0 && len(builder.runtime.Dns) == 0 && utils.CheckLocalDns() {
//"WARNING: Docker detected local DNS server on resolv.conf. Using default external servers: %v", defaultDns
builder.runtime.Dns = defaultDns
}
// If custom dns exists, then create a resolv.conf for the container
if len(config.Dns) > 0 || len(builder.runtime.Dns) > 0 {
var dns []string
if len(config.Dns) > 0 {
dns = config.Dns
} else {
dns = builder.runtime.Dns
}
container.ResolvConfPath = path.Join(container.root, "resolv.conf")
f, err := os.Create(container.ResolvConfPath)
if err != nil {
return nil, err
}
defer f.Close()
for _, dns := range dns {
if _, err := f.Write([]byte("nameserver " + dns + "\n")); err != nil {
return nil, err
}
}
} else {
container.ResolvConfPath = "/etc/resolv.conf"
}
// Step 2: save the container json
if err := container.ToDisk(); err != nil {
return nil, err
}
// Step 3: register the container
if err := builder.runtime.Register(container); err != nil {
return nil, err
}
return container, nil
}
// Commit creates a new filesystem image from the current state of a container.
// The image can optionally be tagged into a repository
func (builder *Builder) Commit(container *Container, repository, tag, comment, author string, config *Config) (*Image, error) {
// FIXME: freeze the container before copying it to avoid data corruption?
// FIXME: this shouldn't be in commands.
rwTar, err := container.ExportRw()
if err != nil {
return nil, err
}
// Create a new image from the container's base layers + a new layer from container changes
img, err := builder.graph.Create(rwTar, container, comment, author, config)
if err != nil {
return nil, err
}
// Register the image if needed
if repository != "" {
if err := builder.repositories.Set(repository, tag, img.ID, true); err != nil {
return img, err
}
}
return img, nil
}

View File

@@ -1,18 +1,32 @@
package docker
import (
"bufio"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/auth"
"github.com/dotcloud/docker/registry"
"github.com/dotcloud/docker/runconfig"
"github.com/dotcloud/docker/utils"
"io"
"io/ioutil"
"net/url"
"os"
"path"
"path/filepath"
"reflect"
"regexp"
"sort"
"strings"
)
var (
ErrDockerfileEmpty = errors.New("Dockerfile cannot be empty")
)
type BuildFile interface {
Build(io.Reader) (string, error)
CmdFrom(string) error
@@ -21,29 +35,41 @@ type BuildFile interface {
type buildFile struct {
runtime *Runtime
builder *Builder
srv *Server
image string
maintainer string
config *Config
context string
config *runconfig.Config
contextPath string
context *utils.TarSum
verbose bool
utilizeCache bool
rm bool
authConfig *auth.AuthConfig
configFile *auth.ConfigFile
tmpContainers map[string]struct{}
tmpImages map[string]struct{}
out io.Writer
outStream io.Writer
errStream io.Writer
// Deprecated, original writer used for ImagePull. To be removed.
outOld io.Writer
sf *utils.StreamFormatter
}
func (b *buildFile) clearTmp(containers, images map[string]struct{}) {
func (b *buildFile) clearTmp(containers map[string]struct{}) {
for c := range containers {
tmp := b.runtime.Get(c)
b.runtime.Destroy(tmp)
utils.Debugf("Removing container %s", c)
}
for i := range images {
b.runtime.graph.Delete(i)
utils.Debugf("Removing image %s", i)
if err := b.runtime.Destroy(tmp); err != nil {
fmt.Fprintf(b.outStream, "Error removing intermediate container %s: %s\n", utils.TruncateID(c), err.Error())
} else {
fmt.Fprintf(b.outStream, "Removing intermediate container %s\n", utils.TruncateID(c))
}
}
}
@@ -51,20 +77,25 @@ func (b *buildFile) CmdFrom(name string) error {
image, err := b.runtime.repositories.LookupImage(name)
if err != nil {
if b.runtime.graph.IsNotExist(err) {
var tag, remote string
if strings.Contains(name, ":") {
remoteParts := strings.Split(name, ":")
tag = remoteParts[1]
remote = remoteParts[0]
} else {
remote = name
remote, tag := utils.ParseRepositoryTag(name)
pullRegistryAuth := b.authConfig
if len(b.configFile.Configs) > 0 {
// The request came with a full auth config file, we prefer to use that
endpoint, _, err := registry.ResolveRepositoryName(remote)
if err != nil {
return err
}
resolvedAuth := b.configFile.ResolveAuthConfig(endpoint)
pullRegistryAuth = &resolvedAuth
}
if err := b.srv.ImagePull(remote, tag, "", b.out, utils.NewStreamFormatter(false), nil); err != nil {
job := b.srv.Eng.Job("pull", remote, tag)
job.SetenvBool("json", b.sf.Json())
job.SetenvBool("parallel", true)
job.SetenvJson("authConfig", pullRegistryAuth)
job.Stdout.Add(b.outOld)
if err := job.Run(); err != nil {
return err
}
image, err = b.runtime.repositories.LookupImage(name)
if err != nil {
return err
@@ -74,52 +105,138 @@ func (b *buildFile) CmdFrom(name string) error {
}
}
b.image = image.ID
b.config = &Config{}
b.config = &runconfig.Config{}
if image.Config != nil {
b.config = image.Config
}
if b.config.Env == nil || len(b.config.Env) == 0 {
b.config.Env = append(b.config.Env, "HOME=/", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
}
// Process ONBUILD triggers if they exist
if nTriggers := len(b.config.OnBuild); nTriggers != 0 {
fmt.Fprintf(b.errStream, "# Executing %d build triggers\n", nTriggers)
}
for n, step := range b.config.OnBuild {
if err := b.BuildStep(fmt.Sprintf("onbuild-%d", n), step); err != nil {
return err
}
}
b.config.OnBuild = []string{}
return nil
}
// The ONBUILD command declares a build instruction to be executed in any future build
// using the current image as a base.
func (b *buildFile) CmdOnbuild(trigger string) error {
b.config.OnBuild = append(b.config.OnBuild, trigger)
return b.commit("", b.config.Cmd, fmt.Sprintf("ONBUILD %s", trigger))
}
func (b *buildFile) CmdMaintainer(name string) error {
b.maintainer = name
return b.commit("", b.config.Cmd, fmt.Sprintf("MAINTAINER %s", name))
}
// probeCache checks to see if image-caching is enabled (`b.utilizeCache`)
// and if so attempts to look up the current `b.image` and `b.config` pair
// in the current server `b.srv`. If an image is found, probeCache returns
// `(true, nil)`. If no image is found, it returns `(false, nil)`. If there
// is any error, it returns `(false, err)`.
func (b *buildFile) probeCache() (bool, error) {
if b.utilizeCache {
if cache, err := b.srv.ImageGetCached(b.image, b.config); err != nil {
return false, err
} else if cache != nil {
fmt.Fprintf(b.outStream, " ---> Using cache\n")
utils.Debugf("[BUILDER] Use cached version")
b.image = cache.ID
return true, nil
} else {
utils.Debugf("[BUILDER] Cache miss")
}
}
return false, nil
}
func (b *buildFile) CmdRun(args string) error {
if b.image == "" {
return fmt.Errorf("Please provide a source image with `from` prior to run")
}
config, _, _, err := ParseRun([]string{b.image, "/bin/sh", "-c", args}, nil)
config, _, _, err := runconfig.Parse(append([]string{b.image}, b.buildCmdFromJson(args)...), nil)
if err != nil {
return err
}
cmd := b.config.Cmd
b.config.Cmd = nil
MergeConfig(b.config, config)
runconfig.Merge(b.config, config)
defer func(cmd []string) { b.config.Cmd = cmd }(cmd)
utils.Debugf("Command to be executed: %v", b.config.Cmd)
if cache, err := b.srv.ImageGetCached(b.image, b.config); err != nil {
return err
} else if cache != nil {
fmt.Fprintf(b.out, " ---> Using cache\n")
utils.Debugf("[BUILDER] Use cached version")
b.image = cache.ID
return nil
} else {
utils.Debugf("[BUILDER] Cache miss")
}
cid, err := b.run()
hit, err := b.probeCache()
if err != nil {
return err
}
if err := b.commit(cid, cmd, "run"); err != nil {
if hit {
return nil
}
c, err := b.create()
if err != nil {
return err
}
b.config.Cmd = cmd
// Ensure that we keep the container mounted until the commit
// to avoid unmounting and then mounting directly again
c.Mount()
defer c.Unmount()
err = b.run(c)
if err != nil {
return err
}
if err := b.commit(c.ID, cmd, "run"); err != nil {
return err
}
return nil
}
func (b *buildFile) FindEnvKey(key string) int {
for k, envVar := range b.config.Env {
envParts := strings.SplitN(envVar, "=", 2)
if key == envParts[0] {
return k
}
}
return -1
}
func (b *buildFile) ReplaceEnvMatches(value string) (string, error) {
exp, err := regexp.Compile("(\\\\\\\\+|[^\\\\]|\\b|\\A)\\$({?)([[:alnum:]_]+)(}?)")
if err != nil {
return value, err
}
matches := exp.FindAllString(value, -1)
for _, match := range matches {
match = match[strings.Index(match, "$"):]
matchKey := strings.Trim(match, "${}")
for _, envVar := range b.config.Env {
envParts := strings.SplitN(envVar, "=", 2)
envKey := envParts[0]
envValue := envParts[1]
if envKey == matchKey {
value = strings.Replace(value, match, envValue, -1)
break
}
}
}
return value, nil
}
func (b *buildFile) CmdEnv(args string) error {
tmp := strings.SplitN(args, " ", 2)
if len(tmp) != 2 {
@@ -128,26 +245,45 @@ func (b *buildFile) CmdEnv(args string) error {
key := strings.Trim(tmp[0], " \t")
value := strings.Trim(tmp[1], " \t")
for i, elem := range b.config.Env {
if strings.HasPrefix(elem, key+"=") {
b.config.Env[i] = key + "=" + value
return nil
}
envKey := b.FindEnvKey(key)
replacedValue, err := b.ReplaceEnvMatches(value)
if err != nil {
return err
}
b.config.Env = append(b.config.Env, key+"="+value)
return b.commit("", b.config.Cmd, fmt.Sprintf("ENV %s=%s", key, value))
replacedVar := fmt.Sprintf("%s=%s", key, replacedValue)
if envKey >= 0 {
b.config.Env[envKey] = replacedVar
} else {
b.config.Env = append(b.config.Env, replacedVar)
}
return b.commit("", b.config.Cmd, fmt.Sprintf("ENV %s", replacedVar))
}
func (b *buildFile) buildCmdFromJson(args string) []string {
var cmd []string
if err := json.Unmarshal([]byte(args), &cmd); err != nil {
utils.Debugf("Error unmarshalling: %s, setting to /bin/sh -c", err)
cmd = []string{"/bin/sh", "-c", args}
}
return cmd
}
func (b *buildFile) CmdCmd(args string) error {
var cmd []string
if err := json.Unmarshal([]byte(args), &cmd); err != nil {
utils.Debugf("Error unmarshalling: %s, using /bin/sh -c", err)
cmd = []string{"/bin/sh", "-c", args}
}
if err := b.commit("", cmd, fmt.Sprintf("CMD %v", cmd)); err != nil {
cmd := b.buildCmdFromJson(args)
b.config.Cmd = cmd
if err := b.commit("", b.config.Cmd, fmt.Sprintf("CMD %v", cmd)); err != nil {
return err
}
return nil
}
func (b *buildFile) CmdEntrypoint(args string) error {
entrypoint := b.buildCmdFromJson(args)
b.config.Entrypoint = entrypoint
if err := b.commit("", b.config.Cmd, fmt.Sprintf("ENTRYPOINT %v", entrypoint)); err != nil {
return err
}
b.config.Cmd = cmd
return nil
}
@@ -157,6 +293,11 @@ func (b *buildFile) CmdExpose(args string) error {
return b.commit("", b.config.Cmd, fmt.Sprintf("EXPOSE %v", ports))
}
func (b *buildFile) CmdUser(args string) error {
b.config.User = args
return b.commit("", b.config.Cmd, fmt.Sprintf("USER %v", args))
}
func (b *buildFile) CmdInsert(args string) error {
return fmt.Errorf("INSERT has been deprecated. Please use ADD instead")
}
@@ -165,80 +306,251 @@ func (b *buildFile) CmdCopy(args string) error {
return fmt.Errorf("COPY has been deprecated. Please use ADD instead")
}
func (b *buildFile) addRemote(container *Container, orig, dest string) error {
file, err := utils.Download(orig, ioutil.Discard)
if err != nil {
return err
}
defer file.Body.Close()
return container.Inject(file.Body, dest)
func (b *buildFile) CmdWorkdir(workdir string) error {
b.config.WorkingDir = workdir
return b.commit("", b.config.Cmd, fmt.Sprintf("WORKDIR %v", workdir))
}
func (b *buildFile) addContext(container *Container, orig, dest string) error {
origPath := path.Join(b.context, orig)
destPath := path.Join(container.RootfsPath(), dest)
func (b *buildFile) CmdVolume(args string) error {
if args == "" {
return fmt.Errorf("Volume cannot be empty")
}
var volume []string
if err := json.Unmarshal([]byte(args), &volume); err != nil {
volume = []string{args}
}
if b.config.Volumes == nil {
b.config.Volumes = map[string]struct{}{}
}
for _, v := range volume {
b.config.Volumes[v] = struct{}{}
}
if err := b.commit("", b.config.Cmd, fmt.Sprintf("VOLUME %s", args)); err != nil {
return err
}
return nil
}
func (b *buildFile) checkPathForAddition(orig string) error {
origPath := path.Join(b.contextPath, orig)
if p, err := filepath.EvalSymlinks(origPath); err != nil {
if os.IsNotExist(err) {
return fmt.Errorf("%s: no such file or directory", orig)
}
return err
} else {
origPath = p
}
if !strings.HasPrefix(origPath, b.contextPath) {
return fmt.Errorf("Forbidden path outside the build context: %s (%s)", orig, origPath)
}
_, err := os.Stat(origPath)
if err != nil {
if os.IsNotExist(err) {
return fmt.Errorf("%s: no such file or directory", orig)
}
return err
}
return nil
}
func (b *buildFile) addContext(container *Container, orig, dest string, remote bool) error {
var (
origPath = path.Join(b.contextPath, orig)
destPath = path.Join(container.BasefsPath(), dest)
)
// Preserve the trailing '/'
if dest[len(dest)-1] == '/' {
if strings.HasSuffix(dest, "/") {
destPath = destPath + "/"
}
fi, err := os.Stat(origPath)
if err != nil {
if os.IsNotExist(err) {
return fmt.Errorf("%s: no such file or directory", orig)
}
return err
}
if fi.IsDir() {
if err := CopyWithTar(origPath, destPath); err != nil {
if err := archive.CopyWithTar(origPath, destPath); err != nil {
return err
}
// First try to unpack the source as an archive
} else if err := UntarPath(origPath, destPath); err != nil {
return nil
}
// First try to unpack the source as an archive
// to support the untar feature we need to clean up the path a little bit
// because tar is very forgiving. First we need to strip off the archive's
// filename from the path but this is only added if it does not end in / .
tarDest := destPath
if strings.HasSuffix(tarDest, "/") {
tarDest = filepath.Dir(destPath)
}
// If we are adding a remote file, do not try to untar it
if !remote {
// try to successfully untar the orig
if err := archive.UntarPath(origPath, tarDest); err == nil {
return nil
}
utils.Debugf("Couldn't untar %s to %s: %s", origPath, destPath, err)
// If that fails, just copy it as a regular file
if err := os.MkdirAll(path.Dir(destPath), 0700); err != nil {
return err
}
if err := CopyWithTar(origPath, destPath); err != nil {
return err
}
}
// If that fails, just copy it as a regular file
// but do not use all the magic path handling for the tar path
if err := os.MkdirAll(path.Dir(destPath), 0755); err != nil {
return err
}
if err := archive.CopyWithTar(origPath, destPath); err != nil {
return err
}
return nil
}
func (b *buildFile) CmdAdd(args string) error {
if b.context == "" {
if b.context == nil {
return fmt.Errorf("No context given. Impossible to use ADD")
}
tmp := strings.SplitN(args, " ", 2)
if len(tmp) != 2 {
return fmt.Errorf("Invalid ADD format")
}
orig := strings.Trim(tmp[0], " \t")
dest := strings.Trim(tmp[1], " \t")
orig, err := b.ReplaceEnvMatches(strings.Trim(tmp[0], " \t"))
if err != nil {
return err
}
dest, err := b.ReplaceEnvMatches(strings.Trim(tmp[1], " \t"))
if err != nil {
return err
}
cmd := b.config.Cmd
b.config.Cmd = []string{"/bin/sh", "-c", fmt.Sprintf("#(nop) ADD %s in %s", orig, dest)}
b.config.Image = b.image
var (
origPath = orig
destPath = dest
remoteHash string
isRemote bool
)
if utils.IsURL(orig) {
isRemote = true
resp, err := utils.Download(orig)
if err != nil {
return err
}
tmpDirName, err := ioutil.TempDir(b.contextPath, "docker-remote")
if err != nil {
return err
}
tmpFileName := path.Join(tmpDirName, "tmp")
tmpFile, err := os.OpenFile(tmpFileName, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)
if err != nil {
return err
}
defer os.RemoveAll(tmpDirName)
if _, err = io.Copy(tmpFile, resp.Body); err != nil {
tmpFile.Close()
return err
}
origPath = path.Join(filepath.Base(tmpDirName), filepath.Base(tmpFileName))
tmpFile.Close()
// Process the checksum
r, err := archive.Tar(tmpFileName, archive.Uncompressed)
if err != nil {
return err
}
tarSum := utils.TarSum{Reader: r, DisableCompression: true}
remoteHash = tarSum.Sum(nil)
r.Close()
// If the destination is a directory, figure out the filename.
if strings.HasSuffix(dest, "/") {
u, err := url.Parse(orig)
if err != nil {
return err
}
path := u.Path
if strings.HasSuffix(path, "/") {
path = path[:len(path)-1]
}
parts := strings.Split(path, "/")
filename := parts[len(parts)-1]
if filename == "" {
return fmt.Errorf("cannot determine filename from url: %s", u)
}
destPath = dest + filename
}
}
if err := b.checkPathForAddition(origPath); err != nil {
return err
}
// Hash path and check the cache
if b.utilizeCache {
var (
hash string
sums = b.context.GetSums()
)
if remoteHash != "" {
hash = remoteHash
} else if fi, err := os.Stat(path.Join(b.contextPath, origPath)); err != nil {
return err
} else if fi.IsDir() {
var subfiles []string
for file, sum := range sums {
absFile := path.Join(b.contextPath, file)
absOrigPath := path.Join(b.contextPath, origPath)
if strings.HasPrefix(absFile, absOrigPath) {
subfiles = append(subfiles, sum)
}
}
sort.Strings(subfiles)
hasher := sha256.New()
hasher.Write([]byte(strings.Join(subfiles, ",")))
hash = "dir:" + hex.EncodeToString(hasher.Sum(nil))
} else {
if origPath[0] == '/' && len(origPath) > 1 {
origPath = origPath[1:]
}
origPath = strings.TrimPrefix(origPath, "./")
if h, ok := sums[origPath]; ok {
hash = "file:" + h
}
}
b.config.Cmd = []string{"/bin/sh", "-c", fmt.Sprintf("#(nop) ADD %s in %s", hash, dest)}
hit, err := b.probeCache()
if err != nil {
return err
}
// If we do not have a hash, never use the cache
if hit && hash != "" {
return nil
}
}
// Create the container and start it
container, err := b.builder.Create(b.config)
container, _, err := b.runtime.Create(b.config, "")
if err != nil {
return err
}
b.tmpContainers[container.ID] = struct{}{}
if err := container.EnsureMounted(); err != nil {
if err := container.Mount(); err != nil {
return err
}
defer container.Unmount()
if utils.IsURL(orig) {
if err := b.addRemote(container, orig, dest); err != nil {
return err
}
} else {
if err := b.addContext(container, orig, dest); err != nil {
return err
}
if err := b.addContext(container, origPath, destPath, isRemote); err != nil {
return err
}
if err := b.commit(container.ID, cmd, fmt.Sprintf("ADD %s in %s", orig, dest)); err != nil {
@@ -248,32 +560,85 @@ func (b *buildFile) CmdAdd(args string) error {
return nil
}
func (b *buildFile) run() (string, error) {
type StdoutFormater struct {
io.Writer
*utils.StreamFormatter
}
func (sf *StdoutFormater) Write(buf []byte) (int, error) {
formattedBuf := sf.StreamFormatter.FormatStream(string(buf))
n, err := sf.Writer.Write(formattedBuf)
if n != len(formattedBuf) {
return n, io.ErrShortWrite
}
return len(buf), err
}
type StderrFormater struct {
io.Writer
*utils.StreamFormatter
}
func (sf *StderrFormater) Write(buf []byte) (int, error) {
formattedBuf := sf.StreamFormatter.FormatStream("\033[91m" + string(buf) + "\033[0m")
n, err := sf.Writer.Write(formattedBuf)
if n != len(formattedBuf) {
return n, io.ErrShortWrite
}
return len(buf), err
}
func (b *buildFile) create() (*Container, error) {
if b.image == "" {
return "", fmt.Errorf("Please provide a source image with `from` prior to run")
return nil, fmt.Errorf("Please provide a source image with `from` prior to run")
}
b.config.Image = b.image
// Create the container and start it
c, err := b.builder.Create(b.config)
c, _, err := b.runtime.Create(b.config, "")
if err != nil {
return "", err
return nil, err
}
b.tmpContainers[c.ID] = struct{}{}
fmt.Fprintf(b.out, " ---> Running in %s\n", utils.TruncateID(c.ID))
fmt.Fprintf(b.outStream, " ---> Running in %s\n", utils.TruncateID(c.ID))
// override the entry point that may have been picked up from the base image
c.Path = b.config.Cmd[0]
c.Args = b.config.Cmd[1:]
return c, nil
}
func (b *buildFile) run(c *Container) error {
var errCh chan error
if b.verbose {
errCh = utils.Go(func() error {
return <-c.Attach(nil, nil, b.outStream, b.errStream)
})
}
//start the container
hostConfig := &HostConfig{}
if err := c.Start(hostConfig); err != nil {
return "", err
if err := c.Start(); err != nil {
return err
}
if errCh != nil {
if err := <-errCh; err != nil {
return err
}
}
// Wait for it to finish
if ret := c.Wait(); ret != 0 {
return "", fmt.Errorf("The command %v returned a non-zero code: %d", b.config.Cmd, ret)
err := &utils.JSONError{
Message: fmt.Sprintf("The command %v returned a non-zero code: %d", b.config.Cmd, ret),
Code: ret,
}
return err
}
return c.ID, nil
return nil
}
// Commit the container <id> with the autorun command <autoCmd>
@@ -287,24 +652,25 @@ func (b *buildFile) commit(id string, autoCmd []string, comment string) error {
b.config.Cmd = []string{"/bin/sh", "-c", "#(nop) " + comment}
defer func(cmd []string) { b.config.Cmd = cmd }(cmd)
if cache, err := b.srv.ImageGetCached(b.image, b.config); err != nil {
return err
} else if cache != nil {
fmt.Fprintf(b.out, " ---> Using cache\n")
utils.Debugf("[BUILDER] Use cached version")
b.image = cache.ID
return nil
} else {
utils.Debugf("[BUILDER] Cache miss")
}
container, err := b.builder.Create(b.config)
hit, err := b.probeCache()
if err != nil {
return err
}
if hit {
return nil
}
container, warnings, err := b.runtime.Create(b.config, "")
if err != nil {
return err
}
for _, warning := range warnings {
fmt.Fprintf(b.outStream, " ---> [Warning] %s\n", warning)
}
b.tmpContainers[container.ID] = struct{}{}
fmt.Fprintf(b.out, " ---> Running in %s\n", utils.TruncateID(container.ID))
fmt.Fprintf(b.outStream, " ---> Running in %s\n", utils.TruncateID(container.ID))
id = container.ID
if err := container.EnsureMounted(); err != nil {
if err := container.Mount(); err != nil {
return err
}
defer container.Unmount()
@@ -319,7 +685,7 @@ func (b *buildFile) commit(id string, autoCmd []string, comment string) error {
autoConfig := *b.config
autoConfig.Cmd = autoCmd
// Commit the container
image, err := b.builder.Commit(container, "", "", "", b.maintainer, &autoConfig)
image, err := b.runtime.Commit(container, "", "", "", b.maintainer, &autoConfig)
if err != nil {
return err
}
@@ -328,76 +694,103 @@ func (b *buildFile) commit(id string, autoCmd []string, comment string) error {
return nil
}
// Long lines can be split with a backslash
var lineContinuation = regexp.MustCompile(`\s*\\\s*\n`)
func (b *buildFile) Build(context io.Reader) (string, error) {
// FIXME: @creack any reason for using /tmp instead of ""?
// FIXME: @creack "name" is a terrible variable name
name, err := ioutil.TempDir("/tmp", "docker-build")
tmpdirPath, err := ioutil.TempDir("", "docker-build")
if err != nil {
return "", err
}
if err := Untar(context, name); err != nil {
decompressedStream, err := archive.DecompressStream(context)
if err != nil {
return "", err
}
defer os.RemoveAll(name)
b.context = name
dockerfile, err := os.Open(path.Join(name, "Dockerfile"))
if err != nil {
b.context = &utils.TarSum{Reader: decompressedStream, DisableCompression: true}
if err := archive.Untar(b.context, tmpdirPath, nil); err != nil {
return "", err
}
defer os.RemoveAll(tmpdirPath)
b.contextPath = tmpdirPath
filename := path.Join(tmpdirPath, "Dockerfile")
if _, err := os.Stat(filename); os.IsNotExist(err) {
return "", fmt.Errorf("Can't build a directory with no Dockerfile")
}
// FIXME: "file" is also a terrible variable name ;)
file := bufio.NewReader(dockerfile)
fileBytes, err := ioutil.ReadFile(filename)
if err != nil {
return "", err
}
if len(fileBytes) == 0 {
return "", ErrDockerfileEmpty
}
dockerfile := string(fileBytes)
dockerfile = lineContinuation.ReplaceAllString(dockerfile, "")
stepN := 0
for {
line, err := file.ReadString('\n')
if err != nil {
if err == io.EOF && line == "" {
break
} else if err != io.EOF {
return "", err
}
}
for _, line := range strings.Split(dockerfile, "\n") {
line = strings.Trim(strings.Replace(line, "\t", " ", -1), " \t\r\n")
// Skip comments and empty line
if len(line) == 0 || line[0] == '#' {
continue
}
tmp := strings.SplitN(line, " ", 2)
if len(tmp) != 2 {
return "", fmt.Errorf("Invalid Dockerfile format")
if err := b.BuildStep(fmt.Sprintf("%d", stepN), line); err != nil {
return "", err
}
instruction := strings.ToLower(strings.Trim(tmp[0], " "))
arguments := strings.Trim(tmp[1], " ")
stepN += 1
// FIXME: only count known instructions as build steps
fmt.Fprintf(b.out, "Step %d : %s %s\n", stepN, strings.ToUpper(instruction), arguments)
method, exists := reflect.TypeOf(b).MethodByName("Cmd" + strings.ToUpper(instruction[:1]) + strings.ToLower(instruction[1:]))
if !exists {
fmt.Fprintf(b.out, "# Skipping unknown instruction %s\n", strings.ToUpper(instruction))
continue
}
ret := method.Func.Call([]reflect.Value{reflect.ValueOf(b), reflect.ValueOf(arguments)})[0].Interface()
if ret != nil {
return "", ret.(error)
}
fmt.Fprintf(b.out, " ---> %v\n", utils.TruncateID(b.image))
}
if b.image != "" {
fmt.Fprintf(b.out, "Successfully built %s\n", utils.TruncateID(b.image))
fmt.Fprintf(b.outStream, "Successfully built %s\n", utils.TruncateID(b.image))
if b.rm {
b.clearTmp(b.tmpContainers)
}
return b.image, nil
}
return "", fmt.Errorf("An error occured during the build\n")
return "", fmt.Errorf("No image was generated. This may be because the Dockerfile does not, like, do anything.\n")
}
func NewBuildFile(srv *Server, out io.Writer) BuildFile {
// BuildStep parses a single build step from `instruction` and executes it in the current context.
func (b *buildFile) BuildStep(name, expression string) error {
fmt.Fprintf(b.outStream, "Step %s : %s\n", name, expression)
tmp := strings.SplitN(expression, " ", 2)
if len(tmp) != 2 {
return fmt.Errorf("Invalid Dockerfile format")
}
instruction := strings.ToLower(strings.Trim(tmp[0], " "))
arguments := strings.Trim(tmp[1], " ")
method, exists := reflect.TypeOf(b).MethodByName("Cmd" + strings.ToUpper(instruction[:1]) + strings.ToLower(instruction[1:]))
if !exists {
fmt.Fprintf(b.errStream, "# Skipping unknown instruction %s\n", strings.ToUpper(instruction))
return nil
}
ret := method.Func.Call([]reflect.Value{reflect.ValueOf(b), reflect.ValueOf(arguments)})[0].Interface()
if ret != nil {
return ret.(error)
}
fmt.Fprintf(b.outStream, " ---> %s\n", utils.TruncateID(b.image))
return nil
}
func NewBuildFile(srv *Server, outStream, errStream io.Writer, verbose, utilizeCache, rm bool, outOld io.Writer, sf *utils.StreamFormatter, auth *auth.AuthConfig, authConfigFile *auth.ConfigFile) BuildFile {
return &buildFile{
builder: NewBuilder(srv.runtime),
runtime: srv.runtime,
srv: srv,
config: &Config{},
out: out,
config: &runconfig.Config{},
outStream: outStream,
errStream: errStream,
tmpContainers: make(map[string]struct{}),
tmpImages: make(map[string]struct{}),
verbose: verbose,
utilizeCache: utilizeCache,
rm: rm,
sf: sf,
authConfig: auth,
configFile: authConfigFile,
outOld: outOld,
}
}

View File

@@ -1,109 +0,0 @@
package docker
import (
"io/ioutil"
"sync"
"testing"
"fmt"
)
// mkTestContext generates a build context from the contents of the provided dockerfile.
// This context is suitable for use as an argument to BuildFile.Build()
func mkTestContext(dockerfile string, files [][2]string, t *testing.T) Archive {
context, err := mkBuildContext(fmt.Sprintf(dockerfile, unitTestImageId), files)
if err != nil {
t.Fatal(err)
}
return context
}
// A testContextTemplate describes a build context and how to test it
type testContextTemplate struct {
// Contents of the Dockerfile
dockerfile string
// Additional files in the context, eg [][2]string{"./passwd", "gordon"}
files [][2]string
}
// A table of all the contexts to build and test.
// A new docker runtime will be created and torn down for each context.
var testContexts []testContextTemplate = []testContextTemplate{
{
`
from %s
run sh -c 'echo root:testpass > /tmp/passwd'
run mkdir -p /var/run/sshd
run [ "$(cat /tmp/passwd)" = "root:testpass" ]
run [ "$(ls -d /var/run/sshd)" = "/var/run/sshd" ]
`,
nil,
},
{
`
from %s
add foo /usr/lib/bla/bar
run [ "$(cat /usr/lib/bla/bar)" = 'hello world!' ]
`,
[][2]string{{"foo", "hello world!"}},
},
{
`
from %s
add f /
run [ "$(cat /f)" = "hello" ]
add f /abc
run [ "$(cat /abc)" = "hello" ]
add f /x/y/z
run [ "$(cat /x/y/z)" = "hello" ]
add f /x/y/d/
run [ "$(cat /x/y/d/f)" = "hello" ]
add d /
run [ "$(cat /ga)" = "bu" ]
add d /somewhere
run [ "$(cat /somewhere/ga)" = "bu" ]
add d /anotherplace/
run [ "$(cat /anotherplace/ga)" = "bu" ]
add d /somewheeeere/over/the/rainbooow
run [ "$(cat /somewheeeere/over/the/rainbooow/ga)" = "bu" ]
`,
[][2]string{
{"f", "hello"},
{"d/ga", "bu"},
},
},
{
`
from %s
env FOO BAR
run [ "$FOO" = "BAR" ]
`,
nil,
},
}
// FIXME: test building with 2 successive overlapping ADD commands
func TestBuild(t *testing.T) {
for _, ctx := range testContexts {
runtime, err := newTestRuntime()
if err != nil {
t.Fatal(err)
}
defer nuke(runtime)
srv := &Server{
runtime: runtime,
lock: &sync.Mutex{},
pullingPool: make(map[string]struct{}),
pushingPool: make(map[string]struct{}),
}
buildfile := NewBuildFile(srv, ioutil.Discard)
if _, err := buildfile.Build(mkTestContext(ctx.dockerfile, ctx.files, t)); err != nil {
t.Fatal(err)
}
}
}

View File

@@ -1,106 +0,0 @@
package docker
import (
"fmt"
"os"
"path/filepath"
"strings"
)
type ChangeType int
const (
ChangeModify = iota
ChangeAdd
ChangeDelete
)
type Change struct {
Path string
Kind ChangeType
}
func (change *Change) String() string {
var kind string
switch change.Kind {
case ChangeModify:
kind = "C"
case ChangeAdd:
kind = "A"
case ChangeDelete:
kind = "D"
}
return fmt.Sprintf("%s %s", kind, change.Path)
}
func Changes(layers []string, rw string) ([]Change, error) {
var changes []Change
err := filepath.Walk(rw, func(path string, f os.FileInfo, err error) error {
if err != nil {
return err
}
// Rebase path
path, err = filepath.Rel(rw, path)
if err != nil {
return err
}
path = filepath.Join("/", path)
// Skip root
if path == "/" {
return nil
}
// Skip AUFS metadata
if matched, err := filepath.Match("/.wh..wh.*", path); err != nil || matched {
return err
}
change := Change{
Path: path,
}
// Find out what kind of modification happened
file := filepath.Base(path)
// If there is a whiteout, then the file was removed
if strings.HasPrefix(file, ".wh.") {
originalFile := file[len(".wh."):]
change.Path = filepath.Join(filepath.Dir(path), originalFile)
change.Kind = ChangeDelete
} else {
// Otherwise, the file was added
change.Kind = ChangeAdd
// ...Unless it already existed in a top layer, in which case, it's a modification
for _, layer := range layers {
stat, err := os.Stat(filepath.Join(layer, path))
if err != nil && !os.IsNotExist(err) {
return err
}
if err == nil {
// The file existed in the top layer, so that's a modification
// However, if it's a directory, maybe it wasn't actually modified.
// If you modify /foo/bar/baz, then /foo will be part of the changed files only because it's the parent of bar
if stat.IsDir() && f.IsDir() {
if f.Size() == stat.Size() && f.Mode() == stat.Mode() && f.ModTime() == stat.ModTime() {
// Both directories are the same, don't record the change
return nil
}
}
change.Kind = ChangeModify
break
}
}
}
// Record change
changes = append(changes, change)
return nil
})
if err != nil {
return nil, err
}
return changes, nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,459 +0,0 @@
package docker
import (
"bufio"
"fmt"
"github.com/dotcloud/docker/utils"
"io"
"io/ioutil"
"strings"
"testing"
"time"
)
func closeWrap(args ...io.Closer) error {
e := false
ret := fmt.Errorf("Error closing elements")
for _, c := range args {
if err := c.Close(); err != nil {
e = true
ret = fmt.Errorf("%s\n%s", ret, err)
}
}
if e {
return ret
}
return nil
}
func setTimeout(t *testing.T, msg string, d time.Duration, f func()) {
c := make(chan bool)
// Make sure we are not too long
go func() {
time.Sleep(d)
c <- true
}()
go func() {
f()
c <- false
}()
if <-c {
t.Fatal(msg)
}
}
func assertPipe(input, output string, r io.Reader, w io.Writer, count int) error {
for i := 0; i < count; i++ {
if _, err := w.Write([]byte(input)); err != nil {
return err
}
o, err := bufio.NewReader(r).ReadString('\n')
if err != nil {
return err
}
if strings.Trim(o, " \r\n") != output {
return fmt.Errorf("Unexpected output. Expected [%s], received [%s]", output, o)
}
}
return nil
}
/*TODO
func cmdImages(srv *Server, args ...string) (string, error) {
stdout, stdoutPipe := io.Pipe()
go func() {
if err := srv.CmdImages(nil, stdoutPipe, args...); err != nil {
return
}
// force the pipe closed, so that the code below gets an EOF
stdoutPipe.Close()
}()
output, err := ioutil.ReadAll(stdout)
if err != nil {
return "", err
}
// Cleanup pipes
return string(output), closeWrap(stdout, stdoutPipe)
}
// TestImages checks that 'docker images' displays information correctly
func TestImages(t *testing.T) {
runtime, err := newTestRuntime()
if err != nil {
t.Fatal(err)
}
defer nuke(runtime)
srv := &Server{runtime: runtime}
output, err := cmdImages(srv)
if !strings.Contains(output, "REPOSITORY") {
t.Fatal("'images' should have a header")
}
if !strings.Contains(output, "docker-ut") {
t.Fatal("'images' should show the docker-ut image")
}
if !strings.Contains(output, "e9aa60c60128") {
t.Fatal("'images' should show the docker-ut image id")
}
output, err = cmdImages(srv, "-q")
if strings.Contains(output, "REPOSITORY") {
t.Fatal("'images -q' should not have a header")
}
if strings.Contains(output, "docker-ut") {
t.Fatal("'images' should not show the docker-ut image name")
}
if !strings.Contains(output, "e9aa60c60128") {
t.Fatal("'images' should show the docker-ut image id")
}
output, err = cmdImages(srv, "-viz")
if !strings.HasPrefix(output, "digraph docker {") {
t.Fatal("'images -v' should start with the dot header")
}
if !strings.HasSuffix(output, "}\n") {
t.Fatal("'images -v' should end with a '}'")
}
if !strings.Contains(output, "base -> \"e9aa60c60128\" [style=invis]") {
t.Fatal("'images -v' should have the docker-ut image id node")
}
// todo: add checks for -a
}
*/
// TestRunHostname checks that 'docker run -h' correctly sets a custom hostname
func TestRunHostname(t *testing.T) {
stdout, stdoutPipe := io.Pipe()
cli := NewDockerCli(nil, stdoutPipe, nil, testDaemonProto, testDaemonAddr)
defer cleanup(globalRuntime)
c := make(chan struct{})
go func() {
defer close(c)
if err := cli.CmdRun("-h", "foobar", unitTestImageId, "hostname"); err != nil {
t.Fatal(err)
}
}()
utils.Debugf("--")
setTimeout(t, "Reading command output time out", 2*time.Second, func() {
cmdOutput, err := bufio.NewReader(stdout).ReadString('\n')
if err != nil {
t.Fatal(err)
}
if cmdOutput != "foobar\n" {
t.Fatalf("'hostname' should display '%s', not '%s'", "foobar\n", cmdOutput)
}
})
setTimeout(t, "CmdRun timed out", 5*time.Second, func() {
<-c
})
}
/*
func TestRunExit(t *testing.T) {
runtime, err := newTestRuntime()
if err != nil {
t.Fatal(err)
}
defer nuke(runtime)
srv := &Server{runtime: runtime}
stdin, stdinPipe := io.Pipe()
stdout, stdoutPipe := io.Pipe()
c1 := make(chan struct{})
go func() {
srv.CmdRun(stdin, rcli.NewDockerLocalConn(stdoutPipe), "-i", GetTestImage(runtime).Id, "/bin/cat")
close(c1)
}()
setTimeout(t, "Read/Write assertion timed out", 2*time.Second, func() {
if err := assertPipe("hello\n", "hello", stdout, stdinPipe, 15); err != nil {
t.Fatal(err)
}
})
container := runtime.List()[0]
// Closing /bin/cat stdin, expect it to exit
p, err := container.StdinPipe()
if err != nil {
t.Fatal(err)
}
if err := p.Close(); err != nil {
t.Fatal(err)
}
// as the process exited, CmdRun must finish and unblock. Wait for it
setTimeout(t, "Waiting for CmdRun timed out", 2*time.Second, func() {
<-c1
cmdWait(srv, container)
})
// Make sure that the client has been disconnected
setTimeout(t, "The client should have been disconnected once the remote process exited.", 2*time.Second, func() {
// Expecting pipe i/o error, just check that read does not block
stdin.Read([]byte{})
})
// Cleanup pipes
if err := closeWrap(stdin, stdinPipe, stdout, stdoutPipe); err != nil {
t.Fatal(err)
}
}
// Expected behaviour: the process dies when the client disconnects
func TestRunDisconnect(t *testing.T) {
runtime, err := newTestRuntime()
if err != nil {
t.Fatal(err)
}
defer nuke(runtime)
srv := &Server{runtime: runtime}
stdin, stdinPipe := io.Pipe()
stdout, stdoutPipe := io.Pipe()
c1 := make(chan struct{})
go func() {
// We're simulating a disconnect so the return value doesn't matter. What matters is the
// fact that CmdRun returns.
srv.CmdRun(stdin, rcli.NewDockerLocalConn(stdoutPipe), "-i", GetTestImage(runtime).Id, "/bin/cat")
close(c1)
}()
setTimeout(t, "Read/Write assertion timed out", 2*time.Second, func() {
if err := assertPipe("hello\n", "hello", stdout, stdinPipe, 15); err != nil {
t.Fatal(err)
}
})
// Close pipes (simulate disconnect)
if err := closeWrap(stdin, stdinPipe, stdout, stdoutPipe); err != nil {
t.Fatal(err)
}
// as the pipes are close, we expect the process to die,
// therefore CmdRun to unblock. Wait for CmdRun
setTimeout(t, "Waiting for CmdRun timed out", 2*time.Second, func() {
<-c1
})
// Client disconnect after run -i should cause stdin to be closed, which should
// cause /bin/cat to exit.
setTimeout(t, "Waiting for /bin/cat to exit timed out", 2*time.Second, func() {
container := runtime.List()[0]
container.Wait()
if container.State.Running {
t.Fatalf("/bin/cat is still running after closing stdin")
}
})
}
// Expected behaviour: the process dies when the client disconnects
func TestRunDisconnectTty(t *testing.T) {
runtime, err := newTestRuntime()
if err != nil {
t.Fatal(err)
}
defer nuke(runtime)
srv := &Server{runtime: runtime}
stdin, stdinPipe := io.Pipe()
stdout, stdoutPipe := io.Pipe()
c1 := make(chan struct{})
go func() {
// We're simulating a disconnect so the return value doesn't matter. What matters is the
// fact that CmdRun returns.
srv.CmdRun(stdin, rcli.NewDockerLocalConn(stdoutPipe), "-i", "-t", GetTestImage(runtime).Id, "/bin/cat")
close(c1)
}()
setTimeout(t, "Waiting for the container to be started timed out", 2*time.Second, func() {
for {
// Client disconnect after run -i should keep stdin out in TTY mode
l := runtime.List()
if len(l) == 1 && l[0].State.Running {
break
}
time.Sleep(10 * time.Millisecond)
}
})
// Client disconnect after run -i should keep stdin out in TTY mode
container := runtime.List()[0]
setTimeout(t, "Read/Write assertion timed out", 2*time.Second, func() {
if err := assertPipe("hello\n", "hello", stdout, stdinPipe, 15); err != nil {
t.Fatal(err)
}
})
// Close pipes (simulate disconnect)
if err := closeWrap(stdin, stdinPipe, stdout, stdoutPipe); err != nil {
t.Fatal(err)
}
// In tty mode, we expect the process to stay alive even after client's stdin closes.
// Do not wait for run to finish
// Give some time to monitor to do his thing
container.WaitTimeout(500 * time.Millisecond)
if !container.State.Running {
t.Fatalf("/bin/cat should still be running after closing stdin (tty mode)")
}
}
*/
// TestAttachStdin checks attaching to stdin without stdout and stderr.
// 'docker run -i -a stdin' should sends the client's stdin to the command,
// then detach from it and print the container id.
func TestRunAttachStdin(t *testing.T) {
stdin, stdinPipe := io.Pipe()
stdout, stdoutPipe := io.Pipe()
cli := NewDockerCli(stdin, stdoutPipe, nil, testDaemonProto, testDaemonAddr)
defer cleanup(globalRuntime)
ch := make(chan struct{})
go func() {
defer close(ch)
cli.CmdRun("-i", "-a", "stdin", unitTestImageId, "sh", "-c", "echo hello && cat")
}()
// Send input to the command, close stdin
setTimeout(t, "Write timed out", 10*time.Second, func() {
if _, err := stdinPipe.Write([]byte("hi there\n")); err != nil {
t.Fatal(err)
}
if err := stdinPipe.Close(); err != nil {
t.Fatal(err)
}
})
container := globalRuntime.List()[0]
// Check output
setTimeout(t, "Reading command output time out", 10*time.Second, func() {
cmdOutput, err := bufio.NewReader(stdout).ReadString('\n')
if err != nil {
t.Fatal(err)
}
if cmdOutput != container.ShortID()+"\n" {
t.Fatalf("Wrong output: should be '%s', not '%s'\n", container.ShortID()+"\n", cmdOutput)
}
})
// wait for CmdRun to return
setTimeout(t, "Waiting for CmdRun timed out", 5*time.Second, func() {
// Unblock hijack end
stdout.Read([]byte{})
<-ch
})
setTimeout(t, "Waiting for command to exit timed out", 5*time.Second, func() {
container.Wait()
})
// Check logs
if cmdLogs, err := container.ReadLog("stdout"); err != nil {
t.Fatal(err)
} else {
if output, err := ioutil.ReadAll(cmdLogs); err != nil {
t.Fatal(err)
} else {
expectedLog := "hello\nhi there\n"
if string(output) != expectedLog {
t.Fatalf("Unexpected logs: should be '%s', not '%s'\n", expectedLog, output)
}
}
}
}
/*
// Expected behaviour, the process stays alive when the client disconnects
func TestAttachDisconnect(t *testing.T) {
runtime, err := newTestRuntime()
if err != nil {
t.Fatal(err)
}
defer nuke(runtime)
srv := &Server{runtime: runtime}
container, err := NewBuilder(runtime).Create(
&Config{
Image: GetTestImage(runtime).Id,
CpuShares: 1000,
Memory: 33554432,
Cmd: []string{"/bin/cat"},
OpenStdin: true,
},
)
if err != nil {
t.Fatal(err)
}
defer runtime.Destroy(container)
// Start the process
if err := container.Start(); err != nil {
t.Fatal(err)
}
stdin, stdinPipe := io.Pipe()
stdout, stdoutPipe := io.Pipe()
// Attach to it
c1 := make(chan struct{})
go func() {
// We're simulating a disconnect so the return value doesn't matter. What matters is the
// fact that CmdAttach returns.
srv.CmdAttach(stdin, rcli.NewDockerLocalConn(stdoutPipe), container.Id)
close(c1)
}()
setTimeout(t, "First read/write assertion timed out", 2*time.Second, func() {
if err := assertPipe("hello\n", "hello", stdout, stdinPipe, 15); err != nil {
t.Fatal(err)
}
})
// Close pipes (client disconnects)
if err := closeWrap(stdin, stdinPipe, stdout, stdoutPipe); err != nil {
t.Fatal(err)
}
// Wait for attach to finish, the client disconnected, therefore, Attach finished his job
setTimeout(t, "Waiting for CmdAttach timed out", 2*time.Second, func() {
<-c1
})
// We closed stdin, expect /bin/cat to still be running
// Wait a little bit to make sure container.monitor() did his thing
err = container.WaitTimeout(500 * time.Millisecond)
if err == nil || !container.State.Running {
t.Fatalf("/bin/cat is not running after closing stdin")
}
// Try to avoid the timeoout in destroy. Best effort, don't check error
cStdin, _ := container.StdinPipe()
cStdin.Close()
container.Wait()
}
*/

160
commands_unit_test.go Normal file
View File

@@ -0,0 +1,160 @@
package docker
import (
"github.com/dotcloud/docker/runconfig"
"strings"
"testing"
)
func parse(t *testing.T, args string) (*runconfig.Config, *runconfig.HostConfig, error) {
config, hostConfig, _, err := runconfig.Parse(strings.Split(args+" ubuntu bash", " "), nil)
return config, hostConfig, err
}
func mustParse(t *testing.T, args string) (*runconfig.Config, *runconfig.HostConfig) {
config, hostConfig, err := parse(t, args)
if err != nil {
t.Fatal(err)
}
return config, hostConfig
}
func TestParseRunLinks(t *testing.T) {
if _, hostConfig := mustParse(t, "-link a:b"); len(hostConfig.Links) == 0 || hostConfig.Links[0] != "a:b" {
t.Fatalf("Error parsing links. Expected []string{\"a:b\"}, received: %v", hostConfig.Links)
}
if _, hostConfig := mustParse(t, "-link a:b -link c:d"); len(hostConfig.Links) < 2 || hostConfig.Links[0] != "a:b" || hostConfig.Links[1] != "c:d" {
t.Fatalf("Error parsing links. Expected []string{\"a:b\", \"c:d\"}, received: %v", hostConfig.Links)
}
if _, hostConfig := mustParse(t, ""); len(hostConfig.Links) != 0 {
t.Fatalf("Error parsing links. No link expected, received: %v", hostConfig.Links)
}
if _, _, err := parse(t, "-link a"); err == nil {
t.Fatalf("Error parsing links. `-link a` should be an error but is not")
}
if _, _, err := parse(t, "-link"); err == nil {
t.Fatalf("Error parsing links. `-link` should be an error but is not")
}
}
func TestParseRunAttach(t *testing.T) {
if config, _ := mustParse(t, "-a stdin"); !config.AttachStdin || config.AttachStdout || config.AttachStderr {
t.Fatalf("Error parsing attach flags. Expect only Stdin enabled. Received: in: %v, out: %v, err: %v", config.AttachStdin, config.AttachStdout, config.AttachStderr)
}
if config, _ := mustParse(t, "-a stdin -a stdout"); !config.AttachStdin || !config.AttachStdout || config.AttachStderr {
t.Fatalf("Error parsing attach flags. Expect only Stdin and Stdout enabled. Received: in: %v, out: %v, err: %v", config.AttachStdin, config.AttachStdout, config.AttachStderr)
}
if config, _ := mustParse(t, "-a stdin -a stdout -a stderr"); !config.AttachStdin || !config.AttachStdout || !config.AttachStderr {
t.Fatalf("Error parsing attach flags. Expect all attach enabled. Received: in: %v, out: %v, err: %v", config.AttachStdin, config.AttachStdout, config.AttachStderr)
}
if config, _ := mustParse(t, ""); config.AttachStdin || !config.AttachStdout || !config.AttachStderr {
t.Fatalf("Error parsing attach flags. Expect Stdin disabled. Received: in: %v, out: %v, err: %v", config.AttachStdin, config.AttachStdout, config.AttachStderr)
}
if _, _, err := parse(t, "-a"); err == nil {
t.Fatalf("Error parsing attach flags, `-a` should be an error but is not")
}
if _, _, err := parse(t, "-a invalid"); err == nil {
t.Fatalf("Error parsing attach flags, `-a invalid` should be an error but is not")
}
if _, _, err := parse(t, "-a invalid -a stdout"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stdout -a invalid` should be an error but is not")
}
if _, _, err := parse(t, "-a stdout -a stderr -d"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stdout -a stderr -d` should be an error but is not")
}
if _, _, err := parse(t, "-a stdin -d"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stdin -d` should be an error but is not")
}
if _, _, err := parse(t, "-a stdout -d"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stdout -d` should be an error but is not")
}
if _, _, err := parse(t, "-a stderr -d"); err == nil {
t.Fatalf("Error parsing attach flags, `-a stderr -d` should be an error but is not")
}
if _, _, err := parse(t, "-d -rm"); err == nil {
t.Fatalf("Error parsing attach flags, `-d -rm` should be an error but is not")
}
}
func TestParseRunVolumes(t *testing.T) {
if config, hostConfig := mustParse(t, "-v /tmp"); hostConfig.Binds != nil {
t.Fatalf("Error parsing volume flags, `-v /tmp` should not mount-bind anything. Received %v", hostConfig.Binds)
} else if _, exists := config.Volumes["/tmp"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /tmp` is missing from volumes. Received %v", config.Volumes)
}
if config, hostConfig := mustParse(t, "-v /tmp -v /var"); hostConfig.Binds != nil {
t.Fatalf("Error parsing volume flags, `-v /tmp -v /var` should not mount-bind anything. Received %v", hostConfig.Binds)
} else if _, exists := config.Volumes["/tmp"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /tmp` is missing from volumes. Recevied %v", config.Volumes)
} else if _, exists := config.Volumes["/var"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /var` is missing from volumes. Received %v", config.Volumes)
}
if config, hostConfig := mustParse(t, "-v /hostTmp:/containerTmp"); hostConfig.Binds == nil || hostConfig.Binds[0] != "/hostTmp:/containerTmp" {
t.Fatalf("Error parsing volume flags, `-v /hostTmp:/containerTmp` should mount-bind /hostTmp into /containeTmp. Received %v", hostConfig.Binds)
} else if _, exists := config.Volumes["/containerTmp"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /tmp` is missing from volumes. Received %v", config.Volumes)
}
if config, hostConfig := mustParse(t, "-v /hostTmp:/containerTmp -v /hostVar:/containerVar"); hostConfig.Binds == nil || hostConfig.Binds[0] != "/hostTmp:/containerTmp" || hostConfig.Binds[1] != "/hostVar:/containerVar" {
t.Fatalf("Error parsing volume flags, `-v /hostTmp:/containerTmp -v /hostVar:/containerVar` should mount-bind /hostTmp into /containeTmp and /hostVar into /hostContainer. Received %v", hostConfig.Binds)
} else if _, exists := config.Volumes["/containerTmp"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /containerTmp` is missing from volumes. Received %v", config.Volumes)
} else if _, exists := config.Volumes["/containerVar"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /containerVar` is missing from volumes. Received %v", config.Volumes)
}
if config, hostConfig := mustParse(t, "-v /hostTmp:/containerTmp:ro -v /hostVar:/containerVar:rw"); hostConfig.Binds == nil || hostConfig.Binds[0] != "/hostTmp:/containerTmp:ro" || hostConfig.Binds[1] != "/hostVar:/containerVar:rw" {
t.Fatalf("Error parsing volume flags, `-v /hostTmp:/containerTmp:ro -v /hostVar:/containerVar:rw` should mount-bind /hostTmp into /containeTmp and /hostVar into /hostContainer. Received %v", hostConfig.Binds)
} else if _, exists := config.Volumes["/containerTmp"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /containerTmp` is missing from volumes. Received %v", config.Volumes)
} else if _, exists := config.Volumes["/containerVar"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /containerVar` is missing from volumes. Received %v", config.Volumes)
}
if config, hostConfig := mustParse(t, "-v /hostTmp:/containerTmp -v /containerVar"); hostConfig.Binds == nil || len(hostConfig.Binds) > 1 || hostConfig.Binds[0] != "/hostTmp:/containerTmp" {
t.Fatalf("Error parsing volume flags, `-v /hostTmp:/containerTmp -v /containerVar` should mount-bind only /hostTmp into /containeTmp. Received %v", hostConfig.Binds)
} else if _, exists := config.Volumes["/containerTmp"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /containerTmp` is missing from volumes. Received %v", config.Volumes)
} else if _, exists := config.Volumes["/containerVar"]; !exists {
t.Fatalf("Error parsing volume flags, `-v /containerVar` is missing from volumes. Received %v", config.Volumes)
}
if config, hostConfig := mustParse(t, ""); hostConfig.Binds != nil {
t.Fatalf("Error parsing volume flags, without volume, nothing should be mount-binded. Received %v", hostConfig.Binds)
} else if len(config.Volumes) != 0 {
t.Fatalf("Error parsing volume flags, without volume, no volume should be present. Received %v", config.Volumes)
}
if _, _, err := parse(t, "-v /"); err == nil {
t.Fatalf("Expected error, but got none")
}
if _, _, err := parse(t, "-v /:/"); err == nil {
t.Fatalf("Error parsing volume flags, `-v /:/` should fail but didn't")
}
if _, _, err := parse(t, "-v"); err == nil {
t.Fatalf("Error parsing volume flags, `-v` should fail but didn't")
}
if _, _, err := parse(t, "-v /tmp:"); err == nil {
t.Fatalf("Error parsing volume flags, `-v /tmp:` should fail but didn't")
}
if _, _, err := parse(t, "-v /tmp:ro"); err == nil {
t.Fatalf("Error parsing volume flags, `-v /tmp:ro` should fail but didn't")
}
if _, _, err := parse(t, "-v /tmp::"); err == nil {
t.Fatalf("Error parsing volume flags, `-v /tmp::` should fail but didn't")
}
if _, _, err := parse(t, "-v :"); err == nil {
t.Fatalf("Error parsing volume flags, `-v :` should fail but didn't")
}
if _, _, err := parse(t, "-v ::"); err == nil {
t.Fatalf("Error parsing volume flags, `-v ::` should fail but didn't")
}
if _, _, err := parse(t, "-v /tmp:/tmp:/tmp:/tmp"); err == nil {
t.Fatalf("Error parsing volume flags, `-v /tmp:/tmp:/tmp:/tmp` should fail but didn't")
}
}

65
config.go Normal file
View File

@@ -0,0 +1,65 @@
package docker
import (
"net"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/networkdriver"
)
const (
defaultNetworkMtu = 1500
DisableNetworkBridge = "none"
)
// FIXME: separate runtime configuration from http api configuration
type DaemonConfig struct {
Pidfile string
Root string
AutoRestart bool
Dns []string
EnableIptables bool
EnableIpForward bool
DefaultIp net.IP
BridgeIface string
BridgeIP string
InterContainerCommunication bool
GraphDriver string
Mtu int
DisableNetwork bool
}
// ConfigFromJob creates and returns a new DaemonConfig object
// by parsing the contents of a job's environment.
func DaemonConfigFromJob(job *engine.Job) *DaemonConfig {
config := &DaemonConfig{
Pidfile: job.Getenv("Pidfile"),
Root: job.Getenv("Root"),
AutoRestart: job.GetenvBool("AutoRestart"),
EnableIptables: job.GetenvBool("EnableIptables"),
EnableIpForward: job.GetenvBool("EnableIpForward"),
BridgeIP: job.Getenv("BridgeIP"),
BridgeIface: job.Getenv("BridgeIface"),
DefaultIp: net.ParseIP(job.Getenv("DefaultIp")),
InterContainerCommunication: job.GetenvBool("InterContainerCommunication"),
GraphDriver: job.Getenv("GraphDriver"),
}
if dns := job.GetenvList("Dns"); dns != nil {
config.Dns = dns
}
if mtu := job.GetenvInt("Mtu"); mtu != 0 {
config.Mtu = mtu
} else {
config.Mtu = GetDefaultNetworkMtu()
}
config.DisableNetwork = config.BridgeIface == DisableNetworkBridge
return config
}
func GetDefaultNetworkMtu() int {
if iface, err := networkdriver.GetDefaultRouteIface(); err == nil {
return iface.MTU
}
return defaultNetworkMtu
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

145
container_unit_test.go Normal file
View File

@@ -0,0 +1,145 @@
package docker
import (
"github.com/dotcloud/docker/nat"
"testing"
)
func TestParseNetworkOptsPrivateOnly(t *testing.T) {
ports, bindings, err := nat.ParsePortSpecs([]string{"192.168.1.100::80"})
if err != nil {
t.Fatal(err)
}
if len(ports) != 1 {
t.Logf("Expected 1 got %d", len(ports))
t.FailNow()
}
if len(bindings) != 1 {
t.Logf("Expected 1 got %d", len(bindings))
t.FailNow()
}
for k := range ports {
if k.Proto() != "tcp" {
t.Logf("Expected tcp got %s", k.Proto())
t.Fail()
}
if k.Port() != "80" {
t.Logf("Expected 80 got %s", k.Port())
t.Fail()
}
b, exists := bindings[k]
if !exists {
t.Log("Binding does not exist")
t.FailNow()
}
if len(b) != 1 {
t.Logf("Expected 1 got %d", len(b))
t.FailNow()
}
s := b[0]
if s.HostPort != "" {
t.Logf("Expected \"\" got %s", s.HostPort)
t.Fail()
}
if s.HostIp != "192.168.1.100" {
t.Fail()
}
}
}
func TestParseNetworkOptsPublic(t *testing.T) {
ports, bindings, err := nat.ParsePortSpecs([]string{"192.168.1.100:8080:80"})
if err != nil {
t.Fatal(err)
}
if len(ports) != 1 {
t.Logf("Expected 1 got %d", len(ports))
t.FailNow()
}
if len(bindings) != 1 {
t.Logf("Expected 1 got %d", len(bindings))
t.FailNow()
}
for k := range ports {
if k.Proto() != "tcp" {
t.Logf("Expected tcp got %s", k.Proto())
t.Fail()
}
if k.Port() != "80" {
t.Logf("Expected 80 got %s", k.Port())
t.Fail()
}
b, exists := bindings[k]
if !exists {
t.Log("Binding does not exist")
t.FailNow()
}
if len(b) != 1 {
t.Logf("Expected 1 got %d", len(b))
t.FailNow()
}
s := b[0]
if s.HostPort != "8080" {
t.Logf("Expected 8080 got %s", s.HostPort)
t.Fail()
}
if s.HostIp != "192.168.1.100" {
t.Fail()
}
}
}
func TestParseNetworkOptsUdp(t *testing.T) {
ports, bindings, err := nat.ParsePortSpecs([]string{"192.168.1.100::6000/udp"})
if err != nil {
t.Fatal(err)
}
if len(ports) != 1 {
t.Logf("Expected 1 got %d", len(ports))
t.FailNow()
}
if len(bindings) != 1 {
t.Logf("Expected 1 got %d", len(bindings))
t.FailNow()
}
for k := range ports {
if k.Proto() != "udp" {
t.Logf("Expected udp got %s", k.Proto())
t.Fail()
}
if k.Port() != "6000" {
t.Logf("Expected 6000 got %s", k.Port())
t.Fail()
}
b, exists := bindings[k]
if !exists {
t.Log("Binding does not exist")
t.FailNow()
}
if len(b) != 1 {
t.Logf("Expected 1 got %d", len(b))
t.FailNow()
}
s := b[0]
if s.HostPort != "" {
t.Logf("Expected \"\" got %s", s.HostPort)
t.Fail()
}
if s.HostIp != "192.168.1.100" {
t.Fail()
}
}
}
func TestGetFullName(t *testing.T) {
name, err := getFullName("testing")
if err != nil {
t.Fatal(err)
}
if name != "/testing" {
t.Fatalf("Expected /testing got %s", name)
}
if _, err := getFullName(""); err == nil {
t.Fatal("Error should not be nil")
}
}

View File

@@ -1 +1 @@
# Maintainer wanted! Enroll on #docker@freenode
Tianon Gravi <admwiggin@gmail.com> (@tianon)

692
contrib/completion/bash/docker Executable file
View File

@@ -0,0 +1,692 @@
#!bash
#
# bash completion file for core docker commands
#
# This script provides supports completion of:
# - commands and their options
# - container ids and names
# - image repos and tags
# - filepaths
#
# To enable the completions either:
# - place this file in /etc/bash_completion.d
# or
# - copy this file and add the line below to your .bashrc after
# bash completion features are loaded
# . docker.bash
#
# Note:
# Currently, the completions will not work if the docker daemon is not
# bound to the default communication port/socket
# If the docker daemon is using a unix socket for communication your user
# must have access to the socket for the completions to function correctly
__docker_q() {
docker 2>/dev/null "$@"
}
__docker_containers_all()
{
local containers="$( __docker_q ps -a -q )"
local names="$( __docker_q inspect --format '{{.Name}}' $containers | sed 's,^/,,' )"
COMPREPLY=( $( compgen -W "$names $containers" -- "$cur" ) )
}
__docker_containers_running()
{
local containers="$( __docker_q ps -q )"
local names="$( __docker_q inspect --format '{{.Name}}' $containers | sed 's,^/,,' )"
COMPREPLY=( $( compgen -W "$names $containers" -- "$cur" ) )
}
__docker_containers_stopped()
{
local containers="$( { __docker_q ps -a -q; __docker_q ps -q; } | sort | uniq -u )"
local names="$( __docker_q inspect --format '{{.Name}}' $containers | sed 's,^/,,' )"
COMPREPLY=( $( compgen -W "$names $containers" -- "$cur" ) )
}
__docker_image_repos()
{
local repos="$( __docker_q images | awk 'NR>1{print $1}' | grep -v '^<none>$' )"
COMPREPLY=( $( compgen -W "$repos" -- "$cur" ) )
}
__docker_image_repos_and_tags()
{
local repos="$( __docker_q images | awk 'NR>1{print $1}' | grep -v '^<none>$' )"
local images="$( __docker_q images | awk 'NR>1{print $1":"$2}' | grep -v '^<none>:' )"
COMPREPLY=( $( compgen -W "$repos $images" -- "$cur" ) )
__ltrim_colon_completions "$cur"
}
__docker_image_repos_and_tags_and_ids()
{
local repos="$( __docker_q images | awk 'NR>1{print $1}' | grep -v '^<none>$' )"
local images="$( __docker_q images | awk 'NR>1{print $1":"$2}' | grep -v '^<none>:' )"
local ids="$( __docker_q images -a -q )"
COMPREPLY=( $( compgen -W "$repos $images $ids" -- "$cur" ) )
__ltrim_colon_completions "$cur"
}
__docker_containers_and_images()
{
local containers="$( __docker_q ps -a -q )"
local names="$( __docker_q inspect --format '{{.Name}}' $containers | sed 's,^/,,' )"
local repos="$( __docker_q images | awk 'NR>1{print $1}' | grep -v '^<none>$' )"
local images="$( __docker_q images | awk 'NR>1{print $1":"$2}' | grep -v '^<none>:' )"
local ids="$( __docker_q images -a -q )"
COMPREPLY=( $( compgen -W "$containers $names $repos $images $ids" -- "$cur" ) )
__ltrim_colon_completions "$cur"
}
__docker_pos_first_nonflag()
{
local argument_flags=$1
local counter=$cpos
while [ $counter -le $cword ]; do
if [ -n "$argument_flags" ] && eval "case '${words[$counter]}' in $argument_flags) true ;; *) false ;; esac"; then
(( counter++ ))
else
case "${words[$counter]}" in
-*)
;;
*)
break
;;
esac
fi
(( counter++ ))
done
echo $counter
}
_docker_docker()
{
case "$prev" in
-H)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-H" -- "$cur" ) )
;;
*)
COMPREPLY=( $( compgen -W "$commands help" -- "$cur" ) )
;;
esac
}
_docker_attach()
{
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--no-stdin --sig-proxy" -- "$cur" ) )
;;
*)
local counter="$(__docker_pos_first_nonflag)"
if [ $cword -eq $counter ]; then
__docker_containers_running
fi
;;
esac
}
_docker_build()
{
case "$prev" in
-t|--tag)
__docker_image_repos_and_tags
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-t --tag -q --quiet --no-cache --rm" -- "$cur" ) )
;;
*)
local counter="$(__docker_pos_first_nonflag '-t|--tag')"
if [ $cword -eq $counter ]; then
_filedir
fi
;;
esac
}
_docker_commit()
{
case "$prev" in
-m|--message|-a|--author|--run)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-m --message -a --author --run" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '-m|--message|-a|--author|--run')
if [ $cword -eq $counter ]; then
__docker_containers_all
return
fi
(( counter++ ))
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags
return
fi
;;
esac
}
_docker_cp()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
case "$cur" in
*:)
return
;;
*)
__docker_containers_all
COMPREPLY=( $( compgen -W "${COMPREPLY[*]}" -S ':' ) )
compopt -o nospace
return
;;
esac
fi
(( counter++ ))
if [ $cword -eq $counter ]; then
_filedir
return
fi
}
_docker_diff()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_containers_all
fi
}
_docker_events()
{
case "$prev" in
--since)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--since" -- "$cur" ) )
;;
*)
;;
esac
}
_docker_export()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_containers_all
fi
}
_docker_help()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
fi
}
_docker_history()
{
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-q --quiet --no-trunc" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags_and_ids
fi
;;
esac
}
_docker_images()
{
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-q --quiet -a --all --no-trunc -v --viz -t --tree" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_image_repos
fi
;;
esac
}
_docker_import()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
return
fi
(( counter++ ))
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags
return
fi
}
_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
-f|--format)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-f --format" -- "$cur" ) )
;;
*)
__docker_containers_and_images
;;
esac
}
_docker_kill()
{
__docker_containers_running
}
_docker_load()
{
return
}
_docker_login()
{
case "$prev" in
-u|--username|-p|--password|-e|--email)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-u --username -p --password -e --email" -- "$cur" ) )
;;
*)
;;
esac
}
_docker_logs()
{
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-f --follow" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_containers_all
fi
;;
esac
}
_docker_port()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_containers_all
fi
}
_docker_ps()
{
case "$prev" in
--since-id|--before-id)
COMPREPLY=( $( compgen -W "$( __docker_q ps -a -q )" -- "$cur" ) )
# TODO replace this with __docker_containers_all
# see https://github.com/dotcloud/docker/issues/3565
return
;;
-n)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-q --quiet -s --size -a --all --no-trunc -l --latest --since-id --before-id -n" -- "$cur" ) )
;;
*)
;;
esac
}
_docker_pull()
{
case "$prev" in
-t|--tag)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-t --tag" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '-t|--tag')
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags
fi
;;
esac
}
_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
fi
}
_docker_restart()
{
case "$prev" in
-t|--time)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-t --time" -- "$cur" ) )
;;
*)
__docker_containers_all
;;
esac
}
_docker_rm()
{
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-v --volumes -l --link" -- "$cur" ) )
;;
*)
__docker_containers_stopped
;;
esac
}
_docker_rmi()
{
__docker_image_repos_and_tags_and_ids
}
_docker_run()
{
case "$prev" in
--cidfile)
_filedir
;;
--volumes-from)
__docker_containers_all
;;
-v|--volume)
# TODO something magical with colons and _filedir ?
return
;;
-e|--env)
COMPREPLY=( $( compgen -e -- "$cur" ) )
return
;;
--entrypoint|-h|--hostname|-m|--memory|-u|--user|-w|--workdir|-c|--cpu-shares|-n|--name|-a|--attach|--link|-p|--publish|--expose|--dns|--lxc-conf)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--rm -d --detach -n --networking --privileged -P --publish-all -i --interactive -t --tty --cidfile --entrypoint -h --hostname -m --memory -u --user -w --workdir -c --cpu-shares --sig-proxy --name -a --attach -v --volume --link -e --env -p --publish --expose --dns --volumes-from --lxc-conf" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '--cidfile|--volumes-from|-v|--volume|-e|--env|--entrypoint|-h|--hostname|-m|--memory|-u|--user|-w|--workdir|-c|--cpu-shares|-n|--name|-a|--attach|--link|-p|--publish|--expose|--dns|--lxc-conf')
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags_and_ids
fi
;;
esac
}
_docker_save()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags_and_ids
fi
}
_docker_search()
{
case "$prev" in
-s|--stars)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--no-trunc -t --trusted -s --stars" -- "$cur" ) )
;;
*)
;;
esac
}
_docker_start()
{
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-a --attach -i --interactive" -- "$cur" ) )
;;
*)
__docker_containers_stopped
;;
esac
}
_docker_stop()
{
case "$prev" in
-t|--time)
return
;;
*)
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-t --time" -- "$cur" ) )
;;
*)
__docker_containers_running
;;
esac
}
_docker_tag()
{
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-f --force" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags
return
fi
(( counter++ ))
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags
return
fi
;;
esac
}
_docker_top()
{
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_containers_running
fi
}
_docker_version()
{
return
}
_docker_wait()
{
__docker_containers_all
}
_docker()
{
local commands="
attach
build
commit
cp
diff
events
export
history
images
import
info
insert
inspect
kill
load
login
logs
port
ps
pull
push
restart
rm
rmi
run
save
search
start
stop
tag
top
version
wait
"
COMPREPLY=()
local cur prev words cword
_get_comp_words_by_ref -n : cur prev words cword
local command='docker'
local counter=1
while [ $counter -lt $cword ]; do
case "${words[$counter]}" in
-H)
(( counter++ ))
;;
-*)
;;
*)
command="${words[$counter]}"
cpos=$counter
(( cpos++ ))
break
;;
esac
(( counter++ ))
done
local completions_func=_docker_${command}
declare -F $completions_func >/dev/null && $completions_func
return 0
}
complete -F _docker docker

242
contrib/completion/zsh/_docker Executable file
View File

@@ -0,0 +1,242 @@
#compdef docker
#
# zsh completion for docker (http://docker.io)
#
# version: 0.2.2
# author: Felix Riedel
# license: BSD License
# github: https://github.com/felixr/docker-zsh-completion
#
__parse_docker_list() {
sed -e '/^ID/d' -e 's/[ ]\{2,\}/|/g' -e 's/ \([hdwm]\)\(inutes\|ays\|ours\|eeks\)/\1/' | awk ' BEGIN {FS="|"} { printf("%s:%7s, %s\n", $1, $4, $2)}'
}
__docker_stoppedcontainers() {
local expl
declare -a stoppedcontainers
stoppedcontainers=(${(f)"$(docker ps -a | grep --color=never 'Exit' | __parse_docker_list )"})
_describe -t containers-stopped "Stopped Containers" stoppedcontainers
}
__docker_runningcontainers() {
local expl
declare -a containers
containers=(${(f)"$(docker ps | __parse_docker_list)"})
_describe -t containers-active "Running Containers" containers
}
__docker_containers () {
__docker_stoppedcontainers
__docker_runningcontainers
}
__docker_images () {
local expl
declare -a images
images=(${(f)"$(docker images | awk '(NR > 1){printf("%s\\:%s\n", $1,$2)}')"})
images=($images ${(f)"$(docker images | awk '(NR > 1){printf("%s:%-15s in %s\n", $3,$2,$1)}')"})
_describe -t docker-images "Images" images
}
__docker_tags() {
local expl
declare -a tags
tags=(${(f)"$(docker images | awk '(NR>1){print $2}'| sort | uniq)"})
_describe -t docker-tags "tags" tags
}
__docker_search() {
# declare -a dockersearch
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy __docker_caching_policy
fi
local searchterm cachename
searchterm="${words[$CURRENT]%/}"
cachename=_docker-search-$searchterm
local expl
local -a result
if ( [[ ${(P)+cachename} -eq 0 ]] || _cache_invalid ${cachename#_} ) \
&& ! _retrieve_cache ${cachename#_}; then
_message "Searching for ${searchterm}..."
result=(${(f)"$(docker search ${searchterm} | awk '(NR>2){print $1}')"})
_store_cache ${cachename#_} result
fi
_wanted dockersearch expl 'Available images' compadd -a result
}
__docker_caching_policy()
{
# oldp=( "$1"(Nmh+24) ) # 24 hour
oldp=( "$1"(Nmh+1) ) # 24 hour
(( $#oldp ))
}
__docker_repositories () {
local expl
declare -a repos
repos=(${(f)"$(docker images | sed -e '1d' -e 's/[ ].*//' | sort | uniq)"})
_describe -t docker-repos "Repositories" repos
}
__docker_commands () {
# local -a _docker_subcommands
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy __docker_caching_policy
fi
if ( [[ ${+_docker_subcommands} -eq 0 ]] || _cache_invalid docker_subcommands) \
&& ! _retrieve_cache docker_subcommands;
then
_docker_subcommands=(${${(f)"$(_call_program commands
docker 2>&1 | sed -e '1,6d' -e '/^[ ]*$/d' -e 's/[ ]*\([^ ]\+\)\s*\([^ ].*\)/\1:\2/' )"}})
_docker_subcommands=($_docker_subcommands 'help:Show help for a command')
_store_cache docker_subcommands _docker_subcommands
fi
_describe -t docker-commands "docker command" _docker_subcommands
}
__docker_subcommand () {
local -a _command_args
case "$words[1]" in
(attach|wait)
_arguments ':containers:__docker_runningcontainers'
;;
(build)
_arguments \
'-t=-:repository:__docker_repositories' \
':path or URL:_directories'
;;
(commit)
_arguments \
':container:__docker_containers' \
':repository:__docker_repositories' \
':tag: '
;;
(diff|export|logs)
_arguments '*:containers:__docker_containers'
;;
(history)
_arguments '*:images:__docker_images'
;;
(images)
_arguments \
'-a[Show all images]' \
':repository:__docker_repositories'
;;
(inspect)
_arguments '*:containers:__docker_containers'
;;
(history)
_arguments ':images:__docker_images'
;;
(insert)
_arguments '1:containers:__docker_containers' \
'2:URL:(http:// file://)' \
'3:file:_files'
;;
(kill)
_arguments '*:containers:__docker_runningcontainers'
;;
(port)
_arguments '1:containers:__docker_runningcontainers'
;;
(start)
_arguments '*:containers:__docker_stoppedcontainers'
;;
(rm)
_arguments '-v[Remove the volumes associated to the container]' \
'*:containers:__docker_stoppedcontainers'
;;
(rmi)
_arguments '-v[Remove the volumes associated to the container]' \
'*:images:__docker_images'
;;
(top)
_arguments '1:containers:__docker_runningcontainers'
;;
(restart|stop)
_arguments '-t=-[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)' \
'*:containers:__docker_runningcontainers'
;;
(top)
_arguments ':containers:__docker_runningcontainers'
;;
(ps)
_arguments '-a[Show all containers. Only running containers are shown by default]' \
'-h[Show help]' \
'-before-id=-[Show only container created before Id, include non-running one]:containers:__docker_containers' \
'-n=-[Show n last created containers, include non-running one]:n:(1 5 10 25 50)'
;;
(tag)
_arguments \
'-f[force]'\
':image:__docker_images'\
':repository:__docker_repositories' \
':tag:__docker_tags'
;;
(run)
_arguments \
'-a=-[Attach to stdin, stdout or stderr]:toggle:(true false)' \
'-c=-[CPU shares (relative weight)]:CPU shares: ' \
'-d[Detached mode: leave the container running in the background]' \
'*--dns=[Set custom dns servers]:dns server: ' \
'*-e=[Set environment variables]:environment variable: ' \
'--entrypoint=-[Overwrite the default entrypoint of the image]:entry point: ' \
'-h=-[Container host name]:hostname:_hosts' \
'-i[Keep stdin open even if not attached]' \
'-m=-[Memory limit (in bytes)]:limit: ' \
'*-p=-[Expose a container''s port to the host]:port:_ports' \
'-t=-[Allocate a pseudo-tty]:toggle:(true false)' \
'-u=-[Username or UID]:user:_users' \
'*-v=-[Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)]:volume: '\
'--volumes-from=-[Mount volumes from the specified container]:volume: ' \
'(-):images:__docker_images' \
'(-):command: _command_names -e' \
'*::arguments: _normal'
;;
(pull|search)
_arguments ':name:__docker_search'
;;
(help)
_arguments ':subcommand:__docker_commands'
;;
(*)
_message 'Unknown sub command'
esac
}
_docker () {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
'-H=-[tcp://host:port to bind/connect to]:socket: ' \
'(-): :->command' \
'(-)*:: :->option-or-argument'
if (( CURRENT == 1 )); then
fi
case $state in
(command)
__docker_commands
;;
(option-or-argument)
curcontext=${curcontext%:*:*}:docker-$words[1]:
__docker_subcommand
;;
esac
}
_docker "$@"

View File

@@ -77,7 +77,7 @@ func crashTest() error {
stop = false
for i := 0; i < 100 && !stop; {
func() error {
cmd := exec.Command(DOCKERPATH, "run", "base", "echo", fmt.Sprintf("%d", totalTestCount))
cmd := exec.Command(DOCKERPATH, "run", "ubuntu", "echo", fmt.Sprintf("%d", totalTestCount))
i++
totalTestCount++
outPipe, err := cmd.StdoutPipe()

View File

@@ -0,0 +1,11 @@
Desktop Integration
===================
The ./contrib/desktop-integration contains examples of typical dockerized
desktop applications.
Examples
========
* Data container: ./data/Dockerfile creates a data image sharing /data volume
* Iceweasel: ./iceweasel/Dockerfile shows a way to dockerize a common multimedia application

View File

@@ -0,0 +1,38 @@
# VERSION: 0.1
# DESCRIPTION: Create data image sharing /data volume
# AUTHOR: Daniel Mizyrycki <daniel@dotcloud.com>
# COMMENTS:
# This image is used as base for all data containers.
# /data volume is owned by sysadmin.
# USAGE:
# # Download data Dockerfile
# wget http://raw.github.com/dotcloud/docker/master/contrib/desktop-integration/data/Dockerfile
#
# # Build data image
# docker build -t data -rm .
#
# # Create a data container. (eg: iceweasel-data)
# docker run -name iceweasel-data data true
#
# # List data from it
# docker run -volumes-from iceweasel-data busybox ls -al /data
docker-version 0.6.5
# Smallest base image, just to launch a container
FROM busybox
MAINTAINER Daniel Mizyrycki <daniel@docker.com>
# Create a regular user
RUN echo 'sysadmin:x:1000:1000::/data:/bin/sh' >> /etc/passwd
RUN echo 'sysadmin:x:1000:' >> /etc/group
# Create directory for that user
RUN mkdir /data
RUN chown sysadmin.sysadmin /data
# Add content to /data. This will keep sysadmin ownership
RUN touch /data/init_volume
# Create /data volume
VOLUME /data

View File

@@ -0,0 +1,41 @@
# VERSION: 0.7
# DESCRIPTION: Create iceweasel container with its dependencies
# AUTHOR: Daniel Mizyrycki <daniel@dotcloud.com>
# COMMENTS:
# This file describes how to build a Iceweasel container with all
# dependencies installed. It uses native X11 unix socket and alsa
# sound devices. Tested on Debian 7.2
# USAGE:
# # Download Iceweasel Dockerfile
# wget http://raw.github.com/dotcloud/docker/master/contrib/desktop-integration/iceweasel/Dockerfile
#
# # Build iceweasel image
# docker build -t iceweasel -rm .
#
# # Run stateful data-on-host iceweasel. For ephemeral, remove -v /data/iceweasel:/data
# docker run -v /data/iceweasel:/data -v /tmp/.X11-unix:/tmp/.X11-unix \
# -v /dev/snd:/dev/snd -lxc-conf='lxc.cgroup.devices.allow = c 116:* rwm' \
# -e DISPLAY=unix$DISPLAY iceweasel
#
# # To run stateful dockerized data containers
# docker run -volumes-from iceweasel-data -v /tmp/.X11-unix:/tmp/.X11-unix \
# -v /dev/snd:/dev/snd -lxc-conf='lxc.cgroup.devices.allow = c 116:* rwm' \
# -e DISPLAY=unix$DISPLAY iceweasel
docker-version 0.6.5
# Base docker image
FROM debian:wheezy
MAINTAINER Daniel Mizyrycki <daniel@docker.com>
# Install Iceweasel and "sudo"
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq iceweasel sudo
# create sysadmin account
RUN useradd -m -d /data -p saIVpsc0EVTwA sysadmin
RUN sed -Ei 's/sudo:x:27:/sudo:x:27:sysadmin/' /etc/group
RUN sed -Ei 's/(\%sudo\s+ALL=\(ALL\:ALL\) )ALL/\1 NOPASSWD:ALL/' /etc/sudoers
# Autorun iceweasel. -no-remote is necessary to create a new container, as
# iceweasel appears to communicate with itself through X11.
CMD ["/usr/bin/sudo", "-u", "sysadmin", "-H", "-E", "/usr/bin/iceweasel", "-no-remote"]

View File

@@ -0,0 +1,170 @@
package main
import (
"flag"
"fmt"
"github.com/dotcloud/docker/graphdriver/devmapper"
"os"
"path"
"sort"
"strconv"
"strings"
)
func usage() {
fmt.Fprintf(os.Stderr, "Usage: %s <flags> [status] | [list] | [device id] | [resize new-pool-size] | [snap new-id base-id] | [remove id] | [mount id mountpoint]\n", os.Args[0])
flag.PrintDefaults()
os.Exit(1)
}
func byteSizeFromString(arg string) (int64, error) {
digits := ""
rest := ""
last := strings.LastIndexAny(arg, "0123456789")
if last >= 0 {
digits = arg[:last+1]
rest = arg[last+1:]
}
val, err := strconv.ParseInt(digits, 10, 64)
if err != nil {
return val, err
}
rest = strings.ToLower(strings.TrimSpace(rest))
var multiplier int64 = 1
switch rest {
case "":
multiplier = 1
case "k", "kb":
multiplier = 1024
case "m", "mb":
multiplier = 1024 * 1024
case "g", "gb":
multiplier = 1024 * 1024 * 1024
case "t", "tb":
multiplier = 1024 * 1024 * 1024 * 1024
default:
return 0, fmt.Errorf("Unknown size unit: %s", rest)
}
return val * multiplier, nil
}
func main() {
root := flag.String("r", "/var/lib/docker", "Docker root dir")
flDebug := flag.Bool("D", false, "Debug mode")
flag.Parse()
if *flDebug {
os.Setenv("DEBUG", "1")
}
if flag.NArg() < 1 {
usage()
}
args := flag.Args()
home := path.Join(*root, "devicemapper")
devices, err := devmapper.NewDeviceSet(home, false)
if err != nil {
fmt.Println("Can't initialize device mapper: ", err)
os.Exit(1)
}
switch args[0] {
case "status":
status := devices.Status()
fmt.Printf("Pool name: %s\n", status.PoolName)
fmt.Printf("Data Loopback file: %s\n", status.DataLoopback)
fmt.Printf("Metadata Loopback file: %s\n", status.MetadataLoopback)
fmt.Printf("Sector size: %d\n", status.SectorSize)
fmt.Printf("Data use: %d of %d (%.1f %%)\n", status.Data.Used, status.Data.Total, 100.0*float64(status.Data.Used)/float64(status.Data.Total))
fmt.Printf("Metadata use: %d of %d (%.1f %%)\n", status.Metadata.Used, status.Metadata.Total, 100.0*float64(status.Metadata.Used)/float64(status.Metadata.Total))
break
case "list":
ids := devices.List()
sort.Strings(ids)
for _, id := range ids {
fmt.Println(id)
}
break
case "device":
if flag.NArg() < 2 {
usage()
}
status, err := devices.GetDeviceStatus(args[1])
if err != nil {
fmt.Println("Can't get device info: ", err)
os.Exit(1)
}
fmt.Printf("Id: %d\n", status.DeviceId)
fmt.Printf("Size: %d\n", status.Size)
fmt.Printf("Transaction Id: %d\n", status.TransactionId)
fmt.Printf("Size in Sectors: %d\n", status.SizeInSectors)
fmt.Printf("Mapped Sectors: %d\n", status.MappedSectors)
fmt.Printf("Highest Mapped Sector: %d\n", status.HighestMappedSector)
break
case "resize":
if flag.NArg() < 2 {
usage()
}
size, err := byteSizeFromString(args[1])
if err != nil {
fmt.Println("Invalid size: ", err)
os.Exit(1)
}
err = devices.ResizePool(size)
if err != nil {
fmt.Println("Error resizeing pool: ", err)
os.Exit(1)
}
break
case "snap":
if flag.NArg() < 3 {
usage()
}
err := devices.AddDevice(args[1], args[2])
if err != nil {
fmt.Println("Can't create snap device: ", err)
os.Exit(1)
}
break
case "remove":
if flag.NArg() < 2 {
usage()
}
err := devices.RemoveDevice(args[1])
if err != nil {
fmt.Println("Can't remove device: ", err)
os.Exit(1)
}
break
case "mount":
if flag.NArg() < 3 {
usage()
}
err := devices.MountDevice(args[1], args[2], false)
if err != nil {
fmt.Println("Can't create snap device: ", err)
os.Exit(1)
}
break
default:
fmt.Printf("Unknown command %s\n", args[0])
usage()
os.Exit(1)
}
return
}

View File

@@ -0,0 +1,27 @@
#
# This Dockerfile will create an image that allows to generate upstart and
# systemd scripts (more to come)
#
# docker-version 0.6.2
#
FROM ubuntu:12.10
MAINTAINER Guillaume J. Charmes <guillaume@dotcloud.com>
RUN apt-get update && apt-get install -y wget git mercurial
# Install Go
RUN wget --no-check-certificate https://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz -O go-1.1.2.tar.gz
RUN tar -xzvf go-1.1.2.tar.gz && mv /go /goroot
RUN mkdir /go
ENV GOROOT /goroot
ENV GOPATH /go
ENV PATH $GOROOT/bin:$PATH
RUN go get github.com/dotcloud/docker && cd /go/src/github.com/dotcloud/docker && git checkout v0.6.3
ADD manager.go /manager/
RUN cd /manager && go build -o /usr/bin/manager
ENTRYPOINT ["/usr/bin/manager"]

View File

@@ -0,0 +1,4 @@
FROM busybox
MAINTAINER Guillaume J. Charmes <guillaume@dotcloud.com>
ADD manager /usr/bin/
ENTRYPOINT ["/usr/bin/manager"]

View File

@@ -0,0 +1,130 @@
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"github.com/dotcloud/docker"
"os"
"strings"
"text/template"
)
var templates = map[string]string{
"upstart": `description "{{.description}}"
author "{{.author}}"
start on filesystem and started lxc-net and started docker
stop on runlevel [!2345]
respawn
exec /home/vagrant/goroot/bin/docker start -a {{.container_id}}
`,
"systemd": `[Unit]
Description={{.description}}
Author={{.author}}
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a {{.container_id}}
ExecStop=/usr/bin/docker stop -t 2 {{.container_id}}
[Install]
WantedBy=local.target
`,
}
func main() {
// Parse command line for custom options
kind := flag.String("t", "upstart", "Type of manager requested")
author := flag.String("a", "<none>", "Author of the image")
description := flag.String("d", "<none>", "Description of the image")
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "\nUsage: manager <container id>\n\n")
flag.PrintDefaults()
}
flag.Parse()
// We require at least the container ID
if flag.NArg() != 1 {
println(flag.NArg())
flag.Usage()
return
}
// Check that the requested process manager is supported
if _, exists := templates[*kind]; !exists {
panic("Unknown script template")
}
// Load the requested template
tpl, err := template.New("processManager").Parse(templates[*kind])
if err != nil {
panic(err)
}
// Create stdout/stderr buffers
bufOut := bytes.NewBuffer(nil)
bufErr := bytes.NewBuffer(nil)
// Instanciate the Docker CLI
cli := docker.NewDockerCli(nil, bufOut, bufErr, "unix", "/var/run/docker.sock")
// Retrieve the container info
if err := cli.CmdInspect(flag.Arg(0)); err != nil {
// As of docker v0.6.3, CmdInspect always returns nil
panic(err)
}
// If there is nothing in the error buffer, then the Docker daemon is there and the container has been found
if bufErr.Len() == 0 {
// Unmarshall the resulting container data
c := []*docker.Container{{}}
if err := json.Unmarshal(bufOut.Bytes(), &c); err != nil {
panic(err)
}
// Reset the buffers
bufOut.Reset()
bufErr.Reset()
// Retrieve the info of the linked image
if err := cli.CmdInspect(c[0].Image); err != nil {
panic(err)
}
// If there is nothing in the error buffer, then the image has been found.
if bufErr.Len() == 0 {
// Unmarshall the resulting image data
img := []*docker.Image{{}}
if err := json.Unmarshal(bufOut.Bytes(), &img); err != nil {
panic(err)
}
// If no author has been set, use the one from the image
if *author == "<none>" && img[0].Author != "" {
*author = strings.Replace(img[0].Author, "\"", "", -1)
}
// If no description has been set, use the comment from the image
if *description == "<none>" && img[0].Comment != "" {
*description = strings.Replace(img[0].Comment, "\"", "", -1)
}
}
}
/// Old version: Wrtie the resulting script to file
// f, err := os.OpenFile(kind, os.O_CREATE|os.O_WRONLY, 0755)
// if err != nil {
// panic(err)
// }
// defer f.Close()
// Create a map with needed data
data := map[string]string{
"author": *author,
"description": *description,
"container_id": flag.Arg(0),
}
// Process the template and output it on Stdout
if err := tpl.Execute(os.Stdout, data); err != nil {
panic(err)
}
}

View File

@@ -0,0 +1,53 @@
#!/bin/sh
set -e
usage() {
echo >&2 "usage: $0 [-a author] [-d description] container [manager]"
echo >&2 " ie: $0 -a 'John Smith' 4ec9612a37cd systemd"
echo >&2 " ie: $0 -d 'Super Cool System' 4ec9612a37cd # defaults to upstart"
exit 1
}
auth='<none>'
desc='<none>'
have_auth=
have_desc=
while getopts a:d: opt; do
case "$opt" in
a)
auth="$OPTARG"
have_auth=1
;;
d)
desc="$OPTARG"
have_desc=1
;;
esac
done
shift $(($OPTIND - 1))
[ $# -ge 1 -a $# -le 2 ] || usage
cid="$1"
script="${2:-upstart}"
if [ ! -e "manager/$script" ]; then
echo >&2 "Error: manager type '$script' is unknown (PRs always welcome!)."
echo >&2 'The currently supported types are:'
echo >&2 " $(cd manager && echo *)"
exit 1
fi
# TODO https://github.com/dotcloud/docker/issues/734 (docker inspect formatting)
#if command -v docker > /dev/null 2>&1; then
# image="$(docker inspect -f '{{.Image}}' "$cid")"
# if [ "$image" ]; then
# if [ -z "$have_auth" ]; then
# auth="$(docker inspect -f '{{.Author}}' "$image")"
# fi
# if [ -z "$have_desc" ]; then
# desc="$(docker inspect -f '{{.Comment}}' "$image")"
# fi
# fi
#fi
exec "manager/$script" "$cid" "$auth" "$desc"

View File

@@ -0,0 +1,20 @@
#!/bin/sh
set -e
cid="$1"
auth="$2"
desc="$3"
cat <<-EOF
[Unit]
Description=$desc
Author=$auth
After=docker.service
[Service]
ExecStart=/usr/bin/docker start -a $cid
ExecStop=/usr/bin/docker stop -t 2 $cid
[Install]
WantedBy=local.target
EOF

View File

@@ -0,0 +1,15 @@
#!/bin/sh
set -e
cid="$1"
auth="$2"
desc="$3"
cat <<-EOF
description "$(echo "$desc" | sed 's/"/\\"/g')"
author "$(echo "$auth" | sed 's/"/\\"/g')"
start on filesystem and started lxc-net and started docker
stop on runlevel [!2345]
respawn
exec /usr/bin/docker start -a "$cid"
EOF

View File

@@ -0,0 +1,13 @@
# /etc/conf.d/docker: config file for /etc/init.d/docker
# where the docker daemon output gets piped
#DOCKER_LOGFILE="/var/log/docker.log"
# where docker's pid get stored
#DOCKER_PIDFILE="/run/docker.pid"
# where the docker daemon itself is run from
#DOCKER_BINARY="/usr/bin/docker"
# any other random options you want to pass to docker
DOCKER_OPTS=""

View File

@@ -0,0 +1,31 @@
#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
DOCKER_LOGFILE=${DOCKER_LOGFILE:-/var/log/${SVCNAME}.log}
DOCKER_PIDFILE=${DOCKER_PIDFILE:-/run/${SVCNAME}.pid}
DOCKER_BINARY=${DOCKER_BINARY:-/usr/bin/docker}
DOCKER_OPTS=${DOCKER_OPTS:-}
start() {
checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
ebegin "Starting docker daemon"
start-stop-daemon --start --background \
--exec "$DOCKER_BINARY" \
--pidfile "$DOCKER_PIDFILE" \
--stdout "$DOCKER_LOGFILE" \
--stderr "$DOCKER_LOGFILE" \
-- -d -p "$DOCKER_PIDFILE" \
$DOCKER_OPTS
eend $?
}
stop() {
ebegin "Stopping docker daemon"
start-stop-daemon --stop \
--exec "$DOCKER_BINARY" \
--pidfile "$DOCKER_PIDFILE"
eend $?
}

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
After=network.target
[Service]
ExecStart=/usr/bin/docker -d
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
After=network.target
[Service]
ExecStart=/usr/bin/docker -d -H fd://
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=/var/run/docker.sock
[Install]
WantedBy=sockets.target

View File

@@ -0,0 +1,123 @@
#!/bin/sh
#
# /etc/rc.d/init.d/docker
#
# Daemon for docker.io
#
# chkconfig: 2345 95 95
# description: Daemon for docker.io
### BEGIN INIT INFO
# Provides: docker
# Required-Start: $network cgconfig
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop docker
# Description: Daemon for docker.io
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
prog="docker"
exec="/usr/bin/$prog"
pidfile="/var/run/$prog.pid"
lockfile="/var/lock/subsys/$prog"
logfile="/var/log/$prog"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
prestart() {
service cgconfig status > /dev/null
if [[ $? != 0 ]]; then
service cgconfig start
fi
}
start() {
[ -x $exec ] || exit 5
if ! [ -f $pidfile ]; then
prestart
printf "Starting $prog:\t"
echo "\n$(date)\n" >> $logfile
$exec -d $other_args &>> $logfile &
pid=$!
touch $lockfile
success
echo
else
failure
echo
printf "$pidfile still exists...\n"
exit 7
fi
}
stop() {
echo -n $"Stopping $prog: "
killproc -p $pidfile $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
status -p $pidfile $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@@ -0,0 +1,7 @@
# /etc/sysconfig/docker
#
# Other arguments to pass to the docker daemon process
# These will be parsed by the sysv initscript and appended
# to the arguments list passed to docker -d
other_args=""

96
contrib/init/sysvinit/docker Executable file
View File

@@ -0,0 +1,96 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: docker
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Create lightweight, portable, self-sufficient containers.
# Description:
# Docker is an open-source project to easily create lightweight, portable,
# self-sufficient containers from any application. The same container that a
# developer builds and tests on a laptop can run at scale, in production, on
# VMs, bare metal, OpenStack clusters, public clouds and more.
### END INIT INFO
BASE=$(basename $0)
DOCKER=/usr/bin/$BASE
DOCKER_PIDFILE=/var/run/$BASE.pid
DOCKER_OPTS=
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
# Get lsb functions
. /lib/lsb/init-functions
if [ -f /etc/default/$BASE ]; then
. /etc/default/$BASE
fi
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then
log_failure_msg "Docker is managed via upstart, try using service $BASE $1"
exit 1
fi
# Check docker is present
if [ ! -x $DOCKER ]; then
log_failure_msg "$DOCKER not present or not executable"
exit 1
fi
fail_unless_root() {
if [ "$(id -u)" != '0' ]; then
log_failure_msg "Docker must be run as root"
exit 1
fi
}
case "$1" in
start)
fail_unless_root
log_begin_msg "Starting Docker: $BASE"
mount | grep cgroup >/dev/null || mount -t cgroup none /sys/fs/cgroup 2>/dev/null
start-stop-daemon --start --background \
--exec "$DOCKER" \
--pidfile "$DOCKER_PIDFILE" \
-- -d -p "$DOCKER_PIDFILE" \
$DOCKER_OPTS
log_end_msg $?
;;
stop)
fail_unless_root
log_begin_msg "Stopping Docker: $BASE"
start-stop-daemon --stop \
--pidfile "$DOCKER_PIDFILE"
log_end_msg $?
;;
restart)
fail_unless_root
docker_pid=`cat "$DOCKER_PIDFILE" 2>/dev/null`
[ -n "$docker_pid" ] \
&& ps -p $docker_pid > /dev/null 2>&1 \
&& $0 stop
$0 start
;;
force-reload)
fail_unless_root
$0 restart
;;
status)
status_of_proc -p "$DOCKER_PIDFILE" "$DOCKER" docker
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,15 @@
description "Docker daemon"
start on filesystem and started lxc-net
stop on runlevel [!2345]
respawn
script
DOCKER=/usr/bin/$UPSTART_JOB
DOCKER_OPTS=
if [ -f /etc/default/$UPSTART_JOB ]; then
. /etc/default/$UPSTART_JOB
fi
"$DOCKER" -d $DOCKER_OPTS
end script

View File

@@ -1,55 +0,0 @@
#!/bin/sh
# This script is meant for quick & easy install via 'curl URL-OF-SCRIPT | sh'
# Original version by Jeff Lindsay <progrium@gmail.com>
# Revamped by Jerome Petazzoni <jerome@dotcloud.com>
#
# This script canonical location is http://get.docker.io/; to update it, run:
# s3cmd put -m text/x-shellscript -P install.sh s3://get.docker.io/index
echo "Ensuring basic dependencies are installed..."
apt-get -qq update
apt-get -qq install lxc wget
echo "Looking in /proc/filesystems to see if we have AUFS support..."
if grep -q aufs /proc/filesystems
then
echo "Found."
else
echo "Ahem, it looks like the current kernel does not support AUFS."
echo "Let's see if we can load the AUFS module with modprobe..."
if modprobe aufs
then
echo "Module loaded."
else
echo "Ahem, things didn't turn out as expected."
KPKG=linux-image-extra-$(uname -r)
echo "Trying to install $KPKG..."
if apt-get -qq install $KPKG
then
echo "Installed."
else
echo "Oops, we couldn't install the -extra kernel."
echo "Are you sure you are running a supported version of Ubuntu?"
echo "Proceeding anyway, but Docker will probably NOT WORK!"
fi
fi
fi
echo "Downloading docker binary and uncompressing into /usr/local/bin..."
curl -s http://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-latest.tgz |
tar -C /usr/local/bin --strip-components=1 -zxf- \
docker-latest/docker
if [ -f /etc/init/dockerd.conf ]
then
echo "Upstart script already exists."
else
echo "Creating /etc/init/dockerd.conf..."
echo "exec env LANG=\"en_US.UTF-8\" /usr/local/bin/docker -d" > /etc/init/dockerd.conf
fi
echo "Starting dockerd..."
start dockerd > /dev/null
echo "Done."
echo

View File

@@ -0,0 +1,92 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

63
contrib/mkimage-arch.sh Executable file
View File

@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# Generate a minimal filesystem for archlinux and load it into the local
# docker as "archlinux"
# requires root
set -e
hash pacstrap &>/dev/null || {
echo "Could not find pacstrap. Run pacman -S arch-install-scripts"
exit 1
}
hash expect &>/dev/null || {
echo "Could not find expect. Run pacman -S expect"
exit 1
}
ROOTFS=$(mktemp -d /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
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"
echo 'en_US.UTF-8 UTF-8' > $ROOTFS/etc/locale.gen
arch-chroot $ROOTFS locale-gen
arch-chroot $ROOTFS /bin/sh -c 'echo "Server = http://mirrors.kernel.org/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist'
# udev doesn't work in containers, rebuild /dev
DEV=$ROOTFS/dev
rm -rf $DEV
mkdir -p $DEV
mknod -m 666 $DEV/null c 1 3
mknod -m 666 $DEV/zero c 1 5
mknod -m 666 $DEV/random c 1 8
mknod -m 666 $DEV/urandom c 1 9
mkdir -m 755 $DEV/pts
mkdir -m 1777 $DEV/shm
mknod -m 666 $DEV/tty c 5 0
mknod -m 600 $DEV/console c 5 1
mknod -m 666 $DEV/tty0 c 4 0
mknod -m 666 $DEV/full c 1 7
mknod -m 600 $DEV/initctl p
mknod -m 666 $DEV/ptmx c 5 2
tar --numeric-owner -C $ROOTFS -c . | docker import - archlinux
docker run -i -t archlinux echo Success.
rm -rf $ROOTFS

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Generate a very minimal filesystem based on busybox-static,
# and load it into the local docker under the name "busybox".
@@ -35,5 +35,5 @@ do
cp -a /dev/$X dev
done
tar -cf- . | docker import - busybox
tar --numeric-owner -cf- . | docker import - busybox
docker run -i -u root busybox /bin/echo Success.

75
contrib/mkimage-crux.sh Executable file
View File

@@ -0,0 +1,75 @@
#!/usr/bin/env bash
# Generate a minimal filesystem for CRUX/Linux and load it into the local
# docker as "cruxlinux"
# requires root and the crux iso (http://crux.nu)
set -e
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "1 argument(s) required, $# provided. Usage: ./mkimage-crux.sh /path/to/iso"
ISO=${1}
ROOTFS=$(mktemp -d /tmp/rootfs-crux-XXXXXXXXXX)
CRUX=$(mktemp -d /tmp/crux-XXXXXXXXXX)
TMP=$(mktemp -d /tmp/XXXXXXXXXX)
VERSION=$(basename --suffix=.iso $ISO | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
# Mount the ISO
mount -o ro,loop $ISO $CRUX
# Extract pkgutils
tar -C $TMP -xf $CRUX/tools/pkgutils#*.pkg.tar.gz
# Put pkgadd in the $PATH
export PATH="$TMP/usr/bin:$PATH"
# Install core packages
mkdir -p $ROOTFS/var/lib/pkg
touch $ROOTFS/var/lib/pkg/db
for pkg in $CRUX/crux/core/*; do
pkgadd -r $ROOTFS $pkg
done
# Remove agetty and inittab config
if (grep agetty ${ROOTFS}/etc/inittab 2>&1 > /dev/null); then
echo "Removing agetty from /etc/inittab ..."
chroot ${ROOTFS} sed -i -e "/agetty/d" /etc/inittab
chroot ${ROOTFS} sed -i -e "/shutdown/d" /etc/inittab
chroot ${ROOTFS} sed -i -e "/^$/N;/^\n$/d" /etc/inittab
fi
# Remove kernel source
rm -rf $ROOTFS/usr/src/*
# udev doesn't work in containers, rebuild /dev
DEV=$ROOTFS/dev
rm -rf $DEV
mkdir -p $DEV
mknod -m 666 $DEV/null c 1 3
mknod -m 666 $DEV/zero c 1 5
mknod -m 666 $DEV/random c 1 8
mknod -m 666 $DEV/urandom c 1 9
mkdir -m 755 $DEV/pts
mkdir -m 1777 $DEV/shm
mknod -m 666 $DEV/tty c 5 0
mknod -m 600 $DEV/console c 5 1
mknod -m 666 $DEV/tty0 c 4 0
mknod -m 666 $DEV/full c 1 7
mknod -m 600 $DEV/initctl p
mknod -m 666 $DEV/ptmx c 5 2
IMAGE_ID=$(tar --numeric-owner -C $ROOTFS -c . | docker import - crux:$VERSION)
docker tag $IMAGE_ID crux:latest
docker run -i -t crux echo Success.
# Cleanup
umount $CRUX
rm -rf $ROOTFS
rm -rf $CRUX
rm -rf $TMP

View File

@@ -1,55 +0,0 @@
#!/bin/bash
set -e
# these should match the names found at http://www.debian.org/releases/
stableSuite='wheezy'
testingSuite='jessie'
unstableSuite='sid'
variant='minbase'
include='iproute,iputils-ping'
repo="$1"
suite="${2:-$stableSuite}"
mirror="${3:-}" # stick to the default debootstrap mirror if one is not provided
if [ ! "$repo" ]; then
echo >&2 "usage: $0 repo [suite [mirror]]"
echo >&2 " ie: $0 tianon/debian squeeze"
exit 1
fi
target="/tmp/docker-rootfs-debian-$suite-$$-$RANDOM"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
returnTo="$(pwd -P)"
set -x
# bootstrap
mkdir -p "$target"
sudo debootstrap --verbose --variant="$variant" --include="$include" "$suite" "$target" "$mirror"
cd "$target"
# create the image
img=$(sudo tar -c . | docker import -)
# tag suite
docker tag $img $repo $suite
# test the image
docker run -i -t $repo:$suite echo success
if [ "$suite" = "$stableSuite" -o "$suite" = 'stable' ]; then
# tag latest
docker tag $img $repo latest
# tag the specific debian release version
ver=$(docker run $repo:$suite cat /etc/debian_version)
docker tag $img $repo $ver
fi
# cleanup
cd "$returnTo"
sudo rm -rf "$target"

257
contrib/mkimage-debootstrap.sh Executable file
View File

@@ -0,0 +1,257 @@
#!/usr/bin/env bash
set -e
variant='minbase'
include='iproute,iputils-ping'
arch='amd64' # intentionally undocumented for now
skipDetection=
strictDebootstrap=
justTar=
usage() {
echo >&2
echo >&2 "usage: $0 [options] repo suite [mirror]"
echo >&2
echo >&2 'options: (not recommended)'
echo >&2 " -p set an http_proxy for debootstrap"
echo >&2 " -v $variant # change default debootstrap variant"
echo >&2 " -i $include # change default package includes"
echo >&2 " -d # strict debootstrap (do not apply any docker-specific tweaks)"
echo >&2 " -s # skip version detection and tagging (ie, precise also tagged as 12.04)"
echo >&2 " # note that this will also skip adding universe and/or security/updates to sources.list"
echo >&2 " -t # just create a tarball, especially for dockerbrew (uses repo as tarball name)"
echo >&2
echo >&2 " ie: $0 username/debian squeeze"
echo >&2 " $0 username/debian squeeze http://ftp.uk.debian.org/debian/"
echo >&2
echo >&2 " ie: $0 username/ubuntu precise"
echo >&2 " $0 username/ubuntu precise http://mirrors.melbourne.co.uk/ubuntu/"
echo >&2
echo >&2 " ie: $0 -t precise.tar.bz2 precise"
echo >&2 " $0 -t wheezy.tgz wheezy"
echo >&2 " $0 -t wheezy-uk.tar.xz wheezy http://ftp.uk.debian.org/debian/"
echo >&2
}
# these should match the names found at http://www.debian.org/releases/
debianStable=wheezy
debianUnstable=sid
# this should match the name found at http://releases.ubuntu.com/
ubuntuLatestLTS=precise
while getopts v:i:a:p:dst name; do
case "$name" in
p)
http_proxy="$OPTARG"
;;
v)
variant="$OPTARG"
;;
i)
include="$OPTARG"
;;
a)
arch="$OPTARG"
;;
d)
strictDebootstrap=1
;;
s)
skipDetection=1
;;
t)
justTar=1
;;
?)
usage
exit 0
;;
esac
done
shift $(($OPTIND - 1))
repo="$1"
suite="$2"
mirror="${3:-}" # stick to the default debootstrap mirror if one is not provided
if [ ! "$repo" ] || [ ! "$suite" ]; then
usage
exit 1
fi
# some rudimentary detection for whether we need to "sudo" our docker calls
docker=''
if docker version > /dev/null 2>&1; then
docker='docker'
elif sudo docker version > /dev/null 2>&1; then
docker='sudo docker'
elif command -v docker > /dev/null 2>&1; then
docker='docker'
else
echo >&2 "warning: either docker isn't installed, or your current user cannot run it;"
echo >&2 " this script is not likely to work as expected"
sleep 3
docker='docker' # give us a command-not-found later
fi
# make sure we have an absolute path to our final tarball so we can still reference it properly after we change directory
if [ "$justTar" ]; then
if [ ! -d "$(dirname "$repo")" ]; then
echo >&2 "error: $(dirname "$repo") does not exist"
exit 1
fi
repo="$(cd "$(dirname "$repo")" && pwd -P)/$(basename "$repo")"
fi
# will be filled in later, if [ -z "$skipDetection" ]
lsbDist=''
target="/tmp/docker-rootfs-debootstrap-$suite-$$-$RANDOM"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
returnTo="$(pwd -P)"
if [ "$suite" = 'lucid' ]; then
# lucid fails and doesn't include gpgv in minbase; "apt-get update" fails
include+=',gpgv'
fi
set -x
# bootstrap
mkdir -p "$target"
sudo http_proxy=$http_proxy debootstrap --verbose --variant="$variant" --include="$include" --arch="$arch" "$suite" "$target" "$mirror"
cd "$target"
if [ -z "$strictDebootstrap" ]; then
# prevent init scripts from running during install/update
# policy-rc.d (for most scripts)
echo $'#!/bin/sh\nexit 101' | sudo tee usr/sbin/policy-rc.d > /dev/null
sudo chmod +x usr/sbin/policy-rc.d
# initctl (for some pesky upstart scripts)
sudo chroot . dpkg-divert --local --rename --add /sbin/initctl
sudo ln -sf /bin/true sbin/initctl
# see https://github.com/dotcloud/docker/issues/446#issuecomment-16953173
# shrink the image, since apt makes us fat (wheezy: ~157.5MB vs ~120MB)
sudo chroot . apt-get clean
if strings usr/bin/dpkg | grep -q unsafe-io; then
# while we're at it, apt is unnecessarily slow inside containers
# this forces dpkg not to call sync() after package extraction and speeds up install
# the benefit is huge on spinning disks, and the penalty is nonexistent on SSD or decent server virtualization
echo 'force-unsafe-io' | sudo tee etc/dpkg/dpkg.cfg.d/02apt-speedup > /dev/null
# we have this wrapped up in an "if" because the "force-unsafe-io"
# option was added in dpkg 1.15.8.6
# (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584254#82),
# and ubuntu lucid/10.04 only has 1.15.5.6
fi
# we want to effectively run "apt-get clean" after every install to keep images small (see output of "apt-get clean -s" for context)
{
aptGetClean='"rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true";'
echo "DPkg::Post-Invoke { ${aptGetClean} };"
echo "APT::Update::Post-Invoke { ${aptGetClean} };"
echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";'
} | sudo tee etc/apt/apt.conf.d/no-cache > /dev/null
# and remove the translations, too
echo 'Acquire::Languages "none";' | sudo tee etc/apt/apt.conf.d/no-languages > /dev/null
# helpful undo lines for each the above tweaks (for lack of a better home to keep track of them):
# rm /usr/sbin/policy-rc.d
# rm /sbin/initctl; dpkg-divert --rename --remove /sbin/initctl
# rm /etc/dpkg/dpkg.cfg.d/02apt-speedup
# rm /etc/apt/apt.conf.d/no-cache
# rm /etc/apt/apt.conf.d/no-languages
if [ -z "$skipDetection" ]; then
# see also rudimentary platform detection in hack/install.sh
lsbDist=''
if [ -r etc/lsb-release ]; then
lsbDist="$(. etc/lsb-release && echo "$DISTRIB_ID")"
fi
if [ -z "$lsbDist" ] && [ -r etc/debian_version ]; then
lsbDist='Debian'
fi
case "$lsbDist" in
Debian)
# add the updates and security repositories
if [ "$suite" != "$debianUnstable" -a "$suite" != 'unstable' ]; then
# ${suite}-updates only applies to non-unstable
sudo sed -i "p; s/ $suite main$/ ${suite}-updates main/" etc/apt/sources.list
# same for security updates
echo "deb http://security.debian.org/ $suite/updates main" | sudo tee -a etc/apt/sources.list > /dev/null
fi
;;
Ubuntu)
# add the universe, updates, and security repositories
sudo sed -i "
s/ $suite main$/ $suite main universe/; p;
s/ $suite main/ ${suite}-updates main/; p;
s/ $suite-updates main/ ${suite}-security main/
" etc/apt/sources.list
;;
esac
fi
# make sure our packages lists are as up to date as we can get them
sudo chroot . apt-get update
fi
if [ "$justTar" ]; then
# create the tarball file so it has the right permissions (ie, not root)
touch "$repo"
# fill the tarball
sudo tar --numeric-owner -caf "$repo" .
else
# create the image (and tag $repo:$suite)
sudo tar --numeric-owner -c . | $docker import - $repo:$suite
# test the image
$docker run -i -t $repo:$suite echo success
if [ -z "$skipDetection" ]; then
case "$lsbDist" in
Debian)
if [ "$suite" = "$debianStable" -o "$suite" = 'stable' ] && [ -r etc/debian_version ]; then
# tag latest
$docker tag $repo:$suite $repo:latest
if [ -r etc/debian_version ]; then
# tag the specific debian release version (which is only reasonable to tag on debian stable)
ver=$(cat etc/debian_version)
$docker tag $repo:$suite $repo:$ver
fi
fi
;;
Ubuntu)
if [ "$suite" = "$ubuntuLatestLTS" ]; then
# tag latest
$docker tag $repo:$suite $repo:latest
fi
if [ -r etc/lsb-release ]; then
lsbRelease="$(. etc/lsb-release && echo "$DISTRIB_RELEASE")"
if [ "$lsbRelease" ]; then
# tag specific Ubuntu version number, if available (12.04, etc.)
$docker tag $repo:$suite $repo:$lsbRelease
fi
fi
;;
esac
fi
fi
# cleanup
cd "$returnTo"
sudo rm -rf "$target"

119
contrib/mkimage-rinse.sh Executable file
View File

@@ -0,0 +1,119 @@
#!/usr/bin/env bash
#
# Create a base CentOS Docker image.
# This script is useful on systems with rinse available (e.g.,
# building a CentOS image on Debian). See contrib/mkimage-yum.sh for
# a way to build CentOS images on systems with yum installed.
set -e
repo="$1"
distro="$2"
mirror="$3"
if [ ! "$repo" ] || [ ! "$distro" ]; then
self="$(basename $0)"
echo >&2 "usage: $self repo distro [mirror]"
echo >&2
echo >&2 " ie: $self username/centos centos-5"
echo >&2 " $self username/centos centos-6"
echo >&2
echo >&2 " ie: $self username/slc slc-5"
echo >&2 " $self username/slc slc-6"
echo >&2
echo >&2 " ie: $self username/centos centos-5 http://vault.centos.org/5.8/os/x86_64/CentOS/"
echo >&2 " $self username/centos centos-6 http://vault.centos.org/6.3/os/x86_64/Packages/"
echo >&2
echo >&2 'See /etc/rinse for supported values of "distro" and for examples of'
echo >&2 ' expected values of "mirror".'
echo >&2
echo >&2 'This script is tested to work with the original upstream version of rinse,'
echo >&2 ' found at http://www.steve.org.uk/Software/rinse/ and also in Debian at'
echo >&2 ' http://packages.debian.org/wheezy/rinse -- as always, YMMV.'
echo >&2
exit 1
fi
target="/tmp/docker-rootfs-rinse-$distro-$$-$RANDOM"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
returnTo="$(pwd -P)"
rinseArgs=( --arch amd64 --distribution "$distro" --directory "$target" )
if [ "$mirror" ]; then
rinseArgs+=( --mirror "$mirror" )
fi
set -x
mkdir -p "$target"
sudo rinse "${rinseArgs[@]}"
cd "$target"
# rinse fails a little at setting up /dev, so we'll just wipe it out and create our own
sudo rm -rf dev
sudo mkdir -m 755 dev
(
cd dev
sudo ln -sf /proc/self/fd ./
sudo mkdir -m 755 pts
sudo mkdir -m 1777 shm
sudo mknod -m 600 console c 5 1
sudo mknod -m 600 initctl p
sudo mknod -m 666 full c 1 7
sudo mknod -m 666 null c 1 3
sudo mknod -m 666 ptmx c 5 2
sudo mknod -m 666 random c 1 8
sudo mknod -m 666 tty c 5 0
sudo mknod -m 666 tty0 c 4 0
sudo mknod -m 666 urandom c 1 9
sudo mknod -m 666 zero c 1 5
)
# effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb --keep-services "$target"
# locales
sudo rm -rf usr/{{lib,share}/locale,{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive}
# docs
sudo rm -rf usr/share/{man,doc,info,gnome/help}
# cracklib
sudo rm -rf usr/share/cracklib
# i18n
sudo rm -rf usr/share/i18n
# yum cache
sudo rm -rf var/cache/yum
sudo mkdir -p --mode=0755 var/cache/yum
# sln
sudo rm -rf sbin/sln
# ldconfig
#sudo rm -rf sbin/ldconfig
sudo rm -rf etc/ld.so.cache var/cache/ldconfig
sudo mkdir -p --mode=0755 var/cache/ldconfig
# allow networking init scripts inside the container to work without extra steps
echo 'NETWORKING=yes' | sudo tee etc/sysconfig/network > /dev/null
# to restore locales later:
# yum reinstall glibc-common
version=
if [ -r etc/redhat-release ]; then
version="$(sed -E 's/^[^0-9.]*([0-9.]+).*$/\1/' etc/redhat-release)"
elif [ -r etc/SuSE-release ]; then
version="$(awk '/^VERSION/ { print $3 }' etc/SuSE-release)"
fi
if [ -z "$version" ]; then
echo >&2 "warning: cannot autodetect OS version, using $distro as tag"
sleep 20
version="$distro"
fi
sudo tar --numeric-owner -c . | docker import - $repo:$version
docker run -i -t $repo:$version echo success
cd "$returnTo"
sudo rm -rf "$target"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Generate a very minimal filesystem based on busybox-static,
# and load it into the local docker under the name "docker-ut".
@@ -23,7 +23,9 @@ mkdir bin etc dev dev/pts lib proc sys tmp
touch etc/resolv.conf
cp /etc/nsswitch.conf etc/nsswitch.conf
echo root:x:0:0:root:/:/bin/sh > etc/passwd
echo daemon:x:1:1:daemon:/usr/sbin:/bin/sh >> etc/passwd
echo root:x:0: > etc/group
echo daemon:x:1: >> etc/group
ln -s lib lib64
ln -s bin sbin
cp $BUSYBOX $SOCAT bin
@@ -41,6 +43,7 @@ do
cp -a /dev/$X dev
done
tar -cf- . | docker import - docker-ut
chmod 0755 $ROOTFS # See #486
tar --numeric-owner -cf- . | docker import - docker-ut
docker run -i -u root docker-ut /bin/echo Success.
rm -rf $ROOTFS

90
contrib/mkimage-yum.sh Executable file
View File

@@ -0,0 +1,90 @@
#!/usr/bin/env bash
#
# Create a base CentOS Docker image.
#
# This script is useful on systems with yum installed (e.g., building
# a CentOS image on CentOS). See contrib/mkimage-rinse.sh for a way
# to build CentOS images on other systems.
usage() {
cat <<EOOPTS
$(basename $0) [OPTIONS] <name>
OPTIONS:
-y <yumconf> The path to the yum config to install packages from. The
default is /etc/yum.conf.
EOOPTS
exit 1
}
# option defaults
yum_config=/etc/yum.conf
while getopts ":y:h" opt; do
case $opt in
y)
yum_config=$OPTARG
;;
h)
usage
;;
\?)
echo "Invalid option: -$OPTARG"
usage
;;
esac
done
shift $((OPTIND - 1))
name=$1
if [[ -z $name ]]; then
usage
fi
#--------------------
target=$(mktemp -d --tmpdir $(basename $0).XXXXXX)
set -x
for dev in console null zero urandom; do
/sbin/MAKEDEV -d "$target"/dev -x $dev
done
yum -c "$yum_config" --installroot="$target" --setopt=tsflags=nodocs \
--setopt=group_package_types=mandatory -y groupinstall Core
yum -c "$yum_config" --installroot="$target" -y clean all
cat > "$target"/etc/sysconfig/network <<EOF
NETWORKING=yes
HOSTNAME=localhost.localdomain
EOF
# effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb
# --keep-services "$target". Stolen from mkimage-rinse.sh
# locales
rm -rf "$target"/usr/{{lib,share}/locale,{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive}
# docs
rm -rf "$target"/usr/share/{man,doc,info,gnome/help}
# cracklib
rm -rf "$target"/usr/share/cracklib
# i18n
rm -rf "$target"/usr/share/i18n
# sln
rm -rf "$target"/sbin/sln
# ldconfig
rm -rf "$target"/etc/ld.so.cache
rm -rf "$target"/var/cache/ldconfig/*
version=
if [ -r "$target"/etc/redhat-release ]; then
version="$(sed 's/^[^0-9\]*\([0-9.]\+\).*$/\1/' /etc/redhat-release)"
fi
if [ -z "$version" ]; then
echo >&2 "warning: cannot autodetect OS version, using '$name' as tag"
version=$name
fi
tar --numeric-owner -c -C "$target" . | docker import - $name:$version
docker run -i -t $name:$version echo success
rm -rf "$target"

77
contrib/mkseccomp.pl Executable file
View File

@@ -0,0 +1,77 @@
#!/usr/bin/perl
#
# A simple helper script to help people build seccomp profiles for
# Docker/LXC. The goal is mostly to reduce the attack surface to the
# kernel, by restricting access to rarely used, recently added or not used
# syscalls.
#
# This script processes one or more files which contain the list of system
# calls to be allowed. See mkseccomp.sample for more information how you
# can configure the list of syscalls. When run, this script produces output
# which, when stored in a file, can be passed to docker as follows:
#
# docker run -lxc-conf="lxc.seccomp=$file" <rest of arguments>
#
# The included sample file shows how to cut about a quarter of all syscalls,
# which affecting most applications.
#
# For specific situations it is possible to reduce the list further. By
# reducing the list to just those syscalls required by a certain application
# you can make it difficult for unknown/unexpected code to run.
#
# Run this script as follows:
#
# ./mkseccomp.pl < mkseccomp.sample >syscalls.list
# or
# ./mkseccomp.pl mkseccomp.sample >syscalls.list
#
# Multiple files can be specified, in which case the lists of syscalls are
# combined.
#
# By Martijn van Oosterhout <kleptog@svana.org> Nov 2013
# How it works:
#
# This program basically spawns two processes to form a chain like:
#
# <process data section to prefix __NR_> | cpp | <add header and filter unknown syscalls>
use strict;
use warnings;
if( -t ) {
print STDERR "Helper script to make seccomp filters for Docker/LXC.\n";
print STDERR "Usage: mkseccomp.pl < [files...]\n";
exit 1;
}
my $pid = open(my $in, "-|") // die "Couldn't fork1 ($!)\n";
if($pid == 0) { # Child
$pid = open(my $out, "|-") // die "Couldn't fork2 ($!)\n";
if($pid == 0) { # Child, which execs cpp
exec "cpp" or die "Couldn't exec cpp ($!)\n";
exit 1;
}
# Process the DATA section and output to cpp
print $out "#include <sys/syscall.h>\n";
while(<>) {
if(/^\w/) {
print $out "__NR_$_";
}
}
close $out;
exit 0;
}
# Print header and then process output from cpp.
print "1\n";
print "whitelist\n";
while(<$in>) {
print if( /^[0-9]/ );
}

444
contrib/mkseccomp.sample Normal file
View File

@@ -0,0 +1,444 @@
/* This sample file is an example for mkseccomp.pl to produce a seccomp file
* which restricts syscalls that are only useful for an admin but allows the
* vast majority of normal userspace programs to run normally.
*
* The format of this file is one line per syscall. This is then processed
* and passed to 'cpp' to convert the names to numbers using whatever is
* correct for your platform. As such C-style comments are permitted. Note
* this also means that C preprocessor macros are also allowed. So it is
* possible to create groups surrounded by #ifdef/#endif and control their
* inclusion via #define (not #include).
*
* Syscalls that don't exist on your architecture are silently filtered out.
* Syscalls marked with (*) are required for a container to spawn a bash
* shell successfully (not necessarily full featured). Listing the same
* syscall multiple times is no problem.
*
* If you want to make a list specifically for one application the easiest
* way is to run the application under strace, like so:
*
* $ strace -f -q -c -o strace.out application args...
*
* Once you have a reasonable sample of the execution of the program, exit
* it. The file strace.out will have a summary of the syscalls used. Copy
* that list into this file, comment out everything else except the starred
* syscalls (which you need for the container to start) and you're done.
*
* To get the list of syscalls from the strace output this works well for
* me
*
* $ cut -c52 < strace.out
*
* This sample list was compiled as a combination of all the syscalls
* available on i386 and amd64 on Ubuntu Precise, as such it may not contain
* everything and not everything may be relevent for your system. This
* shouldn't be a problem.
*/
// Filesystem/File descriptor related
access // (*)
chdir // (*)
chmod
chown
chown32
close // (*)
creat
dup // (*)
dup2 // (*)
dup3
epoll_create
epoll_create1
epoll_ctl
epoll_ctl_old
epoll_pwait
epoll_wait
epoll_wait_old
eventfd
eventfd2
faccessat // (*)
fadvise64
fadvise64_64
fallocate
fanotify_init
fanotify_mark
ioctl // (*)
fchdir
fchmod
fchmodat
fchown
fchown32
fchownat
fcntl // (*)
fcntl64
fdatasync
fgetxattr
flistxattr
flock
fremovexattr
fsetxattr
fstat // (*)
fstat64
fstatat64
fstatfs
fstatfs64
fsync
ftruncate
ftruncate64
getcwd // (*)
getdents // (*)
getdents64
getxattr
inotify_add_watch
inotify_init
inotify_init1
inotify_rm_watch
io_cancel
io_destroy
io_getevents
io_setup
io_submit
lchown
lchown32
lgetxattr
link
linkat
listxattr
llistxattr
llseek
_llseek
lremovexattr
lseek // (*)
lsetxattr
lstat
lstat64
mkdir
mkdirat
mknod
mknodat
newfstatat
_newselect
oldfstat
oldlstat
oldolduname
oldstat
olduname
oldwait4
open // (*)
openat // (*)
pipe // (*)
pipe2
poll
ppoll
pread64
preadv
futimesat
pselect6
pwrite64
pwritev
read // (*)
readahead
readdir
readlink
readlinkat
readv
removexattr
rename
renameat
rmdir
select
sendfile
sendfile64
setxattr
splice
stat // (*)
stat64
statfs // (*)
statfs64
symlink
symlinkat
sync
sync_file_range
sync_file_range2
syncfs
tee
truncate
truncate64
umask
unlink
unlinkat
ustat
utime
utimensat
utimes
write // (*)
writev
// Network related
accept
accept4
bind // (*)
connect // (*)
getpeername
getsockname // (*)
getsockopt
listen
recv
recvfrom // (*)
recvmmsg
recvmsg
send
sendmmsg
sendmsg
sendto // (*)
setsockopt
shutdown
socket // (*)
socketcall
socketpair
sethostname // (*)
// Signal related
pause
rt_sigaction // (*)
rt_sigpending
rt_sigprocmask // (*)
rt_sigqueueinfo
rt_sigreturn // (*)
rt_sigsuspend
rt_sigtimedwait
rt_tgsigqueueinfo
sigaction
sigaltstack // (*)
signal
signalfd
signalfd4
sigpending
sigprocmask
sigreturn
sigsuspend
// Other needed POSIX
alarm
brk // (*)
clock_adjtime
clock_getres
clock_gettime
clock_nanosleep
//clock_settime
gettimeofday
nanosleep
nice
sysinfo
syslog
time
timer_create
timer_delete
timerfd_create
timerfd_gettime
timerfd_settime
timer_getoverrun
timer_gettime
timer_settime
times
uname // (*)
// Memory control
madvise
mbind
mincore
mlock
mlockall
mmap // (*)
mmap2
mprotect // (*)
mremap
msync
munlock
munlockall
munmap // (*)
remap_file_pages
set_mempolicy
vmsplice
// Process control
capget
capset // (*)
clone // (*)
execve // (*)
exit // (*)
exit_group // (*)
fork
getcpu
getpgid
getpgrp // (*)
getpid // (*)
getppid // (*)
getpriority
getresgid
getresgid32
getresuid
getresuid32
getrlimit // (*)
getrusage
getsid
getuid // (*)
getuid32
getegid // (*)
getegid32
geteuid // (*)
geteuid32
getgid // (*)
getgid32
getgroups
getgroups32
getitimer
get_mempolicy
kill
//personality
prctl
prlimit64
sched_getaffinity
sched_getparam
sched_get_priority_max
sched_get_priority_min
sched_getscheduler
sched_rr_get_interval
//sched_setaffinity
//sched_setparam
//sched_setscheduler
sched_yield
setfsgid
setfsgid32
setfsuid
setfsuid32
setgid
setgid32
setgroups
setgroups32
setitimer
setpgid // (*)
setpriority
setregid
setregid32
setresgid
setresgid32
setresuid
setresuid32
setreuid
setreuid32
setrlimit
setsid
setuid
setuid32
ugetrlimit
vfork
wait4 // (*)
waitid
waitpid
// IPC
ipc
mq_getsetattr
mq_notify
mq_open
mq_timedreceive
mq_timedsend
mq_unlink
msgctl
msgget
msgrcv
msgsnd
semctl
semget
semop
semtimedop
shmat
shmctl
shmdt
shmget
// Linux specific, mostly needed for thread-related stuff
arch_prctl // (*)
get_robust_list
get_thread_area
gettid
futex // (*)
restart_syscall // (*)
set_robust_list // (*)
set_thread_area
set_tid_address // (*)
tgkill
tkill
// Admin syscalls, these are blocked
//acct
//adjtimex
//bdflush
//chroot
//create_module
//delete_module
//get_kernel_syms // Obsolete
//idle // Obsolete
//init_module
//ioperm
//iopl
//ioprio_get
//ioprio_set
//kexec_load
//lookup_dcookie // oprofile only?
//migrate_pages // NUMA
//modify_ldt
//mount
//move_pages // NUMA
//name_to_handle_at // NFS server
//nfsservctl // NFS server
//open_by_handle_at // NFS server
//perf_event_open
//pivot_root
//process_vm_readv // For debugger
//process_vm_writev // For debugger
//ptrace // For debugger
//query_module
//quotactl
//reboot
//setdomainname
//setns
//settimeofday
//sgetmask // Obsolete
//ssetmask // Obsolete
//stime
//swapoff
//swapon
//_sysctl
//sysfs
//sys_setaltroot
//umount
//umount2
//unshare
//uselib
//vhangup
//vm86
//vm86old
// Kernel key management
//add_key
//keyctl
//request_key
// Unimplemented
//afs_syscall
//break
//ftime
//getpmsg
//gtty
//lock
//madvise1
//mpx
//prof
//profil
//putpmsg
//security
//stty
//tuxcall
//ulimit
//vserver

View File

@@ -0,0 +1,7 @@
#!/bin/sh
# Auto sign all commits to allow them to be used by the Docker project.
# see https://github.com/dotcloud/docker/blob/master/CONTRIBUTING.md#sign-your-work
#
GH_USER=$(git config --get github.user)
SOB=$(git var GIT_AUTHOR_IDENT | sed -n "s/^\(.*>\).*$/Docker-DCO-1.1-Signed-off-by: \1 \(github: $GH_USER\)/p")
grep -qs "^$SOB" "$1" || echo "\n$SOB" >> "$1"

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.dockerfile</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string># </string>
</dict>
</array>
</dict>
<key>uuid</key>
<string>2B215AC0-A7F3-4090-9FF6-F4842BD56CA7</string>
</dict>
</plist>

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Dockerfile</string>
<key>fileTypes</key>
<array>
<string>Dockerfile</string>
</array>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>^\s*(ONBUILD\s+)?(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|VOLUME|USER|WORKDIR)\s</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.control.dockerfile</string>
</dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.special-method.dockerfile</string>
</dict>
</dict>
</dict>
<dict>
<key>match</key>
<string>^\s*(ONBUILD\s+)?(CMD|ENTRYPOINT)\s</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.operator.dockerfile</string>
</dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.special-method.dockerfile</string>
</dict>
</dict>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>end</key>
<string>"</string>
<key>name</key>
<string>string.quoted.double.dockerfile</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escaped.dockerfile</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>end</key>
<string>'</string>
<key>name</key>
<string>string.quoted.single.dockerfile</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escaped.dockerfile</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>^\s*#.*$</string>
<key>name</key>
<string>comment.block.dockerfile</string>
</dict>
</array>
<key>scopeName</key>
<string>source.dockerfile</string>
<key>uuid</key>
<string>a39d8795-59d2-49af-aa00-fe74ee29576e</string>
</dict>
</plist>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>contactEmailRot13</key>
<string>germ@andz.com.ar</string>
<key>contactName</key>
<string>GermanDZ</string>
<key>description</key>
<string>Helpers for Docker.</string>
<key>name</key>
<string>Docker</string>
<key>uuid</key>
<string>8B9DDBAF-E65C-4E12-FFA7-467D4AA535B1</string>
</dict>
</plist>

View File

@@ -0,0 +1 @@
Asbjorn Enge <asbjorn@hanafjedle.net> (@asbjornenge)

View File

@@ -0,0 +1,16 @@
# Docker.tmbundle
Dockerfile syntaxt highlighting for TextMate and Sublime Text.
## Install
### Sublime Text
Available for Sublime Text under [package control](https://sublime.wbond.net/packages/Dockerfile%20Syntax%20Highlighting).
Search for *Dockerfile Syntax Highlighting*
### TextMate 2
Copy the directory `Docker.tmbundle` (showed as a Package in OSX) to `~/Library/Application Support/TextMate/Managed/Bundles`
enjoy.

View File

@@ -0,0 +1,22 @@
Copyright (c) 2013 Honza Pokorny
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,23 @@
dockerfile.vim
==============
Syntax highlighting for Dockerfiles
Installation
------------
Via pathogen, the usual way...
Features
--------
The syntax highlighting includes:
* The directives (e.g. `FROM`)
* Strings
* Comments
License
-------
BSD, short and sweet

View File

@@ -0,0 +1,18 @@
*dockerfile.txt* Syntax highlighting for Dockerfiles
Author: Honza Pokorny <http://honza.ca>
License: BSD
INSTALLATION *installation*
Drop it on your Pathogen path and you're all set.
FEATURES *features*
The syntax highlighting includes:
* The directives (e.g. FROM)
* Strings
* Comments
vim:tw=78:et:ft=help:norl:

View File

@@ -0,0 +1 @@
au BufNewFile,BufRead Dockerfile set filetype=dockerfile

View File

@@ -0,0 +1,23 @@
" dockerfile.vim - Syntax highlighting for Dockerfiles
" Maintainer: Honza Pokorny <http://honza.ca>
" Version: 0.5
if exists("b:current_syntax")
finish
endif
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/
highlight link dockerfileKeyword Keyword
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
highlight link dockerfileString String
syntax match dockerfileComment "\v^\s*#.*$"
highlight link dockerfileComment Comment
set commentstring=#\ %s

View File

@@ -0,0 +1,3 @@
# hide docker's loopback devices from udisks, and thus from user desktops
SUBSYSTEM=="block", ENV{DM_NAME}=="docker-*", ENV{UDISKS_PRESENTATION_HIDE}="1", ENV{UDISKS_IGNORE}="1"
SUBSYSTEM=="block", DEVPATH=="/devices/virtual/block/loop*", ATTR{loop/backing_file}=="/var/lib/docker/*", ENV{UDISKS_PRESENTATION_HIDE}="1", ENV{UDISKS_IGNORE}="1"

View File

@@ -1,3 +1,50 @@
# Vagrant-docker
# Vagrant integration
This is a placeholder for the official vagrant-docker, a plugin for Vagrant (http://vagrantup.com) which exposes Docker as a provider.
Currently there are at least 4 different projects that we are aware of that deals
with integration with [Vagrant](http://vagrantup.com/) at different levels. One
approach is to use Docker as a [provisioner](http://docs.vagrantup.com/v2/provisioning/index.html)
which means you can create containers and pull base images on VMs using Docker's
CLI and the other is to use Docker as a [provider](http://docs.vagrantup.com/v2/providers/index.html),
meaning you can use Vagrant to control Docker containers.
### Provisioners
* [Vocker](https://github.com/fgrehm/vocker)
* [Ventriloquist](https://github.com/fgrehm/ventriloquist)
### Providers
* [docker-provider](https://github.com/fgrehm/docker-provider)
* [vagrant-shell](https://github.com/destructuring/vagrant-shell)
## Setting up Vagrant-docker with the Remote API
The initial Docker upstart script will not work because it runs on `127.0.0.1`, which is not accessible to the host machine. Instead, we need to change the script to connect to `0.0.0.0`. To do this, modify `/etc/init/docker.conf` to look like this:
```
description "Docker daemon"
start on filesystem and started lxc-net
stop on runlevel [!2345]
respawn
script
/usr/bin/docker -d -H=tcp://0.0.0.0:4243/
end script
```
Once that's done, you need to set up a SSH tunnel between your host machine and the vagrant machine that's running Docker. This can be done by running the following command in a host terminal:
```
ssh -L 4243:localhost:4243 -p 2222 vagrant@localhost
```
(The first 4243 is what your host can connect to, the second 4243 is what port Docker is running on in the vagrant machine, and the 2222 is the port Vagrant is providing for SSH. If VirtualBox is the VM you're using, you can see what value "2222" should be by going to: Network > Adapter 1 > Advanced > Port Forwarding in the VirtualBox GUI.)
Note that because the port has been changed, to run docker commands from within the command line you must run them like this:
```
sudo docker -H 0.0.0.0:4243 < commands for docker >
```

1
contrib/zfs/MAINTAINERS Normal file
View File

@@ -0,0 +1 @@
Gurjeet Singh <gurjeet@singh.im> (gurjeet.singh.im)

23
contrib/zfs/README.md Normal file
View File

@@ -0,0 +1,23 @@
# ZFS Storage Driver
This is a placeholder to declare the presence and status of ZFS storage driver
for containers.
The current development is done in Gurjeet Singh's fork of Docker, under the
branch named [zfs_driver].
[zfs_driver]: https://github.com/gurjeet/docker/tree/zfs_driver
# Status
Alpha: The code is now capable of creating, running and destroying containers
and images.
The code is under development. Contributions in the form of suggestions,
code-reviews, and patches are welcome.
Please send the communication to gurjeet@singh.im and CC at least one Docker
mailing list.

View File

@@ -1,150 +1,139 @@
package main
import (
"flag"
"fmt"
"github.com/dotcloud/docker"
"github.com/dotcloud/docker/utils"
"io/ioutil"
"log"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
)
var (
GITCOMMIT string
_ "github.com/dotcloud/docker"
"github.com/dotcloud/docker/api"
"github.com/dotcloud/docker/dockerversion"
"github.com/dotcloud/docker/engine"
flag "github.com/dotcloud/docker/pkg/mflag"
"github.com/dotcloud/docker/pkg/opts"
"github.com/dotcloud/docker/sysinit"
"github.com/dotcloud/docker/utils"
)
func main() {
if utils.SelfPath() == "/sbin/init" {
if selfPath := utils.SelfPath(); selfPath == "/sbin/init" || selfPath == "/.dockerinit" {
// Running in init mode
docker.SysInit()
sysinit.SysInit()
return
}
// FIXME: Switch d and D ? (to be more sshd like)
flDaemon := flag.Bool("d", false, "Daemon mode")
flDebug := flag.Bool("D", false, "Debug mode")
flAutoRestart := flag.Bool("r", false, "Restart previously running containers")
bridgeName := flag.String("b", "", "Attach containers to a pre-existing network bridge")
pidfile := flag.String("p", "/var/run/docker.pid", "File containing process PID")
flGraphPath := flag.String("g", "/var/lib/docker", "Path to graph storage base dir.")
flEnableCors := flag.Bool("api-enable-cors", false, "Enable CORS requests in the remote api.")
flDns := flag.String("dns", "", "Set custom dns servers")
flHosts := docker.ListOpts{fmt.Sprintf("tcp://%s:%d", docker.DEFAULTHTTPHOST, docker.DEFAULTHTTPPORT)}
flag.Var(&flHosts, "H", "tcp://host:port to bind/connect to or unix://path/to/socket to use")
var (
flVersion = flag.Bool([]string{"v", "-version"}, false, "Print version information and quit")
flDaemon = flag.Bool([]string{"d", "-daemon"}, false, "Enable daemon mode")
flDebug = flag.Bool([]string{"D", "-debug"}, false, "Enable debug mode")
flAutoRestart = flag.Bool([]string{"r", "-restart"}, true, "Restart previously running containers")
bridgeName = flag.String([]string{"b", "-bridge"}, "", "Attach containers to a pre-existing network bridge; use '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")
flEnableCors = flag.Bool([]string{"#api-enable-cors", "-api-enable-cors"}, false, "Enable CORS headers in the remote API")
flDns = opts.NewListOpts(opts.ValidateIp4Address)
flEnableIptables = flag.Bool([]string{"#iptables", "-iptables"}, true, "Disable docker's addition of iptables rules")
flEnableIpForward = flag.Bool([]string{"#ip-forward", "-ip-forward"}, true, "Disable enabling of 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")
flHosts = opts.NewListOpts(api.ValidateHost)
flMtu = flag.Int([]string{"#mtu", "-mtu"}, 0, "Set the containers network MTU; if no value is provided: default to the default route MTU or 1500 if not default route is available")
)
flag.Var(&flDns, []string{"#dns", "-dns"}, "Force docker to use specific DNS servers")
flag.Var(&flHosts, []string{"H", "-host"}, "tcp://host:port, unix://path/to/socket, fd://* or fd://socketfd to use in daemon mode. Multiple sockets can be specified")
flag.Parse()
if len(flHosts) > 1 {
flHosts = flHosts[1:len(flHosts)] //trick to display a nice defaul value in the usage
if *flVersion {
showVersion()
return
}
for i, flHost := range flHosts {
flHosts[i] = utils.ParseHost(docker.DEFAULTHTTPHOST, docker.DEFAULTHTTPPORT, flHost)
if flHosts.Len() == 0 {
defaultHost := os.Getenv("DOCKER_HOST")
if defaultHost == "" || *flDaemon {
// If we do not have a host, default to unix socket
defaultHost = fmt.Sprintf("unix://%s", api.DEFAULTUNIXSOCKET)
}
if _, err := api.ValidateHost(defaultHost); err != nil {
log.Fatal(err)
}
flHosts.Set(defaultHost)
}
if *bridgeName != "" {
docker.NetworkBridgeIface = *bridgeName
} else {
docker.NetworkBridgeIface = docker.DefaultNetworkBridge
if *bridgeName != "" && *bridgeIp != "" {
log.Fatal("You specified -b & --bip, mutually exclusive options. Please specify only one.")
}
if *flDebug {
os.Setenv("DEBUG", "1")
}
docker.GITCOMMIT = GITCOMMIT
if *flDaemon {
if flag.NArg() != 0 {
flag.Usage()
return
}
if err := daemon(*pidfile, *flGraphPath, flHosts, *flAutoRestart, *flEnableCors, *flDns); err != nil {
eng, err := engine.New(*flRoot)
if err != nil {
log.Fatal(err)
}
// load the daemon in the background so we can immediately start
// the http api so that connections don't fail while the daemon
// is booting
go func() {
// Load plugin: httpapi
job := eng.Job("initserver")
job.Setenv("Pidfile", *pidfile)
job.Setenv("Root", *flRoot)
job.SetenvBool("AutoRestart", *flAutoRestart)
job.SetenvList("Dns", flDns.GetAll())
job.SetenvBool("EnableIptables", *flEnableIptables)
job.SetenvBool("EnableIpForward", *flEnableIpForward)
job.Setenv("BridgeIface", *bridgeName)
job.Setenv("BridgeIP", *bridgeIp)
job.Setenv("DefaultIp", *flDefaultIp)
job.SetenvBool("InterContainerCommunication", *flInterContainerComm)
job.Setenv("GraphDriver", *flGraphDriver)
job.SetenvInt("Mtu", *flMtu)
if err := job.Run(); err != nil {
log.Fatal(err)
}
// after the daemon is done setting up we can tell the api to start
// accepting connections
if err := eng.Job("acceptconnections").Run(); err != nil {
log.Fatal(err)
}
}()
// Serve api
job := eng.Job("serveapi", flHosts.GetAll()...)
job.SetenvBool("Logging", true)
job.SetenvBool("EnableCors", *flEnableCors)
job.Setenv("Version", dockerversion.VERSION)
if err := job.Run(); err != nil {
log.Fatal(err)
os.Exit(-1)
}
} else {
if len(flHosts) > 1 {
if flHosts.Len() > 1 {
log.Fatal("Please specify only one -H")
return
}
protoAddrParts := strings.SplitN(flHosts[0], "://", 2)
if err := docker.ParseCommands(protoAddrParts[0], protoAddrParts[1], flag.Args()...); err != nil {
protoAddrParts := strings.SplitN(flHosts.GetAll()[0], "://", 2)
if err := api.ParseCommands(protoAddrParts[0], protoAddrParts[1], flag.Args()...); err != nil {
if sterr, ok := err.(*utils.StatusError); ok {
if sterr.Status != "" {
log.Println(sterr.Status)
}
os.Exit(sterr.StatusCode)
}
log.Fatal(err)
os.Exit(-1)
}
}
}
func createPidFile(pidfile string) error {
if pidString, err := ioutil.ReadFile(pidfile); err == nil {
pid, err := strconv.Atoi(string(pidString))
if err == nil {
if _, err := os.Stat(fmt.Sprintf("/proc/%d/", pid)); err == nil {
return fmt.Errorf("pid file found, ensure docker is not running or delete %s", pidfile)
}
}
}
file, err := os.Create(pidfile)
if err != nil {
return err
}
defer file.Close()
_, err = fmt.Fprintf(file, "%d", os.Getpid())
return err
}
func removePidFile(pidfile string) {
if err := os.Remove(pidfile); err != nil {
log.Printf("Error removing %s: %s", pidfile, err)
}
}
func daemon(pidfile string, flGraphPath string, protoAddrs []string, autoRestart, enableCors bool, flDns string) error {
if err := createPidFile(pidfile); err != nil {
log.Fatal(err)
}
defer removePidFile(pidfile)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, os.Kill, os.Signal(syscall.SIGTERM))
go func() {
sig := <-c
log.Printf("Received signal '%v', exiting\n", sig)
removePidFile(pidfile)
os.Exit(0)
}()
var dns []string
if flDns != "" {
dns = []string{flDns}
}
server, err := docker.NewServer(flGraphPath, autoRestart, enableCors, dns)
if err != nil {
return err
}
chErrors := make(chan error, len(protoAddrs))
for _, protoAddr := range protoAddrs {
protoAddrParts := strings.SplitN(protoAddr, "://", 2)
if protoAddrParts[0] == "unix" {
syscall.Unlink(protoAddrParts[1])
} else if protoAddrParts[0] == "tcp" {
if !strings.HasPrefix(protoAddrParts[1], "127.0.0.1") {
log.Println("/!\\ DON'T BIND ON ANOTHER IP ADDRESS THAN 127.0.0.1 IF YOU DON'T KNOW WHAT YOU'RE DOING /!\\")
}
} else {
log.Fatal("Invalid protocol format.")
os.Exit(-1)
}
go func() {
chErrors <- docker.ListenAndServe(protoAddrParts[0], protoAddrParts[1], server, true)
}()
}
for i := 0; i < len(protoAddrs); i += 1 {
err := <-chErrors
if err != nil {
return err
}
}
return nil
func showVersion() {
fmt.Printf("Docker version %s, build %s\n", dockerversion.VERSION, dockerversion.GITCOMMIT)
}

11
dockerinit/dockerinit.go Normal file
View File

@@ -0,0 +1,11 @@
package main
import (
"github.com/dotcloud/docker/sysinit"
)
func main() {
// Running in init mode
sysinit.SysInit()
return
}

View File

@@ -0,0 +1,15 @@
package dockerversion
// FIXME: this should be embedded in the docker/docker.go,
// but we can't because distro policy requires us to
// package a separate dockerinit binary, and that binary needs
// to know its version too.
var (
GITCOMMIT string
VERSION string
IAMSTATIC bool // whether or not Docker itself was compiled statically via ./hack/make.sh binary
INITSHA1 string // sha1sum of separate static dockerinit, if Docker itself was compiled dynamically via ./hack/make.sh dynbinary
INITPATH string // custom location to search for a valid dockerinit binary (available for packagers as a last resort escape hatch)
)

19
docs/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM ubuntu:12.04
MAINTAINER Nick Stinemates
#
# docker build -t docker:docs . && docker run -p 8000:8000 docker:docs
#
# TODO switch to http://packages.ubuntu.com/trusty/python-sphinxcontrib-httpdomain once trusty is released
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq make python-pip python-setuptools
# pip installs from docs/requirements.txt, but here to increase cacheability
RUN pip install Sphinx==1.2.1
RUN pip install sphinxcontrib-httpdomain==1.2.0
ADD . /docs
RUN make -C /docs clean docs
WORKDIR /docs/_build/html
CMD ["python", "-m", "SimpleHTTPServer"]
# note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525
EXPOSE 8000

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