Commit graph

1749 commits

Author SHA1 Message Date
David Calavera
e84a938f2e Merge pull request #15222 from jlhawn/error_on_v2pull_hash_mismatch
[Re]Enforce manifest/layer digest verification
2015-08-03 13:02:52 -07:00
Josh Hawn
de52a3bcaa [graph] Enforce manifest/layer digest verification
We noticed a regression since the 1.7.1 patch after some refactoring. This
patch corrects the behavior and adds integration tests for modified manifest
and rootfs layer blobs.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-08-03 11:41:23 -07:00
Arnaud Porterie
67bca8ab8a Merge pull request #15215 from dmcgowan/notary-update
Notary updates
2015-08-03 09:06:09 -07:00
Alexander Morozov
69f3def58d Merge pull request #15225 from runcom/add-restart-always-test-on-daemon-restart
test: daemon restart with containers running with restart always policy manually stopped
2015-08-03 08:40:44 -07:00
Antonio Murdaca
af59c80b4a test: daemon restart with containers running with restart always policy
manually stopped

If a container is running with a restart policy of always and it's
manually stopped, then on daemon restart it will be running.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-08-02 11:14:01 +02:00
Mohammed Aaqib Ansari
84c9a6684f skipping test TestRunCapAddSYSTIME on lxc
Signed-off-by: Mohammed Aaqib Ansari <maaquib@gmail.com>
2015-07-31 22:07:40 -04:00
Derek McGowan
6ce76cd9ed Updated to use latest version of notary
Update UX to use aliases for root, snapshot, and target key

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-31 17:32:35 -07:00
David Calavera
9e9f3aa36b Merge pull request #15185 from aboch/vnd_lbn_1.8
Vendoring libnetwork 31139cdb513aea5ad1ed08b60d4350a68b4c96db
2015-07-31 08:58:41 -07:00
Brian Goff
5276655b69 Merge pull request #14463 from sunyuan3/TestRunCapAddSYSTIME
Add TestRunCapAddSYSTIME test case.
2015-07-31 09:40:12 -04:00
Tibor Vass
1032202b88 Merge pull request #15193 from jfrazelle/fix-lxc
fix lxc test machine
2015-07-31 09:13:52 -04:00
Brian Goff
468bc7d819 Merge pull request #15191 from duglin/TlsTest
Add a test to make sure that --tlsverify=false turns on tls in daemon
2015-07-31 08:54:35 -04:00
Yuan Sun
a5e2fa2b2e Add TestRunCapAddSYSTIME test case.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-07-31 12:53:46 +08:00
Jessica Frazelle
f12e18d7ef fix lxc test machine
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-07-30 21:30:47 -07:00
Doug Davis
5ced3ab323 Add a test to make sure that --tlsverify=false turn on tls in daemon
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-30 21:21:24 -07:00
Tibor Vass
8d2739df98 Merge pull request #15146 from kolyshkin/mkdirall
Simplify and fix MkdirAll usage
2015-07-30 22:40:57 -04:00
Alessandro Boch
4964ab0821 Add test code to cover issue #14859
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-07-30 17:37:11 -07:00
Josh Hawn
75f6929b44 Fix docker cp Behavior With Symlinks
[pkg/archive] Update archive/copy path handling

  - Remove unused TarOptions.Name field.
  - Add new TarOptions.RebaseNames field.
  - Update some of the logic around path dir/base splitting.
  - Update some of the logic behind archive entry name rebasing.

[api/types] Add LinkTarget field to PathStat

[daemon] Fix stat, archive, extract of symlinks

  These operations *should* resolve symlinks that are in the path but if the
  resource itself is a symlink then it *should not* be resolved. This patch
  puts this logic into a common function `resolvePath` which resolves symlinks
  of the path's dir in scope of the container rootfs but does not resolve the
  final element of the path. Now archive, extract, and stat operations will
  return symlinks if the path is indeed a symlink.

[api/client] Update cp path hanling

[docs/reference/api] Update description of stat

  Add the linkTarget field to the header of the archive endpoint.
  Remove path field.

[integration-cli] Fix/Add cp symlink test cases

  Copying a symlink should do just that: copy the symlink NOT
  copy the target of the symlink. Also, the resulting file from
  the copy should have the name of the symlink NOT the name of
  the target file.

  Copying to a symlink should copy to the symlink target and not
  modify the symlink itself.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-30 12:14:28 -07:00
