Commit Graph

1742 Commits

Author SHA1 Message Date
da82af9892 Merge pull request #15185 from aboch/vnd_lbn_1.8
Vendoring libnetwork 31139cdb513aea5ad1ed08b60d4350a68b4c96db
Upstream-commit: 9e9f3aa36b5286556c8f99557d8bcc66946598d3
Component: engine
2015-07-31 08:58:41 -07:00
f8cb968c76 Merge pull request #14463 from sunyuan3/TestRunCapAddSYSTIME
Add TestRunCapAddSYSTIME test case.
Upstream-commit: 5276655b694bec1125c4c119adb941a2b7531433
Component: engine
2015-07-31 09:40:12 -04:00
2f7ecc6177 Merge pull request #15193 from jfrazelle/fix-lxc
fix lxc test machine
Upstream-commit: 1032202b88145478c2206873056497a03a758bb9
Component: engine
2015-07-31 09:13:52 -04:00
8b2de70434 Merge pull request #15191 from duglin/TlsTest
Add a test to make sure that --tlsverify=false turns on tls in daemon
Upstream-commit: 468bc7d819f37badde32fd6e45dae41149695a92
Component: engine
2015-07-31 08:54:35 -04:00
e9bd79ecdf Add TestRunCapAddSYSTIME test case.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: a5e2fa2b2e30cf515d22dee532ae33d5ab695008
Component: engine
2015-07-31 12:53:46 +08:00
4d212c22a0 fix lxc test machine
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: f12e18d7ef9b1a354c10038874f0e7be0a8bb66f
Component: engine
2015-07-30 21:30:47 -07:00
1d4ee6ca42 Add a test to make sure that --tlsverify=false turn on tls in daemon
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 5ced3ab3236bfe8ade1b5b6663599518086af7da
Component: engine
2015-07-30 21:21:24 -07:00
385c38be8c Merge pull request #15146 from kolyshkin/mkdirall
Simplify and fix MkdirAll usage
Upstream-commit: 8d2739df980a1af76ad50e5c423134815186b61c
Component: engine
2015-07-30 22:40:57 -04:00
40d1455b2e Add test code to cover issue #14859
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 4964ab08218f3b40f5c3a6bf19fe74f7fb39562a
Component: engine
2015-07-30 17:37:11 -07:00
0a7e55f30a 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)
Upstream-commit: 75f6929b449a59335572436862d644afacf55cdb
Component: engine
2015-07-30 12:14:28 -07:00
76f950f781 Merge pull request #15163 from crosbymichael/proc-ro
Don't mount /proc as ro
Upstream-commit: a687448c4dec200336ed28c5ef26c8198cc0505b
Component: engine
2015-07-30 15:12:29 -04:00
3c8e934faf 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>
Upstream-commit: a83a76934787a20e96389d33bd56a09369f9b808
Component: engine
2015-07-30 11:48:08 -07:00
114011a355 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>
Upstream-commit: f5c388b35a9ddd699b3dbbe85b80fa02234f8355
Component: engine
2015-07-30 14:40:28 -04:00
8461105dc9 Don't mount /proc as ro
This caused a regression with LSM labeling.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: bfc51cf6605ebcf7a4ec791fb0f3b5ae7b05c6fd
Component: engine
2015-07-30 10:57:50 -07:00
513c7293de Merge pull request #15132 from LK4D4/improve_test
Fix message and add additional check to test
Upstream-commit: b71cf6938040fc4ae190f3e7eb24d51f756c9e11
Component: engine
2015-07-29 17:36:11 -07:00
683390e0bc Merge pull request #14980 from jlhawn/build_tag_resolved_digests
[api/client] Tag resolved digest from Dockerfile
Upstream-commit: d94aeb28765635970e7cac605b85785212855438
Component: engine
2015-07-29 16:52:14 -07:00
1bd0671e56 Merge pull request #15098 from calavera/backwards_compat_kill_error
Keep backwards compatibility in kill api.
Upstream-commit: 4a71323ec3c00be48e3539a1da0444972f22c355
Component: engine
2015-07-29 16:42:36 -07:00
36993f8dbd 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>
Upstream-commit: 5832715052e9e165cc40a5ac8178fa62685985aa
Component: engine
2015-07-29 17:08:51 -04:00
4e9957ee2d Merge pull request #15133 from dmcgowan/notary-fix-test-date
Skip notary tests which update system clock
Upstream-commit: 0f85fadb4ec1aa3d0270351fc72fa9a70cffd3b9
Component: engine
2015-07-29 12:51:05 -07:00
4c1bdea55d 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)
Upstream-commit: bf3c1e6a3afc951e41643b8d55d4ac25fa9cb06d
Component: engine
2015-07-29 12:09:40 -07:00
6f4ce090eb Fix message and add additional check to TestBuildContainerWithCgroupParent
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 0d09439acea2ee1886d301c03e5e33abf8735896
Component: engine
2015-07-29 11:46:33 -07:00
7b7157591c Merge pull request #15099 from ewindisch/apparmor-restore-en
Restore AppArmor generation + fixes
Upstream-commit: d7661cb48b93978b4b30d2c60f3201d685af7f95
Component: engine
2015-07-29 09:36:59 -07:00
67bf5ba305 Replace GenerateRandomID with GenerateNonCryptoID
This allow us to avoid entropy usage in non-crypto critical places.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6bca8ec3c9ccc169c53b3d7060fe5c8ba8670aac
Component: engine
2015-07-28 22:31:01 -07:00
e057b33e06 [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)
Upstream-commit: bb2e6c72d2fb3f1b64755bdf6d6269dbc6767f87
Component: engine
2015-07-28 17:54:48 -07:00
e9b83a5a26 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>
Upstream-commit: 3edc88f76df6a3bc9d887de8157ec71730c9057a
Component: engine
2015-07-28 17:45:51 -04:00
26753acfcd 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>
Upstream-commit: 621e3d8587bbee86b4e36d0b7822662bfbedd76c
Component: engine
2015-07-28 12:25:36 -07:00
6f7ccf2956 Skip DockerSuite.TestExecResizeImmediatelyAfterExecStart on lxc
Signed-off-by: Chris Seto <chriskseto@gmail.com>
Upstream-commit: 83cb28857551d0077b3877d1de1c3c44a39da705
Component: engine
2015-07-27 19:20:15 -04:00
e075bafeec Merge pull request #15039 from jlhawn/fix_build_context_is_symlink
[api/client] Fix build when context dir is symlink
Upstream-commit: bdc55be9b49bd4cdcc9373e2eb847b133532cedc
Component: engine
2015-07-27 15:11:36 -07:00
c3325b7678 Merge pull request #15045 from cpuguy83/fix_dockercmdwitherror
Don't pass check.C to dockerCmdWithError
Upstream-commit: 8c9cd0418d1baa5ceddec58e3a4873607e9cafcd
Component: engine
2015-07-27 16:04:16 -04:00
a5d4f063b0 [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)
Upstream-commit: 01d570ad30a794f2736b679700af91625e61bc85
Component: engine
2015-07-27 12:01:13 -07:00
6f5eddf659 Merge pull request #15044 from jlhawn/fix_15042
[integration-cli] fix windows build test cases
Upstream-commit: d0215376f838c73b9684f34584e63908fdeca281
Component: engine
2015-07-27 11:47:56 -07:00
6e14356132 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 693ba98cb9118bf15caaabc69ca281c0ce604226
Component: engine
2015-07-27 14:33:32 -04:00
083f0a374e [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)
Upstream-commit: d06ffd0a5f5d55dacc369fc6560316e9f17e2cac
Component: engine
2015-07-27 11:30:38 -07:00
2c72388c36 Merge pull request #15026 from duglin/Issue14837
Add a test for using -f w/git repo on build
Upstream-commit: afac39d3082febd5c0270f7d19cb6c7512002f7d
Component: engine
2015-07-27 10:55:47 -07:00
1b5a1d2d53 Merge pull request #14547 from duglin/ErrDeadExec
Return 404 on exec-inspect when container is dead but exec is still around
Upstream-commit: 4dbdd98b4142dbda1c6028c17a9a0d6dd8cdce04
Component: engine
2015-07-27 10:46:32 -07:00
6356a946a6 Merge pull request #14118 from mountkin/fix-rmi-force
raise an error if rmi -f with multiple tags and running container
Upstream-commit: 33bd41df94a3fa81e3b011602008a31a57a5ca68
Component: engine
2015-07-27 10:42:07 -07:00
6f66e6db3b Merge pull request #14899 from mountkin/fix-exec-resize-panic
fix the panic caused by resizing a starting exec
Upstream-commit: 70842ea942326b2a3be3b504a7f5038ba68f07f1
Component: engine
2015-07-27 10:27:29 -07:00
ae24227f7b Merge pull request #15028 from vbatts/typo
api/client/build: typo in error
Upstream-commit: c451d597f2abef42bd26212d18844a03c3773818
Component: engine
2015-07-27 10:13:05 -07:00
704cf2735f Merge pull request #15010 from runcom/14947-fix-inspect-time-RFC3339Nano
Format times in inspect command with a template as RFC3339Nano
Upstream-commit: e89aec0dfb2dd4a5decc11ea008f3ab179e8d5f8
Component: engine
2015-07-27 10:08:21 -07:00
af395c292f Merge pull request #14917 from srust/14915-empty-hostconfig-on-create
Check for nil before using HostConfig to adjustCpuShares
Upstream-commit: ec8173b5171b7f7cd4816453bdf714fec8d22353
Component: engine
2015-07-27 09:38:32 -07:00
7eed677896 *: s/direcotry/directory/g typo
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 7b4e6fc47b5b4b25f74f12419005098478e16ce7
Component: engine
2015-07-27 11:29:28 -04:00
a8c27a01ce 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>
Upstream-commit: d8835404400d46dfe475fa3bad9f1b9fb8396bef
Component: engine
2015-07-27 07:49:42 -07:00
dec1a0e3c4 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>
Upstream-commit: c358a4cd3597ac330674c9d93b6038e8f455c8f7
Component: engine
2015-07-26 20:33:04 -04:00
0fccf757d0 Format times in inspect command with a template as RFC3339Nano
In 1.6.2 we were decoding inspect API response into interface{}.
time.Time fields were JSON encoded as RFC3339Nano in the response
and when decoded into interface{} they were just strings so the inspect
template treated them as just strings.
From 1.7 we are decoding into types.ContainerJSON and when the template
gets executed it now gets a time.Time and it's formatted as
2015-07-22 05:02:38.091530369 +0000 UTC.
This patch brings back the old behavior by typing time.Time fields
as string so they gets formatted as they were encoded in JSON -- RCF3339Nano

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: c9207bc0aa57745876a3422d2cbc290be7c53da8
Component: engine
2015-07-26 15:25:08 +02:00
861b01ab9e Fix go vet errors
Signed-off-by: Chris Seto <chriskseto@gmail.com>
Upstream-commit: 04f76b67c9f0a4559ef91e24873f51b81c81b957
Component: engine
2015-07-25 17:00:10 -04:00
7a78f67eef Merge pull request #14941 from hqhq/hq_cli_remove_cleanup
Remove unnecessary container cleanup in integration-cli
Upstream-commit: 6b12d37cedc3c4c9287d1dcdb1fc831f46e49ee6
Component: engine
2015-07-24 20:38:15 -07:00
abb442b01d Merge pull request #14979 from runcom/fix-flacky-TestRunNonRootUserResolvName
Fix TestRunNonRootUserResolvName flackiness
Upstream-commit: afb831d35e62139c9e7a214a471c3dd956076223
Component: engine
2015-07-24 21:50:44 -04:00
6a640c48bd Fix TestRunNonRootUserResolvName flackiness
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 30d4c70d282248ac218c6c505d5a316e5cc9ac01
Component: engine
2015-07-25 02:45:17 +02:00
4f2862dc8f Merge pull request #14546 from dmcgowan/trusted-notary-integration
Notary integration
Upstream-commit: 4f5b677fd9808b34382061c458e13d3930516889
Component: engine
2015-07-24 17:44:14 -07:00
99a373ceb8 Rename to flags and environment variables to content trust
Update help line to allow 90 characters instead of 80

The trust flag pushes out the help description column wider, requiring more room to display help messages.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 259cadb0b19a9049302e78fec529b0105efabb1d
Component: engine
2015-07-24 16:31:18 -07:00