Compare commits

...

1859 Commits

Author SHA1 Message Date
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
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
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
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
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
Guillaume J. Charmes
bc82940a57 Forbid syscalls in tests, add 2 new unit tests 2013-11-21 16:32:16 -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
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
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
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
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
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
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
Michael Crosby
1b28cdc7f9 Handle image metadata when drivers are switched 2013-11-20 10:31:51 -08: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
24586d7af5 Merge pull request #54 from shykes/vieux_merge_master
Merge from master
2013-11-19 18:38:15 -08:00
Victor Vieux
880a0e9c36 Merge branch 'master' into vieux_merge_master 2013-11-19 18:34:19 -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
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
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
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
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
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
Michael Crosby
f88b760809 Migrate images with parent relationship 2013-11-18 16:17:43 -08: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
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
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
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
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
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
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
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
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
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
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
Michael Crosby
a69d86e0b1 Add test for ApplyDiff 2013-11-13 11:03:56 -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
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
Michael Crosby
a4f14528c2 Ignore dir sizes in TreeSize func 2013-11-13 10:33:24 -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
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
Michael Crosby
5d9723002b Allow drivers to implement ApplyDiff in Differ interface 2013-11-11 19:09:57 -08:00
Michael Crosby
2c7f50a77d Add ability to exclude files from tar 2013-11-11 14:30:38 -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
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
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
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
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
Solomon Hykes
948bb29d27 Don't use drivers to store temporary image downloads 2013-11-09 00:53:58 +00: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
Michael Crosby
ddb27268c9 Do not pass container information when creating a volume 2013-11-08 16:11:57 -08:00
Michael Crosby
1eb00e1d5b Allow drivers to export their own diff 2013-11-08 15:32:50 -08:00
Michael Crosby
9514767587 Allow driver to provide changes if it impl the Changer interface 2013-11-08 14:54:20 -08:00
Michael Crosby
f512049c8f Add unit test for child changes diff in aufs 2013-11-08 12:25:17 -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
Michael Crosby
51c93c0f33 Fix aufs error at startup
Add String methods to other drivers
2013-11-07 19:02:15 -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
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
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
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
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
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
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
Solomon Hykes
4d90e91243 Merge branch 'finalize-interfaces' into 0.6.5-dm-plugin 2013-11-05 23:24:46 +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
Michael Crosby
ed572b457d Finalize driver interfaces 2013-11-04 20:51:12 -08:00
Solomon Hykes
66bf395e4d Merge branch 'dm-plugin-dockerfile' into 0.6.5-dm-plugin 2013-11-04 23:41:23 +00: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
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
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
Solomon Hykes
ff42748bc5 Rename graph backends to 'drivers' which is probably more self-explanatory 2013-11-04 01:54:51 +00:00
Solomon Hykes
d23b9e8734 devmapper: implement OnRemove 2013-11-02 21:25:06 +00: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
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
Michael Crosby
699a1074fb Initial work on moving aufs to a subpackage 2013-10-31 18:07:54 -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
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
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
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
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
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
Solomon Hykes
85a36b3b53 devmapper: rename deviceset_devmapper.go to deviceset.go 2013-10-18 05:19:22 +00: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
d034aafac7 devicemapper: Add fixme 2013-10-18 00:58:20 +00: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
Guillaume J. Charmes
31b883b076 Add error checking and error messages 2013-10-17 15:04:14 -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
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
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
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
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
Solomon Hykes
1711de4b09 devmapper: wait for devices to be effectively unmounted before removing them 2013-10-16 23:06:07 +00: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
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
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
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
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
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
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
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
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
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
Solomon Hykes
1804fcba93 Merged master into device-mapper branch 2013-10-10 12:50:30 -07: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
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
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
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
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
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
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
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
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
359 changed files with 32649 additions and 11763 deletions

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

View File

@@ -1,9 +1,11 @@
# Generate AUTHORS: git log --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,8 +17,11 @@ 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>
@@ -38,3 +43,18 @@ 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:

172
AUTHORS
View File

@@ -3,28 +3,42 @@
#
# For a list of active project maintainers, see the MAINTAINERS file.
#
Al Tobey <al@ooyala.com>
Alex Gaynor <alex.gaynor@gmail.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>
Ben Toews <mastahyeti@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.co>
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>
@@ -32,166 +46,298 @@ 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>
Dr Nic Williams <drnicwilliams@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>
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>
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>
Guillaume J. Charmes <guillaume.charmes@dotcloud.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>
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>
Jon Wedaman <jweede@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>
Jérôme Petazzoni <jerome.petazzoni@dotcloud.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 <karl@karlgrz.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>
Matt Apperson <me@mattapperson.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>
Sven Dowideit <SvenDowideit@home.org.au>
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>
vgeta <gopikannan.venugopalsamy@gmail.com>
Victor Coisne <victor.coisne@dotcloud.com>
Victor Lyuboslavsky <victor@victoreda.com>
Victor Vieux <victor.vieux@dotcloud.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>

View File

