Commit Graph

186 Commits

Author SHA1 Message Date
8f6577a7cd Merge pull request #14780 from icecrime/14756_add_golint
Add golint to the development toolbox
Upstream-commit: e4f1cf787c50e0f4e97ea5d0aee5a7b4c5b40ff5
Component: engine
2015-07-21 09:50:58 -07:00
5bcf01ef67 Add golint to the development toolbox
Add golint to the Dockerfile, and a `validate-lint` task to the
Makefile. Currently, the linter will process a harcoded list of packages
that will expand as we fix more warnings. Eventually, the linter should
process all subpackages of the repo (excluding vendored code).

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 6cce8d18384a5ae1212e7b0f7b7ac9662a89c8c1
Component: engine
2015-07-21 09:00:36 -07:00
74cf202b4f Move AppArmor policy to contrib & deb packaging
The automatic installation of AppArmor policies prevents the
management of custom, site-specific apparmor policies for the
default container profile. Furthermore, this change will allow
a future policy for the engine itself to be written without demanding
the engine be able to arbitrarily create and manage AppArmor policies.

- Add deb package suggests for apparmor.
- Ubuntu postinst use aa-status & fix policy path
- Add the policies to the debian packages.
- Add apparmor tests for writing proc files
Additional restrictions against modifying files in proc
are enforced by AppArmor. Ensure that AppArmor is preventing
access to these files, not simply Docker's configuration of proc.
- Remove /proc/k?mem from AA policy
The path to mem and kmem are in /dev, not /proc
and cannot be restricted successfully through AppArmor.
The device cgroup will need to be sufficient here.
- Load contrib/apparmor during integration tests
Note that this is somewhat dirty because we
cannot restore the host to its original configuration.
However, it should be noted that prior to this patch
series, the Docker daemon itself was loading apparmor
policy from within the tests, so this is no dirtier or
uglier than the status-quo.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 80d99236c1ef9d389dbaca73c1a949da16b56b42
Component: engine
2015-07-21 11:05:53 -04:00
4ee32ba904 Add release-deb & release-rpm scripts.
These will create the apt & yum repos for the deb/rpms generated by build-deb
and build-rpm.