Tibor Vass
a687448c4d Merge pull request #15163 from crosbymichael/proc-ro
Don't mount /proc as ro
2015-07-30 15:12:29 -04:00
Kir Kolyshkin
a83a769347 Simplify and fix os.MkdirAll() usage
TL;DR: check for IsExist(err) after a failed MkdirAll() is both
redundant and wrong -- so two reasons to remove it.

Quoting MkdirAll documentation:

> MkdirAll creates a directory named path, along with any necessary
> parents, and returns nil, or else returns an error. If path
> is already a directory, MkdirAll does nothing and returns nil.

This means two things:

1. If a directory to be created already exists, no error is returned.

2. If the error returned is IsExist (EEXIST), it means there exists
a non-directory with the same name as MkdirAll need to use for
directory. Example: we want to MkdirAll("a/b"), but file "a"
(or "a/b") already exists, so MkdirAll fails.

The above is a theory, based on quoted documentation and my UNIX
knowledge.

3. In practice, though, current MkdirAll implementation [1] returns
ENOTDIR in most of cases described in #2, with the exception when
there is a race between MkdirAll and someone else creating the
last component of MkdirAll argument as a file. In this very case
MkdirAll() will indeed return EEXIST.

Because of #1, IsExist check after MkdirAll is not needed.

Because of #2 and #3, ignoring IsExist error is just plain wrong,
as directory we require is not created. It's cleaner to report
the error now.

Note this error is all over the tree, I guess due to copy-paste,
or trying to follow the same usage pattern as for Mkdir(),
or some not quite correct examples on the Internet.

[v2: a separate aufs commit is merged into this one]

