Commit Graph

166 Commits

Author SHA1 Message Date
f10695300a Use WaitWithContext for WaitStop
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 36d6d76a41be4973eed98f64a565f8cf92dc16e0
Component: engine
2016-11-16 22:08:37 -05:00
1689aa276d Fix uneccessary calls to volume.Unmount()
Fixes #22564

When an error occurs on mount, there should not be any call later to
unmount. This can throw off refcounting in the underlying driver
unexpectedly.

Consider these two cases:

```
$ docker run -v foo:/bar busybox true
```

```
$ docker run -v foo:/bar -w /foo busybox true
```

In the first case, if mounting `foo` fails, the volume driver will not
get a call to unmount (this is the incorrect behavior).

In the second case, the volume driver will not get a call to unmount
(correct behavior).

This occurs because in the first case, `/bar` does not exist in the
container, and as such there is no call to `volume.Mount()` during the
`create` phase. It will error out during the `start` phase.

In the second case `/bar` is created before dealing with the volume
because of the `-w`. Because of this, when the volume is being setup
docker will try to copy the image path contents in the volume, in which
case it will attempt to mount the volume and fail. This happens during
the `create` phase. This makes it so the container will not be created
(or at least fully created) and the user gets the error on `create`
instead of `start`. The error handling is different in these two phases.

Changed to only send `unmount` if the volume is mounted.

While investigating the cause of the reported issue I found some odd
behavior in unmount calls so I've cleaned those up a bit here as well.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 9a2d0bc3adc0c21c82cd1974be45ea0449f9f224
Component: engine
2016-11-10 14:04:08 -05:00
ade83acd05 lint fixes
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: baffa793db51e72ef853336fb7c3a11a233ce039
Component: engine
2016-11-09 14:27:44 -05:00
3d26adc9bc secrets: only try to unmount if present
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 643ae8b400492d47a42524124b5d41da3c37e081
Component: engine
2016-11-09 14:27:44 -05:00
a28c910916 add secret support for service update
- add nosuid and noexec to tmpfs

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 00237a96249739dbf426d81672a904e9f4c5e702
Component: engine
2016-11-09 14:27:44 -05:00
f9430dc4f0 add SecretMount and UnmountSecrets methods for non-Linux
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 72c1d7f46bbc5e525f9339f6a1015c6a38b2616e
Component: engine
2016-11-09 14:27:43 -05:00
848c015ac1 more review updates
- use /secrets for swarm secret create route
- do not specify omitempty for secret and secret reference
- simplify lookup for secret ids
- do not use pointer for secret grpc conversion

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 189f89301e0abfee32447f2ca23dacd3a96de06d
Component: engine
2016-11-09 14:27:43 -05:00
dde21cf7dc review changes
- fix lint issues
- use errors pkg for wrapping errors
- cleanup on error when setting up secrets mount
- fix erroneous import
- remove unneeded switch for secret reference mode
- return single mount for secrets instead of slice

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 857e60c2f943a09e3ec0ac0f236821b797935900
Component: engine
2016-11-09 14:27:43 -05:00
9dbbc071d5 secrets: secret management for swarm
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: use tmpfs for swarm secrets

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: inject secrets from swarm secret store

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

secrets: use secret names in cli for service create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

switch to use mounts instead of volumes

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vendor: use ehazlett swarmkit

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

secrets: finish secret update

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 3716ec25b423d8ff7dfa231a7b3cf0154726ed37
Component: engine
2016-11-09 14:27:43 -05:00
e967a9b4b9 api: fix ReadOnly support for tmpfs
For `--mount type=tmpfs,target=/foo,readonly`, the `readonly` flag was just ignored.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 3e3d3c8086237f4938e3e13561dbc1d41b5c617b
Component: engine
2016-11-08 06:49:17 +00:00
6fb90ed484 Add functional support for Docker sub commands on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 934328d8ea650bf8a9c3c719999ce2a1f5dd5df6
Component: engine
2016-11-07 09:06:34 -08:00
0c5998d38f remove world/group writable perms
change files from being written with group and world writable permissions.