@@ -1,10 +1,275 @@
# Changelog
## 0.8.0 (2014-02-04)
#### Notable features since 0.7.0
* Images and containers can be removed much faster
* Building an image from source with docker build is now much faster
* The Docker daemon starts and stops much faster
* The memory footprint of many common operations has been reduced, by streaming files instead of buffering them in memory, fixing memory leaks, and fixing various suboptimal memory allocations
* Several race conditions were fixed, making Docker more stable under very high concurrency load. This makes Docker more stable and less likely to crash and reduces the memory footprint of many common operations
* All packaging operations are now built on the Go languages standard tar implementation, which is bundled with Docker itself. This makes packaging more portable across host distributions, and solves several issues caused by quirks and incompatibilities between different distributions of tar
* Docker can now create, remove and modify larger numbers of containers and images graciously thanks to more aggressive releasing of system resources. For example the storage driver API now allows Docker to do reference counting on mounts created by the drivers
With the ongoing changes to the networking and execution subsystems of docker testing these areas have been a focus of the refactoring. By moving these subsystems into separate packages we can test, analyze, and monitor coverage and quality of these packages
* Many components have been separated into smaller sub-packages, each with a dedicated test suite. As a result the code is better-tested, more readable and easier to change
* The ADD instruction now supports caching, which avoids unnecessarily re-uploading the same source content again and again when it hasnt changed
* The new ONBUILD instruction adds to your image a “trigger” instruction to be executed at a later time, when the image is used as the base for another build
* Docker now ships with an experimental storage driver which uses the BTRFS filesystem for copy-on-write
* Docker is officially supported on Mac OSX
* The Docker daemon supports systemd socket activation
## 0.7.6 (2014-01-14)
#### Builder
* Do not follow symlink outside of build context
#### Runtime
- Remount bind mounts when ro is specified
* Use https for fetching docker version
#### Other
* Inline the test.docker.io fingerprint
* Add ca-certificates to packaging documentation
## 0.7.5 (2014-01-09)
#### Builder
* Disable compression for build. More space usage but a much faster upload
- Fix ADD caching for certain paths
- Do not compress archive from git build
#### Documentation
- Fix error in GROUP add example
* Make sure the GPG fingerprint is inline in the documentation
* Give more specific advice on setting up signing of commits for DCO
#### Runtime
- Fix misspelled container names
- Do not add hostname when networking is disabled
* Return most recent image from the cache by date
- Return all errors from docker wait
* Add Content-Type Header "application/json" to GET /version and /info responses
#### Other
* Update DCO to version 1.1
+ Update Makefile to use "docker:GIT_BRANCH" as the generated image name
* Update Travis to check for new 1.1 DCO version
## 0.7.4 (2014-01-07)
#### Builder
- Fix ADD caching issue with . prefixed path
- Fix docker build on devicemapper by reverting sparse file tar option
- Fix issue with file caching and prevent wrong cache hit
* Use same error handling while unmarshalling CMD and ENTRYPOINT
#### Documentation
* Simplify and streamline Amazon Quickstart
* Install instructions use unprefixed fedora image
* Update instructions for mtu flag for Docker on GCE
+ Add Ubuntu Saucy to installation
- Fix for wrong version warning on master instead of latest
#### Runtime
- Only get the image's rootfs when we need to calculate the image size
- Correctly handle unmapping UDP ports
* Make CopyFileWithTar use a pipe instead of a buffer to save memory on docker build
- Fix login message to say pull instead of push
- Fix "docker load" help by removing "SOURCE" prompt and mentioning STDIN
* Make blank -H option default to the same as no -H was sent
* Extract cgroups utilities to own submodule
#### Other
+ Add Travis CI configuration to validate DCO and gofmt requirements
+ Add Developer Certificate of Origin Text
* Upgrade VBox Guest Additions
* Check standalone header when pinging a registry server
## 0.7.3 (2014-01-02)
#### Builder
+ Update ADD to use the image cache, based on a hash of the added content
* Add error message for empty Dockerfile
#### Documentation
- Fix outdated link to the "Introduction" on www.docker.io
+ Update the docs to get wider when the screen does
- Add information about needing to install LXC when using raw binaries
* Update Fedora documentation to disentangle the docker and docker.io conflict
* Add a note about using the new `-mtu` flag in several GCE zones
+ Add FrugalWare installation instructions
+ Add a more complete example of `docker run`
- Fix API documentation for creating and starting Privileged containers
- Add missing "name" parameter documentation on "/containers/create"
* Add a mention of `lxc-checkconfig` as a way to check for some of the necessary kernel configuration
- Update the 1.8 API documentation with some additions that were added to the docs for 1.7
#### Hack
- Add missing libdevmapper dependency to the packagers documentation
* Update minimum Go requirement to a hard line at Go 1.2+
* Many minor improvements to the Vagrantfile
+ Add ability to customize dockerinit search locations when compiling (to be used very sparingly only by packagers of platforms who require a nonstandard location)
+ Add coverprofile generation reporting
- Add `-a` to our Go build flags, removing the need for recompiling the stdlib manually
* Update Dockerfile to be more canonical and have less spurious warnings during build
- Fix some miscellaneous `docker pull` progress bar display issues
* Migrate more miscellaneous packages under the "pkg" folder
* Update TextMate highlighting to automatically be enabled for files named "Dockerfile"
* Reorganize syntax highlighting files under a common "contrib/syntax" directory
* Update install.sh script (https://get.docker.io/) to not fail if busybox fails to download or run at the end of the Ubuntu/Debian installation
* Add support for container names in bash completion
#### Packaging
+ Add an official Docker client binary for Darwin (Mac OS X)
* Remove empty "Vendor" string and added "License" on deb package
+ Add a stubbed version of "/etc/default/docker" in the deb package
#### Runtime
* Update layer application to extract tars in place, avoiding file churn while handling whiteouts
- Fix permissiveness of mtime comparisons in tar handling (since GNU tar and Go tar do not yet support sub-second mtime precision)
* Reimplement `docker top` in pure Go to work more consistently, and even inside Docker-in-Docker (thus removing the shell injection vulnerability present in some versions of `lxc-ps`)
+ Update `-H unix://` to work similarly to `-H tcp://` by inserting the default values for missing portions
- Fix more edge cases regarding dockerinit and deleted or replaced docker or dockerinit files
* Update container name validation to include '.'
- Fix use of a symlink or non-absolute path as the argument to `-g` to work as expected
* Update to handle external mounts outside of LXC, fixing many small mounting quirks and making future execution backends and other features simpler
* Update to use proper box-drawing characters everywhere in `docker images -tree`
* Move MTU setting from LXC configuration to directly use netlink
* Add `-S` option to external tar invocation for more efficient spare file handling
+ Add arch/os info to User-Agent string, especially for registry requests
+ Add `-mtu` option to Docker daemon for configuring MTU
- Fix `docker build` to exit with a non-zero exit code on error
+ Add `DOCKER_HOST` environment variable to configure the client `-H` flag without specifying it manually for every invocation
## 0.7.2 (2013-12-16)
#### Runtime
+ Validate container names on creation with standard regex
* Increase maximum image depth to 127 from 42
* Continue to move api endpoints to the job api
+ Add -bip flag to allow specification of dynamic bridge IP via CIDR
- Allow bridge creation when ipv6 is not enabled on certain systems
* Set hostname and IP address from within dockerinit
* Drop capabilities from within dockerinit
- Fix volumes on host when symlink is present the image
- Prevent deletion of image if ANY container is depending on it even if the container is not running
* Update docker push to use new progress display
* Use os.Lstat to allow mounting unix sockets when inspecting volumes
- Adjust handling of inactive user login
- Add missing defines in devicemapper for older kernels
- Allow untag operations with no container validation
- Add auth config to docker build
#### Documentation
* Add more information about Docker logging
+ Add RHEL documentation
* Add a direct example for changing the CMD that is run in a container
* Update Arch installation documentation
+ Add section on Trusted Builds
+ Add Network documentation page
#### Other
+ Add new cover bundle for providing code coverage reporting
* Separate integration tests in bundles
* Make Tianon the hack maintainer
* Update mkimage-debootstrap with more tweaks for keeping images small
* Use https to get the install script
* Remove vendored dotcloud/tar now that Go 1.2 has been released
## 0.7.1 (2013-12-05)
#### Documentation
+ Add @SvenDowideit as documentation maintainer
+ Add links example
+ Add documentation regarding ambassador pattern
+ Add Google Cloud Platform docs
+ Add dockerfile best practices
* Update doc for RHEL
* Update doc for registry
* Update Postgres examples
* Update doc for Ubuntu install
* Improve remote api doc
#### Runtime
+ Add hostconfig to docker inspect
+ Implement `docker log -f` to stream logs
+ Add env variable to disable kernel version warning
+ Add -format to `docker inspect`
+ Support bind-mount for files
- Fix bridge creation on RHEL
- Fix image size calculation
- Make sure iptables are called even if the bridge already exists
- Fix issue with stderr only attach
- Remove init layer when destroying a container
- Fix same port binding on different interfaces
- `docker build` now returns the correct exit code
- Fix `docker port` to display correct port
- `docker build` now check that the dockerfile exists client side
- `docker attach` now returns the correct exit code
- Remove the name entry when the container does not exist
#### Registry
* Improve progress bars, add ETA for downloads
* Simultaneous pulls now waits for the first to finish instead of failing
- Tag only the top-layer image when pushing to registry
- Fix issue with offline image transfer
- Fix issue preventing using ':' in password for registry
#### Other
+ Add pprof handler for debug
+ Create a Makefile
* Use stdlib tar that now includes fix
* Improve make.sh test script
* Handle SIGQUIT on the daemon
* Disable verbose during tests
* Upgrade to go1.2 for official build
* Improve unit tests
* The test suite now runs all tests even if one fails
* Refactor C in Go (Devmapper)
- Fix OSX compilation
## 0.7.0 (2013-11-25)
#### Notable features since 0.6.0
* Storage drivers: choose from aufs, device-mapper, or vfs.
* Standard Linux support: docker now runs on unmodified Linux kernels and all major distributions.
* Links: compose complex software stacks by connecting containers to each other.
* Container naming: organize your containers by giving them memorable names.
* Advanced port redirects: specify port redirects per interface, or keep sensitive ports private.
* Offline transfer: push and pull images to the filesystem without losing information.
* Quality: numerous bugfixes and small usability improvements. Significant increase in test coverage.
## 0.6.7 (2013-11-21)
#### Runtime
* Improved stability, fixes some race conditons
* Improve stability, fixes some race conditons
* Skip the volumes mounted when deleting the volumes of container.
* Fix layer size computation: handle hard links correctly
* Use the work Path for docker cp CONTAINER:PATH
@@ -47,7 +312,7 @@
+ Add lock around write operations in graph
* Check if port is valid
* Fix restart runtime error with ghost container networking
+ Added some more colors and animals to increase the pool of generated names
+ Add some more colors and animals to increase the pool of generated names
* Fix issues in docker inspect
+ Escape apparmor confinement
+ Set environment variables using a file.
@@ -201,7 +466,7 @@
* Improve network performance for VirtualBox
* Revamp install.sh to be usable by more people, and to use official install methods whenever possible (apt repo, portage tree, etc.)
- Fix contrib/mkimage-debian.sh apt caching prevention
+ Added Dockerfile.tmLanguage to contrib
+ Add Dockerfile.tmLanguage to contrib
* Configured FPM to make /etc/init/docker.conf a config file
* Enable SSH Agent forwarding in Vagrant VM
* Several small tweaks/fixes for contrib/mkimage-debian.sh
@@ -315,7 +580,7 @@
* Mount /dev/shm as a tmpfs
- Switch from http to https for get.docker.io
* Let userland proxy handle container-bound traffic
* Updated the Docker CLI to specify a value for the "Host" header.
* Update the Docker CLI to specify a value for the "Host" header.
- Change network range to avoid conflict with EC2 DNS
- Reduce connect and read timeout when pinging the registry
* Parallel pull
@@ -511,7 +776,7 @@
+ Builder: 'docker build git://URL' fetches and builds a remote git repository
* Runtime: 'docker ps -s' optionally prints container size
* Tests: Improved and simplified
* Tests: improved and simplified
- Runtime: fix a regression introduced in 0.4.3 which caused the logs command to fail.
- Builder: fix a regression when using ADD with single regular file.
@@ -526,7 +791,7 @@
+ ADD of a local file will detect tar archives and unpack them
* ADD improvements: use tar for copy + automatically unpack local archives
* ADD uses tar/untar for copies instead of calling 'cp -ar'
* Fixed the behavior of ADD to be (mostly) reverse-compatible, predictable and well-documented.
* Fix the behavior of ADD to be (mostly) reverse-compatible, predictable and well-documented.
- Fix a bug which caused builds to fail if ADD was the first command
* Nicer output for 'docker build'
@@ -571,7 +836,7 @@
+ Detect faulty DNS configuration and replace it with a public default
+ Allow docker run <name>:<id>
+ You can now specify public port (ex: -p 80:4500)
* Improved image removal to garbage-collect unreferenced parents
* Improve image removal to garbage-collect unreferenced parents
#### Client
@@ -625,7 +890,7 @@
#### Documentation
* Improved install instructions.
* Improve install instructions.
## 0.3.3 (2013-05-23)
@@ -710,7 +975,7 @@
+ Support for data volumes ('docker run -v=PATH')
+ Share data volumes between containers ('docker run -volumes-from')
+ Improved documentation
+ Improve documentation
* Upgrade to Go 1.0.3
* Various upgrades to the dev environment for contributors
@@ -766,7 +1031,7 @@
- Add debian packaging
- Documentation: installing on Arch Linux
- Documentation: running Redis on docker
- Fixed lxc 0.9 compatibility
- Fix lxc 0.9 compatibility
- Automatically load aufs module
- Various bugfixes and stability improvements
@@ -801,7 +1066,7 @@
- Stabilize process management
- Layers can include a commit message
- Simplified 'docker attach'
- Fixed support for re-attaching
- Fix support for re-attaching
- Various bugfixes and stability improvements
- Auto-download at run
- Auto-login on push

View File

@@ -4,6 +4,13 @@ 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... )
and the output of `docker version` along with the output of `docker info` if possible.
This information will help us review and fix your issue faster.
## Build Environment
For instructions on setting up your development environment, please
@@ -38,7 +45,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.
@@ -64,7 +71,7 @@ your branch before submitting a pull request.
Update the documentation when creating or modifying features. Test
your documentation changes for clarity, concision, and correctness, as
well as a clean docmuent build. See ``docs/README.md`` for more
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,
@@ -98,23 +105,65 @@ 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.
### Approval
### Sign your work
Docker maintainers use LGTM (looks good to me) in comments on the code review
to indicate acceptance.
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:
```
Docker Developer Grant and Certificate of Origin 1.1
By making a contribution to the Docker Project ("Project"), I represent and
warrant that:
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
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)
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
For more details see [MAINTAINERS.md](hack/MAINTAINERS.md)
### 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
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!

View File

@@ -23,44 +23,73 @@
# the case. Therefore, you don't have to disable it anymore.
#
docker-version 0.6.1
from ubuntu:12.04
maintainer Solomon Hykes <solomon@dotcloud.com>
docker-version 0.6.1
FROM ubuntu:13.10
MAINTAINER Tianon Gravi <admwiggin@gmail.com> (@tianon)
# Build dependencies
run echo 'deb http://archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list
run apt-get update
run apt-get install -y -q curl
run apt-get install -y -q git
run apt-get install -y -q mercurial
run apt-get install -y -q build-essential libsqlite3-dev
# 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.2rc5.src.tar.gz | tar -v -C /usr/local -xz
env PATH /usr/local/go/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
env GOPATH /go:/go/src/github.com/dotcloud/docker/vendor
run cd /usr/local/go/src && ./make.bash && go install -ldflags '-w -linkmode external -extldflags "-static -Wl,--unresolved-symbols=ignore-in-shared-libs"' -tags netgo -a std
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
# Ubuntu stuff
run apt-get install -y -q ruby1.9.3 rubygems libffi-dev
run gem install --no-rdoc --no-ri fpm
run apt-get install -y -q reprepro dpkg-sig
# 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'
run apt-get install -y -q python-pip
run pip install s3cmd==1.1.0-beta3
run pip install python-magic==0.4.6
run /bin/echo -e '[default]\naccess_key=$AWS_ACCESS_KEY\nsecret_key=$AWS_SECRET_KEY\n' > /.s3cfg
# Grab Go's cover tool for dead-simple code coverage testing
RUN go get code.google.com/p/go.tools/cmd/cover
# Runtime dependencies
run apt-get install -y -q iptables
run apt-get install -y -q lxc
run apt-get install -y -q aufs-tools
# TODO replace FPM with some very minimal debhelper stuff
RUN gem install --no-rdoc --no-ri fpm --version 1.0.2
volume /var/lib/docker
workdir /go/src/github.com/dotcloud/docker
# 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"]
ENTRYPOINT ["hack/dind"]
# Upload docker source
add . /go/src/github.com/dotcloud/docker
ADD . /go/src/github.com/dotcloud/docker

View File

@@ -2,5 +2,8 @@ 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)
Vagrantfile: Daniel Mizyrycki <daniel@dotcloud.com> (@mzdaniel)
Dockerfile: Tianon Gravi <admwiggin@gmail.com> (@tianon)
Makefile: Tianon Gravi <admwiggin@gmail.com> (@tianon)
Vagrantfile: Cristian Staretu <cristian.staretu@gmail.com> (@unclejack)

41
Makefile Normal file
View File

@@ -0,0 +1,41 @@
.PHONY: all binary build cross default docs docs-build docs-shell shell test test-integration
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)"
default: binary
all: build
$(DOCKER_RUN_DOCKER) hack/make.sh
binary: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary
cross: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary cross
docs: docs-build
docker run -rm -i -t -p 8000:8000 "$(DOCKER_DOCS_IMAGE)"
docs-shell: docs-build
docker run -rm -i -t -p 8000:8000 "$(DOCKER_DOCS_IMAGE)" bash
test: build
$(DOCKER_RUN_DOCKER) hack/make.sh test test-integration
test-integration: build
$(DOCKER_RUN_DOCKER) hack/make.sh test-integration
shell: build
$(DOCKER_RUN_DOCKER) bash
build: bundles
docker build -rm -t "$(DOCKER_IMAGE)" .
docs-build:
docker build -rm -t "$(DOCKER_DOCS_IMAGE)" docs
bundles:
mkdir bundles

2
NOTICE
View File

@@ -1,5 +1,5 @@
Docker
Copyright 2012-2013 Docker, Inc.
Copyright 2012-2014 Docker, Inc.
This product includes software developed at Docker, Inc. (http://www.docker.com).

View File

@@ -22,7 +22,7 @@ hundreds of thousands of applications and databases.
## Better than VMs
A common method for distributing applications and sandbox their
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

View File

@@ -1 +1 @@
0.6.7
0.8.0

55
Vagrantfile vendored
View File

@@ -8,10 +8,20 @@ AWS_BOX_URI = ENV['BOX_URI'] || "https://github.com/mitchellh/vagrant-aws/raw/ma
AWS_REGION = ENV['AWS_REGION'] || "us-east-1"
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
SSH_PRIVKEY_PATH = ENV["SSH_PRIVKEY_PATH"]
# 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.
@@ -23,10 +33,14 @@ if [ -z "$user" ]; then
user=vagrant
fi
# Adding an apt gpg key is idempotent.
wget -q -O - https://get.docker.io/gpg | apt-key add -
# 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
# Creating the docker.list file is idempotent, but it may overrite desired
# 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' > \
@@ -41,7 +55,7 @@ apt-get install -q -y lxc-docker
usermod -a -G docker "$user"
tmp=`mktemp -q` && {
# Only install the backport kernel, don't bother upgrade if the backport is
# 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.
@@ -70,7 +84,7 @@ SCRIPT
# 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.2/ ]; then
if [ ! -d /opt/VBoxGuestAdditions-4.3.6/ ]; then
# Update remote package metadata. 'apt-get update' is idempotent.
apt-get update -q
@@ -79,9 +93,10 @@ if [ ! -d /opt/VBoxGuestAdditions-4.3.2/ ]; then
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.2/VBoxGuestAdditions_4.3.2.iso
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.2.iso /mnt
mount -o loop,ro /home/vagrant/VBoxGuestAdditions_4.3.6.iso /mnt
/mnt/VBoxLinuxAdditions.run --nox11
umount /mnt
fi
@@ -151,6 +166,8 @@ Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
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
@@ -160,16 +177,30 @@ Vagrant::VERSION < "1.1.0" and Vagrant::Config.run do |config|
config.vm.provision :shell, :inline => $vbox_script
end
if !FORWARD_DOCKER_PORTS.nil?
# 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|
(49000..49900).each do |port|
forward_ports.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
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

1162
api.go

File diff suppressed because it is too large Load Diff

1193
api/api.go Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
package docker
package api
import (
"fmt"
@@ -7,6 +7,20 @@ import (
"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)

View File

@@ -1,148 +0,0 @@
package docker
import "strings"
type (
APIHistory struct {
ID string `json:"Id"`
Tags []string `json:",omitempty"`
Created int64
CreatedBy string `json:",omitempty"`
Size int64
}
APIImages struct {
ID string `json:"Id"`
RepoTags []string `json:",omitempty"`
Created int64
Size int64
VirtualSize int64
ParentId string `json:",omitempty"`
}
APIImagesOld struct {
Repository string `json:",omitempty"`
Tag string `json:",omitempty"`
ID string `json:"Id"`
Created int64
Size int64
VirtualSize int64
}
APIInfo struct {
Debug bool
Containers int
Images int
NFd int `json:",omitempty"`
NGoroutines int `json:",omitempty"`
MemoryLimit bool `json:",omitempty"`
SwapLimit bool `json:",omitempty"`
IPv4Forwarding bool `json:",omitempty"`
LXCVersion string `json:",omitempty"`
NEventsListener int `json:",omitempty"`
KernelVersion string `json:",omitempty"`
IndexServerAddress string `json:",omitempty"`
}
APITop struct {
Titles []string
Processes [][]string
}
APIRmi struct {
Deleted string `json:",omitempty"`
Untagged string `json:",omitempty"`
}
APIContainers struct {
ID string `json:"Id"`
Image string
Command string
Created int64
Status string
Ports []APIPort
SizeRw int64
SizeRootFs int64
Names []string
}
APIContainersOld struct {
ID string `json:"Id"`
Image string
Command string
Created int64
Status string
Ports string
SizeRw int64
SizeRootFs int64
}
APIID struct {
ID string `json:"Id"`
}
APIRun struct {
ID string `json:"Id"`
Warnings []string `json:",omitempty"`
}
APIPort struct {
PrivatePort int64
PublicPort int64
Type string
IP string
}
APIVersion struct {
Version string
GitCommit string `json:",omitempty"`
GoVersion string `json:",omitempty"`
}
APIWait struct {
StatusCode int
}
APIAuth struct {
Status string
}
APIImageConfig struct {
ID string `json:"Id"`
*Config
}
APICopy struct {
Resource string
HostPath string
}
)
func (api APIImages) ToLegacy() []APIImagesOld {
outs := []APIImagesOld{}
for _, repotag := range api.RepoTags {
components := strings.SplitN(repotag, ":", 2)
outs = append(outs, APIImagesOld{
ID: api.ID,
Repository: components[0],
Tag: components[1],
Created: api.Created,
Size: api.Size,
VirtualSize: api.VirtualSize,
})
}
return outs
}
func (api APIContainers) ToLegacy() *APIContainersOld {
return &APIContainersOld{
ID: api.ID,
Image: api.Image,
Command: api.Command,
Created: api.Created,
Status: api.Status,
Ports: displayablePorts(api.Ports),
SizeRw: api.SizeRw,
SizeRootFs: api.SizeRootFs,
}
}

View File

@@ -1,19 +0,0 @@
package docker
import (
"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()
}
}

View File

@@ -3,6 +3,8 @@ package archive
import (
"archive/tar"
"bytes"
"compress/bzip2"
"compress/gzip"
"fmt"
"github.com/dotcloud/docker/utils"
"io"
@@ -11,11 +13,18 @@ import (
"os/exec"
"path"
"path/filepath"
"strings"
"syscall"
)
type Archive io.Reader
type Compression uint32
type Compression int
type TarOptions struct {
Includes []string
Compression Compression
}
const (
Uncompressed Compression = iota
@@ -51,16 +60,57 @@ func DetectCompression(source []byte) Compression {
return Uncompressed
}
func (compression *Compression) Flag() string {
switch *compression {
case Bzip2:
return "j"
case Gzip:
return "z"
case Xz:
return "J"
func xzDecompress(archive io.Reader) (io.Reader, error) {
args := []string{"xz", "-d", "-c", "-q"}
return CmdStream(exec.Command(args[0], args[1:]...), archive)
}
func DecompressStream(archive io.Reader) (io.Reader, 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 wrap, nil
case Gzip:
return gzip.NewReader(wrap)
case Bzip2:
return 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 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())
}
return ""
}
func (compression *Compression) Extension() string {
@@ -77,23 +127,214 @@ func (compression *Compression) Extension() string {
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 *tar.Reader) error {
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, os.FileMode(hdr.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, os.FileMode(hdr.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 := syscall.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 := syscall.Chmod(path, uint32(hdr.Mode&07777)); 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 := syscall.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.Reader, error) {
return TarFilter(path, compression, nil)
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(path string, compression Compression, filter []string) (io.Reader, error) {
args := []string{"tar", "--numeric-owner", "-f", "-", "-C", path}
if filter == nil {
filter = []string{"."}
func TarFilter(srcPath string, options *TarOptions) (io.Reader, error) {
pipeReader, pipeWriter := io.Pipe()
compressWriter, err := CompressStream(pipeWriter, options.Compression)
if err != nil {
return nil, err
}
for _, f := range filter {
args = append(args, "-c"+compression.Flag(), f)
}
return CmdStream(exec.Command(args[0], args[1:]...))
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)
}
}()
return pipeReader, nil
}
// Untar reads a stream of bytes from `archive`, parses it as a tar archive,
@@ -101,51 +342,92 @@ func TarFilter(path string, compression Compression, filter []string) (io.Reader
// 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, path string) error {
func Untar(archive io.Reader, dest string, options *TarOptions) error {
if archive == nil {
return fmt.Errorf("Empty archive")
}
buf := make([]byte, 10)
totalN := 0
for totalN < 10 {
n, err := archive.Read(buf[totalN:])
archive, err := DecompressStream(archive)
if err != nil {
return err
}
tr := tar.NewReader(archive)
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 {
if err == io.EOF {
return fmt.Errorf("Tarball too short")
}
return err
}
totalN += n
utils.Debugf("[tar autodetect] n: %d", n)
// 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)
}
}
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 = io.MultiReader(bytes.NewReader(buf), archive)
// 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)
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, filter []string, dst string) error {
utils.Debugf("TarUntar(%s %s %s)", src, filter, dst)
archive, err := TarFilter(src, Uncompressed, filter)
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
}
return Untar(archive, dst)
return Untar(archive, dst, nil)
}
// UntarPath is a convenience function which looks for an archive
@@ -153,7 +435,7 @@ func TarUntar(src string, filter []string, dst string) error {
func UntarPath(src, dst string) error {
if archive, err := os.Open(src); err != nil {
return err
} else if err := Untar(archive, dst); err != nil {
} else if err := Untar(archive, dst, nil); err != nil {
return err
}
return nil
@@ -178,7 +460,7 @@ func CopyWithTar(src, dst string) error {
return err
}
utils.Debugf("Calling TarUntar(%s, %s)", src, dst)
return TarUntar(src, nil, dst)
return TarUntar(src, dst)
}
// CopyFileWithTar emulates the behavior of the 'cp' command-line
@@ -187,7 +469,7 @@ func CopyWithTar(src, dst string) error {
//
// If `dst` ends with a trailing slash '/', the final destination path
// will be `dst/base(src)`.
func CopyFileWithTar(src, dst string) error {
func CopyFileWithTar(src, dst string) (err error) {
utils.Debugf("CopyFileWithTar(%s, %s)", src, dst)
srcSt, err := os.Stat(src)
if err != nil {
@@ -204,31 +486,55 @@ func CopyFileWithTar(src, dst string) error {
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))
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) (io.Reader, error) {
func CmdStream(cmd *exec.Cmd, input io.Reader) (io.Reader, 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

View File

@@ -1,6 +1,7 @@
package archive
import (
"archive/tar"
"bytes"
"fmt"
"io"
@@ -14,7 +15,7 @@ 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: %s", err)
}
@@ -35,7 +36,7 @@ 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: %s", err)
}
@@ -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)
}
@@ -83,12 +84,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(archive, 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 +119,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 (
"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)
}
}

120
archive/diff.go Normal file
View File

@@ -0,0 +1,120 @@
package archive
import (
"archive/tar"
"io"
"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 Archive) 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
// 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.") {
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
}
}
}
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
}

17
archive/stat_darwin.go Normal file
View File

@@ -0,0 +1,17 @@
// +build !linux !amd64
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 nil
}

32
archive/stat_linux.go Normal file
View File

@@ -0,0 +1,32 @@
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
}

View File

@@ -63,7 +63,7 @@ func decodeAuth(authStr string) (string, string, error) {
if n > decLen {
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 "", "", fmt.Errorf("Invalid auth configuration file")
}
@@ -163,7 +163,7 @@ func Login(authConfig *AuthConfig, factory *utils.HTTPRequestFactory) (string, e
loginAgainstOfficialIndex := serverAddress == IndexServerAddress()
// to avoid sending the server address to the server it should be removed before marshalled
// to avoid sending the server address to the server it should be removed before being marshalled
authCopy := *authConfig
authCopy.ServerAddress = ""
@@ -192,13 +192,6 @@ func Login(authConfig *AuthConfig, factory *utils.HTTPRequestFactory) (string, e
} else {
status = "Account created. Please see the documentation of the registry " + serverAddress + " for instructions how to activate it."
}
} else if reqStatusCode == 403 {
if loginAgainstOfficialIndex {
return "", fmt.Errorf("Login: Your account hasn't been activated. " +
"Please check your e-mail for a confirmation link.")
}
return "", fmt.Errorf("Login: Your account hasn't been activated. " +
"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 := factory.NewRequest("GET", serverAddress+"users/", nil)
@@ -216,13 +209,39 @@ func Login(authConfig *AuthConfig, factory *utils.HTTPRequestFactory) (string, e
status = "Login Succeeded"
} else if resp.StatusCode == 401 {
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)
}
@@ -235,11 +254,11 @@ func (config *ConfigFile) ResolveAuthConfig(registry string) AuthConfig {
// default to the index server
return config.Configs[IndexServerAddress()]
}
// if its not the index server there are three cases:
// if it's not the index server there are three cases:
//
// 1. this is a full config url -> it should be used as is
// 2. it could be a full url, but with the wrong protocol
// 3. it can be the hostname optionally with a port
// 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

View File

@@ -1,20 +1,31 @@
package docker
import (
"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/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
@@ -25,25 +36,36 @@ type buildFile struct {
runtime *Runtime
srv *Server
image string
maintainer string
config *Config
context string
image string
maintainer string
config *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 map[string]struct{}) {
for c := range containers {
tmp := b.runtime.Get(c)
b.runtime.Destroy(tmp)
fmt.Fprintf(b.out, "Removing intermediate container %s\n", utils.TruncateID(c))
fmt.Fprintf(b.outStream, "Removing intermediate container %s\n", utils.TruncateID(c))
}
}
@@ -52,7 +74,22 @@ func (b *buildFile) CmdFrom(name string) error {
if err != nil {
if b.runtime.graph.IsNotExist(err) {
remote, tag := utils.ParseRepositoryTag(name)
if err := b.srv.ImagePull(remote, tag, b.out, utils.NewStreamFormatter(false), nil, nil, true); err != nil {
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
}
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)
@@ -71,19 +108,57 @@ func (b *buildFile) CmdFrom(name string) error {
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 := ParseRun(append([]string{b.image}, b.buildCmdFromJson(args)...), nil)
if err != nil {
return err
}
@@ -96,17 +171,12 @@ func (b *buildFile) CmdRun(args string) error {
utils.Debugf("Command to be executed: %v", b.config.Cmd)
if b.utilizeCache {
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")
}
hit, err := b.probeCache()
if err != nil {
return err
}
if hit {
return nil
}
cid, err := b.run()
@@ -177,16 +247,30 @@ func (b *buildFile) CmdEnv(args string) error {
return b.commit("", b.config.Cmd, fmt.Sprintf("ENV %s", replacedVar))
}
func (b *buildFile) CmdCmd(args string) error {
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 cmd to /bin/sh -c", err)
utils.Debugf("Error unmarshalling: %s, setting to /bin/sh -c", err)
cmd = []string{"/bin/sh", "-c", args}
}
if err := b.commit("", cmd, fmt.Sprintf("CMD %v", cmd)); err != nil {
return cmd
}
func (b *buildFile) CmdCmd(args string) error {
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
}
@@ -209,23 +293,6 @@ func (b *buildFile) CmdCopy(args string) error {
return fmt.Errorf("COPY has been deprecated. Please use ADD instead")
}
func (b *buildFile) CmdEntrypoint(args string) error {
if args == "" {
return fmt.Errorf("Entrypoint cannot be empty")
}
var entrypoint []string
if err := json.Unmarshal([]byte(args), &entrypoint); err != nil {
b.config.Entrypoint = []string{"/bin/sh", "-c", args}
} else {
b.config.Entrypoint = entrypoint
}
if err := b.commit("", b.config.Cmd, fmt.Sprintf("ENTRYPOINT %s", args)); err != nil {
return err
}
return nil
}
func (b *buildFile) CmdWorkdir(workdir string) error {
b.config.WorkingDir = workdir
return b.commit("", b.config.Cmd, fmt.Sprintf("WORKDIR %v", workdir))
@@ -241,7 +308,7 @@ func (b *buildFile) CmdVolume(args string) error {
volume = []string{args}
}
if b.config.Volumes == nil {
b.config.Volumes = NewPathOpts()
b.config.Volumes = map[string]struct{}{}
}
for _, v := range volume {
b.config.Volumes[v] = struct{}{}
@@ -252,47 +319,44 @@ func (b *buildFile) CmdVolume(args string) error {
return nil
}
func (b *buildFile) addRemote(container *Container, orig, dest string) error {
file, err := utils.Download(orig, ioutil.Discard)
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
}
defer file.Body.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)
}
dest = dest + filename
}
return container.Inject(file.Body, dest)
return nil
}
func (b *buildFile) addContext(container *Container, orig, dest string) error {
origPath := path.Join(b.context, orig)
destPath := path.Join(container.RootfsPath(), dest)
var (
origPath = path.Join(b.contextPath, orig)
destPath = path.Join(container.BasefsPath(), dest)
)
// Preserve the trailing '/'
if strings.HasSuffix(dest, "/") {
destPath = destPath + "/"
}
if !strings.HasPrefix(origPath, b.context) {
return fmt.Errorf("Forbidden path: %s", origPath)
}
fi, err := os.Stat(origPath)
if err != nil {
return fmt.Errorf("%s: no such file or directory", orig)
if os.IsNotExist(err) {
return fmt.Errorf("%s: no such file or directory", orig)
}
return err
}
if fi.IsDir() {
if err := archive.CopyWithTar(origPath, destPath); err != nil {
@@ -313,7 +377,7 @@ func (b *buildFile) addContext(container *Container, orig, dest string) error {
}
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)
@@ -333,8 +397,112 @@ func (b *buildFile) CmdAdd(args string) error {
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
// FIXME: do we really need this?
var (
origPath = orig
destPath = dest
remoteHash string
)
if utils.IsURL(orig) {
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)
// 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.runtime.Create(b.config, "")
if err != nil {
@@ -342,19 +510,13 @@ func (b *buildFile) CmdAdd(args string) error {
}
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); err != nil {
return err
}
if err := b.commit(container.ID, cmd, fmt.Sprintf("ADD %s in %s", orig, dest)); err != nil {
@@ -364,6 +526,34 @@ func (b *buildFile) CmdAdd(args string) error {
return nil
}
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) run() (string, error) {
if b.image == "" {
return "", fmt.Errorf("Please provide a source image with `from` prior to run")
@@ -376,7 +566,7 @@ func (b *buildFile) run() (string, error) {
return "", 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]
@@ -386,7 +576,7 @@ func (b *buildFile) run() (string, error) {
if b.verbose {
errCh = utils.Go(func() error {
return <-c.Attach(nil, nil, b.out, b.out)
return <-c.Attach(nil, nil, b.outStream, b.errStream)
})
}
@@ -403,7 +593,11 @@ func (b *buildFile) run() (string, error) {
// 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
@@ -420,17 +614,12 @@ 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 b.utilizeCache {
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")
}
hit, err := b.probeCache()
if err != nil {
return err
}
if hit {
return nil
}
container, warnings, err := b.runtime.Create(b.config, "")
@@ -438,12 +627,12 @@ func (b *buildFile) commit(id string, autoCmd []string, comment string) error {
return err
}
for _, warning := range warnings {
fmt.Fprintf(b.out, " ---> [Warning] %s\n", warning)
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()
@@ -471,17 +660,24 @@ func (b *buildFile) commit(id string, autoCmd []string, comment string) error {
var lineContinuation = regexp.MustCompile(`\s*\\\s*\n`)
func (b *buildFile) Build(context io.Reader) (string, error) {
// FIXME: @creack "name" is a terrible variable name
name, err := ioutil.TempDir("", "docker-build")
tmpdirPath, err := ioutil.TempDir("", "docker-build")
if err != nil {
return "", err
}
if err := archive.Untar(context, name); err != nil {
decompressedStream, err := archive.DecompressStream(context)
if err != nil {
return "", err
}
defer os.RemoveAll(name)
b.context = name
filename := path.Join(name, "Dockerfile")
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")
}
@@ -489,6 +685,9 @@ func (b *buildFile) Build(context io.Reader) (string, error) {
if err != nil {
return "", err
}
if len(fileBytes) == 0 {
return "", ErrDockerfileEmpty
}
dockerfile := string(fileBytes)
dockerfile = lineContinuation.ReplaceAllString(dockerfile, "")
stepN := 0
@@ -498,49 +697,62 @@ func (b *buildFile) Build(context io.Reader) (string, error) {
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], " ")
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
}
stepN += 1
fmt.Fprintf(b.out, "Step %d : %s %s\n", stepN, strings.ToUpper(instruction), arguments)
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 occurred 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, verbose, utilizeCache, rm bool) 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{
runtime: srv.runtime,
srv: srv,
config: &Config{},
out: out,
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,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 && !os.IsNotExist(err) {
return nil, err
}
return changes, nil
}

File diff suppressed because it is too large Load Diff

159
commands_unit_test.go Normal file
View File

@@ -0,0 +1,159 @@
package docker
import (
"strings"
"testing"
)
func parse(t *testing.T, args string) (*Config, *HostConfig, error) {
config, hostConfig, _, err := ParseRun(strings.Split(args+" ubuntu bash", " "), nil)
return config, hostConfig, err
}
func mustParse(t *testing.T, args string) (*Config, *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")
}
}

View File

@@ -1,8 +1,15 @@
package docker
import (
"github.com/dotcloud/docker/engine"
"net"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/networkdriver"
)
const (
defaultNetworkMtu = 1500
DisableNetworkBridge = "none"
)
// FIXME: separate runtime configuration from http api configuration
@@ -10,32 +17,48 @@ type DaemonConfig struct {
Pidfile string
Root string
AutoRestart bool
EnableCors bool
Dns []string
EnableIptables bool
BridgeIface string
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 ConfigFromJob(job *engine.Job) *DaemonConfig {
var config DaemonConfig
config.Pidfile = job.Getenv("Pidfile")
config.Root = job.Getenv("Root")
config.AutoRestart = job.GetenvBool("AutoRestart")
config.EnableCors = job.GetenvBool("EnableCors")
if dns := job.Getenv("Dns"); dns != "" {
config.Dns = []string{dns}
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"),
DefaultIp: net.ParseIP(job.Getenv("DefaultIp")),
InterContainerCommunication: job.GetenvBool("InterContainerCommunication"),
GraphDriver: job.Getenv("GraphDriver"),
}
config.EnableIptables = job.GetenvBool("EnableIptables")
if br := job.Getenv("BridgeIface"); br != "" {
config.BridgeIface = br
if dns := job.GetenvList("Dns"); dns != nil {
config.Dns = dns
}
if mtu := job.GetenvInt("Mtu"); mtu != 0 {
config.Mtu = mtu
} else {
config.BridgeIface = DefaultNetworkBridge
config.Mtu = GetDefaultNetworkMtu()
}
config.DefaultIp = net.ParseIP(job.Getenv("DefaultIp"))
config.InterContainerCommunication = job.GetenvBool("InterContainerCommunication")
return &config
config.DisableNetwork = job.Getenv("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

View File

@@ -4,7 +4,7 @@
#
# This script provides supports completion of:
# - commands and their options
# - container ids
# - container ids and names
# - image repos and tags
# - filepaths
#
@@ -21,60 +21,88 @@
# 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
containers="$( docker ps -a -q )"
COMPREPLY=( $( compgen -W "$containers" -- "$cur" ) )
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
containers="$( docker ps -q )"
COMPREPLY=( $( compgen -W "$containers" -- "$cur" ) )
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
containers="$( comm -13 <(docker ps -q | sort -u) <(docker ps -a -q | sort -u) )"
COMPREPLY=( $( compgen -W "$containers" -- "$cur" ) )
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
repos="$( docker images | awk 'NR>1{print $1}' )"
local repos="$( __docker_q images | awk 'NR>1{print $1}' | grep -v '^<none>$' )"
COMPREPLY=( $( compgen -W "$repos" -- "$cur" ) )
}
__docker_images()
{
local images
images="$( docker images | awk 'NR>1{print $1":"$2}' )"
COMPREPLY=( $( compgen -W "$images" -- "$cur" ) )
__ltrim_colon_completions "$cur"
}
__docker_image_repos_and_tags()
{
local repos images
repos="$( docker images | awk 'NR>1{print $1}' )"
images="$( docker images | awk 'NR>1{print $1":"$2}' )"
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 images
containers="$( docker ps -a -q )"
images="$( docker images | awk 'NR>1{print $1":"$2}' )"
COMPREPLY=( $( compgen -W "$images $containers" -- "$cur" ) )
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
@@ -97,15 +125,24 @@ _docker_docker()
_docker_attach()
{
if [ $cpos -eq $cword ]; then
__docker_containers_running
fi
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)
-t|--tag)
__docker_image_repos_and_tags
return
;;
*)
@@ -114,10 +151,13 @@ _docker_build()
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-no-cache -t -q -rm" -- "$cur" ) )
COMPREPLY=( $( compgen -W "-t --tag -q --quiet --no-cache --rm" -- "$cur" ) )
;;
*)
_filedir
local counter="$(__docker_pos_first_nonflag '-t|--tag')"
if [ $cword -eq $counter ]; then
_filedir
fi
;;
esac
}
@@ -125,7 +165,7 @@ _docker_build()
_docker_commit()
{
case "$prev" in
-author|-m|-run)
-m|--message|-a|--author|--run)
return
;;
*)
@@ -134,26 +174,20 @@ _docker_commit()
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-author -m -run" -- "$cur" ) )
COMPREPLY=( $( compgen -W "-m --message -a --author --run" -- "$cur" ) )
;;
*)
local counter=$cpos
while [ $counter -le $cword ]; do
case "${words[$counter]}" in
-author|-m|-run)
(( counter++ ))
;;
-*)
;;
*)
break
;;
esac
(( counter++ ))
done
local counter=$(__docker_pos_first_nonflag '-m|--message|-a|--author|--run')
if [ $counter -eq $cword ]; then
if [ $cword -eq $counter ]; then
__docker_containers_all
return
fi
(( counter++ ))
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags
return
fi
;;
esac
@@ -161,16 +195,32 @@ _docker_commit()
_docker_cp()
{
if [ $cpos -eq $cword ]; then
__docker_containers_all
else
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()
{
if [ $cpos -eq $cword ]; then
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_containers_all
fi
}
@@ -178,7 +228,7 @@ _docker_diff()
_docker_events()
{
case "$prev" in
-since)
--since)
return
;;
*)
@@ -187,7 +237,7 @@ _docker_events()
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-since" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--since" -- "$cur" ) )
;;
*)
;;
@@ -196,45 +246,44 @@ _docker_events()
_docker_export()
{
if [ $cpos -eq $cword ]; then
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_containers_all
fi
}
_docker_help()
{
if [ $cpos -eq $cword ]; then
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
fi
}
_docker_history()
{
if [ $cpos -eq $cword ]; then
__docker_image_repos_and_tags
fi
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 "-a -notrunc -q -viz" -- "$cur" ) )
COMPREPLY=( $( compgen -W "-q --quiet -a --all --no-trunc -v --viz -t --tree" -- "$cur" ) )
;;
*)
local counter=$cpos
while [ $counter -le $cword ]; do
case "${words[$counter]}" in
-*)
;;
*)
break
;;
esac
(( counter++ ))
done
if [ $counter -eq $cword ]; then
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_image_repos
fi
;;
@@ -243,7 +292,16 @@ _docker_images()
_docker_import()
{
return
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()
@@ -253,25 +311,16 @@ _docker_info()
_docker_insert()
{
if [ $cpos -eq $cword ]; then
__docker_image_repos_and_tags
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_image_repos_and_tags_and_ids
fi
}
_docker_inspect()
{
__docker_containers_and_images
}
_docker_kill()
{
__docker_containers_running
}
_docker_login()
{
case "$prev" in
-e|-p|-u)
-f|--format)
return
;;
*)
@@ -280,7 +329,37 @@ _docker_login()
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-e -p -u" -- "$cur" ) )
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" ) )
;;
*)
;;
@@ -289,14 +368,23 @@ _docker_login()
_docker_logs()
{
if [ $cpos -eq $cword ]; then
__docker_containers_all
fi
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()
{
if [ $cpos -eq $cword ]; then
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_containers_all
fi
}
@@ -304,7 +392,13 @@ _docker_port()
_docker_ps()
{
case "$prev" in
-beforeId|-n|-sinceId)
--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
;;
*)
@@ -313,7 +407,7 @@ _docker_ps()
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-a -beforeId -l -n -notrunc -q -s -sinceId" -- "$cur" ) )
COMPREPLY=( $( compgen -W "-q --quiet -s --size -a --all --no-trunc -l --latest --since-id --before-id -n" -- "$cur" ) )
;;
*)
;;
@@ -323,7 +417,7 @@ _docker_ps()
_docker_pull()
{
case "$prev" in
-t)
-t|--tag)
return
;;
*)
@@ -332,22 +426,31 @@ _docker_pull()
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-t" -- "$cur" ) )
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()
{
__docker_image_repos
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)
-t|--time)
return
;;
*)
@@ -356,7 +459,7 @@ _docker_restart()
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-t" -- "$cur" ) )
COMPREPLY=( $( compgen -W "-t --time" -- "$cur" ) )
;;
*)
__docker_containers_all
@@ -368,7 +471,7 @@ _docker_rm()
{
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-v" -- "$cur" ) )
COMPREPLY=( $( compgen -W "-v --volumes -l --link" -- "$cur" ) )
;;
*)
__docker_containers_stopped
@@ -378,19 +481,27 @@ _docker_rm()
_docker_rmi()
{
__docker_image_repos_and_tags
__docker_image_repos_and_tags_and_ids
}
_docker_run()
{
case "$prev" in
-cidfile)
--cidfile)
_filedir
;;
-volumes-from)
--volumes-from)
__docker_containers_all
;;
-a|-c|-dns|-e|-entrypoint|-h|-lxc-conf|-m|-p|-u|-v|-w)
-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
;;
*)
@@ -399,45 +510,30 @@ _docker_run()
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-a -c -cidfile -d -dns -e -entrypoint -h -i -lxc-conf -m -n -p -privileged -t -u -v -volumes-from -w" -- "$cur" ) )
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=$cpos
while [ $counter -le $cword ]; do
case "${words[$counter]}" in
-a|-c|-cidfile|-dns|-e|-entrypoint|-h|-lxc-conf|-m|-p|-u|-v|-volumes-from|-w)
(( counter++ ))
;;
-*)
;;
*)
break
;;
esac
(( counter++ ))
done
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 [ $counter -eq $cword ]; then
__docker_image_repos_and_tags
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()
{
COMPREPLY=( $( compgen -W "-notrunc" "-stars" "-trusted" -- "$cur" ) )
}
_docker_start()
{
__docker_containers_stopped
}
_docker_stop()
{
case "$prev" in
-t)
-s|--stars)
return
;;
*)
@@ -446,7 +542,38 @@ _docker_stop()
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-t" -- "$cur" ) )
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
@@ -456,12 +583,31 @@ _docker_stop()
_docker_tag()
{
COMPREPLY=( $( compgen -W "-f" -- "$cur" ) )
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()
{
if [ $cpos -eq $cword ]; then
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_containers_running
fi
}
@@ -478,7 +624,6 @@ _docker_wait()
_docker()
{
local cur prev words cword command="docker" counter=1 word cpos
local commands="
attach
build
@@ -494,6 +639,7 @@ _docker()
insert
inspect
kill
load
login
logs
port
@@ -504,6 +650,7 @@ _docker()
rm
rmi
run
save
search
start
stop
@@ -514,18 +661,20 @@ _docker()
"
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
word="${words[$counter]}"
case "$word" in
case "${words[$counter]}" in
-H)
(( counter++ ))
;;
-*)
;;
*)
command="$word"
command="${words[$counter]}"
cpos=$counter
(( cpos++ ))
break

View File

@@ -174,7 +174,7 @@ __docker_subcommand () {
(ps)
_arguments '-a[Show all containers. Only running containers are shown by default]' \
'-h[Show help]' \
'-beforeId=-[Show only container created before Id, include non-running one]:containers:__docker_containers' \
'-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)
@@ -189,9 +189,9 @@ __docker_subcommand () {
'-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: ' \
'*--dns=[Set custom dns servers]:dns server: ' \
'*-e=[Set environment variables]:environment variable: ' \
'-entrypoint=-[Overwrite the default entrypoint of the image]:entry point: ' \
'--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: ' \
@@ -199,7 +199,7 @@ __docker_subcommand () {
'-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: ' \
'--volumes-from=-[Mount volumes from the specified container]:volume: ' \
'(-):images:__docker_images' \
'(-):command: _command_names -e' \
'*::arguments: _normal'

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

@@ -56,7 +56,7 @@ func main() {
// Check that the requested process manager is supported
if _, exists := templates[*kind]; !exists {
panic("Unkown script template")
panic("Unknown script template")
}
// Load the requested template

View File

@@ -1,13 +1,11 @@
[Unit]
Description=Docker Application Container Engine
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
Requires=network.target
After=multi-user.target
After=network.target
[Service]
Type=simple
ExecStartPre=/bin/mount --make-rprivate /
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,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

View File

@@ -1,30 +1,29 @@
#!/bin/bash
#!/usr/bin/env bash
# Generate a minimal filesystem for archlinux and load it into the local
# docker as "archlinux"
# requires root
set -e
PACSTRAP=$(which pacstrap)
[ "$PACSTRAP" ] || {
hash pacstrap &>/dev/null || {
echo "Could not find pacstrap. Run pacman -S arch-install-scripts"
exit 1
}
EXPECT=$(which expect)
[ "$EXPECT" ] || {
hash expect &>/dev/null || {
echo "Could not find expect. Run pacman -S expect"
exit 1
}
ROOTFS=~/rootfs-arch-$$-$RANDOM
mkdir $ROOTFS
ROOTFS=$(mktemp -d /tmp/rootfs-archlinux-XXXXXXXXXX)
chmod 755 $ROOTFS
#packages to ignore for space savings
# 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 -d -G -i $ROOTFS base haveged --ignore $PKGIGNORE
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 }
@@ -38,29 +37,26 @@ 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"
cat > $ROOTFS/etc/locale.gen <<DELIM
en_US.UTF-8 UTF-8
en_US ISO-8859-1
DELIM
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
mv ${DEV} ${DEV}.old
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
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.

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

View File

@@ -1,15 +0,0 @@
#!/bin/bash
# Create a CentOS base image for Docker
# From unclejack https://github.com/dotcloud/docker/issues/290
set -e
MIRROR_URL="http://centos.netnitco.net/6.4/os/x86_64/"
MIRROR_URL_UPDATES="http://centos.netnitco.net/6.4/updates/x86_64/"
yum install -y febootstrap xz
febootstrap -i bash -i coreutils -i tar -i bzip2 -i gzip -i vim-minimal -i wget -i patch -i diffutils -i iproute -i yum centos centos64 $MIRROR_URL -u $MIRROR_URL_UPDATES
touch centos64/etc/resolv.conf
touch centos64/sbin/init
tar --numeric-owner -Jcpf centos-64.tar.xz -C centos64 .

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,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
variant='minbase'
@@ -117,6 +117,11 @@ 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
@@ -138,18 +143,34 @@ if [ -z "$strictDebootstrap" ]; then
# shrink the image, since apt makes us fat (wheezy: ~157.5MB vs ~120MB)
sudo chroot . apt-get clean
# 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 want to effectively run "apt-get clean" after every install to keep images small
echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | sudo tee etc/apt/apt.conf.d/no-cache > /dev/null
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
@@ -182,6 +203,9 @@ if [ -z "$strictDebootstrap" ]; then
;;
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

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

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="$mount" -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

@@ -4,6 +4,10 @@
<dict>
<key>name</key>
<string>Dockerfile</string>
<key>fileTypes</key>
<array>
<string>Dockerfile</string>
</array>
<key>patterns</key>
<array>
<dict>

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

@@ -17,3 +17,34 @@ meaning you can use Vagrant to control Docker containers.
* [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,15 +1,17 @@
package main
import (
"flag"
"fmt"
"github.com/dotcloud/docker"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/sysinit"
"github.com/dotcloud/docker/utils"
"log"
"os"
"strings"
"github.com/dotcloud/docker"
"github.com/dotcloud/docker/api"
"github.com/dotcloud/docker/engine"
flag "github.com/dotcloud/docker/pkg/mflag"
"github.com/dotcloud/docker/sysinit"
"github.com/dotcloud/docker/utils"
)
var (
@@ -23,21 +25,28 @@ func main() {
sysinit.SysInit()
return
}
// FIXME: Switch d and D ? (to be more sshd like)
flVersion := flag.Bool("v", false, "Print version information and quit")
flDaemon := flag.Bool("d", false, "Daemon mode")
flDebug := flag.Bool("D", false, "Debug mode")
flAutoRestart := flag.Bool("r", true, "Restart previously running containers")
bridgeName := flag.String("b", "", "Attach containers to a pre-existing network bridge. Use 'none' to disable container networking")
pidfile := flag.String("p", "/var/run/docker.pid", "File containing process PID")
flRoot := flag.String("g", "/var/lib/docker", "Path to use as the root of the docker runtime.")
flEnableCors := flag.Bool("api-enable-cors", false, "Enable CORS requests in the remote api.")
flDns := flag.String("dns", "", "Set custom dns servers")
flHosts := utils.ListOpts{fmt.Sprintf("unix://%s", docker.DEFAULTUNIXSOCKET)}
flag.Var(&flHosts, "H", "tcp://host:port to bind/connect to or unix://path/to/socket to use")
flEnableIptables := flag.Bool("iptables", true, "Disable iptables within docker")
flDefaultIp := flag.String("ip", "0.0.0.0", "Default ip address to use when binding a containers ports")
flInterContainerComm := flag.Bool("icc", true, "Enable inter-container communication")
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 = docker.NewListOpts(docker.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 = docker.NewListOpts(docker.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()
@@ -45,16 +54,18 @@ func main() {
showVersion()
return
}
if len(flHosts) > 1 {
flHosts = flHosts[1:] //trick to display a nice default value in the usage
}
for i, flHost := range flHosts {
host, err := utils.ParseHost(docker.DEFAULTHTTPHOST, docker.DEFAULTHTTPPORT, flHost)
if err == nil {
flHosts[i] = host
} else {
log.Fatal(err)
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)
}
flHosts.Set(defaultHost)
}
if *bridgeName != "" && *bridgeIp != "" {
log.Fatal("You specified -b & --bip, mutually exclusive options. Please specify only one.")
}
if *flDebug {
@@ -67,38 +78,47 @@ func main() {
flag.Usage()
return
}
eng, err := engine.New(*flRoot)
if err != nil {
log.Fatal(err)
}
// Load plugin: httpapi
job := eng.Job("initapi")
job := eng.Job("initserver")
job.Setenv("Pidfile", *pidfile)
job.Setenv("Root", *flRoot)
job.SetenvBool("AutoRestart", *flAutoRestart)
job.SetenvBool("EnableCors", *flEnableCors)
job.Setenv("Dns", *flDns)
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)
}
// Serve api
job = eng.Job("serveapi", flHosts...)
job = eng.Job("serveapi", flHosts.GetAll()...)
job.SetenvBool("Logging", true)
job.SetenvBool("EnableCors", *flEnableCors)
job.Setenv("Version", VERSION)
if err := job.Run(); err != nil {
log.Fatal(err)
}
} else {
if len(flHosts) > 1 {
if flHosts.Len() > 1 {
log.Fatal("Please specify only one -H")
}
protoAddrParts := strings.SplitN(flHosts[0], "://", 2)
protoAddrParts := strings.SplitN(flHosts.GetAll()[0], "://", 2)
if err := docker.ParseCommands(protoAddrParts[0], protoAddrParts[1], flag.Args()...); err != nil {
if sterr, ok := err.(*utils.StatusError); ok {
os.Exit(sterr.Status)
if sterr.Status != "" {
log.Println(sterr.Status)
}
os.Exit(sterr.StatusCode)
}
log.Fatal(err)
}

View File

@@ -1,20 +1,19 @@
from ubuntu:12.04
maintainer Nick Stinemates
FROM ubuntu:12.04
MAINTAINER Nick Stinemates
#
# docker build -t docker:docs . && docker run -p 8000:8000 docker:docs
#
run apt-get update
run apt-get install -y python-setuptools make
run easy_install pip
#from docs/requirements.txt, but here to increase cacheability
run pip install Sphinx==1.1.3
run pip install sphinxcontrib-httpdomain==1.1.8
add . /docs
run cd /docs; make docs
# TODO switch to http://packages.ubuntu.com/trusty/python-sphinxcontrib-httpdomain once trusty is released
expose 8000
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
entrypoint ["python", "-m", "SimpleHTTPServer"]
WORKDIR /docs/_build/html
CMD ["python", "-m", "SimpleHTTPServer"]
# note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525
EXPOSE 8000

View File

@@ -1,2 +1,3 @@
Andy Rothfusz <andy@dotcloud.com> (@metalivedev)
Ken Cochrane <ken@dotcloud.com> (@kencochrane)
James Turnbull <james@lovedthanlost.net> (@jamtur01)
Sven Dowideit <SvenDowideit@fosiki.com> (@SvenDowideit)

View File

@@ -41,24 +41,25 @@ its dependencies. There are two main ways to install this tool:
###Native Installation
* Install sphinx: `pip install sphinx`
* Mac OS X: `[sudo] pip-2.7 install sphinx`
* Install sphinx httpdomain contrib package: `pip install sphinxcontrib-httpdomain`
* Mac OS X: `[sudo] pip-2.7 install sphinxcontrib-httpdomain`
* If pip is not available you can probably install it using your favorite package manager as **python-pip**
Install dependencies from `requirements.txt` file in your `docker/docs`
directory:
* Linux: `pip install -r docs/requirements.txt`
* Mac OS X: `[sudo] pip-2.7 install -r docs/requirements.txt`
###Alternative Installation: Docker Container
If you're running ``docker`` on your development machine then you may
find it easier and cleaner to use the Dockerfile. This installs Sphinx
find it easier and cleaner to use the docs Dockerfile. This installs Sphinx
in a container, adds the local ``docs/`` directory and builds the HTML
docs inside the container, even starting a simple HTTP server on port
8000 so that you can connect and see your changes. Just run ``docker
build .`` and run the resulting image. This is the equivalent to
``make clean server`` since each container starts clean.
8000 so that you can connect and see your changes.
In the ``docs/`` directory, run:
```docker build -t docker:docs . && docker run -p 8000:8000 docker:docs```
In the ``docker`` source directory, run:
```make docs```
This is the equivalent to ``make clean server`` since each container starts clean.
Usage
-----
@@ -127,7 +128,8 @@ Guides on using sphinx
* Code examples
* Start without $, so it's easy to copy and paste.
* Start typed commands with ``$ `` (dollar space) so that they
are easily differentiated from program output.
* Use "sudo" with docker to ensure that your command is runnable
even if they haven't [used the *docker*
group](http://docs.docker.io/en/latest/use/basics/#why-sudo).
@@ -136,7 +138,7 @@ Manpages
--------
* To make the manpages, run ``make man``. Please note there is a bug
in spinx 1.1.3 which makes this fail. Upgrade to the latest version
in Sphinx 1.1.3 which makes this fail. Upgrade to the latest version
of Sphinx.
* Then preview the manpage by running ``man _build/man/docker.1``,
where ``_build/man/docker.1`` is the path to the generated manfile

View File

@@ -1,2 +1,2 @@
Sphinx==1.1.3
sphinxcontrib-httpdomain==1.1.9
Sphinx==1.2.1
sphinxcontrib-httpdomain==1.2.0

View File

@@ -1 +0,0 @@
Solomon Hykes <solomon@dotcloud.com> (@shykes)

View File

@@ -1,10 +1,10 @@
:title: Base Image Creation
:title: Create a Base Image
:description: How to create base images
:keywords: Examples, Usage, base image, docker, documentation, examples
.. _base_image_creation:
Base Image Creation
Create a Base Image
===================
So you want to create your own :ref:`base_image_def`? Great!
@@ -34,10 +34,13 @@ It can be as simple as this to create an Ubuntu base image::
DISTRIB_DESCRIPTION="Ubuntu 13.04"
There are more example scripts for creating base images in the
Docker Github Repo:
Docker GitHub Repo:
* `BusyBox <https://github.com/dotcloud/docker/blob/master/contrib/mkimage-busybox.sh>`_
* `CentOS
<https://github.com/dotcloud/docker/blob/master/contrib/mkimage-centos.sh>`_
* `Debian/Ubuntu
* CentOS / Scientific Linux CERN (SLC) `on Debian/Ubuntu
<https://github.com/dotcloud/docker/blob/master/contrib/mkimage-rinse.sh>`_
or
`on CentOS/RHEL/SLC/etc.
<https://github.com/dotcloud/docker/blob/master/contrib/mkimage-yum.sh>`_
* `Debian / Ubuntu
<https://github.com/dotcloud/docker/blob/master/contrib/mkimage-debootstrap.sh>`_