Adds sign-repo script which signs the repo metadata with a gpg key.

Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: c850e97c84abffc71509692ab1accd38408fa51b
Component: engine
2015-07-15 15:54:00 -07:00
fe10418da9 Remove specific dependencies and let RPM auto-generate the dependencies on libraries during build.
Signed-off-by: Avi Miller <avi.miller@oracle.com>
Upstream-commit: e3b5889783d5e83a9cecc0867e7af73d5fd023f0
Component: engine
2015-07-08 15:30:42 +10:00
7eb8fa7601 Adding Group Metatag
Signed-off-by: evalle <shmarnev@gmail.com>
Upstream-commit: 0db7c2a9a686a4101f11ab362e3ab8327b9ea591
Component: engine
2015-07-07 09:08:55 +02:00
888e384d70 Add branch and build time to version
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 87eae0d659d6e4bb75942455f3f73a74f54ed3b9
Component: engine
2015-06-22 13:00:27 -07:00
9e396973a1 Remove timer and use -check.v for tests formatting
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 4253a1f87ee90e3827090dc380bfda2332e23ff3
Component: engine
2015-06-18 14:22:40 -07:00
809c6b1b19 Check for apparmor file before reading it
I ran a single integration test and got an error that the file
/sys/module/apparmor/parameters/enabled doesn't exist. I don't have
apparmor installed. So, just check the file first to avoid a confusing
error.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Upstream-commit: 691ed6ef995b8ee7cf9bdcea29ccf4b58a244234
Component: engine
2015-06-17 11:58:17 -05:00
6fba235ed8 Add new "validate-pkg" bundlescript
This helps ensure that `github.com/docker/docker/pkg/...` is actually safe to use in isolation (ie, doesn't import anything from `github.com/docker/docker` except other things from `pkg` or vendored dependencies).

Adding `github.com/docker/docker/utils` to the imports of `pkg/version/version.go`:

```
---> Making bundle: validate-pkg (in bundles/1.7.0-dev/validate-pkg)
These files import internal code: (either directly or indirectly)
 - pkg/version/version.go imports github.com/docker/docker/autogen/dockerversion
 - pkg/version/version.go imports github.com/docker/docker/utils
```

And then removing it again:

```
---> Making bundle: validate-pkg (in bundles/1.7.0-dev/validate-pkg)
Congratulations! "./pkg/..." is safely isolated from internal code.
```

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 9465272c281c602c758e51ed99f344c0686a899a
Component: engine
2015-06-12 12:28:23 -07:00
84b8fc6fe1 Moving man pages out of docs
Adding in other areas per comments
Updating with comments; equalizing generating man page info
Updating with duglin's comments
Doug is right here again;fixing.

Signed-off-by: Mary Anthony <mary@docker.com>
Upstream-commit: eacae64bd89ccc95a6db7bda76d36014e71e70ac
Component: engine
2015-06-10 13:43:35 -07:00
9a7bae36c0 ugh typo in hack scripts fix, introduced by 2b4facdf
Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: c5f49886fa1a7ce67ab020a19c4aea65225c3658
Component: engine
2015-06-10 11:00:59 -07:00
6f7de6a8db Merge pull request #12583 from Mic92/hack/explicit-bundles
Hack/explicit bundles
Upstream-commit: ceee2595b6b38ec2f7fb01436884b41902acfecc
Component: engine
2015-06-09 14:34:52 -07:00
aeb5ca3cb3 hack: explicit bundles for integration-cli prequisites
no longer load hide critical code such as in .integration-daemon-{start,stop},
if this step failed, it will had logged the corresponding module before:

---> Making bundle: .integration-daemon-start (in bundles/1.7.0-dev/daemon-start)

which is nicer to debug.

This will make it also easier to execute a single tests in an interactive shell.

$ make shell
docker> . hack/make.sh binary .integration-daemon-start .integration-daemon-setup
docker> docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED STATUS              PORTS               NAMES
docker> go test github.com/docker/docker/integration-cli

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: 2b4facdf2ed6b1074a2a8abc031bf0827b6d5f33
Component: engine
2015-06-09 07:22:26 +02:00
67f2667620 Merge pull request #13022 from Microsoft/10662-addrsrc
Windows: Add resources for manifest and icon
Upstream-commit: a2ab067b3c56f6b296150531c94a05b357fc0d70
Component: engine
2015-06-08 15:16:10 -07:00
b199d8e0f8 Windows: Build docker.exe manifested and with icon
Signed-off-by: John Howard <John.Howard@microsoft.com>
Upstream-commit: fd935ee63db31e73b5ee5594644e04b959ead374
Component: engine
2015-06-04 11:49:10 -07:00
e4dcd8eb99 Tiny spelling issue in the debian control file :)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: 318defe1de8a9d2930d784306fd024c59e21a8c5
Component: engine
2015-06-04 18:16:24 +10:00
4e0d41c20f Merge pull request #13704 from tianon/build-utc
Swap build-* to use UTC instead of local time
Upstream-commit: ef3e956aa2c8b24fd18c7fa693b366be781fc30a
Component: engine
2015-06-03 22:05:09 -07:00
961db33814 Update urls from .com to .org.
I added 301 redirects from dockerproject.com to dockerproject.org but may as
well make sure everything is updated anyways.

Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: 7943bce8942ee8c262180652951216d963fa6202
Component: engine
2015-06-03 13:28:47 -07:00
77c62581e8 Swap build-* to use UTC instead of local time
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: aa54a93f749e2048957eb28e6045770672cb8838
Component: engine
2015-06-03 09:56:46 -07:00
d3e3277a8e Merge pull request #13603 from tianon/consistent-dest
Make "DEST" a make.sh construct instead of ad-hoc
Upstream-commit: 0ea14e5c6d5cd731715b53f6971faef45cd06cd3
Component: engine
2015-05-30 16:42:10 -07:00
c50b83a729 Make "DEST" a make.sh construct instead of ad-hoc
Using "DEST" for our build artifacts inside individual bundlescripts was already well-established convention, but this officializes it by having `make.sh` itself set the variable and create the directory, also handling CYGWIN oddities in a single central place (instead of letting them spread outward from `hack/make/binary` like was definitely on their roadmap, whether they knew it or not; sneaky oddities).

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: ac3388367b6493987cef8017774fa4cdb5d2098f
Component: engine
2015-05-30 11:16:43 -07:00
efadb1b4ee Finally add precise/12.04 as a build-deb target
Ubuntu Precise has a number of warts that made it non-trivial to add initially, but I've managed to work through some of them and come up with a working build.  Two important parts to note are that it has neither the `btrfs` nor the `devicemapper` graphdriver backends since `btrfs-tools` and `libdevmapper-dev` in the precise repositories are too ancient for them to even compile.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 98180b89543396c07c1f1ea420554fbcce31c513
Component: engine
2015-05-29 12:55:58 -07:00
78d72e0857 add unshare apparmor profile test
Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: 6f75dd85c5adbced787a2e15aa7e9ccd71289749
Component: engine
2015-05-20 14:06:00 -07:00
1c502870b7 Make which cross binary fails clearer
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0bdeef94c7268e0816528423898b1daefe195d89
Component: engine
2015-05-15 09:25:13 -07:00
01977b40d0 integration: add variable to set storage options for testing
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: 30f3bd643d5f6706bbaa9559e781b036661f149e
Component: engine
2015-05-08 17:49:39 +02:00
eb6a693474 Merge pull request #13032 from jfrazelle/nano-nano-nano
add nanorc to packaged builds
Upstream-commit: 6a1f862e40001b3389970b57ea38f718d4748881
Component: engine
2015-05-07 17:35:03 -06:00
159968801d Merge pull request #13065 from tianon/fix-build-deb-tilde-expansion
Fix '~' expansion in build-deb... (properly this time)
Upstream-commit: b6448f25f2fda3518d36b5a49fd67064cff2c952
Component: engine
2015-05-07 16:24:33 -07:00
72be67236b add nanorc to packaged builds
Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: f66d225427d135069e1fd1e9649bc5654a0f675c
Component: engine
2015-05-07 16:10:07 -07:00
2ee6387cbc Merge pull request #12165 from icecrime/optional_userland_proxy
Optional userland proxy
Upstream-commit: 74bfa3675353aaf10ca760e82a79d758bea0ff6b
Component: engine
2015-05-07 14:01:16 -07:00
23e06861d0 Fix '~' expansion in build-deb... (properly this time)
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 297cd347a676a79dee94509de7669919a4d9fab3
Component: engine
2015-05-07 14:02:21 -06:00
a1ac14178e Fix build-deb
This fixes the part of #12996 that I forgot. 👼