Signed-off-by: epeterso <epeterson@breakpoint-labs.com>
Upstream-commit: 3ec8fed7476704f061891d4c421c615da49e30c7
Component: engine
2016-11-01 16:18:15 -04:00
34bac6f06e Fix bunch of typos
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: e6866492c4492db3bb9546afa2fbaed20f4c1883
Component: engine
2016-10-29 15:03:26 +08:00
0be42defbd Merge pull request #24698 from jhorwit2/jah/clist-health-filter-format
Fixes #24022 - Adds container health support to docker ps filter/format
Upstream-commit: 515e5dade7a006dbd2c42880f1af695da22ece60
Component: engine
2016-10-29 06:56:06 +02:00
5b866e7f54 Adds container health support to docker ps filter
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
Upstream-commit: 1a149a0ea59b6653e0ba14599476bfe19c4c33f3
Component: engine
2016-10-28 15:43:04 -04:00
ecffd5b73a api: add TypeTmpfs to api/types/mount
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 18768fdc2e76ec6c600c8ab57d2d487ee7877794
Component: engine
2016-10-28 08:38:32 +00:00
b4087aee32 Fix logging formatting
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: aa01ee4ac5b8bd2be25db06938533347223f30ba
Component: engine
2016-10-25 18:34:35 -07:00
1883869e16 Move stdio attach from libcontainerd backend to callback
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 37a3be2449d2a314305615ffcc287a598a829dba
Component: engine
2016-10-24 00:20:36 -07:00
15c4940651 Update docker stop and docker restart to allow not specifying timeout and use the one specified at container creation time.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: cc703784f39fb3f585ec685cf7aeda6410648446
Component: engine
2016-10-17 12:53:35 -07:00
9fc27540de Add config parameter to change per-container stop timeout during daemon shutdown
This fix tries to add a flag `--stop-timeout` to specify the timeout value
(in seconds) for the container to stop before SIGKILL is issued. If stop timeout
is not specified then the default timeout (10s) is used.

Additional test cases have been added to cover the change.

This fix is related to #22471. Another pull request will add `--shutdown-timeout`
to daemon for #22471.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e66d2108911a2fad016205bdd6bf181f7e822c1c
Component: engine
2016-10-17 12:28:46 -07:00
763c2d8e2f Windows: Factor out unused fields in container
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 600f0ad21142f4085330107f629a80099af0490f
Component: engine
2016-10-13 14:51:10 -07:00
97516856c4 Remove restartmanager from libcontainerd
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 606a245d8548e98e889df1b9cf511b5953a309b9
Component: engine
2016-10-07 12:09:54 -07:00
7f3def0be4 Merge pull request #27072 from Microsoft/jjh/fix26843
Windows: Don't resolve volume dest
Upstream-commit: d89fb40e1ce1373e3b188b9a817fcf9a5f37cd13
Component: engine
2016-09-30 14:46:07 -04:00
e59d7b9406 Windows: Don't resolve volume dest
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 3838c314add208a57003611a6963784435863330
Component: engine
2016-09-30 09:40:15 -07:00
3616bb2973 Fix missing hostname and links in exec env
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e98145960988a2259074ae911b6478b7a940748b
Component: engine
2016-09-29 13:46:10 -07:00
da06cf8da0 Merge pull request #26843 from anusha-ragunathan/vol-unmount-win
Call "VolumeDriver.Unmount" during container stop.
Upstream-commit: b8265e55508db99aea632033b2f5008f921b11e2
Component: engine
2016-09-23 10:37:28 -07:00
4954dc9e06 Call "VolumeDriver.Unmount" during container stop.
"VolumeDriver.Mount" is being called on container start.
Make the symmetric call on container stop.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: d576509d8ad1ef4770cb3959a792748c8658b0be
Component: engine
2016-09-22 18:20:39 -07:00
6bf922c44e Changes required to support windows service discovery
Signed-off-by: msabansal <sabansal@microsoft.com>
Upstream-commit: d1e0a78614d4efa768c88c9db3868bc9e7782efc
Component: engine
2016-09-22 12:21:21 -07:00
b99f52832d Removed unused state functions
This removes the SetStoppedLocking, and
SetRestartingLocking functions, which
were not used anywhere.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a28c389da109808c5b39da02fdfd24b9e36137fe
Component: engine
2016-09-20 13:09:18 +02:00
92f94b6c20 correct some nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 9279a93f6d43da4c904eeb0adb249fdfa34f7f92
Component: engine
2016-09-15 12:17:58 +08:00
06b2219a87 Add new HostConfig field, Mounts.
`Mounts` allows users to specify in a much safer way the volumes they
want to use in the container.
This replaces `Binds` and `Volumes`, which both still exist, but
`Mounts` and `Binds`/`Volumes` are exclussive.
The CLI will continue to use `Binds` and `Volumes` due to concerns with
parsing the volume specs on the client side and cross-platform support
(for now).

The new API follows exactly the services mount API.

Example usage of `Mounts`:

```
$ curl -XPOST localhost:2375/containers/create -d '{
  "Image": "alpine:latest",
  "HostConfig": {
    "Mounts": [{
      "Type": "Volume",
      "Target": "/foo"
      },{
      "Type": "bind",
      "Source": "/var/run/docker.sock",
      "Target": "/var/run/docker.sock",
      },{
      "Type": "volume",
      "Name": "important_data",
      "Target": "/var/data",
      "ReadOnly": true,
      "VolumeOptions": {
	"DriverConfig": {
	  Name: "awesomeStorage",
	  Options: {"size": "10m"},
	  Labels: {"some":"label"}
	}
      }]
    }
}'
```

There are currently 2 types of mounts:

  - **bind**: Paths on the host that get mounted into the
    container. Paths must exist prior to creating the container.
  - **volume**: Volumes that persist after the
    container is removed.