View File

@@ -0,0 +1,15 @@
:title: Docker articles
:description: various articles related to Docker
:keywords: docker, articles
.. _articles_list:
Articles
========
.. toctree::
:maxdepth: 1
security
baseimages
runmetrics

View File

@@ -0,0 +1,463 @@
:title: Runtime Metrics
:description: Measure the behavior of running containers
:keywords: docker, metrics, CPU, memory, disk, IO, run, runtime
.. _run_metrics:
Runtime Metrics
===============
Linux Containers rely on `control groups
<https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt>`_ which
not only track groups of processes, but also expose metrics about CPU,
memory, and block I/O usage. You can access those metrics and obtain
network usage metrics as well. This is relevant for "pure" LXC
containers, as well as for Docker containers.
Control Groups
--------------
Control groups are exposed through a pseudo-filesystem. In recent
distros, you should find this filesystem under
``/sys/fs/cgroup``. Under that directory, you will see multiple
sub-directories, called devices, freezer, blkio, etc.; each
sub-directory actually corresponds to a different cgroup hierarchy.
On older systems, the control groups might be mounted on ``/cgroup``,
without distinct hierarchies. In that case, instead of seeing the
sub-directories, you will see a bunch of files in that directory, and
possibly some directories corresponding to existing containers.
To figure out where your control groups are mounted, you can run:
::
grep cgroup /proc/mounts
.. _run_findpid:
Enumerating Cgroups
-------------------
You can look into ``/proc/cgroups`` to see the different control group
subsystems known to the system, the hierarchy they belong to, and how
many groups they contain.
You can also look at ``/proc/<pid>/cgroup`` to see which control
groups a process belongs to. The control group will be shown as a path
relative to the root of the hierarchy mountpoint; e.g. ``/`` means
“this process has not been assigned into a particular group”, while
``/lxc/pumpkin`` means that the process is likely to be a member of a
container named ``pumpkin``.
Finding the Cgroup for a Given Container
----------------------------------------
For each container, one cgroup will be created in each hierarchy. On
older systems with older versions of the LXC userland tools, the name
of the cgroup will be the name of the container. With more recent
versions of the LXC tools, the cgroup will be ``lxc/<container_name>.``
For Docker containers using cgroups, the container name will be the
full ID or long ID of the container. If a container shows up as
ae836c95b4c3 in ``docker ps``, its long ID might be something like
``ae836c95b4c3c9e9179e0e91015512da89fdec91612f63cebae57df9a5444c79``. You
can look it up with ``docker inspect`` or ``docker ps -notrunc``.
Putting everything together to look at the memory metrics for a Docker
container, take a look at ``/sys/fs/cgroup/memory/lxc/<longid>/``.
Metrics from Cgroups: Memory, CPU, Block IO
-------------------------------------------
For each subsystem (memory, CPU, and block I/O), you will find one or
more pseudo-files containing statistics.
Memory Metrics: ``memory.stat``
...............................
Memory metrics are found in the "memory" cgroup. Note that the memory
control group adds a little overhead, because it does very
fine-grained accounting of the memory usage on your host. Therefore,
many distros chose to not enable it by default. Generally, to enable
it, all you have to do is to add some kernel command-line parameters:
``cgroup_enable=memory swapaccount=1``.
The metrics are in the pseudo-file ``memory.stat``. Here is what it
will look like:
::
cache 11492564992
rss 1930993664
mapped_file 306728960
pgpgin 406632648
pgpgout 403355412
swap 0
pgfault 728281223
pgmajfault 1724
inactive_anon 46608384
active_anon 1884520448
inactive_file 7003344896
active_file 4489052160
unevictable 32768
hierarchical_memory_limit 9223372036854775807
hierarchical_memsw_limit 9223372036854775807
total_cache 11492564992
total_rss 1930993664
total_mapped_file 306728960
total_pgpgin 406632648
total_pgpgout 403355412
total_swap 0
total_pgfault 728281223
total_pgmajfault 1724
total_inactive_anon 46608384
total_active_anon 1884520448
total_inactive_file 7003344896
total_active_file 4489052160
total_unevictable 32768
The first half (without the ``total_`` prefix) contains statistics
relevant to the processes within the cgroup, excluding
sub-cgroups. The second half (with the ``total_`` prefix) includes
sub-cgroups as well.
Some metrics are "gauges", i.e. values that can increase or decrease
(e.g. swap, the amount of swap space used by the members of the
cgroup). Some others are "counters", i.e. values that can only go up,
because they represent occurrences of a specific event (e.g. pgfault,
which indicates the number of page faults which happened since the
creation of the cgroup; this number can never decrease).
cache
the amount of memory used by the processes of this control group
that can be associated precisely with a block on a block
device. When you read from and write to files on disk, this amount
will increase. This will be the case if you use "conventional" I/O
(``open``, ``read``, ``write`` syscalls) as well as mapped files
(with ``mmap``). It also accounts for the memory used by ``tmpfs``
mounts, though the reasons are unclear.
rss
the amount of memory that *doesn't* correspond to anything on
disk: stacks, heaps, and anonymous memory maps.
mapped_file
indicates the amount of memory mapped by the processes in the
control group. It doesn't give you information about *how much*
memory is used; it rather tells you *how* it is used.
pgfault and pgmajfault
indicate the number of times that a process of the cgroup triggered
a "page fault" and a "major fault", respectively. A page fault
happens when a process accesses a part of its virtual memory space
which is nonexistent or protected. The former can happen if the
process is buggy and tries to access an invalid address (it will
then be sent a ``SIGSEGV`` signal, typically killing it with the
famous ``Segmentation fault`` message). The latter can happen when
the process reads from a memory zone which has been swapped out, or
which corresponds to a mapped file: in that case, the kernel will
load the page from disk, and let the CPU complete the memory
access. It can also happen when the process writes to a
copy-on-write memory zone: likewise, the kernel will preempt the
process, duplicate the memory page, and resume the write operation
on the process' own copy of the page. "Major" faults happen when the
kernel actually has to read the data from disk. When it just has to
duplicate an existing page, or allocate an empty page, it's a
regular (or "minor") fault.
swap
the amount of swap currently used by the processes in this cgroup.
active_anon and inactive_anon
the amount of *anonymous* memory that has been identified has
respectively *active* and *inactive* by the kernel. "Anonymous"
memory is the memory that is *not* linked to disk pages. In other
words, that's the equivalent of the rss counter described above. In
fact, the very definition of the rss counter is **active_anon** +
**inactive_anon** - **tmpfs** (where tmpfs is the amount of memory
used up by ``tmpfs`` filesystems mounted by this control
group). Now, what's the difference between "active" and "inactive"?
Pages are initially "active"; and at regular intervals, the kernel
sweeps over the memory, and tags some pages as "inactive". Whenever
they are accessed again, they are immediately retagged
"active". When the kernel is almost out of memory, and time comes to
swap out to disk, the kernel will swap "inactive" pages.
active_file and inactive_file
cache memory, with *active* and *inactive* similar to the *anon*
memory above. The exact formula is cache = **active_file** +
**inactive_file** + **tmpfs**. The exact rules used by the kernel to
move memory pages between active and inactive sets are different
from the ones used for anonymous memory, but the general principle
is the same. Note that when the kernel needs to reclaim memory, it
is cheaper to reclaim a clean (=non modified) page from this pool,
since it can be reclaimed immediately (while anonymous pages and
dirty/modified pages have to be written to disk first).
unevictable
the amount of memory that cannot be reclaimed; generally, it will
account for memory that has been "locked" with ``mlock``. It is
often used by crypto frameworks to make sure that secret keys and
other sensitive material never gets swapped out to disk.
memory and memsw limits
These are not really metrics, but a reminder of the limits applied
to this cgroup. The first one indicates the maximum amount of
physical memory that can be used by the processes of this control
group; the second one indicates the maximum amount of RAM+swap.
Accounting for memory in the page cache is very complex. If two
processes in different control groups both read the same file
(ultimately relying on the same blocks on disk), the corresponding
memory charge will be split between the control groups. It's nice, but
it also means that when a cgroup is terminated, it could increase the
memory usage of another cgroup, because they are not splitting the
cost anymore for those memory pages.
CPU metrics: ``cpuacct.stat``
.............................
Now that we've covered memory metrics, everything else will look very
simple in comparison. CPU metrics will be found in the ``cpuacct``
controller.
For each container, you will find a pseudo-file ``cpuacct.stat``,
containing the CPU usage accumulated by the processes of the
container, broken down between ``user`` and ``system`` time. If you're
not familiar with the distinction, ``user`` is the time during which
the processes were in direct control of the CPU (i.e. executing
process code), and ``system`` is the time during which the CPU was
executing system calls on behalf of those processes.
Those times are expressed in ticks of 1/100th of a second. Actually,
they are expressed in "user jiffies". There are ``USER_HZ``
*"jiffies"* per second, and on x86 systems, ``USER_HZ`` is 100. This
used to map exactly to the number of scheduler "ticks" per second; but
with the advent of higher frequency scheduling, as well as `tickless
kernels <http://lwn.net/Articles/549580/>`_, the number of kernel
ticks wasn't relevant anymore. It stuck around anyway, mainly for
legacy and compatibility reasons.
Block I/O metrics
.................
Block I/O is accounted in the ``blkio`` controller. Different metrics
are scattered across different files. While you can find in-depth
details in the `blkio-controller
<https://www.kernel.org/doc/Documentation/cgroups/blkio-controller.txt>`_
file in the kernel documentation, here is a short list of the most
relevant ones:
blkio.sectors
contain the number of 512-bytes sectors read and written by the
processes member of the cgroup, device by device. Reads and writes
are merged in a single counter.
blkio.io_service_bytes
indicates the number of bytes read and written by the cgroup. It has
4 counters per device, because for each device, it differentiates
between synchronous vs. asynchronous I/O, and reads vs. writes.
blkio.io_serviced
the number of I/O operations performed, regardless of their size. It
also has 4 counters per device.
blkio.io_queued
indicates the number of I/O operations currently queued for this
cgroup. In other words, if the cgroup isn't doing any I/O, this will
be zero. Note that the opposite is not true. In other words, if
there is no I/O queued, it does not mean that the cgroup is idle
(I/O-wise). It could be doing purely synchronous reads on an
otherwise quiescent device, which is therefore able to handle them
immediately, without queuing. Also, while it is helpful to figure
out which cgroup is putting stress on the I/O subsystem, keep in
mind that is is a relative quantity. Even if a process group does
not perform more I/O, its queue size can increase just because the
device load increases because of other devices.
Network Metrics
---------------
Network metrics are not exposed directly by control groups. There is a
good explanation for that: network interfaces exist within the context
of *network namespaces*. The kernel could probably accumulate metrics
about packets and bytes sent and received by a group of processes, but
those metrics wouldn't be very useful. You want per-interface metrics
(because traffic happening on the local ``lo`` interface doesn't
really count). But since processes in a single cgroup can belong to
multiple network namespaces, those metrics would be harder to
interpret: multiple network namespaces means multiple ``lo``
interfaces, potentially multiple ``eth0`` interfaces, etc.; so this is
why there is no easy way to gather network metrics with control
groups.
Instead we can gather network metrics from other sources:
IPtables
........
IPtables (or rather, the netfilter framework for which iptables is
just an interface) can do some serious accounting.
For instance, you can setup a rule to account for the outbound HTTP
traffic on a web server:
::
iptables -I OUTPUT -p tcp --sport 80
There is no ``-j`` or ``-g`` flag, so the rule will just count matched
packets and go to the following rule.
Later, you can check the values of the counters, with:
::
iptables -nxvL OUTPUT
Technically, ``-n`` is not required, but it will prevent iptables from
doing DNS reverse lookups, which are probably useless in this
scenario.
Counters include packets and bytes. If you want to setup metrics for
container traffic like this, you could execute a ``for`` loop to add
two ``iptables`` rules per container IP address (one in each
direction), in the ``FORWARD`` chain. This will only meter traffic
going through the NAT layer; you will also have to add traffic going
through the userland proxy.
Then, you will need to check those counters on a regular basis. If you
happen to use ``collectd``, there is a nice plugin to automate
iptables counters collection.
Interface-level counters
........................
Since each container has a virtual Ethernet interface, you might want
to check directly the TX and RX counters of this interface. You will
notice that each container is associated to a virtual Ethernet
interface in your host, with a name like ``vethKk8Zqi``. Figuring out
which interface corresponds to which container is, unfortunately,
difficult.
But for now, the best way is to check the metrics *from within the
containers*. To accomplish this, you can run an executable from the
host environment within the network namespace of a container using
**ip-netns magic**.
The ``ip-netns exec`` command will let you execute any program
(present in the host system) within any network namespace visible to
the current process. This means that your host will be able to enter
the network namespace of your containers, but your containers won't be
able to access the host, nor their sibling containers. Containers will
be able to “see” and affect their sub-containers, though.
The exact format of the command is::
ip netns exec <nsname> <command...>
For example::
ip netns exec mycontainer netstat -i
``ip netns`` finds the "mycontainer" container by using namespaces
pseudo-files. Each process belongs to one network namespace, one PID
namespace, one ``mnt`` namespace, etc., and those namespaces are
materialized under ``/proc/<pid>/ns/``. For example, the network
namespace of PID 42 is materialized by the pseudo-file
``/proc/42/ns/net``.
When you run ``ip netns exec mycontainer ...``, it expects
``/var/run/netns/mycontainer`` to be one of those
pseudo-files. (Symlinks are accepted.)
In other words, to execute a command within the network namespace of a
container, we need to:
* Find out the PID of any process within the container that we want to
investigate;
* Create a symlink from ``/var/run/netns/<somename>`` to
``/proc/<thepid>/ns/net``
* Execute ``ip netns exec <somename> ....``
Please review :ref:`run_findpid` to learn how to find the cgroup of a
pprocess running in the container of which you want to measure network
usage. From there, you can examine the pseudo-file named ``tasks``,
which containes the PIDs that are in the control group (i.e. in the
container). Pick any one of them.
Putting everything together, if the "short ID" of a container is held
in the environment variable ``$CID``, then you can do this::
TASKS=/sys/fs/cgroup/devices/$CID*/tasks
PID=$(head -n 1 $TASKS)
mkdir -p /var/run/netns
ln -sf /proc/$PID/ns/net /var/run/netns/$CID
ip netns exec $CID netstat -i
Tips for high-performance metric collection
-------------------------------------------
Note that running a new process each time you want to update metrics
is (relatively) expensive. If you want to collect metrics at high
resolutions, and/or over a large number of containers (think 1000
containers on a single host), you do not want to fork a new process
each time.
Here is how to collect metrics from a single process. You will have to
write your metric collector in C (or any language that lets you do
low-level system calls). You need to use a special system call,
``setns()``, which lets the current process enter any arbitrary
namespace. It requires, however, an open file descriptor to the
namespace pseudo-file (remember: thats the pseudo-file in
``/proc/<pid>/ns/net``).
However, there is a catch: you must not keep this file descriptor
open. If you do, when the last process of the control group exits, the
namespace will not be destroyed, and its network resources (like the
virtual interface of the container) will stay around for ever (or
until you close that file descriptor).
The right approach would be to keep track of the first PID of each
container, and re-open the namespace pseudo-file each time.
Collecting metrics when a container exits
-----------------------------------------
Sometimes, you do not care about real time metric collection, but when
a container exits, you want to know how much CPU, memory, etc. it has
used.
Docker makes this difficult because it relies on ``lxc-start``, which
carefully cleans up after itself, but it is still possible. It is
usually easier to collect metrics at regular intervals (e.g. every
minute, with the collectd LXC plugin) and rely on that instead.
But, if you'd still like to gather the stats when a container stops,
here is how:
For each container, start a collection process, and move it to the
control groups that you want to monitor by writing its PID to the
tasks file of the cgroup. The collection process should periodically
re-read the tasks file to check if it's the last process of the
control group. (If you also want to collect network statistics as
explained in the previous section, you should also move the process to
the appropriate network namespace.)
When the container exits, ``lxc-start`` will try to delete the control
groups. It will fail, since the control group is still in use; but
thats fine. You process should now detect that it is the only one
remaining in the group. Now is the right time to collect all the
metrics you need!
Finally, your process should move itself back to the root control
group, and remove the container control group. To remove a control
group, just ``rmdir`` its directory. It's counter-intuitive to
``rmdir`` a directory as it still contains files; but remember that
this is a pseudo-filesystem, so usual rules don't apply. After the
cleanup is done, the collection process can exit safely.

