Skip to content

Commit

Permalink
[24.0] stop building plugin packages
Browse files Browse the repository at this point in the history
Now that 25.0.0 has been released, plugin packages are built as part
of that release, so there's no longer a need to build them from this
branch.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 40dee11)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Jan 24, 2024
1 parent 1862b1b commit 43b3774
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 268 deletions.
20 changes: 2 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ clean-src:
$(RM) -r src

.PHONY: src
src: src/github.com/docker/cli src/github.com/docker/docker src/github.com/docker/buildx src/github.com/docker/compose ## clone source
src: src/github.com/docker/cli src/github.com/docker/docker ## clone source

ifdef CLI_DIR
src/github.com/docker/cli:
Expand All @@ -37,14 +37,6 @@ src/github.com/docker/docker:
git -C $@ remote add origin "$(DOCKER_ENGINE_REPO)"
endif

src/github.com/docker/buildx:
git init $@
git -C $@ remote add origin "$(DOCKER_BUILDX_REPO)"

src/github.com/docker/compose:
git init $@
git -C $@ remote add origin "$(DOCKER_COMPOSE_REPO)"

.PHONY: checkout-cli
checkout-cli: src/github.com/docker/cli
./scripts/checkout.sh src/github.com/docker/cli "$(DOCKER_CLI_REF)"
Expand All @@ -53,16 +45,8 @@ checkout-cli: src/github.com/docker/cli
checkout-docker: src/github.com/docker/docker
./scripts/checkout.sh src/github.com/docker/docker "$(DOCKER_ENGINE_REF)"

.PHONY: checkout-buildx
checkout-buildx: src/github.com/docker/buildx
./scripts/checkout.sh src/github.com/docker/buildx "$(DOCKER_BUILDX_REF)"

.PHONY: checkout-compose
checkout-compose: src/github.com/docker/compose
./scripts/checkout.sh src/github.com/docker/compose "$(DOCKER_COMPOSE_REF)"

.PHONY: checkout
checkout: checkout-cli checkout-docker checkout-buildx checkout-compose ## checkout source at the given reference(s)
checkout: checkout-cli checkout-docker ## checkout source at the given reference(s)

.PHONY: clean
clean: clean-src ## remove build artifacts
Expand Down
4 changes: 0 additions & 4 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ VERSION?=0.0.1-dev
# the source from. These can be overridden to build from a fork.
DOCKER_CLI_REPO ?= https://github.com/docker/cli.git
DOCKER_ENGINE_REPO ?= https://github.com/docker/docker.git
DOCKER_COMPOSE_REPO ?= https://github.com/docker/compose.git
DOCKER_BUILDX_REPO ?= https://github.com/docker/buildx.git

# REF can be used to specify the same branch or tag to use for *both* the CLI
# and Engine source code. This can be useful if both the CLI and Engine have a
Expand All @@ -38,8 +36,6 @@ DOCKER_BUILDX_REPO ?= https://github.com/docker/buildx.git
REF ?= HEAD
DOCKER_CLI_REF ?= $(REF)
DOCKER_ENGINE_REF ?= $(REF)
DOCKER_COMPOSE_REF ?= v2.21.0
DOCKER_BUILDX_REF ?= v0.11.2

# Use "stage" to install dependencies from download-stage.docker.com during the
# verify step. Leave empty or use any other value to install from download.docker.com
Expand Down
26 changes: 1 addition & 25 deletions deb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ GO_BASE_IMAGE=golang
GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)-bookworm
EPOCH?=5
GEN_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/cli) "$(VERSION)")
GEN_BUILDX_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/buildx) "$(DOCKER_BUILDX_REF)")
GEN_COMPOSE_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/compose) "$(DOCKER_COMPOSE_REF)")
CLI_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/cli) && git rev-parse --short HEAD)
ENGINE_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/docker) && git rev-parse --short HEAD)
BUILDX_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/buildx) && git rev-parse --short HEAD)

ifdef BUILD_IMAGE
BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
Expand All @@ -34,11 +31,6 @@ RUN?=docker run --rm \
-e VERSION=$(word 2, $(GEN_DEB_VER)) \
-e CLI_GITCOMMIT=$(CLI_GITCOMMIT) \
-e ENGINE_GITCOMMIT=$(ENGINE_GITCOMMIT) \
-e BUILDX_VERSION=$(DOCKER_BUILDX_REF) \
-e BUILDX_DEB_VERSION=$(word 1, $(GEN_BUILDX_DEB_VER)) \
-e BUILDX_GITCOMMIT=$(BUILDX_GITCOMMIT) \
-e COMPOSE_VERSION=$(DOCKER_COMPOSE_REF) \
-e COMPOSE_DEB_VERSION=$(word 1, $(GEN_COMPOSE_DEB_VER)) \
-v $(CURDIR)/debbuild/$@:/build \
$(RUN_FLAGS) \
debbuild-$@/$(ARCH)
Expand Down Expand Up @@ -81,7 +73,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: sources/cli.tgz sources/engine.tgz

