Commit Graph

416 Commits

Author SHA1 Message Date
4ee7be3ff1 upstart: Don't emit "started" event until docker.sock is available
Fixes #6647: Other upstart jobs that depend on docker by specifying
"start on started docker" would often start before the docker daemon was
ready, so they'd fail with "Cannot connect to the Docker daemon" or
"dial unix /var/run/docker.sock: no such file or directory".

This is because "docker -d" doesn't daemonize, it runs in the
foreground, so upstart can't know when the daemon is ready to receive
incoming connections. (Traditionally, a daemon will create all necessary
sockets and then fork to signal that it's ready; according to @tianon
this "isn't possible in Go"[1]. See also [2].)

Presumably this isn't a problem with systemd init with its socket
activation. The SysV init scripts may or may not suffer from this
problem but I have no motivation to fix them.

This commit adds a "post-start" stanza to the upstart configuration
that waits for the socket to be available. Upstart won't emit the
"started" event until the "post-start" script completes.[3]

Note that the system administrator might have specified a different path
for the socket, or a tcp socket instead, by customising
/etc/default/docker. In that case we don't try to figure out what the
new socket is, but at least we don't wait in vain for
/var/run/docker.sock to appear.

If the main script (`docker -d`) fails to start, the `initctl status
$UPSTART_JOB | grep -q "stop/"` line ensures that we don't loop forever.
I stole this idea from Steve Langasek.[4]

If for some reason we *still* end up in an infinite loop --I guess
`docker -d` must have hung-- then at least we'll be able to see the
"Waiting for /var/run/docker.sock" debug output in
/var/log/upstart/docker.log.

I considered using inotifywait instead of sleep, but it isn't worth
the complexity & the extra dependency.

[1] https://github.com/docker/docker/issues/6647#issuecomment-47001613
[2] https://code.google.com/p/go/issues/detail?id=227
[3] http://upstart.ubuntu.com/cookbook/#post-start
[4] https://lists.ubuntu.com/archives/upstart-devel/2013-April/002492.html

Signed-off-by: David Röthlisberger <david@rothlis.net>
Upstream-commit: f42c0a53a38a2a141bec8768d0836a3726de4a83
Component: engine
2014-12-16 21:25:01 +00:00
74d75a87de Refactor completion for docker run and docker create
_docker_run and _docker_create had only one differing line.

This refactoring features:

- direct completion for both commands to the same function
- factor out the common arguments, sort & format them nicely
- compute the argument for _docker_pos_first_nonflag.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 46b104bd3977c4777b0d99ba6c190f37ae780245
Component: engine
2014-12-15 21:08:49 +01:00
fdaf63a14a Merge pull request #9630 from ztombol/9642-fix-mkimage-arch
Fix #9462
Upstream-commit: f58a79e59191dd196a48c65ed945e96b944b8567
Component: engine
2014-12-15 08:13:11 -08:00
725ed0d2e6 Merge pull request #9551 from barnybug/9550-fish-completions
Update fish shell completions.
Upstream-commit: d727e3bea6cb0b833f415f6ba2207ee2f82c1453
Component: engine
2014-12-12 12:55:00 -08:00
67fd26525f Fix a bashism and some minor bugs in nuke-graph-directory.sh
Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 6b340e391cff68e6fc2c816cf15ffd67feddf029
Component: engine
2014-12-12 11:51:12 -07:00
f42b6ea0bd Fix #9462
Docker-DCO-1.1-Signed-off-by: Zoltan Tombol <zoltan.tombol@gmail.com> (github: ztombol)
Upstream-commit: d04debddd983b3aa48ad38659d2c3debe794d374
Component: engine
2014-12-12 03:25:14 +01:00
2ecd40b772 Merge pull request #9581 from vbatts/vbatts-fix_gh9138
contrib: fix the docker-device-tool
Upstream-commit: ca2ebaeafe96f1e7e05177058a2a3723c979f830
Component: engine
2014-12-09 09:30:37 -08:00
16cbc8473e Update fish shell completions.
Fixes #9550