File diff suppressed because it is too large Load Diff

View File

@@ -62,7 +62,7 @@ master_doc = 'toctree'
# General information about the project.
project = u'Docker'
copyright = u'2013, Team Docker'
copyright = u'2014 Docker, Inc.'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -175,7 +175,7 @@ html_show_sourcelink = False
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
@@ -235,8 +235,10 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('commandline/cli', 'docker', u'Docker Documentation',
[u'Team Docker'], 1)
('reference/commandline/cli', 'docker', u'Docker CLI Documentation',
[u'Team Docker'], 1),
('reference/builder', 'Dockerfile', u'Dockerfile Documentation',
[u'Team Docker'], 5),
]
# If true, show URL addresses after external links.

View File

@@ -42,11 +42,10 @@ This following command will build a development environment using the Dockerfile
.. code-block:: bash
sudo docker build -t docker .
sudo make build
If the build is successful, congratulations! You have produced a clean build of docker, neatly encapsulated in a standard build environment.
If the build is successful, congratulations! You have produced a clean build of
docker, neatly encapsulated in a standard build environment.
Step 4: Build the Docker Binary
@@ -56,10 +55,23 @@ To create the Docker binary, run this command:
.. code-block:: bash
sudo docker run -privileged -v `pwd`:/go/src/github.com/dotcloud/docker docker hack/make.sh binary
sudo make binary
This will create the Docker binary in ``./bundles/<version>-dev/binary/``
Using your built Docker binary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The binary is available outside the container in the directory
``./bundles/<version>-dev/binary/``. You can swap your host docker executable
with this binary for live testing - for example, on ubuntu:
.. code-block:: bash
sudo service docker stop ; sudo cp $(which docker) $(which docker)_ ; sudo cp ./bundles/<version>-dev/binary/docker-<version>-dev $(which docker);sudo service docker start
.. note:: Its safer to run the tests below before swapping your hosts docker binary.
Step 5: Run the Tests
---------------------
@@ -68,10 +80,15 @@ To execute the test cases, run this command:
.. code-block:: bash
sudo docker run -privileged -v `pwd`:/go/src/github.com/dotcloud/docker docker hack/make.sh test
sudo make test
Note: if you're running the tests in vagrant, you need to specify a dns entry in the command: `-dns 8.8.8.8`
Note: if you're running the tests in vagrant, you need to specify a dns entry in
the command (either edit the Makefile, or run the step manually):
.. code-block:: bash
sudo docker run -dns 8.8.8.8 -privileged -v `pwd`:/go/src/github.com/dotcloud/docker docker hack/make.sh test
If the test are successful then the tail of the output should look something like this
@@ -113,15 +130,24 @@ You can run an interactive session in the newly built container:
.. code-block:: bash
sudo docker run -privileged -i -t docker bash
sudo make shell
# type 'exit' to exit
# type 'exit' or Ctrl-D to exit
Extra Step: Build and view the Documentation
--------------------------------------------
.. note:: The binary is available outside the container in the directory ``./bundles/<version>-dev/binary/``. You can swap your host docker executable with this binary for live testing - for example, on ubuntu: ``sudo service docker stop ; sudo cp $(which docker) $(which docker)_ ; sudo cp ./bundles/<version>-dev/binary/docker-<version>-dev $(which docker);sudo service docker start``.
If you want to read the documentation from a local website, or are making changes
to it, you can build the documentation and then serve it by:
.. code-block:: bash
sudo make docs
# when its done, you can point your browser to http://yourdockerhost:8000
# type Ctrl-C to exit
**Need More Help?**
If you need more help then hop on to the `#docker-dev IRC channel <irc://chat.freenode.net#docker-dev>`_ or post a message on the `Docker developer mailinglist <https://groups.google.com/d/forum/docker-dev>`_.
If you need more help then hop on to the `#docker-dev IRC channel <irc://chat.freenode.net#docker-dev>`_ or post a message on the `Docker developer mailing list <https://groups.google.com/d/forum/docker-dev>`_.