sources/engine.tgz:
mkdir -p $(@D)
Expand All @@ -99,22 +91,6 @@ sources/cli.tgz:
alpine \
tar -C / -c -z -f /v/cli.tgz --exclude .git cli

sources/buildx.tgz:
mkdir -p $(@D)
docker run --rm -w /v \
-v $(realpath $(CURDIR)/../src/github.com/docker/buildx):/buildx \
-v $(CURDIR)/$(@D):/v \
alpine \
tar -C / -c -z -f /v/buildx.tgz --exclude .git buildx

sources/compose.tgz:
mkdir -p $(@D)
docker run --rm -w /v \
-v $(realpath $(CURDIR)/../src/github.com/docker/compose):/compose \
-v $(CURDIR)/$(@D):/v \
alpine \
tar -C / -c -z -f /v/compose.tgz --exclude .git compose

# 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
6 changes: 0 additions & 6 deletions deb/build-deb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ mkdir -p /root/build-deb/engine
tar -C /root/build-deb -xzf /sources/engine.tgz
mkdir -p /root/build-deb/cli
tar -C /root/build-deb -xzf /sources/cli.tgz
mkdir -p /root/build-deb/buildx
tar -C /root/build-deb -xzf /sources/buildx.tgz
mkdir -p /root/build-deb/compose
tar -C /root/build-deb -xzf /sources/compose.tgz

# link them to their canonical path
mkdir -p /go/src/github.com/docker
ln -snf /root/build-deb/engine /go/src/github.com/docker/docker
ln -snf /root/build-deb/cli /go/src/github.com/docker/cli
ln -snf /root/build-deb/buildx /go/src/github.com/docker/buildx
ln -snf /root/build-deb/compose /go/src/github.com/docker/compose

EPOCH="${EPOCH:-}"
EPOCH_SEP=""
Expand Down
20 changes: 0 additions & 20 deletions deb/common/control
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,3 @@ Description: Rootless support for Docker.
This package contains RootlessKit, but does not contain VPNKit.
Either VPNKit or slirp4netns (>= 0.4.0) needs to be installed separately.
Homepage: https://docs.docker.com/engine/security/rootless/

Package: docker-buildx-plugin
Priority: optional
Replaces: docker-ce-cli
Architecture: linux-any
Enhances: docker-ce-cli
Description: Docker Buildx cli plugin.
Homepage: https://github.com/docker/buildx

Package: docker-compose-plugin
Priority: optional
Architecture: linux-any
Enhances: docker-ce-cli
Description: Docker Compose (V2) plugin for the Docker CLI.
.
This plugin provides the 'docker compose' subcommand.
.
The binary can also be run standalone as a direct replacement for
Docker Compose V1 ('docker-compose').
Homepage: https://github.com/docker/compose
39 changes: 0 additions & 39 deletions deb/common/rules
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,13 @@ override_dh_auto_build:
# 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 buildx plugin
cd /go/src/github.com/docker/buildx \
&& mkdir -p /usr/libexec/docker/cli-plugins/ \
&& GO111MODULE=on \
CGO_ENABLED=0 \
go build \
-mod=vendor \
-trimpath \
-ldflags "-X github.com/docker/buildx/version.Version=$(BUILDX_VERSION) -X github.com/docker/buildx/version.Revision=$(BUILDX_GITCOMMIT) -X github.com/docker/buildx/version.Package=github.com/docker/buildx" \
-o "/usr/libexec/docker/cli-plugins/docker-buildx" \
./cmd/buildx

# Build the compose plugin
cd /go/src/github.com/docker/compose \
&& make VERSION=$(COMPOSE_VERSION) DESTDIR=/usr/libexec/docker/cli-plugins build

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)

ver="$$(cli/build/docker --version)"; \
test "$$ver" = "Docker version $(VERSION), build $(CLI_GITCOMMIT)" && echo "PASS: cli version OK" || (echo "FAIL: cli version ($$ver) did not match" && exit 1)

ver="$$(/usr/libexec/docker/cli-plugins/docker-buildx docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $$1 == "Version" { print $$2 }')"; \
test "$$ver" = "$(BUILDX_VERSION)" && echo "PASS: docker-buildx version OK" || (echo "FAIL: docker-buildx version ($$ver) did not match" && exit 1)

ver="$$(/usr/libexec/docker/cli-plugins/docker-compose docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $$1 == "Version" { print $$2 }')"; \
test "$$ver" = "$(COMPOSE_VERSION)" && echo "PASS: docker-compose version OK" || (echo "FAIL: docker-compose version ($$ver) did not match" && exit 1)

override_dh_strip:
# Go has lots of problems with stripping, so just don't

