Commit Graph

179 Commits

Author SHA1 Message Date
7056634df4 Move ReplaceOrAppendEnvValues to container package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 7164b66cfc70b43bad98e156e72e305b66aa8ca4
Component: engine
2016-12-21 22:42:39 +01:00
795fc21c8b Fix a bit typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 11454e1c97ed5495e77a06868a0c199d81aa96c3
Component: engine
2016-12-09 03:05:11 +08:00
582912f0b8 Merge pull request #28854 from coolljt0725/igore_close_stderr_error
Ignore "failed to close stdin" if container or process not found
Upstream-commit: f9ddac3f3cb1edece22f4515671cf9b461975a12
Component: engine
2016-11-30 10:23:27 +01:00
3723431bd0 Change Error log to Warning when close stdin fail
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 37db0220452a837791af84d044b0b308260dccec
Component: engine
2016-11-29 20:42:29 -05:00
89a9795d2b Merge pull request #28710 from miaoyq/eliminate-redundant-parameters
Eliminate the redundant parameter
Upstream-commit: 76a0dfaa8e77fc04d97357fcb999d669b6485db2
Component: engine
2016-11-26 14:37:17 +01:00
0898ad43d6 Fix some output information for container test
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 92ee5a5d3aaefe2fc3b800de67d2ff0acd6a8aae
Component: engine
2016-11-24 20:01:00 +08:00
9b69a300d4 Eliminate redundant parameters
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
Upstream-commit: 58028a2919f1ee794a058fb3451a5145a6382b4d
Component: engine
2016-11-23 09:28:13 +08:00
e5912f7d7e Rename Remote API to Engine API
Implementation of https://github.com/docker/docker/issues/28319

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: f0d55cd081c6e8ad2a8222c787d54f9aae15723f
Component: engine
2016-11-22 12:49:38 +00:00
f8729bb9ff Merge pull request #28556 from ehazlett/container-secret-store
Fix target reference secrets and container secret store
Upstream-commit: 05963010ee2aa363bcbd6d925918a46dba02fd7d
Component: engine
2016-11-21 21:40:01 +01:00
d9512c0fad do not force target type for secret references
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

use secret store interface instead of embedded secret data into container

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: bebd472e40cae91b548e983872a2665a5836ba43
Component: engine
2016-11-17 15:49:02 -05:00
216885f6b0 Merge pull request #28531 from cpuguy83/wait_stop_ctx
Use WaitWithContext for WaitStop
Upstream-commit: b59ee9486fad5fa19f3d0af0eb6c5ce100eae0fc
Component: engine
2016-11-17 11:52:19 -08:00
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
7c64e36522 Fix deadlock on cancelling healthcheck
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 89b123473774248fc3a0356dd3ce5b116cc69b29
Component: engine
2016-11-15 20:10:16 -08:00
ad9327f119 Move StreamConfig out of runconfig
`StreamConfig` carries with it a dep on libcontainerd, which is used by
other projects, but libcontainerd doesn't compile on all platforms, so
move it to `github.com/docker/docker/container/stream`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 5ea75bb6bf41aeaeaa15d8bcceea5be87c211ffc
Component: engine
2016-11-14 15:15:09 -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