View File

@@ -0,0 +1,137 @@
:title: Process Management with CFEngine
:description: Managing containerized processes with CFEngine
:keywords: cfengine, process, management, usage, docker, documentation
Process Management with CFEngine
================================
Create Docker containers with managed processes.
Docker monitors one process in each running container and the container lives or dies with that process.
By introducing CFEngine inside Docker containers, we can alleviate a few of the issues that may arise:
* It is possible to easily start multiple processes within a container, all of which will be managed automatically, with the normal ``docker run`` command.
* If a managed process dies or crashes, CFEngine will start it again within 1 minute.
* The container itself will live as long as the CFEngine scheduling daemon (cf-execd) lives. With CFEngine, we are able to decouple the life of the container from the uptime of the service it provides.
How it works
------------
CFEngine, together with the cfe-docker integration policies, are installed as part of the Dockerfile. This builds CFEngine into our Docker image.
The Dockerfile's ``ENTRYPOINT`` takes an arbitrary amount of commands (with any desired arguments) as parameters.
When we run the Docker container these parameters get written to CFEngine policies and CFEngine takes over to ensure that the desired processes are running in the container.
CFEngine scans the process table for the ``basename`` of the commands given to the ``ENTRYPOINT`` and runs the command to start the process if the ``basename`` is not found.
For example, if we start the container with ``docker run "/path/to/my/application parameters"``, CFEngine will look for a process named ``application`` and run the command.
If an entry for ``application`` is not found in the process table at any point in time, CFEngine will execute ``/path/to/my/application parameters`` to start the application once again.
The check on the process table happens every minute.
Note that it is therefore important that the command to start your application leaves a process with the basename of the command.
This can be made more flexible by making some minor adjustments to the CFEngine policies, if desired.
Usage
-----
This example assumes you have Docker installed and working.
We will install and manage ``apache2`` and ``sshd`` in a single container.
There are three steps:
1. Install CFEngine into the container.
2. Copy the CFEngine Docker process management policy into the containerized CFEngine installation.
3. Start your application processes as part of the ``docker run`` command.
Building the container image
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The first two steps can be done as part of a Dockerfile, as follows.
.. code-block:: bash
FROM ubuntu
MAINTAINER Eystein Måløy Stenberg <eytein.stenberg@gmail.com>
RUN apt-get -y install wget lsb-release unzip
# install latest CFEngine
RUN wget -qO- http://cfengine.com/pub/gpg.key | apt-key add -
RUN echo "deb http://cfengine.com/pub/apt $(lsb_release -cs) main" > /etc/apt/sources.list.d/cfengine-community.list
RUN apt-get update
RUN apt-get install cfengine-community
# install cfe-docker process management policy
RUN wget --no-check-certificate https://github.com/estenberg/cfe-docker/archive/master.zip -P /tmp/ && unzip /tmp/master.zip -d /tmp/
RUN cp /tmp/cfe-docker-master/cfengine/bin/* /var/cfengine/bin/
RUN cp /tmp/cfe-docker-master/cfengine/inputs/* /var/cfengine/inputs/
RUN rm -rf /tmp/cfe-docker-master /tmp/master.zip
# apache2 and openssh are just for testing purposes, install your own apps here
RUN apt-get -y install openssh-server apache2
RUN mkdir -p /var/run/sshd
RUN echo "root:password" | chpasswd # need a password for ssh
ENTRYPOINT ["/var/cfengine/bin/docker_processes_run.sh"]
By saving this file as ``Dockerfile`` to a working directory, you can then build your container with the docker build command,
e.g. ``docker build -t managed_image``.
Testing the container
~~~~~~~~~~~~~~~~~~~~~
Start the container with ``apache2`` and ``sshd`` running and managed, forwarding a port to our SSH instance:
.. code-block:: bash
docker run -p 127.0.0.1:222:22 -d managed_image "/usr/sbin/sshd" "/etc/init.d/apache2 start"
We now clearly see one of the benefits of the cfe-docker integration: it allows to start several processes
as part of a normal ``docker run`` command.
We can now log in to our new container and see that both ``apache2`` and ``sshd`` are running. We have set the root password to
"password" in the Dockerfile above and can use that to log in with ssh:
.. code-block:: bash
ssh -p222 root@127.0.0.1
ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 07:48 ? 00:00:00 /bin/bash /var/cfengine/bin/docker_processes_run.sh /usr/sbin/sshd /etc/init.d/apache2 start
root 18 1 0 07:48 ? 00:00:00 /var/cfengine/bin/cf-execd -F
root 20 1 0 07:48 ? 00:00:00 /usr/sbin/sshd
root 32 1 0 07:48 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 34 32 0 07:48 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 35 32 0 07:48 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 36 32 0 07:48 ? 00:00:00 /usr/sbin/apache2 -k start
root 93 20 0 07:48 ? 00:00:00 sshd: root@pts/0
root 105 93 0 07:48 pts/0 00:00:00 -bash
root 112 105 0 07:49 pts/0 00:00:00 ps -ef
If we stop apache2, it will be started again within a minute by CFEngine.
.. code-block:: bash
service apache2 status
Apache2 is running (pid 32).
service apache2 stop
* Stopping web server apache2 ... waiting [ OK ]
service apache2 status
Apache2 is NOT running.
# ... wait up to 1 minute...
service apache2 status
Apache2 is running (pid 173).
Adapting to your applications
-----------------------------
To make sure your applications get managed in the same manner, there are just two things you need to adjust from the above example:
* In the Dockerfile used above, install your applications instead of ``apache2`` and ``sshd``.
* When you start the container with ``docker run``, specify the command line arguments to your applications rather than ``apache2`` and ``sshd``.

View File

@@ -41,7 +41,7 @@ This time, we're requesting shared access to ``$COUCH1``'s volumes.
.. code-block:: bash
COUCH2=$(sudo docker run -d -p 5984 -volumes-from $COUCH1 shykes/couchdb:2013-05-03)
COUCH2=$(sudo docker run -d -p 5984 --volumes-from $COUCH1 shykes/couchdb:2013-05-03)
Browse data on the second database
----------------------------------

View File

@@ -9,25 +9,23 @@ Hello World
.. _running_examples:
Running the Examples
====================
Check your Docker install
-------------------------
All the examples assume your machine is running the ``docker`` daemon. To
run the ``docker`` daemon in the background, simply type:
This guide assumes you have a working installation of Docker. To check
your Docker install, run the following command:
.. code-block:: bash
sudo docker -d &
# Check that you have a working install
docker info
Now you can run Docker in client mode: by default all commands will be
forwarded to the ``docker`` daemon via a protected Unix socket, so you
must run as the ``root`` or via the ``sudo`` command.
If you get ``docker: command not found`` or something like
``/var/lib/docker/repositories: permission denied`` you may have an incomplete
Docker installation or insufficient privileges to access docker on your machine.
.. code-block:: bash
Please refer to :ref:`installation_list` for installation instructions.
sudo docker help
----
.. _hello_world:
@@ -72,10 +70,12 @@ See the example in action
.. raw:: html
<div style="margin-top:10px;">
<iframe width="560" height="350" src="http://ascii.io/a/2603/raw" frameborder="0"></iframe>
</div>
<iframe width="560" height="400" frameborder="0"
sandbox="allow-same-origin allow-scripts"
srcdoc="<body><script type=&quot;text/javascript&quot;
src=&quot;https://asciinema.org/a/2603.js&quot;
id=&quot;asciicast-2603&quot; async></script></body>">
</iframe>
----
@@ -88,9 +88,7 @@ Hello World Daemon
And now for the most boring daemon ever written!
This example assumes you have Docker installed and the Ubuntu
image already imported with ``docker pull ubuntu``. We will use the Ubuntu
image to run a simple hello world daemon that will just print hello
We will use the Ubuntu image to run a simple hello world daemon that will just print hello
world to standard out every second. It will continue to do this until
we stop it.
@@ -125,14 +123,14 @@ Check the logs make sure it is working correctly.
.. code-block:: bash
sudo docker attach $CONTAINER_ID
sudo docker attach -sig-proxy=false $CONTAINER_ID
Attach to the container to see the results in real-time.
- **"docker attach**" This will allow us to attach to a background
process to see what is going on.
- **"-sig-proxy=true"** Proxify all received signal to the process
(even in non-tty mode)
- **"-sig-proxy=false"** Do not forward signals to the container; allows
us to exit the attachment using Control-C without stopping the container.
- **$CONTAINER_ID** The Id of the container we want to attach too.
Exit from the container attachment by pressing Control-C.
@@ -167,9 +165,12 @@ See the example in action
.. raw:: html
<div style="margin-top:10px;">
<iframe width="560" height="350" src="http://ascii.io/a/2562/raw" frameborder="0"></iframe>
</div>
<iframe width="560" height="400" frameborder="0"
sandbox="allow-same-origin allow-scripts"
srcdoc="<body><script type=&quot;text/javascript&quot;
src=&quot;https://asciinema.org/a/2562.js&quot;
id=&quot;asciicast-2562&quot; async></script></body>">
</iframe>
The next example in the series is a :ref:`python_web_app` example, or
you could skip to any of the other examples:

View File

@@ -24,3 +24,5 @@ to more substantial services like those which you might find in production.
postgresql_service
mongodb
running_riak_service
using_supervisord
cfengine_process_management

View File

@@ -7,26 +7,18 @@
PostgreSQL Service
==================
.. include:: example_header.inc
.. note::
A shorter version of `this blog post`_.
.. note::
As of version 0.5.2, Docker requires root privileges to run.
You have to either manually adjust your system configuration (permissions on
/var/run/docker.sock or sudo config), or prefix `docker` with `sudo`. Check
`this thread`_ for details.
.. _this blog post: http://zaiste.net/2013/08/docker_postgresql_how_to/
.. _this thread: https://groups.google.com/forum/?fromgroups#!topic/docker-club/P3xDLqmLp0E
Installing PostgreSQL on Docker
-------------------------------
For clarity I won't be showing command output.
Run an interactive shell in Docker container.
Run an interactive shell in a Docker container.
.. code-block:: bash
@@ -38,26 +30,26 @@ Update its dependencies.
apt-get update
Install ``python-software-properties``.
Install ``python-software-properties``, ``software-properties-common``, ``wget`` and ``vim``.
.. code-block:: bash
apt-get -y install python-software-properties
apt-get -y install software-properties-common
apt-get -y install python-software-properties software-properties-common wget vim
Add Pitti's PostgreSQL repository. It contains the most recent stable release
of PostgreSQL i.e. ``9.2``.
Add PostgreSQL's repository. It contains the most recent stable release
of PostgreSQL, ``9.3``.
.. code-block:: bash
add-apt-repository ppa:pitti/postgresql
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
apt-get update
Finally, install PostgreSQL 9.2
Finally, install PostgreSQL 9.3
.. code-block:: bash
apt-get -y install postgresql-9.2 postgresql-client-9.2 postgresql-contrib-9.2
apt-get -y install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
Now, create a PostgreSQL superuser role that can create databases and
other roles. Following Vagrant's convention the role will be named
@@ -76,15 +68,14 @@ role.
Adjust PostgreSQL configuration so that remote connections to the
database are possible. Make sure that inside
``/etc/postgresql/9.2/main/pg_hba.conf`` you have following line (you will need
to install an editor, e.g. ``apt-get install vim``):
``/etc/postgresql/9.3/main/pg_hba.conf`` you have following line:
.. code-block:: bash
host all all 0.0.0.0/0 md5
Additionaly, inside ``/etc/postgresql/9.2/main/postgresql.conf``
uncomment ``listen_addresses`` so it is as follows:
Additionaly, inside ``/etc/postgresql/9.3/main/postgresql.conf``
uncomment ``listen_addresses`` like so:
.. code-block:: bash
@@ -94,7 +85,7 @@ uncomment ``listen_addresses`` so it is as follows:
This PostgreSQL setup is for development only purposes. Refer
to PostgreSQL documentation how to fine-tune these settings so that it
is enough secure.
is secure enough.
Exit.
@@ -102,43 +93,43 @@ Exit.
exit
Create an image and assign it a name. ``<container_id>`` is in the
Bash prompt; you can also locate it using ``docker ps -a``.
Create an image from our container and assign it a name. The ``<container_id>``
is in the Bash prompt; you can also locate it using ``docker ps -a``.
.. code-block:: bash
sudo docker commit <container_id> <your username>/postgresql
Finally, run PostgreSQL server via ``docker``.
Finally, run the PostgreSQL server via ``docker``.
.. code-block:: bash
CONTAINER=$(sudo docker run -d -p 5432 \
-t <your username>/postgresql \
/bin/su postgres -c '/usr/lib/postgresql/9.2/bin/postgres \
-D /var/lib/postgresql/9.2/main \
-c config_file=/etc/postgresql/9.2/main/postgresql.conf')
/bin/su postgres -c '/usr/lib/postgresql/9.3/bin/postgres \
-D /var/lib/postgresql/9.3/main \
-c config_file=/etc/postgresql/9.3/main/postgresql.conf')
Connect the PostgreSQL server using ``psql`` (You will need postgres installed
on the machine. For ubuntu, use something like
``sudo apt-get install postgresql``).
Connect the PostgreSQL server using ``psql`` (You will need the
postgresql client installed on the machine. For ubuntu, use something
like ``sudo apt-get install postgresql-client``).
.. code-block:: bash
CONTAINER_IP=$(sudo docker inspect $CONTAINER | grep IPAddress | awk '{ print $2 }' | tr -d ',"')
CONTAINER_IP=$(sudo docker inspect -format='{{.NetworkSettings.IPAddress}}' $CONTAINER)
psql -h $CONTAINER_IP -p 5432 -d docker -U docker -W
As before, create roles or databases if needed.
.. code-block:: bash
psql (9.2.4)
psql (9.3.1)
Type "help" for help.
docker=# CREATE DATABASE foo OWNER=docker;
CREATE DATABASE
Additionally, publish your newly created image on Docker Index.
Additionally, publish your newly created image on the Docker Index.
.. code-block:: bash
@@ -160,9 +151,9 @@ container starts.
.. code-block:: bash
sudo docker commit -run='{"Cmd": \
["/bin/su", "postgres", "-c", "/usr/lib/postgresql/9.2/bin/postgres -D \
/var/lib/postgresql/9.2/main -c \
config_file=/etc/postgresql/9.2/main/postgresql.conf"], "PortSpecs": ["5432"]}' \
["/bin/su", "postgres", "-c", "/usr/lib/postgresql/9.3/bin/postgres -D \
/var/lib/postgresql/9.3/main -c \
config_file=/etc/postgresql/9.3/main/postgresql.conf"], "PortSpecs": ["5432"]}' \
<container_id> <your username>/postgresql
From now on, just type ``docker run <your username>/postgresql`` and

View File

@@ -43,7 +43,7 @@ container. The ``BUILD_JOB`` environment variable will be set with the new conta
[...]
While this container is running, we can attach to the new container to
see what is going on. The flag ``-sig-proxy`` set as ``false`` allows you to connect and
see what is going on. The flag ``--sig-proxy`` set as ``false`` allows you to connect and
disconnect (Ctrl-C) to it without stopping the container.
.. code-block:: bash
@@ -107,8 +107,11 @@ See the example in action
.. raw:: html
<div style="margin-top:10px;">
<iframe width="720" height="350" src="http://ascii.io/a/2573/raw" frameborder="0"></iframe>
</div>
<iframe width="720" height="400" frameborder="0"
sandbox="allow-same-origin allow-scripts"
srcdoc="<body><script type=&quot;text/javascript&quot;
src=&quot;https://asciinema.org/a/2573.js&quot;
id=&quot;asciicast-2573&quot; async></script></body>">
</iframe>
Continue to :ref:`running_ssh_service`.

View File

@@ -44,7 +44,7 @@ use a container link to provide access to our Redis database.
.. code-block:: bash
sudo docker run -name redis -d <your username>/redis
sudo docker run --name redis -d <your username>/redis
Create your web application container
-------------------------------------
@@ -56,7 +56,7 @@ Redis instance running inside that container to only this container.
.. code-block:: bash
sudo docker run -link redis:db -i -t ubuntu:12.10 /bin/bash
sudo docker run --link redis:db -i -t ubuntu:12.10 /bin/bash
Once inside our freshly created container we need to install Redis to get the
``redis-cli`` binary to test our connection.

View File

@@ -25,9 +25,12 @@ smooth, but it gives you a good idea.
.. raw:: html
<div style="margin-top:10px;">
<iframe width="800" height="400" src="http://ascii.io/a/2637/raw" frameborder="0"></iframe>
</div>
<iframe width="815" height="450" frameborder="0"
sandbox="allow-same-origin allow-scripts"
srcdoc="<body><script type=&quot;text/javascript&quot;
src=&quot;https://asciinema.org/a/2637.js&quot;
id=&quot;asciicast-2637&quot; async></script></body>">
</iframe>
You can also get this sshd container by using:
@@ -94,5 +97,13 @@ The password is ``screencast``.
$ ifconfig
$ ssh root@192.168.33.10 -p 49154
# Thanks for watching, Thatcher thatcher@dotcloud.com
Update:
-------
For Ubuntu 13.10 using stackbrew/ubuntu, you may need do these additional steps:
1. change /etc/pam.d/sshd, pam_loginuid line 'required' to 'optional'
2. echo LANG=\"en_US.UTF-8\" > /etc/default/locale

View File

@@ -0,0 +1,128 @@
:title: Using Supervisor with Docker
:description: How to use Supervisor process management with Docker
:keywords: docker, supervisor, process management
.. _using_supervisord:
Using Supervisor with Docker
============================
.. include:: example_header.inc
Traditionally a Docker container runs a single process when it is launched, for
example an Apache daemon or a SSH server daemon. Often though you want to run
more than one process in a container. There are a number of ways you can
achieve this ranging from using a simple Bash script as the value of your
container's ``CMD`` instruction to installing a process management tool.
In this example we're going to make use of the process management tool,
`Supervisor <http://supervisord.org/>`_, to manage multiple processes in our
container. Using Supervisor allows us to better control, manage, and restart the
processes we want to run. To demonstrate this we're going to install and manage both an
SSH daemon and an Apache daemon.
Creating a Dockerfile
---------------------
Let's start by creating a basic ``Dockerfile`` for our new image.
.. code-block:: bash
FROM ubuntu:latest
MAINTAINER examples@docker.io
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
Installing Supervisor
---------------------
We can now install our SSH and Apache daemons as well as Supervisor in our container.
.. code-block:: bash
RUN apt-get install -y openssh-server apache2 supervisor
RUN mkdir -p /var/run/sshd
RUN mkdir -p /var/log/supervisor
Here we're installing the ``openssh-server``, ``apache2`` and ``supervisor``
(which provides the Supervisor daemon) packages. We're also creating two new
directories that are needed to run our SSH daemon and Supervisor.
Adding Supervisor's configuration file
--------------------------------------
Now let's add a configuration file for Supervisor. The default file is called
``supervisord.conf`` and is located in ``/etc/supervisor/conf.d/``.
.. code-block:: bash
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
Let's see what is inside our ``supervisord.conf`` file.
.. code-block:: bash
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D
[program:apache2]
command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND"
The ``supervisord.conf`` configuration file contains directives that configure
Supervisor and the processes it manages. The first block ``[supervisord]``
provides configuration for Supervisor itself. We're using one directive,
``nodaemon`` which tells Supervisor to run interactively rather than daemonize.
The next two blocks manage the services we wish to control. Each block controls
a separate process. The blocks contain a single directive, ``command``, which
specifies what command to run to start each process.
Exposing ports and running Supervisor
-------------------------------------
Now let's finish our ``Dockerfile`` by exposing some required ports and
specifying the ``CMD`` instruction to start Supervisor when our container
launches.
.. code-block:: bash
EXPOSE 22 80
CMD ["/usr/bin/supervisord"]
Here we've exposed ports 22 and 80 on the container and we're running the
``/usr/bin/supervisord`` binary when the container launches.
Building our container
----------------------
We can now build our new container.
.. code-block:: bash
sudo docker build -t <yourname>/supervisord .
Running our Supervisor container
--------------------------------
Once we've got a built image we can launch a container from it.
.. code-block:: bash
sudo docker run -p 22 -p 80 -t -i <yourname>/supervisor
2013-11-25 18:53:22,312 CRIT Supervisor running as root (no user in config file)
2013-11-25 18:53:22,312 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2013-11-25 18:53:22,342 INFO supervisord started with pid 1
2013-11-25 18:53:23,346 INFO spawned: 'sshd' with pid 6
2013-11-25 18:53:23,349 INFO spawned: 'apache2' with pid 7
. . .
We've launched a new container interactively using the ``docker run`` command.
That container has run Supervisor and launched the SSH and Apache daemons with
it. We've specified the ``-p`` flag to expose ports 22 and 80. From here we can
now identify the exposed ports and connect to one or both of the SSH and Apache
daemons.

View File

@@ -26,7 +26,7 @@ Does Docker run on Mac OS X or Windows?
Not at this time, Docker currently only runs on Linux, but you can
use VirtualBox to run Docker in a virtual machine on your box, and
get the best of both worlds. Check out the
:ref:`install_using_vagrant` and :ref:`windows` installation
:ref:`macosx` and :ref:`windows` installation
guides.
How do containers compare to virtual machines?
@@ -111,7 +111,7 @@ What does Docker add to just plain LXC?
registry to store and transfer private containers, for internal
server deployments for example.
* *Tool ecosystem.*
* *Tool ecosystem.*
Docker defines an API for automating and customizing the
creation and deployment of containers. There are a huge number
of tools integrating with Docker to extend its
@@ -122,6 +122,11 @@ What does Docker add to just plain LXC?
(Jenkins, Strider, Travis), etc. Docker is rapidly establishing
itself as the standard for container-based tooling.
What is different between a Docker container and a VM?
......................................................
There's a great StackOverflow answer `showing the differences <http://stackoverflow.com/questions/16047306/how-is-docker-io-different-from-a-normal-virtual-machine>`_.
Do I lose my data when the container exits?
...........................................
@@ -129,6 +134,54 @@ Not at all! Any data that your application writes to disk gets preserved
in its container until you explicitly delete the container. The file
system for the container persists even after the container halts.
How far do Docker containers scale?
...................................
Some of the largest server farms in the world today are based on containers.
Large web deployments like Google and Twitter, and platform providers such as
Heroku and dotCloud all run on container technology, at a scale of hundreds of
thousands or even millions of containers running in parallel.
How do I connect Docker containers?
...................................
Currently the recommended way to link containers is via the `link` primitive.
You can see details of how to `work with links here
<http://docs.docker.io/en/latest/use/working_with_links_names/>`_.
Also of useful when enabling more flexible service portability is the
`Ambassador linking pattern
<http://docs.docker.io/en/latest/use/ambassador_pattern_linking/>`_.
How do I run more than one process in a Docker container?
.........................................................
Any capable process supervisor such as http://supervisord.org/, runit, s6, or
daemontools can do the trick. Docker will start up the process management
daemon which will then fork to run additional processes. As long as the
processor manager daemon continues to run, the container will continue to as
well. You can see a more substantial example `that uses supervisord here
<http://docs.docker.io/en/latest/examples/using_supervisord/>`_.
What platforms does Docker run on?
..................................
Linux:
- Ubuntu 12.04, 13.04 et al
- Fedora 19/20+
- RHEL 6.5+
- Centos 6+
- Gentoo
- ArchLinux
- openSUSE 12.3+
Cloud:
- Amazon EC2
- Google Compute Engine
- Rackspace
Can I help by adding some questions and answers?
................................................
@@ -143,7 +196,7 @@ Where can I find more answers?
* `Docker user mailinglist`_
* `Docker developer mailinglist`_
* `IRC, docker on freenode`_
* `Github`_
* `GitHub`_
* `Ask questions on Stackoverflow`_
* `Join the conversation on Twitter`_

View File

@@ -5,27 +5,22 @@
Introduction
------------
``docker``, the Linux Container Runtime, runs Unix processes with
strong guarantees of isolation across servers. Your software runs
repeatably everywhere because its :ref:`container_def` includes any
dependencies.
Docker is an open-source engine 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, or any major infrastructure provider.
``docker`` runs three ways:
Common use cases for Docker include:
* as a daemon to manage LXC containers on your :ref:`Linux host
<kernel>` (``sudo docker -d``)
* as a :ref:`CLI <cli>` which talks to the daemon's `REST API
<api/docker_remote_api>`_ (``docker run ...``)
* as a client of :ref:`Repositories <working_with_the_repository>`
that let you share what you've built (``docker pull, docker
commit``).
- Automating the packaging and deployment of web applications.
- Automated testing and continuous integration/deployment.
- Deploying and scaling databases and backend services in a service-oriented environment.
- Building custom PaaS environments, either from scratch or as an extension of off-the-shelf platforms like OpenShift or Cloud Foundry.
Each use of ``docker`` is documented here. The features of Docker are
currently in active development, so this documentation will change
frequently.
Please note Docker is currently under heavy developement. It should not be used in production (yet).
For an overview of Docker, please see the `Introduction
<http://www.docker.io>`_. When you're ready to start working with
For a high-level overview of Docker, please see the `Introduction
<http://www.docker.io/learn_more/>`_. When you're ready to start working with
Docker, we have a `quick start <http://www.docker.io/gettingstarted>`_
and a more in-depth guide to :ref:`ubuntu_linux` and other
:ref:`installation_list` paths including prebuilt binaries,

View File

@@ -22,20 +22,32 @@ Amazon QuickStart
1. **Choose an image:**
* Launch the `Create Instance Wizard` <https://console.aws.amazon.com/ec2/v2/home?#LaunchInstanceWizard:> menu on your AWS Console
* Select "Community AMIs" option and serch for ``amd64 precise`` (click enter to search)
* If you choose a EBS enabled AMI you will be able to launch a `t1.micro` instance (more info on `pricing` <http://aws.amazon.com/en/ec2/pricing/> )
* When you click select you'll be taken to the instance setup, and you're one click away from having your Ubuntu VM up and running.
* Launch the `Create Instance Wizard
<https://console.aws.amazon.com/ec2/v2/home?#LaunchInstanceWizard:>`_ menu
on your AWS Console.
* Click the ``Select`` button for a 64Bit Ubuntu image. For example: Ubuntu Server 12.04.3 LTS
* For testing you can use the default (possibly free)
``t1.micro`` instance (more info on `pricing
<http://aws.amazon.com/en/ec2/pricing/>`_).
* Click the ``Next: Configure Instance Details`` button at the bottom right.
2. **Tell CloudInit to install Docker:**
* Enter ``#include https://get.docker.io`` into the instance *User
Data*. `CloudInit <https://help.ubuntu.com/community/CloudInit>`_
is part of the Ubuntu image you chose and it bootstraps from this
*User Data*.
* When you're on the "Configure Instance Details" step, expand the "Advanced
Details" section.
3. After a few more standard choices where defaults are probably ok, your
AWS Ubuntu instance with Docker should be running!
* Under "User data", select "As text".
* Enter ``#include https://get.docker.io`` into the instance *User Data*.
`CloudInit <https://help.ubuntu.com/community/CloudInit>`_ is part of the
Ubuntu image you chose; it will bootstrap Docker by running the shell
script located at this URL.
3. After a few more standard choices where defaults are probably ok, your AWS
Ubuntu instance with Docker should be running!
**If this is your first AWS instance, you may need to set up your
Security Group to allow SSH.** By default all incoming ports to your
@@ -152,7 +164,7 @@ Docker that way too. Vagrant 1.1 or higher is required.
includes rights to SSH (port 22) to your container.
If you have an advanced AWS setup, you might want to have a look at
https://github.com/mitchellh/vagrant-aws
`vagrant-aws <https://github.com/mitchellh/vagrant-aws>`_.
7. Connect to your machine

View File

@@ -1,5 +1,5 @@
:title: Installation on Arch Linux
:description: Docker installation on Arch Linux.
:description: Docker installation on Arch Linux.
:keywords: arch linux, virtualization, docker, documentation, installation
.. _arch_linux:
@@ -7,54 +7,58 @@
Arch Linux
==========
Installing on Arch Linux is not officially supported but can be handled via
either of the following AUR packages:
.. include:: install_header.inc
* `lxc-docker <https://aur.archlinux.org/packages/lxc-docker/>`_
* `lxc-docker-git <https://aur.archlinux.org/packages/lxc-docker-git/>`_
.. include:: install_unofficial.inc
The lxc-docker package will install the latest tagged version of docker.
The lxc-docker-git package will build from the current master branch.
Installing on Arch Linux can be handled via the package in community:
* `docker <https://www.archlinux.org/packages/community/x86_64/docker/>`_
or the following AUR package:
* `docker-git <https://aur.archlinux.org/packages/docker-git/>`_
The docker package will install the latest tagged version of docker.
The docker-git package will build from the current master branch.
Dependencies
------------
Docker depends on several packages which are specified as dependencies in
either AUR package.
the packages. The core dependencies are:
* aufs3
* bridge-utils
* go
* device-mapper
* iproute2
* linux-aufs_friendly
* lxc
* sqlite
Installation
------------
.. include:: install_header.inc
For the normal package a simple
::
.. include:: install_unofficial.inc
pacman -S docker
is all that is needed.
For the AUR package execute:
::
yaourt -S docker-git
The instructions here assume **yaourt** is installed. See
`Arch User Repository <https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages>`_
for information on building and installing packages from the AUR if you have not
done so before.
Keep in mind that if **linux-aufs_friendly** is not already installed that a
new kernel will be compiled and this can take quite a while.
::
yaourt -S lxc-docker-git
Starting Docker
---------------
Prior to starting docker modify your bootloader to use the
**linux-aufs_friendly** kernel and reboot your system.
There is a systemd service unit created for docker. To start the docker service:
::
@@ -67,21 +71,3 @@ To start on system boot:
::
sudo systemctl enable docker
Network Configuration
---------------------
IPv4 packet forwarding is disabled by default on Arch, so internet access from inside
the container may not work.
To enable the forwarding, run as root on the host system:
::
sysctl net.ipv4.ip_forward=1
And, to make it persistent across reboots, enable it on the host's **/etc/sysctl.d/docker.conf**:
::
net.ipv4.ip_forward=1

