Skip to content

Commit

Permalink
remove obsolete plugin installers
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Mar 27, 2022
1 parent 97b6ad8 commit 4f48724
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 207 deletions.
9 changes: 1 addition & 8 deletions deb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ $(DISTROS): sources
$(CHOWN) -R $(shell id -u):$(shell id -g) "debbuild/$@"

.PHONY: sources
sources: sources/cli.tgz sources/engine.tgz sources/buildx.tgz sources/compose.tgz sources/scan-cli-plugin.tgz sources/plugin-installers.tgz
sources: sources/cli.tgz sources/engine.tgz sources/buildx.tgz sources/compose.tgz sources/scan-cli-plugin.tgz

sources/engine.tgz:
mkdir -p $(@D)
Expand Down Expand Up @@ -121,13 +121,6 @@ sources/scan-cli-plugin.tgz:
alpine \
tar -C / -c -z -f /v/scan-cli-plugin.tgz --exclude .git scan-cli-plugin

sources/plugin-installers.tgz: $(wildcard ../plugins/*)
docker run --rm -w /v \
-v $(PLUGINS_DIR):/plugins \
-v $(CURDIR)/$(@D):/v \
alpine \
tar -C / -c -z -f /v/plugin-installers.tgz --exclude .git plugins

# See ARCHES in common.mk. Could not figure out how to match both distro and arch.
BUNDLES:=$(addsuffix .tar.gz,$(addprefix debbuild/bundles-ce-%-,$(ARCHES)))

Expand Down
16 changes: 1 addition & 15 deletions deb/common/rules
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ override_dh_auto_build:
&& 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:
ver="$$(engine/bundles/dynbinary-daemon/dockerd --version)"; \
test "$$ver" = "Docker version $(VERSION), build $(ENGINE_GITCOMMIT)" && echo "PASS: daemon version OK" || (echo "FAIL: daemon version ($$ver) did not match" && exit 1)
Expand Down Expand Up @@ -75,13 +67,7 @@ override_dh_auto_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
Expand Down
37 changes: 0 additions & 37 deletions plugins/.common

This file was deleted.

34 changes: 0 additions & 34 deletions plugins/buildx.installer.disabled

This file was deleted.

40 changes: 0 additions & 40 deletions plugins/scan.installer.disabled

This file was deleted.

9 changes: 1 addition & 8 deletions rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $(DISTROS): sources
$(CHOWN) -R $(shell id -u):$(shell id -g) "rpmbuild/$@"

.PHONY: sources
sources: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz rpmbuild/SOURCES/buildx.tgz rpmbuild/SOURCES/compose.tgz rpmbuild/SOURCES/scan-cli-plugin.tgz rpmbuild/SOURCES/plugin-installers.tgz
sources: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz rpmbuild/SOURCES/buildx.tgz rpmbuild/SOURCES/compose.tgz rpmbuild/SOURCES/scan-cli-plugin.tgz

rpmbuild/SOURCES/engine.tgz:
mkdir -p $(@D)
Expand Down Expand Up @@ -143,13 +143,6 @@ rpmbuild/SOURCES/scan-cli-plugin.tgz:
alpine \
tar -C / -c -z -f /v/scan-cli-plugin.tgz --exclude .git scan-cli-plugin

rpmbuild/SOURCES/plugin-installers.tgz: $(wildcard ../plugins/*)
docker run --rm -w /v \
-v $(PLUGINS_DIR):/plugins \
-v $(CURDIR)/$(@D):/v \
alpine \
tar -C / -c -z -f /v/plugin-installers.tgz --exclude .git plugins

# See ARCHES in common.mk. Could not figure out how to match both distro and arch.
BUNDLES:=$(addsuffix .tar.gz,$(addprefix rpmbuild/bundles-ce-%-,$(ARCHES)))

Expand Down
24 changes: 1 addition & 23 deletions rpm/SPECS/docker-ce-cli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Summary: The open-source application container engine
Group: Tools/Docker
License: ASL 2.0
Source0: cli.tgz
Source1: plugin-installers.tgz
URL: https://www.docker.com
Vendor: Docker
Packager: Docker <[email protected]>
Expand Down Expand Up @@ -65,7 +64,7 @@ for deploying and scaling web apps, databases, and backend services without
depending on a particular stack or provider.

%prep
%setup -q -c -n src -a 1
%setup -q -c -n src -a 0

%build
mkdir -p /go/src/github.com/docker
Expand All @@ -75,16 +74,6 @@ pushd /go/src/github.com/docker/cli
VERSION=%{_origversion} GITCOMMIT=%{_gitcommit_cli} GO_LINKMODE=dynamic ./scripts/build/binary && DISABLE_WARN_OUTSIDE_CONTAINER=1 make manpages # cli
popd

# Build all associated plugins
pushd ${RPM_BUILD_DIR}/src/plugins
for installer in *.installer; do
if [ "${installer}" != "scan.installer" ]; then
bash ${installer} build
fi
done
popd


%check
ver="$(cli/build/docker --version)"; \
test "$ver" = "Docker version %{_origversion}, build %{_gitcommit_cli}" && echo "PASS: cli version OK" || (echo "FAIL: cli version ($ver) did not match" && exit 1)
Expand All @@ -94,17 +83,6 @@ ver="$(cli/build/docker --version)"; \
install -d ${RPM_BUILD_ROOT}%{_bindir}
install -p -m 755 cli/build/docker ${RPM_BUILD_ROOT}%{_bindir}/docker

# install plugins
pushd ${RPM_BUILD_DIR}/src/plugins
for installer in *.installer; do
if [ "${installer}" != "scan.installer" ]; then
DESTDIR=${RPM_BUILD_ROOT} \
PREFIX=%{_libexecdir}/docker/cli-plugins \
bash ${installer} install_plugin
fi
done
popd

# add bash, zsh, and fish completions
install -d ${RPM_BUILD_ROOT}%{_datadir}/bash-completion/completions
install -d ${RPM_BUILD_ROOT}%{_datadir}/zsh/vendor-completions
Expand Down
32 changes: 2 additions & 30 deletions static/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ buildx:
docker buildx inspect | grep -q 'Driver: docker-container' || docker buildx create --use

.PHONY: cross-mac
cross-mac: buildx cross-mac-plugins
cross-mac: buildx
cd $(CLI_DIR) && VERSION=$(GEN_STATIC_VER) docker buildx bake --set binary.platform=darwin/amd64,darwin/arm64 binary
dest=$$PWD/build/mac; cd $(CLI_DIR)/build && for platform in *; do \
arch=$$(echo $$platform | cut -d_ -f2); \
Expand All @@ -82,7 +82,7 @@ cross-mac: buildx cross-mac-plugins
done

.PHONY: cross-win
cross-win: cross-win-engine cross-win-plugins
cross-win: cross-win-engine
cd $(CLI_DIR) && VERSION=$(GEN_STATIC_VER) docker buildx bake --set binary.platform=windows/amd64 binary
mkdir -p build/win/amd64/docker
cp $(CLI_DIR)/build/docker-windows-amd64.exe build/win/amd64/docker/docker.exe
Expand Down Expand Up @@ -116,31 +116,3 @@ cross-all-cli:
.PHONY: cross-win-engine
cross-win-engine:
$(MAKE) -C $(ENGINE_DIR) VERSION=$(GEN_STATIC_VER) DOCKER_CROSSPLATFORMS=windows/amd64 DOCKER_BUILD_OPTS="$(DOCKER_BUILD_OPTS)" cross

BUILD_PLUGIN_RUN_VARS = --rm \
-e GOOS \
-e GOARCH \
-v "$(CURDIR)/build/$(CLI_BUILD_DIR)/$*/docker/cli-plugins":/out \
-v "$(CURDIR)/../plugins":/plugins:ro \
-v "$(CURDIR)/scripts/build-cli-plugins":/build:ro

.PHONY: cross-mac-plugins
cross-mac-plugins: cross-mac-plugins-amd64 cross-mac-plugins-arm64

.PHONY: cross-mac-plugins-%
cross-mac-plugins-%: CLI_BUILD_DIR := mac
cross-mac-plugins-%:
mkdir -p build/$(CLI_BUILD_DIR)/$*/docker
GOOS=darwin GOARCH=$* docker run $(BUILD_PLUGIN_RUN_VARS) $(DOCKER_CLI_GOLANG_IMG) /build
$(CHOWN) -R $(shell id -u):$(shell id -g) build/$(CLI_BUILD_DIR)/$*

.PHONY: cross-win-plugins
cross-win-plugins: cross-win-plugins-amd64

.PHONY: cross-win-plugins-%
cross-win-plugins-%: CLI_BUILD_DIR := win
cross-win-plugins-%:
mkdir -p build/$(CLI_BUILD_DIR)/$*/docker/cli-plugins
GOOS=windows GOARCH=$* docker run $(BUILD_PLUGIN_RUN_VARS) $(DOCKER_CLI_GOLANG_IMG) /build
$(CHOWN) -R $(shell id -u):$(shell id -g) build/$(CLI_BUILD_DIR)/$*
find build/$(CLI_BUILD_DIR)/$*/docker -type f -not -name "*.exe" -exec mv {} {}.exe \;
12 changes: 0 additions & 12 deletions static/scripts/build-cli-plugins

This file was deleted.

0 comments on commit 4f48724

Please sign in to comment.