Commit graph

228 commits

Author SHA1 Message Date
Sebastiaan van Stijn
37498f009d
Shell scripts: fix bare variables
This makes my IDE a bit more silent :-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-10 02:50:47 +01:00
Sebastiaan van Stijn
c3650770cc
Revert "Bash scripts; use double brackets, fix bare variables, add quotes"
This reverts commit 297b30df5f.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-10 02:23:38 +01:00
Sebastiaan van Stijn
297b30df5f
Bash scripts; use double brackets, fix bare variables, add quotes
These scripts explicitly use Bash, so we should be able to use
`[[` instead of `[` (which seems to be recommended).

Also added curly brackets to some bare variables, and quoted some paths.

This makes my IDE a bit more silent :-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-24 00:05:14 +01:00
Kir Kolyshkin
bdcd81d330 go {build,test}: rm -i option, add go cache volume
Looks like -i (together with DOCKER_INCREMENTAL_BINARY etc)
were used to get faster incremental builds.

Nowdays (since Go 1.10) this is no longer the case, as
go build cache is used [1]. Here's a quote:

> You do not have to use "go test -i" or "go build -i" or
> "go install" just to get fast incremental builds. We will
> not have to teach new users those workarounds anymore.
> Everything will just be fast.

To enable go cache between builds, add a volume for /root/.cache.