View File

@@ -12,29 +12,44 @@ Binaries
**This instruction set is meant for hackers who want to try out Docker
on a variety of environments.**
Right now, the officially supported distributions are:
- :ref:`ubuntu_precise`
- :ref:`ubuntu_raring`
Before following these directions, you should really check if a
packaged version of Docker is already available for your distribution.
We have packages for many distributions, and more keep showing up all
the time!
But we know people have had success running it under
Check runtime dependencies
--------------------------
- Debian
- Suse
- :ref:`arch_linux`
.. DOC COMMENT: this should be kept in sync with
https://github.com/dotcloud/docker/blob/master/hack/PACKAGERS.md#runtime-dependencies
Check Your Kernel
-----------------
To run properly, docker needs the following software to be installed at runtime:
- iproute2 version 3.5 or later (build after 2012-05-21), and
specifically the "ip" utility
- iptables version 1.4 or later
- The LXC utility scripts (http://lxc.sourceforge.net) version 0.8 or later
- Git version 1.7 or later
- XZ Utils 4.9 or later
Check kernel dependencies
-------------------------
Docker in daemon mode has specific kernel requirements. For details,
check your distribution in :ref:`installation_list`.
Note that Docker also has a client mode, which can run on virtually
any linux kernel (it even builds on OSX!).
Your host's Linux kernel must meet the Docker :ref:`kernel`
Get the docker binary:
----------------------
.. code-block:: bash
wget --output-document=docker https://get.docker.io/builds/Linux/x86_64/docker-latest
wget https://get.docker.io/builds/Linux/x86_64/docker-latest -O docker
chmod +x docker
@@ -47,6 +62,40 @@ Run the docker daemon
sudo ./docker -d &
.. _dockergroup:
Giving non-root access
----------------------
The ``docker`` daemon always runs as the root user, and since Docker
version 0.5.2, the ``docker`` daemon binds to a Unix socket instead of
a TCP port. By default that Unix socket is owned by the user *root*,
and so, by default, you can access it with ``sudo``.
Starting in version 0.5.3, if you (or your Docker installer) create a
Unix group called *docker* and add users to it, then the ``docker``
daemon will make the ownership of the Unix socket read/writable by the
*docker* group when the daemon starts. The ``docker`` daemon must
always run as the root user, but if you run the ``docker`` client as a
user in the *docker* group then you don't need to add ``sudo`` to all
the client commands.
.. warning:: The *docker* group is root-equivalent.
Upgrades
--------
To upgrade your manual installation of Docker, first kill the docker
daemon:
.. code-block:: bash
killall docker
Then follow the regular installation steps.
Run your first container!
-------------------------

View File

@@ -0,0 +1,75 @@
:title: Requirements and Installation on Fedora
:description: Please note this project is currently under heavy development. It should not be used in production.
:keywords: Docker, Docker documentation, Fedora, requirements, virtualbox, vagrant, git, ssh, putty, cygwin, linux
.. _fedora:
Fedora
======
.. include:: install_header.inc
.. include:: install_unofficial.inc
Docker is available in **Fedora 19 and later**. Please note that due to the
current Docker limitations Docker is able to run only on the **64 bit**
architecture.
Installation
------------
The ``docker-io`` package provides Docker on Fedora.
If you have the (unrelated) ``docker`` package installed already, it will
conflict with ``docker-io``. There's a `bug report`_ filed for it.
To proceed with ``docker-io`` installation on Fedora 19, please remove
``docker`` first.
.. code-block:: bash
sudo yum -y remove docker
For Fedora 20 and later, the ``wmdocker`` package will provide the same
functionality as ``docker`` and will also not conflict with ``docker-io``.
.. code-block:: bash
sudo yum -y install wmdocker
sudo yum -y remove docker
Install the ``docker-io`` package which will install Docker on our host.
.. code-block:: bash
sudo yum -y install docker-io
To update the ``docker-io`` package:
.. code-block:: bash
sudo yum -y update docker-io
Now that it's installed, let's start the Docker daemon.
.. code-block:: bash
sudo systemctl start docker
If we want Docker to start at boot, we should also:
.. code-block:: bash
sudo systemctl enable docker
Now let's verify that Docker is working.
.. code-block:: bash
sudo docker run -i -t fedora /bin/bash
**Done!**, now continue with the :ref:`hello_world` example.
.. _bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1043676

View File

@@ -0,0 +1,62 @@
:title: Installation on FrugalWare
:description: Docker installation on FrugalWare.
:keywords: frugalware linux, virtualization, docker, documentation, installation
.. _frugalware:
FrugalWare
==========
.. include:: install_header.inc
.. include:: install_unofficial.inc
Installing on FrugalWare is handled via the official packages:
* `lxc-docker i686 <http://www.frugalware.org/packages/200141>`_
* `lxc-docker x86_64 <http://www.frugalware.org/packages/200130>`_
The `lxc-docker` package will install the latest tagged version of Docker.
Dependencies
------------
Docker depends on several packages which are specified as dependencies in
the packages. The core dependencies are:
* systemd
* lvm2
* sqlite3
* libguestfs
* lxc
* iproute2
* bridge-utils
Installation
------------
A simple
::
pacman -S lxc-docker
is all that is needed.
Starting Docker
---------------
There is a systemd service unit created for Docker. To start Docker as service:
::
sudo systemctl start lxc-docker
To start on system boot:
::
sudo systemctl enable lxc-docker

View File

@@ -4,8 +4,8 @@
.. _gentoo_linux:
Gentoo Linux
============
Gentoo
======
.. include:: install_header.inc
@@ -22,17 +22,19 @@ provided at https://github.com/tianon/docker-overlay which can be added using
properly installing and using the overlay can be found in `the overlay README
<https://github.com/tianon/docker-overlay/blob/master/README.md#using-this-overlay>`_.
Note that sometimes there is a disparity between the latest version and what's
in the overlay, and between the latest version in the overlay and what's in the
portage tree. Please be patient, and the latest version should propagate
shortly.
Installation
^^^^^^^^^^^^
The package should properly pull in all the necessary dependencies and prompt
for all necessary kernel options. For the most straightforward installation
experience, use ``sys-kernel/aufs-sources`` as your kernel sources. If you
prefer not to use ``sys-kernel/aufs-sources``, the portage tree also contains
``sys-fs/aufs3``, which includes the patches necessary for adding AUFS support
to other kernel source packages such as ``sys-kernel/gentoo-sources`` (and a
``kernel-patch`` USE flag to perform the patching to ``/usr/src/linux``
automatically).
for all necessary kernel options. The ebuilds for 0.7+ include use flags to
pull in the proper dependencies of the major storage drivers, with the
"device-mapper" use flag being enabled by default, since that is the simplest
installation path.
.. code-block:: bash
@@ -47,9 +49,9 @@ the #docker IRC channel on the freenode network.
Starting Docker
^^^^^^^^^^^^^^^
Ensure that you are running a kernel that includes the necessary AUFS
patches/support and includes all the necessary modules and/or configuration for
LXC.
Ensure that you are running a kernel that includes all the necessary modules
and/or configuration for LXC (and optionally for device-mapper and/or AUFS,
depending on the storage driver you've decided to use).
OpenRC
------
@@ -80,19 +82,3 @@ To start on system boot:
.. code-block:: bash
sudo systemctl enable docker.service
Network Configuration
^^^^^^^^^^^^^^^^^^^^^
IPv4 packet forwarding is disabled by default, so internet access from inside
the container will not work unless ``net.ipv4.ip_forward`` is enabled:
.. code-block:: bash
sudo sysctl -w net.ipv4.ip_forward=1
Or, to enable it more permanently:
.. code-block:: bash
echo net.ipv4.ip_forward = 1 | sudo tee /etc/sysctl.d/docker.conf

View File

@@ -0,0 +1,67 @@
:title: Installation on Google Cloud Platform
:description: Please note this project is currently under heavy development. It should not be used in production.
:keywords: Docker, Docker documentation, installation, google, Google Compute Engine, Google Cloud Platform
`Google Cloud Platform <https://cloud.google.com/>`_
====================================================
.. include:: install_header.inc
.. _googlequickstart:
`Compute Engine <https://developers.google.com/compute>`_ QuickStart for `Debian <https://www.debian.org>`_
-----------------------------------------------------------------------------------------------------------
1. Go to `Google Cloud Console <https://cloud.google.com/console>`_ and create a new Cloud Project with `Compute Engine enabled <https://developers.google.com/compute/docs/signup>`_.
2. Download and configure the `Google Cloud SDK <https://developers.google.com/cloud/sdk/>`_ to use your project with the following commands:
.. code-block:: bash
$ curl https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash
$ gcloud auth login
Enter a cloud project id (or leave blank to not set): <google-cloud-project-id>
3. Start a new instance, select a zone close to you and the desired instance size:
.. code-block:: bash
$ gcutil addinstance docker-playground --image=backports-debian-7
1: europe-west1-a
...
4: us-central1-b
>>> <zone-index>
1: machineTypes/n1-standard-1
...
12: machineTypes/g1-small
>>> <machine-type-index>
4. Connect to the instance using SSH:
.. code-block:: bash
$ gcutil ssh docker-playground
docker-playground:~$
5. Install the latest Docker release and configure it to start when the instance boots:
.. code-block:: bash
docker-playground:~$ curl get.docker.io | bash
docker-playground:~$ sudo update-rc.d docker defaults
6. If running in zones: ``us-central1-a``, ``europe-west1-1``, and ``europe-west1-b``, the docker daemon must be started with the ``-mtu`` flag. Without the flag, you may experience intermittent network pauses.
`See this issue <https://code.google.com/p/google-compute-engine/issues/detail?id=57>`_ for more details.
.. code-block:: bash
docker-playground:~$ echo 'DOCKER_OPTS="$DOCKER_OPTS -mtu 1460"' | sudo tee -a /etc/default/docker
docker-playground:~$ sudo service docker restart
7. Start a new container:
.. code-block:: bash
docker-playground:~$ sudo docker run busybox echo 'docker on GCE \o/'
docker on GCE \o/

View File

@@ -9,7 +9,7 @@ Installation
There are a number of ways to install Docker, depending on where you
want to run the daemon. The :ref:`ubuntu_linux` installation is the
officially-tested version, and the community adds more techniques for
officially-tested version. The community adds more techniques for
installing Docker all the time.
Contents:
@@ -18,13 +18,15 @@ Contents:
:maxdepth: 1
ubuntulinux
binaries
security
upgrading
kernel
vagrant
rhel
fedora
archlinux
gentoolinux
openSUSE
frugalware
mac
windows
amazon
rackspace
archlinux
gentoolinux
google
binaries

View File

@@ -1,124 +0,0 @@
:title: Kernel Requirements
:description: Kernel supports
:keywords: kernel requirements, kernel support, docker, installation, cgroups, namespaces
.. _kernel:
Kernel Requirements
===================
In short, Docker has the following kernel requirements:
- Linux version 3.8 or above.
- `AUFS support <http://aufs.sourceforge.net/>`_.
- Cgroups and namespaces must be enabled.
The officially supported kernel is the one recommended by the
:ref:`ubuntu_linux` installation path. It is the one that most developers
will use, and the one that receives the most attention from the core
contributors. If you decide to go with a different kernel and hit a bug,
please try to reproduce it with the official kernels first.
If you cannot or do not want to use the "official" kernels,
here is some technical background about the features (both optional and
mandatory) that docker needs to run successfully.
Linux version 3.8 or above
--------------------------
Kernel versions 3.2 to 3.5 are not stable when used with docker.
In some circumstances, you will experience kernel "oopses", or even crashes.
The symptoms include:
- a container being killed in the middle of an operation (e.g. an ``apt-get``
command doesn't complete);
- kernel messages including mentioning calls to ``mntput`` or
``d_hash_and_lookup``;
- kernel crash causing the machine to freeze for a few minutes, or even
completely.
Additionally, kernels prior 3.4 did not implement ``reboot_pid_ns``,
which means that the ``reboot()`` syscall could reboot the host machine,
instead of terminating the container. To work around that problem,
LXC userland tools (since version 0.8) automatically drop the ``SYS_BOOT``
capability when necessary. Still, if you run a pre-3.4 kernel with pre-0.8
LXC tools, be aware that containers can reboot the whole host! This is
not something that Docker wants to address in the short term, since you
shouldn't use kernels prior 3.8 with Docker anyway.
While it is still possible to use older kernels for development, it is
really not advised to do so.
Docker checks the kernel version when it starts, and emits a warning if it
detects something older than 3.8.
See issue `#407 <https://github.com/dotcloud/docker/issues/407>`_ for details.
AUFS support
------------
Docker currently relies on AUFS, an unioning filesystem.
While AUFS is included in the kernels built by the Debian and Ubuntu
distributions, is not part of the standard kernel. This means that if
you decide to roll your own kernel, you will have to patch your
kernel tree to add AUFS. The process is documented on
`AUFS webpage <http://aufs.sourceforge.net/>`_.
Cgroups and namespaces
----------------------
You need to enable namespaces and cgroups, to the extent of what is needed
to run LXC containers. Technically, while namespaces have been introduced
in the early 2.6 kernels, we do not advise to try any kernel before 2.6.32
to run LXC containers. Note that 2.6.32 has some documented issues regarding
network namespace setup and teardown; those issues are not a risk if you
run containers in a private environment, but can lead to denial-of-service
attacks if you want to run untrusted code in your containers. For more details,
see `LP#720095 <https://bugs.launchpad.net/ubuntu/+source/linux/+bug/720095>`_.
Kernels 2.6.38, and every version since 3.2, have been deployed successfully
to run containerized production workloads. Feature-wise, there is no huge
improvement between 2.6.38 and up to 3.6 (as far as docker is concerned!).
Extra Cgroup Controllers
------------------------
Most control groups can be enabled or disabled individually. For instance,
you can decide that you do not want to compile support for the CPU or memory
controller. In some cases, the feature can be enabled or disabled at boot
time. It is worth mentioning that some distributions (like Debian) disable
"expensive" features, like the memory controller, because they can have
a significant performance impact.
In the specific case of the memory cgroup, docker will detect if the cgroup
is available or not. If it's not, it will print a warning, and it won't
use the feature. If you want to enable that feature -- read on!
Memory and Swap Accounting on Debian/Ubuntu
-------------------------------------------
If you use Debian or Ubuntu kernels, and want to enable memory and swap
accounting, you must add the following command-line parameters to your kernel::
cgroup_enable=memory swapaccount=1
On Debian or Ubuntu systems, if you use the default GRUB bootloader, you can
add those parameters by editing ``/etc/default/grub`` and extending
``GRUB_CMDLINE_LINUX``. Look for the following line::
GRUB_CMDLINE_LINUX=""
And replace it by the following one::
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
Then run ``update-grub``, and reboot.

View File

@@ -0,0 +1,160 @@
:title: Requirements and Installation on Mac OS X 10.6 Snow Leopard
:description: Please note this project is currently under heavy development. It should not be used in production.
:keywords: Docker, Docker documentation, requirements, virtualbox, ssh, linux, os x, osx, mac
.. _macosx:
========
Mac OS X
========
.. note::
These instructions are available with the new release of Docker
(version 0.8). However, they are subject to change.
.. include:: install_header.inc
Docker is supported on Mac OS X 10.6 "Snow Leopard" or newer.
How To Install Docker On Mac OS X
=================================
VirtualBox
----------
Docker on OS X needs VirtualBox to run. To begin with, head over to
`VirtualBox Download Page`_ and get the tool for ``OS X hosts x86/amd64``.
.. _VirtualBox Download Page: https://www.virtualbox.org/wiki/Downloads
Once the download is complete, open the disk image, run the set up file
(i.e. ``VirtualBox.pkg``) and install VirtualBox. Do not simply copy the
package without running the installer.
boot2docker
-----------
`boot2docker`_ provides a handy script to easily manage the VM running the
``docker`` daemon. It also takes care of the installation for the OS image
that is used for the job.
.. _GitHub page: https://github.com/steeve/boot2docker
Open up a new terminal window, if you have not already.
Run the following commands to get boot2docker:
.. code-block:: bash
# Enter the installation directory
cd ~/bin
# Get the file
curl https://raw.github.com/steeve/boot2docker/master/boot2docker > boot2docker
# Mark it executable
chmod +x boot2docker
Docker OS X Client
------------------
The ``docker`` daemon is accessed using the ``docker`` client.
Run the following commands to get it downloaded and set up:
.. code-block:: bash
# Get the file
curl -o docker http://get.docker.io/builds/Darwin/x86_64/docker-latest
# Mark it executable
chmod +x docker
# Set the environment variable for the docker daemon
export DOCKER_HOST=tcp://
# Copy the executable file
sudo cp docker /usr/local/bin/
And thats it! Lets check out how to use it.
How To Use Docker On Mac OS X
=============================
The ``docker`` daemon (via boot2docker)
---------------------------------------
Inside the ``~/bin`` directory, run the following commands:
.. code-block:: bash
# Initiate the VM
./boot2docker init
# Run the VM (the docker daemon)
./boot2docker up
# To see all available commands:
./boot2docker
# Usage ./boot2docker {init|start|up|pause|stop|restart|status|info|delete|ssh|download}
The ``docker`` client
---------------------
Once the VM with the ``docker`` daemon is up, you can use the ``docker``
client just like any other application.
.. code-block:: bash
docker version
# Client version: 0.7.6
# Go version (client): go1.2
# Git commit (client): bc3b2ec
# Server version: 0.7.5
# Git commit (server): c348c04
# Go version (server): go1.2
SSH-ing The VM
--------------
If you feel the need to connect to the VM, you can simply run:
.. code-block:: bash
./boot2docker ssh
# User: docker
# Pwd: tcuser
You can now continue with the :ref:`hello_world` example.
Learn More
==========
boot2docker:
------------
See the GitHub page for `boot2docker`_.
.. _boot2docker: https://github.com/steeve/boot2docker
If SSH complains about keys:
----------------------------
.. code-block:: bash
ssh-keygen -R '[localhost]:2022'
About the way Docker works on Mac OS X:
---------------------------------------
Docker has two key components: the ``docker`` daemon and the ``docker``
client. The tool works by client commanding the daemon. In order to
work and do its magic, the daemon makes use of some Linux Kernel
features (e.g. LXC, name spaces etc.), which are not supported by OS X.
Therefore, the solution of getting Docker to run on OS X consists of
running it inside a lightweight virtual machine. In order to simplify
things, Docker comes with a bash script to make this whole process as
easy as possible (i.e. boot2docker).

View File

@@ -0,0 +1,73 @@
:title: Installation on openSUSE
:description: Docker installation on openSUSE.
:keywords: openSUSE, virtualbox, docker, documentation, installation
.. _openSUSE:
openSUSE
========
.. include:: install_header.inc
.. include:: install_unofficial.inc
Docker is available in **openSUSE 12.3 and later**. Please note that due to the
current Docker limitations Docker is able to run only on the **64 bit**
architecture.
Installation
------------
The ``docker`` package from the `Virtualization project`_ on `OBS`_ provides
Docker on openSUSE.
To proceed with Docker installation please add the right Virtualization
repository.
.. code-block:: bash
# openSUSE 12.3
sudo zypper ar -f http://download.opensuse.org/repositories/Virtualization/openSUSE_12.3/ Virtualization
# openSUSE 13.1
sudo zypper ar -f http://download.opensuse.org/repositories/Virtualization/openSUSE_13.1/ Virtualization
Install the Docker package.
.. code-block:: bash
sudo zypper in docker
It's also possible to install Docker using openSUSE's 1-click install. Just
visit `this`_ page, select your openSUSE version and click on the installation
link. This will add the right repository to your system and it will
also install the `docker` package.
Now that it's installed, let's start the Docker daemon.
.. code-block:: bash
sudo systemctl start docker
If we want Docker to start at boot, we should also:
.. code-block:: bash
sudo systemctl enable docker
The `docker` package creates a new group named `docker`. Users, other than
`root` user, need to be part of this group in order to interact with the
Docker daemon.
.. code-block:: bash
sudo usermod -G docker <username>
**Done!**, now continue with the :ref:`hello_world` example.
.. _Virtualization project: https://build.opensuse.org/project/show/Virtualization
.. _OBS: https://build.opensuse.org/
.. _this: http://software.opensuse.org/package/docker

View File

@@ -2,7 +2,6 @@
:description: Installing Docker on Ubuntu proviced by Rackspace
:keywords: Rackspace Cloud, installation, docker, linux, ubuntu
===============
Rackspace Cloud
===============
@@ -14,14 +13,14 @@ straightforward, and you should mostly be able to follow the
**However, there is one caveat:**
If you are using any linux not already shipping with the 3.8 kernel
If you are using any Linux not already shipping with the 3.8 kernel
you will need to install it. And this is a little more difficult on
Rackspace.
Rackspace boots their servers using grub's ``menu.lst`` and does not
like non 'virtual' packages (e.g. xen compatible) kernels there,
although they do work. This makes ``update-grub`` to not have the
expected result, and you need to set the kernel manually.
like non 'virtual' packages (e.g. Xen compatible) kernels there,
although they do work. This results in ``update-grub`` not having the
expected result, and you will need to set the kernel manually.
**Do not attempt this on a production machine!**
@@ -34,7 +33,7 @@ expected result, and you need to set the kernel manually.
apt-get install linux-generic-lts-raring
Great, now you have kernel installed in ``/boot/``, next is to make it
Great, now you have the kernel installed in ``/boot/``, next you need to make it
boot next time.
.. code-block:: bash
@@ -48,9 +47,9 @@ boot next time.
Now you need to manually edit ``/boot/grub/menu.lst``, you will find a
section at the bottom with the existing options. Copy the top one and
substitute the new kernel into that. Make sure the new kernel is on
top, and double check kernel and initrd point to the right files.
top, and double check the kernel and initrd lines point to the right files.
Make special care to double check the kernel and initrd entries.
Take special care to double check the kernel and initrd entries.
.. code-block:: bash
@@ -79,7 +78,7 @@ It will probably look something like this:
initrd /boot/initrd.img-3.2.0-38-virtual
Reboot server (either via command line or console)
Reboot the server (either via command line or console)
.. code-block:: bash

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