Граф коммитов

109 Коммитов

Автор SHA1 Сообщение Дата
Peng Tao 1a6bf8248a fix aufs mount option length calculation
We add ",dirperm1" but only increase length by len("dirperm1").

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2017-06-08 19:21:52 +08:00
Brian Goff 54dcbab25e 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>
2017-05-05 17:02:04 -04:00
Antonio Murdaca abbbf91498
Switch to using opencontainers/selinux for selinux bindings
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-04-24 21:29:47 +02:00
Kenfe-Mickael Laventure eac66b67be Remove aufs debugEBusy()
Since it was introduced no reports were made and lsof seems to cause
issues on some systems.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-03-09 14:35:13 -08:00
Akihiro Suda a6576b8a2b Merge pull request #31212 from fate-grand-order/fixed
use t.Fatal() to output the err message and fix typo
2017-02-27 12:26:35 +09:00
fate-grand-order 2a8d6368d4 use t.Fatal() to output the err message where the values used for formatting
text does not appear to contain a placeholder

Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>
2017-02-23 10:16:22 +08:00
Tonis Tiigi fc1cf1911b Add more locking to storage drivers
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-02-17 15:50:25 -08:00
Aaron.L.Xu 40af569164 fix typo
fix typo I found AMAP in integration-cli/*

fix typo mentioned by Allencloud

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
2017-01-19 15:52:28 +08:00
Vivek Goyal b937aa8e69 Pass all graphdriver create() parameters in a struct
This allows for easy extension of adding more parameters to existing
parameters list. Otherwise adding a single parameter changes code
at so many places.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2016-11-09 15:59:58 -05:00
Michael Crosby 22f3e43e9a Merge pull request #22641 from cpuguy83/build_finalization
Adds ability to flatten image after build
2016-11-01 14:30:18 -07:00
Brian Goff 362369b4bb Adds ability to squash image after build
Allow built images to be squash to scratch.
Squashing does not destroy any images or layers, and preserves the
build cache.

Introduce a new CLI argument --squash to docker build
Introduce a new param to the build API endpoint `squash`

Once the build is complete, docker creates a new image loading the diffs
from each layer into a single new layer and references all the parent's
layers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-11-01 13:41:59 -04:00
Daehyeok Mun fa710e504b Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

Fixed issue #23459

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-10-31 22:05:01 -06:00
Stephen J Day aa2cc18745
pkg/archive: remove unnecessary Archive and Reader type
The `archive` package defines aliases for `io.ReadCloser` and
`io.Reader`. These don't seem to provide an benefit other than type
decoration. Per this change, several unnecessary type cases were
removed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-10-20 19:31:24 -07:00
Michael Crosby c35ab68665 Merge pull request #26536 from anusha-ragunathan/aufs_unmount
Add retry logic during aufs unmount.
2016-09-26 13:17:12 -07:00
Anusha Ragunathan 0e539fec33 Add retry logic during aufs unmount.
Treat EBUSY as a transient error and retry. Also stop ignoring unmount errors.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-09-23 13:15:04 -07:00
Yanqiang Miao b6a268d91f refactor the function 'aufsMount' in 'daemon/graphdriver/aufs/aufs.go'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-09-14 15:42:51 +08:00
lixiaobing10051267 cdb6c59eda wrong id when testing exists in daemon aufs
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-08-16 16:42:45 +08:00
Brian Goff 19ec73b8b5 Merge pull request #24997 from WeiZhang555/fix-unmeaningful-log
small nit: fix unmeaningful log
2016-07-25 10:33:57 -04:00
Zhang Wei af8359562c small nit: fix unmeaningful log
Truncated dir name can't give any useful information, print whole dir
name will.

Bad debug log is like this:

```
DEBU[2449] aufs error unmounting /var/lib/doc: no such file or directory
```

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-07-26 07:10:28 +08:00
allencloud 4e959ef2f7 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-23 11:32:23 +08:00
unclejack 5e85ec82af aufs,overlay: disable on eCryptfs
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2016-06-01 21:00:35 +03:00
Michael Crosby 5b6b8df0c1 Add reference counting to aufs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-23 15:57:23 -07:00
Sebastiaan van Stijn 1fc0acc9ae
refactor overlay storage driver compatibility check
use a consistent approach for checking if the
backing filesystem is compatible with the
storage driver.

also add an error-message for the AUFS driver if
an incompatible combination is found.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-05-10 18:22:36 +02:00
David Calavera 7c16063afa Merge pull request #21714 from hallyn/2016-03-31/aufs.2
don't try to use aufs in a user namespace
2016-04-12 14:07:51 -07:00
Serge Hallyn 2a71f28a4e don't try to use aufs in a user namespace
If aufs is already modprobe'd but we are in a user namespace, the
aufs driver will happily load but then get eperm when it actually tries
to do something.  So detect that condition.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-04-11 13:38:15 -05:00
John Howard fec6cd2eb9 Merge pull request #20525 from Microsoft/sjw/update-graphdriver-create
Adding readOnly parameter to graphdriver Create method
2016-04-08 20:44:03 -07:00
Anusha Ragunathan dbd9b7e121 Be more lenient on auplink errors.
On aufs, auplink is run before the Unmount. Irrespective of the
result, we proceed to issue a Unmount syscall. In which case,
demote erros on auplink to warning.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-04-06 18:24:19 -07:00
Stefan J. Wernli ef5bfad321 Adding readOnly parameter to graphdriver Create method
Since the layer store was introduced, the level above the graphdriver
now differentiates between read/write and read-only layers.  This
distinction is useful for graphdrivers that need to take special steps
when creating a layer based on whether it is read-only or not.
Adding this parameter allows the graphdrivers to differentiate, which
in the case of the Windows graphdriver, removes our dependence on parsing
the id of the parent for "-init" in order to infer this information.

This will also set the stage for unblocking some of the layer store
unit tests in the next preview build of Windows.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-04-06 13:52:53 -07:00
Vincent Demeester e6aa40a017 Merge pull request #19367 from shishir-a412ed/rootfs_size_configurable_cli
CLI flag for docker create(run) to change block device size.
2016-03-29 08:52:54 +02:00
Shishir Mahajan b16decfccf CLI flag for docker create(run) to change block device size.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-03-28 10:05:18 -04:00
Tonis Tiigi 824c24e680 Protect aufs mounts with locks
Parallel aufs mount calls produce invalid argument error.

Fixes #21545


Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-26 22:53:47 -07:00
Brian Goff 65d79e3e5e Move layer mount refcounts to mountedLayer
Instead of implementing refcounts at each graphdriver, implement this in
the layer package which is what the engine actually interacts with now.
This means interacting directly with the graphdriver is no longer
explicitly safe with regard to Get/Put calls being refcounted.

In addition, with the containerd, layers may still be mounted after
a daemon restart since we will no longer explicitly kill containers when
we shutdown or startup engine.
Because of this ref counts would need to be repopulated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-23 14:42:52 -07:00
Tonis Tiigi e91de9fb9d Revert "Move layer mount refcounts to mountedLayer"
This reverts commit 563d0711f8.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-23 00:33:02 -07:00
Brian Goff 563d0711f8 Move layer mount refcounts to mountedLayer
Instead of implementing refcounts at each graphdriver, implement this in
the layer package which is what the engine actually interacts with now.
This means interacting directly with the graphdriver is no longer
explicitly safe with regard to Get/Put calls being refcounted.

In addition, with the containerd, layers may still be mounted after
a daemon restart since we will no longer explicitly kill containers when
we shutdown or startup engine.
Because of this ref counts would need to be repopulated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-22 11:36:28 -04:00
Tatsushi Inagaki e8513675a2 Aufs: reduce redundant parsing of mountinfo
Check whether or not the file system type of a mountpoint is aufs
by calling statfs() instead of parsing mountinfo. This assumes
that aufs graph driver does not allow aufs as a backing file
system.

Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
2016-03-04 11:39:59 +09:00
David Calavera 8f109829e2 Merge pull request #20475 from Microsoft/jstarks/filegetter
graphdriver: Replace DiffPath with DiffGetter
2016-03-02 08:36:36 -08:00
John Starks 58bec40d16 graphdriver: Replace DiffPath with DiffGetter
This allows a graph driver to provide a custom FileGetter for tar-split
to use. Windows will use this to provide a more efficient implementation
in a follow-up change.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-03-01 10:25:33 -08:00
hsinko 772f5495b7 folders->directories
Signed-off-by: hsinko <21551195@zju.edu.cn>
2016-02-29 21:32:30 -08:00
Brian Goff e386dfc33f fix double-lock
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-02-27 09:49:21 -05:00
Brian Goff c2f7777603 Revert "Add finer-grained locking for aufs"
This reverts commit f31014197c.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-02-27 08:01:19 -05:00
Brian Goff f31014197c Add finer-grained locking for aufs
```
benchmark                       old ns/op       new ns/op     delta
BenchmarkConcurrentAccess-8     10269529748     26834747      -99.74%

benchmark                       old allocs     new allocs     delta
BenchmarkConcurrentAccess-8     309948         7232           -97.67%

benchmark                       old bytes     new bytes     delta
BenchmarkConcurrentAccess-8     23943576      1578441       -93.41%
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-02-25 18:06:41 -05:00
Brian Goff 55c91f2ab9 Fix some issues with concurrency in aufs.
Adds a benchmark to measure performance under concurrent actions.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-02-25 14:32:13 -05:00
Tonis Tiigi 98d0997894 Revert "Copy aufs hardlinks to top layer"
This reverts commit ef05b83417.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-01-21 07:52:50 -08:00
Tõnis Tiigi fe550a1f17 Merge pull request #19093 from estesp/userns-root-rework
Allow root non-userns metadata backwards compatibility
2016-01-06 09:48:37 -08:00
Phil Estes e8532023f2 Allow root non-userns metadata backwards compatibility
Instead of creating a "0.0" subdirectory and migrating graphroot
metadata into it when user namespaces are available in the daemon
(currently only in experimental), change the graphroot dir permissions
to only include the execute bit for "other" users.

This allows easy migration to and from user namespaces and will allow
easier integration of user namespace support into the master build.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2016-01-05 11:51:14 -05:00
Tonis Tiigi 0641429ad8 Use direct filesystem access for tar-split on aufs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-01-04 09:41:02 -08:00
Daniel Nephin 0673361ef6 Remove migrateIfDownlevel and aufs migration from docker pre-0.7
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-12-22 16:45:42 -05:00
Liu Hua 451f751773 fix Put without Get in aufs
this Patch is ported from 3916561619

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
2015-12-03 22:22:25 +08:00
Dan Walsh 1716d497a4 Relabel BTRFS Content on container Creation
This change will allow us to run SELinux in a container with
BTRFS back end.  We continue to work on fixing the kernel/BTRFS
but this change will allow SELinux Security separation on BTRFS.

It basically relabels the content on container creation.

Just relabling -init directory in BTRFS use case. Everything looks like it
works. I don't believe tar/achive stores the SELinux labels, so we are good
as far as docker commit.

Tested Speed on startup with BTRFS on top of loopback directory. BTRFS
not on loopback should get even better perfomance on startup time.  The
more inodes inside of the container image will increase the relabel time.

This patch will give people who care more about security the option of
runnin BTRFS with SELinux.  Those who don't want to take the slow down
can disable SELinux either in individual containers or for all containers
by continuing to disable SELinux in the daemon.

Without relabel:

> time docker run --security-opt label:disable fedora echo test
test

real    0m0.918s
user    0m0.009s
sys    0m0.026s

With Relabel

test

real    0m1.942s
user    0m0.007s
sys    0m0.030s

Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-11-11 14:49:27 -05:00
Tonis Tiigi ef05b83417 Copy aufs hardlinks to top layer
Show warning if old method is used.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-10-12 20:44:32 -07:00