Signed-off-by: Barnaby Gray <barnaby@pickle.me.uk>
Upstream-commit: 4f6cdb12ab64cf76f5a57cb1d24081882c61def3
Component: engine
2014-12-07 12:40:29 +00:00
996111b8d3 Merge pull request #9272 from SvenDowideit/pr_out_try_out_a_different_phrase_for_icc
Try out a different phrase for --icc
Upstream-commit: 8dfcbf62edb2853176eb3f5cf077dae68f2e85c3
Component: engine
2014-12-05 16:22:51 +10:00
34e4a16b13 Rename the overlay storage driver
so that docker is started with `docker -d -s overlay` instead of `docker -d -s overlayfs`

Signed-off-by: Lénaïc Huard <lhuard@amadeus.com>
Upstream-commit: d680ca5c96484474757fb6f92274f47bf1520631
Component: engine
2014-12-03 13:57:23 +01:00
215ea5a487 fixes as per feedback
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
Upstream-commit: 070a519a9b972ffffda62b82fbc27825d4a6f9b0
Component: engine
2014-12-03 12:46:23 +10:00
7045c111d6 Try out a different phrase for --icc
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
Upstream-commit: 94d67d5d5b300c346e17503810d521c91db89c14
Component: engine
2014-12-03 12:46:23 +10:00
d67f32cdc7 Man: describe --icc option better
Current description is misleading. It make an impression the --icc=false
prevents containers to talk with each other.

Signed-off-by: Michal Minar <miminar@redhat.com>

Docker-DCO-1.1-Signed-off-by: Michal Minar <miminar@redhat.com> (github: SvenDowideit)
Upstream-commit: a61a4a31882335020cfbffc49ffe274847a5c803
Component: engine
2014-12-03 12:46:16 +10:00
506a27fa45 Rename overlayfs to overlay
Since Linux 3.18-rc6, overlayfs has been renamed overlay.

This change was introduced by the following commit in linux.git:
ef94b1864d1ed5be54376404bb23d22ed0481feb ovl: rename filesystem type to "overlay"

Signed-off-by: Lénaïc Huard <lhuard@amadeus.com>
Upstream-commit: c57317893a743720a241ae328d1bdf7bd02b1fea
Component: engine
2014-12-02 10:02:59 +01:00
f439fe36a4 Minor bash completion cleanup
The -n and --networking options were removed because they are
unsupported. 
Bash completion should not reveal the existence of otherwise
undocumented unsupported options.

Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: eac9f2e5c4fa47b0ef1e064ac2bc62be6f3a3c99
Component: engine
2014-11-25 08:53:13 +01:00
3701f3bcf6 Add missing options to bash completion for the run and create commands
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: 2e863e8a3849f6ea34dd281aac6f8a6c700bf029
Component: engine
2014-11-25 08:53:12 +01:00
aba2469af0 Merge pull request #9224 from tianon/custom-debootstrap
Allow for custom debootstrap wrappers like qemu-debootstrap in contrib/mkimage/debootstrap
Upstream-commit: 27127437a6249bbf6f70707ff681992eb00ac47b
Component: engine
2014-11-24 18:11:59 -08:00
fa79f79bdc contrib: fix the docker-device-tool
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Upstream-commit: e07daa58d99fc1733603a9fbc5c795818cdc6687
Component: engine
2014-11-24 13:49:09 -05:00
b226fef09a zsh: correctly parse available subcommands
A lot of flags have been added on the output of `docker help`. Use a
more robust method to extract the list of available subcommands by
spotting the `Command:` line and the next blank line.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
Upstream-commit: 34fe2a372576907cb7ec26cf22ac4e93b8974f6e
Component: engine
2014-11-23 00:45:14 +01:00
e390ce1d8e Merge pull request #9144 from miminar/sigproxy_tty
Corrected description of --sig-proxy
Upstream-commit: c7e6ad8e987d06385894ee8cd77fe2571ca9bb50
Component: engine
2014-11-19 14:52:01 -08:00
a18fff0f61 Updated sig-proxy text also in zsh completion script
Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 1cd12efb5d0065990334de4f97fa85b317f97f11
Component: engine
2014-11-19 09:09:42 +01:00
6b55e11244 Allow for custom debootstrap wrappers like qemu-debootstrap in contrib/mkimage/debootstrap
Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 33e0de15d77ef57b5c4615c6bd535775d54d8c9b
Component: engine
2014-11-18 15:13:35 -07:00
87e8b60fe9 Add CONFIG_OVERLAYFS_FS to check-config.sh
Also, added some slight adjustment to the AUFS_FS output/note to make it more clear what it applies to.