Not all fields are available in each type, and validation is done to
ensure these fields aren't mixed up between types.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: fc7b904dced4d18d49c8a6c47ae3f415d16d0c43
Component: engine
2016-09-13 09:55:35 -04:00
7bef93723c Initial implementation of containerd Checkpoint API.
Signed-off-by: boucher <rboucher@gmail.com>
Upstream-commit: d8fef66b03c1ea8715470690efbd950033f7f628
Component: engine
2016-09-08 21:31:52 -04:00
f0d30a4b26 Add support for docker run in swarm mode overlay
This PR adds support for running regular containers to be connected to
swarm mode multi-host network so that:
    - containers connected to the same network across the cluster can
      discover and connect to each other.
    - Get access to services(and their associated loadbalancers)
      connected to the same network

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Upstream-commit: 99a98ccc14a9427be47c8006e130750710db0a16
Component: engine
2016-09-07 21:20:41 -07:00
45ddc4bfcb Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 91e197d614547f0202e6ae9b8a24d88ee131d950
Component: engine
2016-09-07 11:05:58 -07:00
ba213d0956 Re-export container state's ExitCode and Error fields
Those are needed in order to reload their value upon docker daemon
restart.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 2998945a54577e24a6414d576bc861e58fa87359
Component: engine
2016-08-30 14:17:09 -07:00
6b76ab7e83 We need to relabel newly created container volumes
This will add a label to any volume that is shared into a container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 5a277c8a4a9107f18211aabd6e332dbafb1a8469
Component: engine
2016-08-24 08:27:01 -04:00
165357a3a8 Persist pause state to disk to support container live restore
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: f4bbfc34ce1785863dcdea44c981f6532c5e2860
Component: engine
2016-08-19 05:32:33 -04:00
c8732c07e1 expose RemovalInProgress in StateString #25652
Signed-off-by: timfeirg <kkcocogogo@gmail.com>
Upstream-commit: 37466cc8c85ccbdade57463ae2aacac638002f8a
Component: engine
2016-08-18 11:25:27 +08:00
a0933c7d27 Merge pull request #25721 from cpuguy83/revendor_engine-api
revendor engine-api
Upstream-commit: 37302bbb3f4889e9de2a95d5ea018acdab9e4447
Component: engine
2016-08-16 17:18:43 -04:00
3dcc0abf19 revendor engine-api
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 6d98e344c7702a8a713cb9e02a19d83a79d3f930
Component: engine
2016-08-16 14:16:12 -04:00
d1bde01a82 Forbid update restart policy of container with AutoRemove flag
"--restart" and "--rm" are conflict options, if a container is started
with AutoRemove flag, we should forbid the update action for its Restart
Policy.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 4754c64ab5b5bf5ae6f8a3040606296910e6cb19
Component: engine
2016-08-16 15:36:13 +08:00
7c36224e9c test container state timeout with 200 milliseconds
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 51f927d4e5007d11d71a9cd68a6b1e93828becc5
Component: engine
2016-08-10 17:19:25 +08:00
2dac8a0018 Fix update memory without memoryswap
The memory should always be smaller than memoryswap,
we should error out with message that user know how
to do rather than just an invalid argument error if
user update the memory limit bigger than already set
memory swap.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 92394785fa3e55b19402fc762c030d28b36b6cfc
Component: engine
2016-08-08 18:36:03 +08:00
a1b703934e Fix missing mount ID on volume unmount
Fixes #25331

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 63983f3ffe7895fce3a75115a5bcfe8258e5654c
Component: engine
2016-08-02 11:24:54 -04:00
a43b617d89 Treat HEALTHCHECK NONE the same as not setting a healthcheck
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
Upstream-commit: 4016038bd323a4ef4ee8d0af8da5dafd88ab1721
Component: engine
2016-07-25 11:11:14 -04:00
9921891219 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: edc307cb9213d11d9c5911b08ebd921a097939c0
Component: engine
2016-07-05 20:42:17 +08:00
a0153fe543 Merge pull request #23542 from mavenugo/aliases
Use service alias and configure service VIP or dns-rr
Upstream-commit: 011774e6f0eb5db13fb084b2b8d4d499a9f0548b
Component: engine
2016-06-15 16:18:50 -04:00
52c1999aed Merge pull request #23301 from runcom/tmpfs-trump
daemon: allow tmpfs to trump over VOLUME(s)
Upstream-commit: 480d7b310b2b063621eb260aff34e34171694ae3
Component: engine
2016-06-15 17:11:00 +00:00
eb2bdeb9cf daemon: allow tmpfs to trump over VOLUME(s)
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 756f6cef4a1379e59d6511ee000e435d23659153
Component: engine
2016-06-15 16:01:51 +02:00
e306e601d2 Use service alias and configure container's --net-alias
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 07e39e9e7283a159efa18bc8f72cb2dc0e4f700f
Component: engine
2016-06-14 19:50:34 -07:00