forked from docker/docker-ce-packaging
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrules
More file actions
executable file
·92 lines (78 loc) · 4.34 KB
/
Copy pathrules
File metadata and controls
executable file
·92 lines (78 loc) · 4.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/make -f
VERSION ?= $(shell cat engine/VERSION)
TARGET_ARCH = $(shell dpkg-architecture -qDEB_TARGET_ARCH)
override_dh_auto_build:
# Build the daemon and dependencies
cd engine && DOCKER_GITCOMMIT=$(ENGINE_GITCOMMIT) PRODUCT=docker ./hack/make.sh dynbinary
cd engine && TMP_GOPATH="/go" hack/dockerfile/install/install.sh tini
cd engine && TMP_GOPATH="/go" hack/dockerfile/install/install.sh rootlesskit dynamic
# Build the CLI
cd /go/src/github.com/docker/cli && VERSION=$(VERSION) GITCOMMIT=$(CLI_GITCOMMIT) LDFLAGS='' GO_LINKMODE=dynamic ./scripts/build/binary && DISABLE_WARN_OUTSIDE_CONTAINER=1 LDFLAGS='' make manpages
# Build the scan-plugin
# TODO change once we support scan-plugin on other architectures
if [ "$(TARGET_ARCH)" = "amd64" ]; then \
cd /go/src/github.com/docker/scan-cli-plugin \
&& PLATFORM_BINARY=docker-scan COMMIT=$(SCAN_GITCOMMIT) TAG_NAME=$(SCAN_VERSION) make native-build \
&& mkdir -p /usr/libexec/docker/cli-plugins/ \
&& mv bin/docker-scan /usr/libexec/docker/cli-plugins/; \
fi
# Build the CLI plugins
# Make sure to set LDFLAGS="" since, dpkg-buildflags sets it to some weird values
set -e;cd /sources && \
tar xzf plugin-installers.tgz; \
for installer in plugins/*.installer; do \
LDFLAGS='' bash $${installer} build; \
done
override_dh_auto_test:
./engine/bundles/dynbinary-daemon/dockerd -v
./cli/build/docker -v
override_dh_strip:
# Go has lots of problems with stripping, so just don't
override_dh_auto_install:
# docker-ce-cli install
install -D -m 0644 cli/contrib/completion/fish/docker.fish debian/docker-ce-cli/usr/share/fish/vendor_completions.d/docker.fish
install -D -m 0644 cli/contrib/completion/zsh/_docker debian/docker-ce-cli/usr/share/zsh/vendor-completions/_docker
install -D -m 0755 cli/build/docker debian/docker-ce-cli/usr/bin/docker
set -e;cd /sources && \
tar xzf plugin-installers.tgz; \
for installer in plugins/*.installer; do \
DESTDIR=/root/build-deb/debian/docker-ce-cli \
PREFIX=/usr/libexec/docker/cli-plugins \
bash $${installer} install_plugin; \
done
# docker-ce install
install -D -m 0644 engine/contrib/init/systemd/docker.service debian/docker-ce/lib/systemd/system/docker.service
install -D -m 0644 engine/contrib/init/systemd/docker.socket debian/docker-ce/lib/systemd/system/docker.socket
install -D -m 0755 $(shell readlink -e engine/bundles/dynbinary-daemon/dockerd) debian/docker-ce/usr/bin/dockerd
install -D -m 0755 $(shell readlink -e engine/bundles/dynbinary-daemon/docker-proxy) debian/docker-ce/usr/bin/docker-proxy
install -D -m 0755 /usr/local/bin/docker-init debian/docker-ce/usr/bin/docker-init
# docker-scan-plugin install
# TODO change once we support scan-plugin on other architectures
if [ "$(TARGET_ARCH)" = "amd64" ]; then \
install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-scan debian/docker-scan-plugin/usr/libexec/docker/cli-plugins/docker-scan; \
fi
# docker-ce-rootless-extras install
install -D -m 0755 /usr/local/bin/rootlesskit debian/docker-ce-rootless-extras/usr/bin/rootlesskit
install -D -m 0755 /usr/local/bin/rootlesskit-docker-proxy debian/docker-ce-rootless-extras/usr/bin/rootlesskit-docker-proxy
install -D -m 0755 engine/contrib/dockerd-rootless.sh debian/docker-ce-rootless-extras/usr/bin/dockerd-rootless.sh
install -D -m 0755 engine/contrib/dockerd-rootless-setuptool.sh debian/docker-ce-rootless-extras/usr/bin/dockerd-rootless-setuptool.sh
# TODO: how can we install vpnkit?
override_dh_installinit:
# use "docker" as our service name, not "docker-ce"
dh_installinit --name=docker
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
override_dh_install:
dh_install
# TODO Can we do this from within our container?
dh_apparmor --profile-name=docker-ce -pdocker-ce
override_dh_gencontrol:
# Use separate version for the scan-plugin package, then generate the other control files as usual
# TODO override "Source" field in control as well (to point to scan-cli-plugin, as it doesn't match the package name)
# TODO change once we support scan-plugin on other architectures (see dpkg-architecture -L)
if [ "$(TARGET_ARCH)" = "amd64" ]; then \
dh_gencontrol -pdocker-scan-plugin -- -v$${SCAN_VERSION#v}~$${DISTRO}-$${SUITE}; \
fi
dh_gencontrol --remaining-packages
%:
dh $@ --with=bash-completion $(shell command -v dh_systemd_enable > /dev/null 2>&1 && echo --with=systemd)