Example output:
```console
$ ./contrib/check-config.sh
info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_MACVLAN: enabled
- CONFIG_VETH: enabled
- CONFIG_BRIDGE: enabled
- CONFIG_NF_NAT_IPV4: enabled
- CONFIG_IP_NF_FILTER: enabled
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled
- CONFIG_NF_NAT: enabled
- CONFIG_NF_NAT_NEEDED: enabled

Optional Features:
- CONFIG_MEMCG_SWAP: enabled
- CONFIG_RESOURCE_COUNTERS: enabled
- CONFIG_CGROUP_PERF: missing
- Storage Drivers:
  - "aufs":
    - CONFIG_AUFS_FS: missing
      (note that some kernels include AUFS patches but not the AUFS_FS flag)
    - CONFIG_EXT4_FS_POSIX_ACL: enabled
    - CONFIG_EXT4_FS_SECURITY: enabled
  - "btrfs":
    - CONFIG_BTRFS_FS: enabled
  - "devicemapper":
    - CONFIG_BLK_DEV_DM: enabled
    - CONFIG_DM_THIN_PROVISIONING: enabled
    - CONFIG_EXT4_FS: enabled
    - CONFIG_EXT4_FS_POSIX_ACL: enabled
    - CONFIG_EXT4_FS_SECURITY: enabled
  - "overlayfs":
    - CONFIG_OVERLAYFS_FS: missing
```

Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 54a6e6d1229adb1169809493af89600c5ccc70ae
Component: engine
2014-11-18 12:20:49 -07:00
5d1b12a860 Merge pull request #8993 from SvenDowideit/make-ps-size-docs-clearer
makes the -s --size option documentation clearer #8950
Upstream-commit: 882db5f8858f36e213feabda459e6b5e639c5c85
Component: engine
2014-11-17 17:42:27 -07:00
40988ed79f Add --log-level support
Next steps, in another PR, would be:
- make all logging go through the logrus stuff
- I'd like to see if we can remove the env var stuff (like DEBUG) but we'll see

Closes #5198

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 2facc0467336a80f48c765dbdbd803055a431aa9
Component: engine
2014-11-15 09:00:48 -08:00
a56997089b Corrected description of --sig-proxy
Signal proxy does work only in non-TTY mode (--tty=false). Man pages and
commands should not lie about it.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: e71f241c4b8006f097e4c63f7b3ea28d4591ddee
Component: engine
2014-11-13 10:50:06 +01:00
a14eceb8d8 makes the -s --size option documentation clearer #8950
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: 6dc11cc992531a2cf75666e417af7730a7f0764b
Component: engine
2014-11-07 11:56:56 +10:00
fa6d8281bd Add check for IP_NF_FILTER
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: e621f99923ae8ab74a44d1fa2416e28a6dbc6eb0
Component: engine
2014-11-04 14:47:13 -08:00
3b3d561fb2 Merge pull request #8404 from danjpgriffin/master
Preserve extended attributes and acls on archlinux build
Upstream-commit: c478143ec0ca8f610f7980991b9b2ba0e1160b3e
Component: engine
2014-11-04 14:14:10 -07:00
54a35eb340 Merge pull request #8198 from jfrazelle/add-jessie-to-various-maintainers
Adding self to various maintainers files.
Upstream-commit: f0327c99dd6fb7353d76726e0adb67a1b5a98451
Component: engine
2014-10-28 19:35:28 -07:00
29c195c7fd Merge pull request #6992 from mschurenko/master
include --releasever=/ in mkimage-yum.sh
Upstream-commit: 5631ffbdfd252c369d393e41ee86008ab2d7eb7c
Component: engine
2014-10-25 02:03:32 -06:00
c1f75e87da DOCKER_VERSION and docker-version havn't been implemented.
So far, it looks like the declarations are not used, and so its safer not to
confuse people into thinking they do something.

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
Upstream-commit: 6ed610fb8014d500e001bb0677f0e1af0dc9312d
Component: engine
2014-10-21 16:04:11 +10:00
08b7ea45da zsh: update zsh completion for docker command
zsh completion is updated with the content of
felixr/docker-zsh-completion.

