Commit Graph

53 Commits

Author SHA1 Message Date
be83c11fb0 Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f0d95fa6ee7f865597c03b9e63702cdcb0f7067
Component: engine
2018-02-05 16:51:57 -05:00
a3765ce30c Optimizations for recurrsive unmount
When a recursive unmount fails, don't bother parsing the mount table to check
if what we expected to be a mountpoint is still mounted. `EINVAL` is
returned when you try to unmount something that is not a mountpoint, the
other cases of `EINVAL` would not apply here unless everything is just
wrong. Parsing the mount table over and over is relatively expensive,
especially in the code path that it's in.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: dd2108766017c13a19bdbfd1a56cd1358580e0bb
Component: engine
2018-01-11 16:13:16 -05:00
fd08bae89c Remove redundant build-tags
Files that are suffixed with `_linux.go` or `_windows.go` are
already only built on Linux / Windows, so these build-tags
were redundant.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6ed1163c98703f8dd0693cecbadc84d2cda811c3
Component: engine
2017-12-18 17:41:53 +01:00
eefbd135ae Remove solaris build tag and `contrib/mkimage/solaris
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4785f1a7ab7ec857dc3ca849ee6ecadf519ef30e
Component: engine
2017-11-02 00:01:46 +00:00
d78181e968 Remove solaris files
For obvious reasons that it is not really supported now.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 5a9b5f10cf967f31f0856871ad08f9a0286b4a46
Component: engine
2017-10-24 15:39:34 -04:00
044d7f995b Update libcontainerd to use containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: ddae20c032058a0fd42c34c2e9750ee8f6296ac8
Component: engine
2017-10-20 07:11:37 -07:00
08619d0c7c Fix TestMount under a selinux system
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8bebd42df2d8eaa0ecdc9c78bc1e395a752eb5c9
Component: engine
2017-09-25 11:54:30 +02:00
5086fdcfde Fix CString memory leaks
Make sure to call C.free on C string allocated using C.CString in every
exit path.

C.CString allocates memory in the C heap using malloc. It is the callers
responsibility to free them. See
https://golang.org/cmd/cgo/#hdr-Go_references_to_C for details.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Upstream-commit: 593dbfd1448e8dac08488786fde6fe7fb057bdac
Component: engine
2017-09-15 09:57:26 +02:00
6b3b192846 Add goimports to linters.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 372670b5074b077927314cdf46af30f8752e7db0
Component: engine
2017-08-21 18:15:08 -04:00
d4d72fe32c In the case of remounting with changed data, need to call mount
The case where we are trying to do a remount with changed filesystem specific options was missing,
we need to call `mount` as well here to change those options.

See #33844 for where we need this, as we change `tmpfs` options.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 3a1ab5b479ce843648cf676fbaaf2bec9e040dce
Component: engine
2017-07-13 15:48:58 +01:00
e95f4619cd [project] change syscall to /x/sys/unix|windows
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

[s390x] switch utsname from unsigned to signed

per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 069fdc8a083cb1663e4f86fe3fd9b9a1aebc3e54
Component: engine
2017-07-11 08:00:32 -04:00
d267fa757f Do not remove containers from memory on error
Before this, if `forceRemove` is set the container data will be removed
no matter what, including if there are issues with removing container
on-disk state (rw layer, container root).

In practice this causes a lot of issues with leaked data sitting on
disk that users are not able to clean up themselves.
This is particularly a problem while the `EBUSY` errors on remove are so
prevalent. So for now let's not keep this behavior.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 54dcbab25ea4771da303fa95e0c26f2d39487b49
Component: engine
2017-05-05 17:02:04 -04:00
2805ccbd34 Use lazy unmount for local volume driver unmount
This fixes issues where the underlying filesystem may be disconnected and
attempting to unmount may cause a hang.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: acbfe6bc56b9357d40a452f6b3901cb2c2d40404
Component: engine
2017-04-27 08:43:43 -04:00
f23397c0c0 pkg/*: clean up a few issues
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: a23c456e5a136d65d02d66af398af1e3ce3a4081
Component: engine
2017-03-30 16:50:46 +03:00
e7f7c8cfe0 Fix linux mount calls not applying propagation type changes
Propagation type changes must be done as a separate call, in the
same way as read only bind mounts.

To fix this:
1. Ensure propagation type change flags aren't included in other calls.
2. Apply propagation type change in a separate call.

Also:
* Make it clear which parameters are ignored by passing them as empty.
* Add tests to ensure Mount options are applied correctly.

Fixes #30415

Signed-off-by: Steven Hartland <steven.hartland@multiplay.co.uk>
Upstream-commit: b3b14b97b1087bfbce6a4de7039e17847fe491a2
Component: engine
2017-02-15 14:15:09 +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
0e099055bb Inconsistent --tmpfs behavior
This fix tries to address the issue raised in #22420. When
`--tmpfs` is specified with `/tmp`, the default value is
`rw,nosuid,nodev,noexec,relatime,size=65536k`. When `--tmpfs`
is specified with `/tmp:rw`, then the value changed to
`rw,nosuid,nodev,noexec,relatime`.

The reason for such an inconsistency is because docker tries
to add `size=65536k` option only when user provides no option.

This fix tries to address this issue by always pre-progating
`size=65536k` along with `rw,nosuid,nodev,noexec,relatime`.
If user provides a different value (e.g., `size=8192k`), it
will override the `size=65536k` anyway since the combined
options will be parsed and merged to remove any duplicates.

Additional test cases have been added to cover the changes
in this fix.

This fix fixes #22420.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 397a6fefadf9ac91a5c9de2447f4dea607296470
Component: engine
2016-05-26 19:28:18 -07:00
3a35464d9d Get the Docker Engine to build clean on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
Upstream-commit: 86d8758e2bb5e9d21d454ceda90b33feb8e74771
Component: engine
2016-05-23 16:37:12 -07:00
4ffd819c8f Windows: Fix mountinfo
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: bb68b666c51eb145a4376c239878d1d985afe01e
Component: engine
2016-03-21 22:03:24 -07:00
ae0977f1d1 fix variables that werent being called
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 0e025b4bb16c0d4cc6b3f0c040713d061b9b051a
Component: engine
2016-03-17 13:19:55 -07:00
34dcc50973 Windows CI: Unit Test - pkg/mount is Unix specific
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d509e615404d8e6f568cf30b6ad37311d4698ece
Component: engine
2016-02-10 18:09:15 -08:00
4edafc3bc1 *: purge dockerinit from source code
dockerinit has been around for a very long time. It was originally used
as a way for us to do configuration for LXC containers once the
container had started. LXC is no longer supported, and /.dockerinit has
been dead code for quite a while. This removes all code and references
in code to dockerinit.

Signed-off-by: Aleksa Sarai <asarai@suse.com>
Upstream-commit: 4357ed4a7363a1032edf93cf03232953c805184f
Component: engine
2016-01-26 23:47:02 +11:00
47e00eae65 No options to tmpfs is valid
If you run a

docker run command with --tmpfs /mountpoint:noexec

Or certain options that get translated into mount options, the mount command can get passed "" for mount data.
So this should be valid.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 89a775d2dc596b9ac86873edf447fff2f7012ef3
Component: engine
2015-12-22 14:15:07 -05:00
3c4fcf6b7a Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Upstream-commit: 927b334ebfc786276a039e45ec097e71bf9a104c
Component: engine
2015-12-13 18:04:12 +02:00
71b21cf347 This patch adds --tmpfs as a option for mounting tmpfs on directories
It will Tar up contents of child directory onto tmpfs if mounted over

This patch will use the new PreMount and PostMount hooks to "tar"
up the contents of the base image on top of tmpfs mount points.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: b3e527dfd242ad30c0297c8b257862116cf2c50e
Component: engine
2015-12-02 10:06:59 -05:00
e1e5cbd789 pkg: mount: golint
Fix the following warnings:

pkg/mount/mountinfo.go:5:6: type name will be used as mount.MountInfo by other packages, and that stutters; consider calling this Info
pkg/mount/mountinfo.go:7:2: struct field Id should be ID

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d
Component: engine
2015-07-22 10:26:10 +02:00
49b6701d13 update testcase mount/sharedsubtree_linux_test.go
Signed-off-by: Yan Feng <yanfeng2@huawei.com>
Upstream-commit: 2cca502c054f9e6c5845206aace8ffe8059b4f5a
Component: engine
2015-06-27 14:34:32 -04:00
5361796b1a Add documentation for exported functions and types
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
Upstream-commit: 9a98556c2bc355170893568ca20e102cbda7d600
Component: engine
2015-04-03 11:33:34 +02:00
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
5bd881552f fix comments typos
s/propogated/propagated

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Upstream-commit: ef3192f161a89bbff11d88da523be61484a822f2
Component: engine
2015-02-04 10:47:37 +08:00
de88b2cc7b Fix output format where no variable specified in mount pkg
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 6fd818f3ef8ca018b74544362c37d41a1095ba9d
Component: engine
2014-12-03 19:02:51 -08:00
00bf60f5c4 Merge pull request #8937 from vbatts/vbatts-mount_optional_fields
pkg/mount: include optional field
Upstream-commit: 379c0da4648f7a8d62740b5c217cfac58f45ca10
Component: engine
2014-11-17 18:25:00 -08:00
71912fc9e2 pkg/mount: testing mountinfo fields
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 83d7db3e505f2d080ac78ca7777937c812588003
Component: engine
2014-11-17 16:17:06 -05:00
007506732f Merge pull request #8930 from vbatts/vbatts-mount_freebsd_fields
pkg/mount: adding fields supported by freebsd
Upstream-commit: b9fb9787b6db5332944d9d0f1fc42eae77d34b7d
Component: engine
2014-11-13 11:54:16 -08:00
3b4007ccd1 Merge pull request #8897 from vbatts/vbatts-mount_sharedsubtree
pkg/mount: sharedsubtree options and testing
Upstream-commit: e4105e4535de0ddb1a0e3ddbc646429c5c8ab5ec
Component: engine
2014-11-13 11:26:29 -08:00
56dd7dc6ae pkg/mount: mountinfo from specified pid
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 64e7a1722daa6508f38287c6b8eee72850f22a86
Component: engine
2014-11-07 13:37:23 -05:00
c9daf4dfd5 pkg/mount: include optional field
one linux, the optional field designates the sharedsubtree information,
if any.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 91b4ac320fd91a6b776713b3c35a51da96024b32
Component: engine
2014-11-03 22:05:04 -05:00
c665136554 pkg/mount: adding fields supported by freebsd
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 0e217c4a9e123551843ceeecdefe5d66b408cdf3
Component: engine
2014-11-03 14:01:50 -05:00
9717d8585b pkg/mount: testing for linux sharedsubtree mounts
* shared
* shared/slave
* unbindable
* private

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 7a3a93871218e5bc50a368f00f043c84004e5986
Component: engine
2014-10-31 15:31:34 -04:00
0cdf5185f2 pkg/mount: add more sharesubtree options
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 06bd66a1f8079c9135acc34bcb9d46c439b429f1
Component: engine
2014-10-31 13:29:35 -04:00
4e9f4b9a1b mount: move the MakePrivate to pkg/mount
The logic is unrelated to graphdriver.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 930a756ad55ad5f4e5e6391b41673743d7254c2b
Component: engine
2014-10-30 17:04:56 -04:00
9e6770baa4 FIX 6613:launch docker fail with space named drive
Signed-off-by: Guillaume Dufour <guillaume.duff@gmail.com>
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: acea488eb6ed40e6e5894e1b259ad861c9a98042
Component: engine
2014-09-19 12:07:53 -04:00
b75c55fd72 Only import "testing" from *_test.go
This prevents the testing package flags from leaking into the flagsets
of binaries that import docker. I left integration-cli alone.

Docker-DCO-1.1-Signed-off-by: Peter Bourgon <peter@bourgon.org> (github: peterbourgon)
Upstream-commit: b87daf6d697655ca092bf54717a64b07504a13c1
Component: engine
2014-08-07 14:25:21 -07:00
416ed08d2b Replace "amd64" build tags with "cgo" as appropriate, and remove where unnecessary
Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 89ec17d11319ae39bff19985ac59fc878fe1fe1e
Component: engine
2014-08-06 17:20:21 -06:00
8897c337e6 Allow re-mounting an existing mount with "remount"
Without this line of code, if a volume is present in /proc/mounts,
it cannot be remounted with new mount options.

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
Upstream-commit: f87afda12344b726c1bfb49b2dc8b5995f86f4ab
Component: engine
2014-06-25 22:06:24 +01:00
f555d1ef2b Support FreeBSD on pkg/mount
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
Upstream-commit: 3754fdd7caae423b606c6fb5160683534a830a1a
Component: engine
2014-04-15 23:16:51 +09:00
d6c3caff98 FreeBSD's nullfs doesn't support file mount
FreeBSD doesn't have "bind" mount, but nullfs might be a similar feature.
However nullfs can mount only directories.

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
Upstream-commit: ca7a0e6d6e31c02baf692315d2481ef35a7e9134
Component: engine
2014-04-15 05:40:23 +09:00
6514818ece Add a test for mount.GetMounts
Because mount.parseInfoFile is only available on Linux

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
Upstream-commit: a7e181c8576e0413da888bea95fb7155173714ea
Component: engine
2014-04-15 05:40:23 +09:00
3044e71de0 Merge pull request #3841 from alexlarsson/separate-base-fs
Separate out graphdriver mount and container root
Upstream-commit: 53ee1daa699ab28fdd37d77b2cfbb0fc14dc0fdb
Component: engine
2014-01-31 11:49:14 -08:00
e8f6d5eb59 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)
Upstream-commit: 065dd231dd7d7858df982a8decfade9df936cf63
Component: engine
2014-01-31 03:16:42 -07:00