Commit graph

239 commits

Author SHA1 Message Date
Sebastiaan van Stijn
0e9a66d35a
logger/journald: remove journald_compat (for systemd < 209)
This was added in 6cdc4ba6cd in 2016, likely
because at the time we were still building for CentOS 6 and Ubuntu 14.04.

All currently supported distros appear to be on _at least_ 219 now, so it looks
safe to remove this;

```bash
docker run -it --rm centos:7

yum install -y systemd-devel

pkg-config 'libsystemd >= 209' && echo "OK" || echo "KO"
OK

pkg-config --print-provides 'libsystemd'
libsystemd = 219

pkg-config --print-provides 'libsystemd-journal'
libsystemd-journal = 219
```

And on a `debian:buster` (old stable)

```bash
docker run -it --rm debian:buster

apt-get update && apt-get install -y libsystemd-dev pkg-config

pkg-config 'libsystemd >= 209' && echo "OK" || echo "KO"
OK

pkg-config --print-provides 'libsystemd'
libsystemd = 241

pkg-config --print-provides 'libsystemd-journal'
Package libsystemd-journal was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd-journal.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd-journal' found
```

OpenSUSE leap (I think that's built for s390x)

```bash
docker run -it --rm docker.io/opensuse/leap:15

zypper install -y systemd-devel

pkg-config 'libsystemd >= 209' && echo "OK" || echo "KO"
OK

pkg-config --print-provides 'libsystemd'
libsystemd = 246

pkg-config --print-provides 'libsystemd-journal'
Package libsystemd-journal was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd-journal.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd-journal' found
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-20 18:48:00 +02:00
Akihiro Suda
abf2404642 hack/make.sh: remove extra empty lines
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-03 12:36:06 +09:00
Akihiro Suda
3cf82748dd run shfmt
git grep --name-only '^#!' | egrep -v '(vendor|\.go|Jenkinsfile)' | xargs shfmt -w -bn -ci -sr

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-03 12:27:49 +09:00
Brian Goff
79a52bb1ba Add support for outputing binaries to custom dir
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2019-12-02 10:21:46 -08:00
Brian Goff
675b414f56 Use -X ldflags to set dockerversion package vars
This eliminates the need to lay down an auto-generated file.
IIRC this was originally hadded for gccgo which we no longer support.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2019-12-02 10:21:41 -08:00
Tianon Gravi
7a8a9c186b
Merge pull request #39604 from seemethere/in_container_question_mark
hack: Remove inContainer check, it wasn't useful
2019-08-27 16:10:47 -07:00
Sebastiaan van Stijn
dde1fd78c7
hack/make.sh remove "latest" symlink
This symlink was added in d42753485b,
to allow finding the path to the latest built binary, because at the time,
those paths were prefixed with the version or commit (e.g. `bundles/1.5.0-dev`).

Commit bac2447964 removed the version-prefix in
paths, but kept the old symlink for backward compatiblity. However, many
things were moved since then (e.g. paths were renamed to `binary-daemon`,
and various other changes). With the symlink pointing to the symlink's parent
directory, following the symlink may result into an infinite recursion,
which can happen if scripts using wildcards / globbing to find files.

With this symlink no longer serving a real purpose, we can probably safely
remove this symlink now.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-25 16:26:14 +02:00
Eli Uriegas
e665263b10
daemon: Remove btrfs_noversion build flag
btrfs_noversion was added in d7c37b5a28
for distributions that did not have the `btrfs/version.h` header file.

Seeing how all of the distributions we currently support do have the
`btrfs/version.h` file we should probably just remove this build flag
altogether.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2019-08-06 22:55:29 +00:00
Eli Uriegas
f5cd8fdd44
hack: Remove inContainer check, it wasn't useful
The inContainer check isn't really useful anymore.

Even though it was said that we shouldn't rely on its existence back in
2016, we're now in 2019 and this thing still exists so we should just
rely on it now to check whether or not we're in a container.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2019-07-25 23:12:01 +00:00
Michael Zhao
790da6c223 Set TIMEOUT according to os/arch.
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2019-07-23 10:44:50 +08:00
Sebastiaan van Stijn
f75f34249b
Fix "Removing bundles/" not actually removing bundles
Before:

Running `ls -la bundles/` before, and after removing:

    ls -la bundles/
    total 16
    drwxr-xr-x  7 root root  224 Jul 12 12:25 .
    drwxr-xr-x  1 root root 4096 Jul 12 12:30 ..
    drwxr-xr-x  2 root root   64 Jul 12 10:00 dynbinary
    drwxr-xr-x  6 root root  192 Jul 12 12:25 dynbinary-daemon
    lrwxrwxrwx  1 root root    1 Jul 12 12:25 latest -> .
    drwxr-xr-x 92 root root 2944 Jul 12 12:29 test-integration

    Removing bundles/

    ls -la bundles/
    total 16
    drwxr-xr-x  7 root root  224 Jul 12 12:25 .
    drwxr-xr-x  1 root root 4096 Jul 12 12:30 ..
    drwxr-xr-x  2 root root   64 Jul 12 10:00 dynbinary
    drwxr-xr-x  6 root root  192 Jul 12 12:25 dynbinary-daemon
    lrwxrwxrwx  1 root root    1 Jul 12 12:25 latest -> .
    drwxr-xr-x 92 root root 2944 Jul 12 12:29 test-integration

After:

Running `ls -la bundles/` before, and after removing:

    ls -la bundles/
    total 16
    drwxr-xr-x  7 root root  224 Jul 12 12:25 .
    drwxr-xr-x  1 root root 4096 Jul 12 12:30 ..
    drwxr-xr-x  2 root root   64 Jul 12 10:00 dynbinary
    drwxr-xr-x  6 root root  192 Jul 12 12:25 dynbinary-daemon
    lrwxrwxrwx  1 root root    1 Jul 12 12:25 latest -> .
    drwxr-xr-x 92 root root 2944 Jul 12 12:29 test-integration

    Removing bundles/

    ls -la bundles/
    total 4
    drwxr-xr-x 2 root root   64 Jul 12 12:25 .
    drwxr-xr-x 1 root root 4096 Jul 12 12:30 ..

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-12 14:41:08 +02:00
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