The major change since the last merge is the addition of
exec/create (but they were already present in the docker repository) as
well as pause/unpause/logout/events and the use of short/long options
when they are available. Some missing options were also added.

12f00abd7178 Add completion for `exec'
4e2faa075f9a Merge `run' and `create' commands.
34134de077de Add missing long/short options for most commands.
d09f62339ab5 Add completion for `pause' and `unpause'
e4754c3b3b9d Add completion for `logout'
e0935eb3d5d2 Add completion for `events'
dae353cb9afb Add completion for `create`

Docker-DCO-1.1-Signed-off-by: Vincent Bernat <vincent@bernat.im> (github: vincentbernat)
Upstream-commit: ed7934fd63ed52ad0086aaac62203e58e304bcb7
Component: engine
2014-10-20 15:33:17 +02:00
381b9857ce Fix support for --env-file in bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
Upstream-commit: ba311ee58a7114270d7853ebae5f1e86efdc8005
Component: engine
2014-10-14 17:45:29 +02:00
98819811ac Update desktop integration examples to be more up to date.
Chromium > Iceweasel and cool new gparted example.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 8aa468ef56001ad2da3015383df2a8723ca1afa3
Component: engine
2014-10-09 17:13:13 -07:00
4a5c5e00b6 Fix system socket/service unit files
Two problems how they are today:

In the current systemd unit files it is impossible to have the
docker.service started at system boot.  Instead enableing docker.service
will actually enable docker.socket.  This is a problem, as that means
any container with --restart=always will not launch on reboot.  And of
course as soon as you log in and type docker ps, docker.service will be
launched and now your images are running.  Talk about a PITA to debug!
The fix is to just install docker.service when people ask docker.service
to be enabled.  If an admin wants to enable docker.socket instead, that
is fine and will work just as it does today.

The second problem is a common docker devel workflow, although not
something normal admins would hit.  In this case consider a dev doing
the following:

systemctl stop docker.service

docker -d
[run commands]
[^C]

systemctl start docker.service

