2019-08-15 00:48:38 +03:00
|
|
|
include common.mk
|
|
|
|
|
2020-04-23 14:38:20 +03:00
|
|
|
STATIC_VERSION=$(shell static/gen-static-ver $(realpath $(CURDIR)/src/github.com/docker/docker) $(VERSION))
|
2017-05-20 08:11:06 +03:00
|
|
|
|
2018-08-02 21:32:44 +03:00
|
|
|
# Taken from: https://www.cmcrossroads.com/article/printing-value-makefile-variable
|
|
|
|
print-% : ; @echo $($*)
|
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: help
|
2017-05-20 08:11:06 +03:00
|
|
|
help: ## show make targets
|
|
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
|
|
|
|
2020-04-23 14:38:20 +03:00
|
|
|
.PHONY: clean-src
|
|
|
|
clean-src:
|
|
|
|
[ ! -d src ] || $(CHOWN) -R $(shell id -u):$(shell id -g) src
|
|
|
|
$(RM) -r src
|
|
|
|
|
|
|
|
.PHONY: src
|
deb: add docker-compose-plugin package
Adds a deb package for the docker-compose cli plugin
with this:
dpkg -i ./docker-ce-cli_0.0.0-20210629140245-4a6fe51-0~ubuntu-focal_amd64.deb
dpkg -i ./docker-compose-plugin_2.3.1.3~ubuntu-focal_amd64.deb
docker info --format '{{json .ClientInfo.Plugins}}' | jq .
[
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v0.5.1-docker",
"ShortDescription": "Build with BuildKit",
"Name": "buildx",
"Path": "/usr/libexec/docker/cli-plugins/docker-buildx"
},
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v2.3.1",
"ShortDescription": "Docker Compose",
"Name": "compose",
"Path": "/usr/libexec/docker/cli-plugins/docker-compose"
}
]
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-03 14:01:16 +03:00
|
|
|
src: src/github.com/docker/cli src/github.com/docker/docker src/github.com/docker/compose src/github.com/docker/scan-cli-plugin ## clone source
|
2020-04-23 14:38:20 +03:00
|
|
|
|
|
|
|
ifdef CLI_DIR
|
|
|
|
src/github.com/docker/cli:
|
|
|
|
mkdir -p "$(@D)"
|
|
|
|
cp -r "$(CLI_DIR)" $@
|
|
|
|
else
|
|
|
|
src/github.com/docker/cli:
|
2020-04-23 15:07:53 +03:00
|
|
|
git init $@
|
|
|
|
git -C $@ remote add origin "$(DOCKER_CLI_REPO)"
|
2020-04-23 14:38:20 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef ENGINE_DIR
|
|
|
|
src/github.com/docker/docker:
|
|
|
|
mkdir -p "$(@D)"
|
|
|
|
cp -r "$(ENGINE_DIR)" $@
|
|
|
|
else
|
|
|
|
src/github.com/docker/docker:
|
2020-04-23 15:07:53 +03:00
|
|
|
git init $@
|
|
|
|
git -C $@ remote add origin "$(DOCKER_ENGINE_REPO)"
|
2020-04-23 14:38:20 +03:00
|
|
|
endif
|
|
|
|
|
deb: add docker-compose-plugin package
Adds a deb package for the docker-compose cli plugin
with this:
dpkg -i ./docker-ce-cli_0.0.0-20210629140245-4a6fe51-0~ubuntu-focal_amd64.deb
dpkg -i ./docker-compose-plugin_2.3.1.3~ubuntu-focal_amd64.deb
docker info --format '{{json .ClientInfo.Plugins}}' | jq .
[
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v0.5.1-docker",
"ShortDescription": "Build with BuildKit",
"Name": "buildx",
"Path": "/usr/libexec/docker/cli-plugins/docker-buildx"
},
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v2.3.1",
"ShortDescription": "Docker Compose",
"Name": "compose",
"Path": "/usr/libexec/docker/cli-plugins/docker-compose"
}
]
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-03 14:01:16 +03:00
|
|
|
src/github.com/docker/compose:
|
|
|
|
git init $@
|
|
|
|
git -C $@ remote add origin "$(DOCKER_COMPOSE_REPO)"
|
|
|
|
|
2021-03-29 18:50:01 +03:00
|
|
|
src/github.com/docker/scan-cli-plugin:
|
|
|
|
git init $@
|
|
|
|
git -C $@ remote add origin "$(DOCKER_SCAN_REPO)"
|
|
|
|
|
|
|
|
|
2020-04-23 14:38:20 +03:00
|
|
|
.PHONY: checkout-cli
|
|
|
|
checkout-cli: src/github.com/docker/cli
|
2020-07-31 21:09:13 +03:00
|
|
|
./scripts/checkout.sh src/github.com/docker/cli "$(DOCKER_CLI_REF)"
|
2020-04-23 14:38:20 +03:00
|
|
|
|
|
|
|
.PHONY: checkout-docker
|
|
|
|
checkout-docker: src/github.com/docker/docker
|
2020-07-31 21:09:13 +03:00
|
|
|
./scripts/checkout.sh src/github.com/docker/docker "$(DOCKER_ENGINE_REF)"
|
2020-04-23 14:38:20 +03:00
|
|
|
|
deb: add docker-compose-plugin package
Adds a deb package for the docker-compose cli plugin
with this:
dpkg -i ./docker-ce-cli_0.0.0-20210629140245-4a6fe51-0~ubuntu-focal_amd64.deb
dpkg -i ./docker-compose-plugin_2.3.1.3~ubuntu-focal_amd64.deb
docker info --format '{{json .ClientInfo.Plugins}}' | jq .
[
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v0.5.1-docker",
"ShortDescription": "Build with BuildKit",
"Name": "buildx",
"Path": "/usr/libexec/docker/cli-plugins/docker-buildx"
},
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v2.3.1",
"ShortDescription": "Docker Compose",
"Name": "compose",
"Path": "/usr/libexec/docker/cli-plugins/docker-compose"
}
]
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-03 14:01:16 +03:00
|
|
|
.PHONY: checkout-compose
|
|
|
|
checkout-compose: src/github.com/docker/compose
|
|
|
|
./scripts/checkout.sh src/github.com/docker/compose "$(DOCKER_COMPOSE_REF)"
|
|
|
|
|
2021-03-29 18:50:01 +03:00
|
|
|
.PHONY: checkout-scan-cli-plugin
|
|
|
|
checkout-scan-cli-plugin: src/github.com/docker/scan-cli-plugin
|
|
|
|
./scripts/checkout.sh src/github.com/docker/scan-cli-plugin "$(DOCKER_SCAN_REF)"
|
|
|
|
|
2020-04-23 14:38:20 +03:00
|
|
|
.PHONY: checkout
|
deb: add docker-compose-plugin package
Adds a deb package for the docker-compose cli plugin
with this:
dpkg -i ./docker-ce-cli_0.0.0-20210629140245-4a6fe51-0~ubuntu-focal_amd64.deb
dpkg -i ./docker-compose-plugin_2.3.1.3~ubuntu-focal_amd64.deb
docker info --format '{{json .ClientInfo.Plugins}}' | jq .
[
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v0.5.1-docker",
"ShortDescription": "Build with BuildKit",
"Name": "buildx",
"Path": "/usr/libexec/docker/cli-plugins/docker-buildx"
},
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v2.3.1",
"ShortDescription": "Docker Compose",
"Name": "compose",
"Path": "/usr/libexec/docker/cli-plugins/docker-compose"
}
]
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-03 14:01:16 +03:00
|
|
|
checkout: checkout-cli checkout-docker checkout-compose checkout-scan-cli-plugin ## checkout source at the given reference(s)
|
2018-08-02 21:32:44 +03:00
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: clean
|
2020-04-23 14:38:20 +03:00
|
|
|
clean: clean-src ## remove build artifacts
|
2017-05-20 08:11:06 +03:00
|
|
|
$(MAKE) -C rpm clean
|
|
|
|
$(MAKE) -C deb clean
|
|
|
|
$(MAKE) -C static clean
|
|
|
|
|
2021-10-22 18:35:22 +03:00
|
|
|
.PHONY: deb rpm
|
|
|
|
deb rpm: checkout ## build rpm/deb packages
|
|
|
|
$(MAKE) -C $@ VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) $@
|
2017-05-20 08:11:06 +03:00
|
|
|
|
2021-10-22 18:35:22 +03:00
|
|
|
.PHONY: centos-% fedora-% rhel-%
|
|
|
|
centos-% fedora-% rhel-%: checkout ## build rpm packages for the specified distro
|
|
|
|
$(MAKE) -C rpm VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) $@
|
|
|
|
|
|
|
|
.PHONY: debian-% raspbian-% ubuntu-%
|
|
|
|
debian-% raspbian-% ubuntu-%: checkout ## build deb packages for the specified distro
|
|
|
|
$(MAKE) -C deb VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) $@
|
2017-05-20 08:11:06 +03:00
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: static
|
2017-05-20 08:11:06 +03:00
|
|
|
static: DOCKER_BUILD_PKGS:=static-linux cross-mac cross-win cross-arm
|
2020-04-23 14:38:20 +03:00
|
|
|
static: checkout ## build static-compiled packages
|
2017-05-20 08:11:06 +03:00
|
|
|
for p in $(DOCKER_BUILD_PKGS); do \
|
2021-10-04 10:44:09 +03:00
|
|
|
$(MAKE) -C $@ VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) TARGETPLATFORM=$(TARGETPLATFORM) CONTAINERD_VERSION=$(CONTAINERD_VERSION) RUNC_VERSION=$(RUNC_VERSION) $${p}; \
|
2017-05-20 08:11:06 +03:00
|
|
|
done
|