Expand All @@ -68,12 +46,6 @@ override_dh_auto_install:
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/libexec/docker/docker-init

# docker-buildx-plugin install
install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-buildx debian/docker-buildx-plugin/usr/libexec/docker/cli-plugins/docker-buildx

# docker-compose-plugin install
install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-compose debian/docker-compose-plugin/usr/libexec/docker/cli-plugins/docker-compose

# 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
Expand All @@ -97,16 +69,5 @@ override_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 buildx-plugin package, then generate the other control files as usual
# TODO override "Source" field in control as well (to point to buildx, as it doesn't match the package name)
dh_gencontrol -pdocker-buildx-plugin -- -v$${BUILDX_DEB_VERSION#v}-$${PKG_REVISION}~$${DISTRO}.$${VERSION_ID}~$${SUITE}

# Use separate version for the compose-plugin package, then generate the other control files as usual
# TODO override "Source" field in control as well (to point to compose, as it doesn't match the package name)
dh_gencontrol -pdocker-compose-plugin -- -v$${COMPOSE_DEB_VERSION#v}-$${PKG_REVISION}~$${DISTRO}.$${VERSION_ID}~$${SUITE}

dh_gencontrol --remaining-packages

%:
dh $@ --with=bash-completion
28 changes: 2 additions & 26 deletions rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ PLUGINS_DIR=$(realpath $(CURDIR)/../plugins)
GO_BASE_IMAGE=golang
GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)-bookworm
GEN_RPM_VER=$(shell ./gen-rpm-ver $(realpath $(CURDIR)/../src/github.com/docker/cli) "$(VERSION)")
GEN_BUILDX_RPM_VER=$(shell ./gen-rpm-ver $(realpath $(CURDIR)/../src/github.com/docker/buildx) "$(DOCKER_BUILDX_REF)")
GEN_COMPOSE_RPM_VER=$(shell ./gen-rpm-ver $(realpath $(CURDIR)/../src/github.com/docker/compose) "$(DOCKER_COMPOSE_REF)")
CLI_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/cli) && git rev-parse --short HEAD)
ENGINE_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/docker) && git rev-parse --short HEAD)
BUILDX_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/buildx) && git rev-parse --short HEAD)

ifdef BUILD_IMAGE
BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
Expand All @@ -22,7 +19,7 @@ BUILD?=DOCKER_BUILDKIT=1 \
.


SPEC_FILES?=docker-ce.spec docker-ce-cli.spec docker-ce-rootless-extras.spec docker-buildx-plugin.spec docker-compose-plugin.spec
SPEC_FILES?=docker-ce.spec docker-ce-cli.spec docker-ce-rootless-extras.spec

SPECS?=$(addprefix SPECS/, $(SPEC_FILES))
RPMBUILD_FLAGS?=-ba\
Expand All @@ -31,11 +28,6 @@ RPMBUILD_FLAGS?=-ba\
--define '_release $(word 2,$(GEN_RPM_VER))' \
--define '_version $(word 1,$(GEN_RPM_VER))' \
--define '_origversion $(word 4, $(GEN_RPM_VER))' \
--define '_buildx_rpm_version $(word 1,$(GEN_BUILDX_RPM_VER))' \
--define '_buildx_version $(word 4,$(GEN_BUILDX_RPM_VER))' \
--define '_buildx_gitcommit $(BUILDX_GITCOMMIT)' \
--define '_compose_rpm_version $(word 1,$(GEN_COMPOSE_RPM_VER))' \
--define '_compose_version $(word 4,$(GEN_COMPOSE_RPM_VER))' \
$(RPMBUILD_EXTRA_FLAGS) \
$(SPECS)

Expand Down Expand Up @@ -91,7 +83,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
sources: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz

rpmbuild/SOURCES/engine.tgz:
mkdir -p $(@D)
Expand All @@ -109,22 +101,6 @@ rpmbuild/SOURCES/cli.tgz:
alpine \
tar -C / -c -z -f /v/cli.tgz --exclude .git cli

rpmbuild/SOURCES/buildx.tgz:
mkdir -p $(@D)
docker run --rm -w /v \
-v $(realpath $(CURDIR)/../src/github.com/docker/buildx):/buildx \
-v $(CURDIR)/$(@D):/v \
alpine \
tar -C / -c -z -f /v/buildx.tgz --exclude .git buildx

rpmbuild/SOURCES/compose.tgz:
mkdir -p $(@D)
docker run --rm -w /v \
-v $(realpath $(CURDIR)/../src/github.com/docker/compose):/compose \
-v $(CURDIR)/$(@D):/v \
alpine \
tar -C / -c -z -f /v/compose.tgz --exclude .git compose

# 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
53 changes: 0 additions & 53 deletions rpm/SPECS/docker-buildx-plugin.spec

This file was deleted.

Loading

0 comments on commit 43b3774

Please sign in to comment.