[1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-07-30 11:48:08 -07:00
Eric Windisch
f5c388b35a Only explicitly deny ptrace for container-originated procs
The 'deny ptrace' statement was supposed to only ignore
ptrace failures in the AUDIT log. However, ptrace was implicitly
allowed from unconfined processes (such as the docker daemon and
its integration tests) due to the abstractions/base include.

This rule narrows the definition such that it will only ignore
the failures originating inside of the container and will not
cause denials when the daemon or its tests ptrace inside processes.

Introduces positive and negative tests for ptrace /w apparmor.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-30 14:40:28 -04:00
Michael Crosby
bfc51cf660 Don't mount /proc as ro
This caused a regression with LSM labeling.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-07-30 10:57:50 -07:00
Arnaud Porterie
b71cf69380 Merge pull request #15132 from LK4D4/improve_test
Fix message and add additional check to test
2015-07-29 17:36:11 -07:00
Arnaud Porterie
d94aeb2876 Merge pull request #14980 from jlhawn/build_tag_resolved_digests
[api/client] Tag resolved digest from Dockerfile
2015-07-29 16:52:14 -07:00
Arnaud Porterie
4a71323ec3 Merge pull request #15098 from calavera/backwards_compat_kill_error
Keep backwards compatibility in kill api.
2015-07-29 16:42:36 -07:00
Eric Windisch
5832715052 Fix the proc integration test & include missing AA profile
Integration tests were failing due to proc filter behavior
changes with new apparmor policies.

Also include the missing docker-unconfined policy resolving
potential startup errors. This policy is complain-only so
it should behave identically to the standard unconfined policy,
but will not apply system path-based policies within containers.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-29 17:08:51 -04:00
Alexander Morozov
0f85fadb4e Merge pull request #15133 from dmcgowan/notary-fix-test-date
Skip notary tests which update system clock
2015-07-29 12:51:05 -07:00
Derek McGowan
bf3c1e6a3a Skip notary tests which update system clock
Currently some notary tests change the system clock to check for expiration.
Skip these tests until the code can be refactored to not rely on updating the system clock.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-29 12:09:40 -07:00
Alexander Morozov
0d09439ace Fix message and add additional check to TestBuildContainerWithCgroupParent
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-29 11:46:33 -07:00
Jessie Frazelle
d7661cb48b Merge pull request #15099 from ewindisch/apparmor-restore-en
Restore AppArmor generation + fixes
2015-07-29 09:36:59 -07:00
Alexander Morozov
6bca8ec3c9 Replace GenerateRandomID with GenerateNonCryptoID
This allow us to avoid entropy usage in non-crypto critical places.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-28 22:31:01 -07:00
Josh Hawn
bb2e6c72d2 [api/client] Tag resolved digest from Dockerfile
Builds where the base images have been resolved to trusted digest
references will now be tagged with the original tag reference from
the Dockerfile on a successful build.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-28 17:54:48 -07:00
Eric Windisch
3edc88f76d Restore AppArmor profile generation
Will attempt to load profiles automatically. If loading fails
but the profiles are already loaded, execution will continue.

A hard failure will only occur if Docker cannot load
the profiles *and* they have not already been loaded via
some other means.

Also introduces documentation for AppArmor.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-07-28 17:45:51 -04:00
David Calavera
621e3d8587 Keep backwards compatibility in kill api.
Return an error when the container is stopped only in api versions
equal or greater than 1.20 (docker 1.8).

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-28 12:25:36 -07:00
Chris Seto
83cb288575 Skip DockerSuite.TestExecResizeImmediatelyAfterExecStart on lxc
Signed-off-by: Chris Seto <chriskseto@gmail.com>
2015-07-27 19:20:15 -04:00
Michael Crosby
bdc55be9b4 Merge pull request #15039 from jlhawn/fix_build_context_is_symlink
[api/client] Fix build when context dir is symlink
2015-07-27 15:11:36 -07:00
Doug Davis
8c9cd0418d Merge pull request #15045 from cpuguy83/fix_dockercmdwitherror
Don't pass check.C to dockerCmdWithError
2015-07-27 16:04:16 -04:00
Josh Hawn
01d570ad30 [api/client] Fix build when context dir is symlink
Symbolic links in the context directory path are now evaluated.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-27 12:01:13 -07:00
Jessie Frazelle
d0215376f8 Merge pull request #15044 from jlhawn/fix_15042
[integration-cli] fix windows build test cases
2015-07-27 11:47:56 -07:00
Brian Goff
693ba98cb9 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-07-27 14:33:32 -04:00
Josh Hawn
d06ffd0a5f [integration-cli] fix windows build test cases
Use the same IP as the DOCKER_HOST when making a remote file server.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-27 11:30:38 -07:00
Jessie Frazelle
afac39d308 Merge pull request #15026 from duglin/Issue14837
Add a test for using -f w/git repo on build
2015-07-27 10:55:47 -07:00
Alexander Morozov
4dbdd98b41 Merge pull request #14547 from duglin/ErrDeadExec
Return 404 on exec-inspect when container is dead but exec is still around
2015-07-27 10:46:32 -07:00
Jessie Frazelle
33bd41df94 Merge pull request #14118 from mountkin/fix-rmi-force
raise an error if rmi -f with multiple tags and running container
2015-07-27 10:42:07 -07:00
Jessie Frazelle
70842ea942 Merge pull request #14899 from mountkin/fix-exec-resize-panic
fix the panic caused by resizing a starting exec
2015-07-27 10:27:29 -07:00
David Calavera
c451d597f2 Merge pull request #15028 from vbatts/typo
api/client/build: typo in error
2015-07-27 10:13:05 -07:00
David Calavera
e89aec0dfb Merge pull request #15010 from runcom/14947-fix-inspect-time-RFC3339Nano
Format times in inspect command with a template as RFC3339Nano
2015-07-27 10:08:21 -07:00
Alexander Morozov
ec8173b517 Merge pull request #14917 from srust/14915-empty-hostconfig-on-create
Check for nil before using HostConfig to adjustCpuShares
2015-07-27 09:38:32 -07:00
Vincent Batts
7b4e6fc47b *: s/direcotry/directory/g typo
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-07-27 11:29:28 -04:00
Doug Davis
d883540440 Adda test for using -f w/git repo on build
https://github.com/docker/docker/pull/14546 actually fixed issue #14837
but I don't see a new test to ensure we don't regress. So this PR adds
a test and then we can close #14837.

Closes #14837

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-27 07:49:42 -07:00
Stephen Rust
c358a4cd35 Check for nil before using HostConfig to adjustCpuShares
Fix #14915. Add unit test for #14915.
Thanks @runcom for the test case: when the client calls 1.18 api
version w/o hostconfig it results in a nil pointer dereference.

Signed-off-by: Stephen Rust <srust@blockbridge.com>
2015-07-26 20:33:04 -04:00