This also fixes a minor path issue (there's no `libexec` in Debian), and fixes a minor bug with the `debVersion` parsing.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 867eed8f3586c81b32dc9f85208692e9e1c9909a
Component: engine
2015-05-06 18:10:15 -06:00
898f9341bc Merge pull request #12917 from jfrazelle/add-rpm
Add RPM for centos-7, fedora-20, fedora-21
Upstream-commit: 2281d6c266e87264d885314e2c4641ece725b161
Component: engine
2015-05-05 17:31:21 -07:00
0017c3b28a Add rpm for centos-6, centos-7, fedora-20, fedora-21
Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: 18beb5561140aaa950f00391a87bb332fb2b6aea
Component: engine
2015-05-05 16:05:30 -07:00
ae45d9cbea Make a docker-in-docker dynamic binary and add RPM target
This change adds a new docker-in-docker dynamic binary make target which
builds a centos container for creating the dynamically linked binary.
To use it, you first must create the static binary and then call the
dind-dynbinary target.  You can call it like:

$ hack/make.sh binary dind-dynbinary rpm

This would then package the dynamic binary into the rpm after having
created it in the centos build container.  Unfortunately with this approach
you can't create the rpms and the debs with the same command.  They have to
be created separately otherwise the wrong version (static vs. dynamic) gets
packaged.

Various RPM fixes including:
  - Adding missing RPM dependencies.
  - Add sysconfig configuration files to the RPM.
  - Add an epoch to silence the fpm warning.
  - Remove unnecessary empty package.

Signed-off-by: Patrick Devine <patrick.devine@docker.com>
Signed-off-by: Chad Metcalf <chad@docker.com>
Upstream-commit: 878dcb89f38e8eb7bb07ccd4a4e5ce622252ff30
Component: engine
2015-05-05 10:01:39 -07:00
e1c57390f1 Replace "docker-core" with "docker-engine" in "build-deb"
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 5e563d170815ce3111eb66b44cfd252c80d8f34c
Component: engine
2015-05-05 10:11:59 -06:00
afd229a538 Add DOCKER_USERLANDPROXY test variable
Add an convenient way to switch --userland-proxy on and off in
integration tests.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 44de5fecce9dd194fade1b696e9297ac5c985754
Component: engine
2015-05-04 16:07:51 -07:00
c2d48a3c7b Remove hacky "cp .../Dockerfile.build ." in "build-deb"
Turns out that `-f` on a file that's in `.dockerignore` actually does work.  No idea why it wasn't when I was doing this before, but oh well! 🤘

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 9f5730e131699caaf6f8f6f941d5942d68295055
Component: engine
2015-05-01 14:45:00 -06:00
0ec0dcde9e Remove integration tests and port them to integration-cli
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: f7e417ea5e26f11ec43dba64ee153765d2276f40
Component: engine
2015-04-30 01:35:16 +02:00
2b16b6e81b Merge pull request #12646 from duglin/validateTests
Validate we're not using the old testing stuff
Upstream-commit: d17f2baa811e06dcf70b989c1a84de66da327f12
Component: engine
2015-04-23 11:23:20 -07:00
d67e51c7b3 Fix daemon start/stop logic in hack/make/* scripts
From the Bash manual's `set -e` description:
(https://www.gnu.org/software/bash/manual/bashref.html#index-set)

> Exit immediately if a pipeline (see Pipelines), which may consist of a
> single simple command (see Simple Commands), a list (see Lists), or a
> compound command (see Compound Commands) returns a non-zero status.
> The shell does not exit if the command that fails is part of the
> command list immediately following a while or until keyword, part of
> the test in an if statement, part of any command executed in a && or
> || list except the command following the final && or ||, any command
> in a pipeline but the last, or if the command’s return status is being
> inverted with !. If a compound command other than a subshell returns a
> non-zero status because a command failed while -e was being ignored,
> the shell does not exit.

Additionally, further down:

> If a compound command or shell function executes in a context where -e
> is being ignored, none of the commands executed within the compound
> command or function body will be affected by the -e setting, even if
> -e is set and a command returns a failure status. If a compound
> command or shell function sets -e while executing in a context where
> -e is ignored, that setting will not have any effect until the
> compound command or the command containing the function call
> completes.

Thus, the only way to have our `.integration-daemon-stop` script
actually run appropriately to clean up our daemon on test/script failure
is to use `trap ... EXIT`, which we traditionally avoid because it does
not have any stacking capabilities, but in this case is a reasonable
compromise because it's going to be the only script using it (for now,
at least; we can evaluate more complex solutions in the future if they
actually become necessary).

The alternatives were much less reasonable.  One is to have the entire
complex chains in any script wanting to use `.integration-daemon-start`
/ `.integration-daemon-stop` be chained together with `&&` in an `if`
block, which is untenable.  The other I could think of was taking the
body of these scripts out into separate scripts, essentially meaning
we'd need two files for each of these, which further complicates the
maintenance.

Add to that the fact that our `trap ... EXIT` is scoped to the enclosing
subshell (`( ... )`) and we're in even more reasonable territory with
this pattern.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 929af4c38d8ca4754d2a3ccf087d359bb67c33f3
Component: engine
2015-04-23 11:31:16 -06:00
2c94df895a Validate we're not using the old testing stuff
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: ecccfa82aa22829c52778c4457cacd8d766e3dda
Component: engine
2015-04-23 10:29:47 -07:00
73573e4387 Merge pull request #12376 from Mic92/refactor-hack
Refactor shellscripts
Upstream-commit: e3e1c2be42d3aa6c4da7fe4286c2937bf55c4c0d
Component: engine
2015-04-22 12:12:44 -07:00
64b904ff2d hack/make/test-integration-cli: introduce MAKEDIR variable
- every execution of dirname costs time
- less repeating

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: 6533cb973f6bab672018148fd6a67644580cc61f
Component: engine
2015-04-15 10:44:14 +02:00
29eeea7d5f hack: quote all parameters with variable interpolation
better safe then sorry. especially for rm

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: ac20568b0a62c794c0f1190703f051bd1cfac341
Component: engine
2015-04-15 10:14:14 +02:00
2cc2a96cc1 Enable "netgo" library when we build a static binary with gccgo
Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
Upstream-commit: bcd5e20a094e63093a95840f4f3342d981752708
Component: engine
2015-04-13 21:33:04 -04:00
8259affad5 Merge pull request #12111 from tianon/builder-deb
Add "builder-deb" base images for building ".deb" packages properly
Upstream-commit: 8652ca5d5f56590651e7500b097566083bb1a0da
Component: engine
2015-04-13 13:41:17 -07:00
73aea16588 change tabs to spaces
Signed-off-by: Jessica Frazelle <jess@docker.com>
Upstream-commit: f3ba0a6a3505f5c5c690b84a4db2255fea9af18f
Component: engine
2015-04-13 12:48:40 -07:00
ddcc756587 Adds validate-vet script
resolves #11970

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: 3280ce651b13866f93440b60a9182f9a4f9f14b9
Component: engine
2015-04-13 12:48:05 -07:00
edaf94ae65 Use HTTPS for package URL
Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 67a983fc372e7b5fd1c75d1ceafe9b79b84d7e92
Component: engine
2015-04-11 13:21:16 -04:00