Running docker -d (without -F fd://) will clean up the
/var/run/docker.sock when it exits.  Remember, you just ran the docker
daemon not telling it about socket actviation, so cleaning up its socket
makes sense!  The new docker, started by systemd will expect socket
activation, but the last one cleaned up the docker.sock.  So things are
just broken.  You can, today, work around this by restarting
docker.socket.  This fixes it by telling docker.socket that it is
PartOf=docker.service.  So when docker.service is
started/stopped/restarted docker.socket will also be
started/stopped/restarted.  So the above semi-common devel workflow will
be fine.  When docker.service is stopped, so is docker.socket,   docker
-d (without -F fd://) will create and delete /var/run/docker.sock.
Starting docker.service again will restart docker.socket, which will
create the file an all is happy in the word.

Signed-off-by: Eric Paris <eparis@redhat.com>
Upstream-commit: 053c3557b3198466ecfbe066fefdbab2a78771d5
Component: engine
2014-10-07 14:09:08 -04:00
7abfca08df Preserve extended attributes and acls on archlinux build
Failure to do this means that file capabilites are not preserved in the image.
Ping fails to work as a non-root user if cap_net_raw is capability is not set

Signed-off-by: Dan Griffin <dgriffin@peer1.com>
Upstream-commit: e857716d2d881aaf1cf5a775d02ee5b109d9e423
Component: engine
2014-10-06 09:58:33 +01:00
46af7d8ab7 Merge pull request #8364 from tianon/bash-completion-filters
Optimize the bash completion even further
Upstream-commit: 45667fb1bb30fb206dd6c481f0bd8952c68cf122
Component: engine
2014-10-02 15:00:01 -07:00
641063cc8e Optimize the bash completion even further
The biggest/bestest change here is cutting down on the number of calls to Docker in the filtering helpers (`__docker_containers_running`, etc), especially calls to the really heavy `docker images`.

Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 0597b6445db0b0aeb4a0459f3af4f074a865a42f
Component: engine
2014-10-02 15:13:37 -06:00
9056c02a80 add bash completion support for pause and unpause
Signed-off-by: Michael Scharf <github@scharf.gr>
Upstream-commit: cbb81c30bd50952f84d4a60e850c1cede3318a77
Component: engine
2014-10-02 14:18:47 -06:00
1849734cbc fix help message for mkimage debootstrap with components
debootstrap needs the suite as the second argument, for this the script
reorders arguments beginning with a minus but components separated by
space, as stated by the help message, is not handled and will lead to
the rootfs being passed as suite to debootstrap.
The poor mans solution is to fix the help message to pass the long
option as one argument.

Signed-off-by: Julian Taylor <jtaylor.debian@googlemail.com>
Upstream-commit: 34672240b4e69f5f50448e462540bb0259eecf31
Component: engine
2014-10-01 23:18:23 +02:00
fe37a1db8f Add --security-opts options to allow user to customize security configuration
security-opts will allow you to customise the security subsystem.

For example the labeling system like SELinux will run on a container.

    --security-opt="label:user:USER"   : Set the label user for the container
    --security-opt="label:role:ROLE"   : Set the label role for the container
    --security-opt="label:type:TYPE"   : Set the label type for the container
    --security-opt="label:level:LEVEL" : Set the label level for the container
    --security-opt="label:disabled"    : Turn off label confinement for the container

Since we are passing a list of string options instead of a space separated
string of options, I will change function calls to use InitLabels instead of
GenLabels.  Genlabels interface is Depracated.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 87e732a0f3503517d7a66804bb9a7f74977347e5
Component: engine
2014-09-30 00:06:22 +00:00
8734c910c3 Adding self to various maintainers files.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 6c60e8c7849742c111a2b0a5ad4ff88fc8e960ef
Component: engine
2014-09-29 15:43:07 -07:00
cfaf0bf98f Try to avoid issues when the Docker daemon restarts.
This change will allow the Docker daemon's init script to wait up to 5
minutes before being forcibly terminated by the initscript. Many
non-trivial containers will take more than the default 3 seconds to
stop, which can result in containers whose rootfs is still mounted and
will not restart when the daemon starts up again, or worse, orphan
processes that are still running.

Signed-off-by: Steven Merrill <steven.merrill@gmail.com>
Upstream-commit: 640d2ef6f54d96ac4fc3f0f745cb1e6a35148607
Component: engine
2014-09-18 08:21:00 -04:00
8679a2097b It seems that we need these 2 options enabled for both aufs and devicemapper drivers when running on EXT4 - so test for them
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
Upstream-commit: b7259dc6d45d5bfcb1c45a852bc63addb22e4bc2
Component: engine
2014-09-17 17:03:58 +10:00
4cbe53bc28 Add create to contrib/completion
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 1ec283c3eb37d514be3778537c7ef9d727337f52
Component: engine
2014-09-16 18:40:25 -04:00
ad141b9260 Add exec to autocompletions
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: c9c004d700af23c238adef40a1e579d21c6c5765
Component: engine
2014-09-16 13:01:10 -07:00
3593be2c0f Merge pull request #7871 from vincentbernat/update/zsh-completion-1
zsh: update zsh completion for docker command
Upstream-commit: f7429a2121af0e5a77751c674c8a64dbd76c69d8
Component: engine
2014-09-08 11:25:55 -07:00
d4f0012956 Merge pull request #7763 from jamtur01/kate
Add syntax highlighting file for KDE's "Kate" editor
Upstream-commit: d3b5bf5d24026b1c60aaa77d25460b23c7564f6a
Component: engine
2014-09-04 15:28:11 -06:00
834b945b71 zsh: update zsh completion for docker command
zsh completion is updated with the content of
felixr/docker-zsh-completion.

The major change since the last merge is the removal of use of
sed/awk. This should help a lot OSX users who previously had to install
gawk and gsed.

Docker-DCO-1.1-Signed-off-by: Vincent Bernat <vincent@bernat.im> (github: vincentbernat)
Upstream-commit: dc2eab2cf48be2dc763f132fea1e1a72b0c8e03c
Component: engine
2014-09-03 22:30:11 +02:00