[1] https://groups.google.com/forum/#!msg/golang-dev/qfa3mHN4ZPA/X2UzjNV1BAAJ

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-09-26 10:10:42 -07:00
Kazuhiro Sera
1e49fdcafc Fix the several typos detected by github.com/client9/misspell
Signed-off-by: Kazuhiro Sera <seratch@gmail.com>
2018-08-09 00:45:00 +09:00
Kir Kolyshkin
70cdb1c664 Add osusergo build tar for static binaries
Go 1.11 includes a fix to os/user to be working in a static binary
(fixing https://github.com/golang/go/issues/23265). The fix requires
`osusergo` build tag to be set for static binaries, which is what
this commit adds (also for containerd).

[v2: sort build tags alphabetically]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-07-19 12:25:46 +03:00
Dennis Chen
476d7872ef Some slight tweaks for the integration test
`arm64` needs get more time duration for the test to finish.

`pty.Start()` opens a file, so the caller should close it explicitly,
else the file I/O can result in unexpected data synchronization issue.

All those changes will not affect the test itself.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-05-21 10:08:27 +08:00
Aleksa Sarai
98fe4bd8f1
pkg: devmapper: dynamically load dm_task_deferred_remove
dm_task_deferred_remove is not supported by all distributions, due to
out-dated versions of devicemapper. However, in the case where the
devicemapper library was updated without rebuilding Docker (which can
happen in some distributions) then we should attempt to dynamically load
the relevant object rather than try to link to it.

This can only be done if Docker was built dynamically, for obvious
reasons.

In order to avoid having issues arise when dlsym(3) was unnecessary,
gate the whole dlsym(3) logic behind a buildflag that we disable by
default (libdm_dlsym_deferred_remove).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2018-02-16 17:23:23 +11:00
Daniel Nephin
1e1ad008db Remove version file
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-11-01 16:25:03 -04:00
Michael Crosby
5a9b5f10cf Remove solaris files
For obvious reasons that it is not really supported now.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-24 15:39:34 -04:00
Daniel Nephin
dbf580be57 Add a new entrypoint for CI
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-20 17:26:30 -04:00
Daniel Nephin
bac2447964 Remove version from bundle path
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-05 13:38:32 -04:00
Eli Uriegas
7664302579 Allows VERSION to be overwritten by env variable
VERSION was hardcoded to be used as the `VERSION` file from the root
directory, this makes it so that you have the option to overwrite this.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-09-01 15:47:15 -07:00
Kenfe-Mickael Laventure
45d85c9913
Update containerd to 06b9cb35161009dcb7123345749fef02f7cea8e0
This also update:
 - runc to 3f2f8b84a77f73d38244dd690525642a72156c64
 - runtime-specs to v1.0.0

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-08-21 12:04:07 -07:00
Brian Goff
31d8d2253e Merge pull request #34362 from kolyshkin/update-libdevmapper
Dockerfile*: bump devmapper library version
2017-08-14 09:56:43 -04:00
Daniel Nephin
bc82b13995 Remove test-integration-cli and references to it.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:02:57 -04:00
Vincent Demeester
6b025a8b66 Introduce test-integration target (and deprecate/freeze test-integration-cli)
This adds a new package `integration` where `engine` integration tests
should live. Those integration tests should not depends on any `cli`
components (except from the `dockerd` daemon for now — to actually
start a daemon).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-08-09 11:02:57 -04:00
Kir Kolyshkin
c4fde49a5c Dockerfile*: bump devmapper library version
Let's use latest lvm2 sources to compile the libdevmapper library.

Initial reason for compiling devmapper lib from sources was a need to
have the static version of the library at hand, in order to build
the static dockerd, but note that the same headers/solib are used
for dynamic build (dynbinary) as well.

The reason for this patch is to enable the deferral removal feature.
The supplied devmapper library (and headers) are too old, lacking the
needed functions, so the daemon is built with 'libdm_no_deferred_remove'
build tag (see the check in hack/make.sh). Because of this, even if the
kernel dm driver is perfectly able to support the feature, it can not
be used. For more details and background story, see [1].

Surely, one can't just change the version number. While at it:
 - improve the comments;
 - remove obsoleted URLs;
 - remove s390 and ppc configure updates that are no longer needed;
 - use pkg-config instead of hardcoding the flags (newer lib added
   some more dependencies);

 [1] https://github.com/moby/moby/issues/34298

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-08-01 22:08:24 -07:00
Sebastiaan van Stijn
7e4f4d15fd Merge pull request #34176 from bmwiedemann/date
Allow to override build date
2017-07-28 17:32:29 +01:00
Bernhard M. Wiedemann
760763e995 Allow to override build date
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2017-07-19 06:20:18 +02:00
Daniel Nephin
1fb615599a Remove test-unit from hack/make
Also remove the test flag from pkg/term and jsut checkuid directly.
Fixed a problem with a pkg/term test that was leaving the terminal in a bad
state.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-17 11:39:33 -04:00
Daniel Nephin
ece4520bf8 More helper hack helper functions to a more appropriate place.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-17 11:38:59 -04:00
Daniel Nephin
ea2e4d73c4 remove cli concerns from hack/make
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-21 11:20:05 -04:00
Brian Goff
470dfd69b3 Update golang to 1.8
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-05-10 20:06:27 -04:00
Arnaud Porterie (icecrime)
32915b1d0a Remove cmd/docker and other directories in cli/ in accordance with the new Moby project scope
Starting with this commit, integration tests should no longer rely on
the docker cli, they should be API tests instead. For the existing tests
the scripts will use a frozen version of the docker cli with a
DOCKER_API_VERSION frozen to 1.30, which should ensure that the CI remains
green at all times.

To help contributors develop and test manually with a modified docker
cli, this commit also adds a DOCKER_CLI_PATH environment variable to the
Makefile. This allows to set the path of a custom cli that will be
available inside the development container and used to run the
integration tests.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-05-05 12:14:29 -07:00
Vincent Demeester
b985db92a3
Fix inContainer detection which CROSSPLATFORM env variable missing
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-02 14:36:37 +01:00
Christophe Mehay
01273ad85f Force copy on make install to avoid Text file busy error
Signed-off-by: Christophe Mehay <cmehay@online.net>
2017-02-13 14:17:06 +01:00
Sebastiaan van Stijn
4af2555a35 Merge pull request #30290 from vdemeester/carry-pr-27834
Carry #27834 — Do not require `.git` in the build context
2017-02-04 19:19:16 -08:00
Vincent Demeester
617be0ef2b
Bind mount .git 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-02-03 21:00:32 +01:00
Gaël PORTAY
425cd7d1c5 Fix installation using make install
The following command fails when the target directory does not exist.

	$ sudo make install DOCKER_MAKE_INSTALL_PREFIX=/opt/docker AUTO_GOPATH=1
	KEEPBUNDLE=1 hack/make.sh install-binary
	# WARNING! I don't seem to be running in a Docker container.
	# The result of this command might be an incorrect build, and will not be
	# officially supported.
	#
	# Try this instead: make all
	#

	---> Making bundle: install-binary (in bundles/1.14.0-dev/install-binary)
	Installing docker to /opt/docker/bin/
	cp: cannot create regular file '/opt/docker/bin/': No such file or directory
	make: *** [Makefile:119: install] Error 1

The patch installs the target directory before copying any binaries.

	$ sudo make install DOCKER_MAKE_INSTALL_PREFIX=/opt/docker AUTO_GOPATH=1
	KEEPBUNDLE=1 hack/make.sh install-binary
	# WARNING! I don't seem to be running in a Docker container.
	# The result of this command might be an incorrect build, and will not be
	# officially supported.
	#
	# Try this instead: make all
	#

	---> Making bundle: install-binary (in bundles/1.14.0-dev/install-binary)
	Installing docker to /opt/docker/bin/
	Installing dockerd to /opt/docker/bin/
	Installing docker-runc to /opt/docker/bin/
	Installing docker-containerd to /opt/docker/bin/
	Installing docker-containerd-ctr to /opt/docker/bin/
	Installing docker-containerd-shim to /opt/docker/bin/
	Installing docker-proxy to /opt/docker/bin/
	Installing docker-init to /opt/docker/bin/

Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
2017-01-27 17:34:38 -05:00
Vincent Demeester
fae6ca2bb4
Do not required .git in the build context
- export DOCKER_GITCOMMIT in the Makefile
- prioritize DOCKER_GITCOMMIT against the `git` command in
  `./hack/make.sh`
- Also add `integration-cli/bundles` to gitignore (it's generated when
  using integration-cli shell)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-24 14:42:57 +01:00
Justin Cormack
f8119bb7a7 Remove sqlite
This drops support for migrations from pre-1.10 Docker versions, which
should be done via an external tool or an intermediate upgrade.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-01-18 12:27:21 +00:00
Antonio Murdaca
7b1f77dcbc
hack/make.sh: fix BUILDTIME
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-12-03 09:09:41 +01:00
John Howard
5e6f8cb4a7 Remove old Windows hack in make.sh
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-16 09:29:38 -08:00
Vincent Demeester
2c342cff79
Build docker incrementally by default
This speeds up docker build time drastically. It still possible to
disable this by setting `DOCKER_INCREMENTAL_BUILD` to `0` (and this is
what should be done on the CI).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-11-15 16:23:48 +01:00
Alexander Morozov
f2614f2107 project: use vndr for vendoring
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-03 15:31:46 -07:00
Daniel Nephin
22033e1003 Move validation out of hack/make
Allow each script to run directly without the hack/make.sh wrapper. These
scripts do not produce artifacts and do not benefit from the "bundles"
framework.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-03 14:24:22 -06:00
Qiang Huang
e6866492c4 Fix bunch of typos
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-10-29 15:03:26 +08:00
Alexander Morozov
36f47aa252 Merge pull request #27519 from justincormack/proxy-build
Build docker-proxy from git checkout like other external binaries
2016-10-25 08:54:13 -07:00
Justin Cormack
3996975b08 Build docker-proxy from git checkout like other external binaries
This means we can vendor libnetwork without special casing, and
it is built the same way as the other external binaries.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-10-25 13:13:22 +01:00
Kenfe-Mickael Laventure
7781a1bf0f Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-24 15:20:01 -07:00
Christopher Jones
f431211631
Bump remaining Dockerfile go versions to 1.7.1
These weren't updated with the switch to go1.7.1

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-09-26 12:13:39 -04:00
Michael Crosby
ee3ac3aa66 Add init process for zombie fighting
This adds a small C binary for fighting zombies.  It is mounted under
`/dev/init` and is prepended to the args specified by the user.  You
enable it via a daemon flag, `dockerd --init`, as it is disable by
default for backwards compat.

You can also override the daemon option or specify this on a per
container basis with `docker run --init=true|false`.

You can test this by running a process like this as the pid 1 in a
container and see the extra zombie that appears in the container as it
is running.

```c

int main(int argc, char ** argv) {
	pid_t pid = fork();
	if (pid == 0) {
		pid = fork();
		if (pid == 0) {
			exit(0);
		}
		sleep(3);
		exit(0);
	}
	printf("got pid %d and exited\n", pid);
	sleep(20);
}
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-19 17:33:50 -07:00
Brian Goff
4d0275c819 Verify integration tests before building bundles
Adds a new bundle `verify-integration-tests` which pre-compiles a test
binary for the integration tests.

This makes sure that the integration tests will actually compile before
doing other tasks which take much longer, such as building dockerd and
loading test fixtures.
When it comes time to actually run the tests, the pre-compiled binary
will be used so it doesn't have to compile the tests a 2nd time.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-06 20:27:28 -04:00
Antonio Murdaca
12e2c2687e
Bump go to 1.7
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-08-21 19:04:15 +02:00
Vincent Demeester
5ec6e11e15
Disable coverage on test-integration-cli
Temporarly remove cover bundle from defaults.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-18 22:12:24 +02:00
Daniel Nephin
1d945a9743 Support interactive integration testing.
Interactive integration testing is useful when you're developing new tests, or
making changes to cli code.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-05 12:07:28 -04:00
Sebastiaan van Stijn
589bafddf3
bump Go to 1.6.3
following the announcement;
https://groups.google.com/forum/m/#!topic/golang-announce/7JTsd70ZAT0

> [security] Go 1.6.3 and Go 1.7rc2 pre-announcement
>
> Hello gophers,
> We plan to issue Go 1.6.3 and Go 1.7rc2 on Monday July 18 at approximately 2am UTC.
> These are minor release to fix a security issue.
>
> Following our policy at https://golang.org/security, this is the pre-announcement of those releases.
>
> Because we are so late in the release cycle for Go 1.7, we will not issue a minor release of Go 1.5.
> Additionally, we plan to issue Go 1.7rc3 later next week, which will include any changes between 1.7rc1 and tip.
>
> Cheers,
> Chris on behalf of the Go team

**Note:**
the man/Dockerfile is not yet updated, because
the official image for Go 1.6.2 has not yet
been updated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-07-18 23:15:03 +02:00
Sebastiaan van Stijn
726ef47d5c Merge pull request #23215 from BlackYoup/pkg-config
make.sh: use PKG_CONFIG environment variable if it exists
2016-06-03 15:04:37 +02:00
Brian Goff
9bb54f89ad
Add make install task
This installs docker and dockerd to `$DOCKER_MAKE_INSTALL_PREFIX/bin`, which
defaults to `/usr/local/bin`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-03 12:08:33 +02:00