-
Notifications
You must be signed in to change notification settings - Fork 163
[master] add docker-compose-plugin package (deb, rpm) #553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,15 @@ 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 the compose plugin | ||
| # FIXME: using GOPROXY, to work around: | ||
| # go: github.com/Azure/azure-sdk-for-go@v48.2.0+incompatible: reading github.com/Azure/azure-sdk-for-go/go.mod at revision v48.2.0: unknown revision v48.2.0 | ||
| cd /go/src/github.com/docker/compose \ | ||
| && GOPROXY="https://proxy.golang.org" GO111MODULE=on go mod download \ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We really need to update the Dockerfiles to include the source-code in an (intermediate) stage, instead of bind-mounting from the host. Especially with go modules, we should cache those. |
||
| && mkdir -p /usr/libexec/docker/cli-plugins/ \ | ||
| && GOPROXY="https://proxy.golang.org" GO111MODULE=on GIT_TAG=$(COMPOSE_VERSION) \ | ||
| make COMPOSE_BINARY=/usr/libexec/docker/cli-plugins/docker-compose -f builder.Makefile compose-plugin | ||
|
|
||
| # Build the scan-plugin | ||
| # TODO change once we support scan-plugin on other architectures | ||
| if [ "$(TARGET_ARCH)" = "amd64" ]; then \ | ||
|
|
@@ -40,6 +49,9 @@ override_dh_auto_test: | |
| 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-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) | ||
|
|
||
| # FIXME: --version currently doesn't work as it makes a connection to the daemon, so using the plugin metadata instead | ||
| # TODO change once we support scan-plugin on other architectures | ||
| if [ "$(TARGET_ARCH)" = "amd64" ]; then \ | ||
|
|
@@ -69,6 +81,9 @@ 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/bin/docker-init | ||
|
|
||
| # 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-scan-plugin install | ||
| # TODO change once we support scan-plugin on other architectures | ||
| if [ "$(TARGET_ARCH)" = "amd64" ]; then \ | ||
|
|
@@ -95,6 +110,10 @@ override_dh_install: | |
| dh_apparmor --profile-name=docker-ce -pdocker-ce | ||
|
|
||
| override_dh_gencontrol: | ||
| # 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_VERSION#v}~$${DISTRO}-$${SUITE} | ||
|
|
||
| # 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) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| %global debug_package %{nil} | ||
|
|
||
| Name: docker-compose-plugin | ||
| Version: %{_compose_rpm_version} | ||
| Release: %{_release}%{?dist} | ||
| Epoch: 0 | ||
| Source0: compose.tgz | ||
| Summary: Docker Compose (V2) plugin for the Docker CLI | ||
| Group: Tools/Docker | ||
| License: ASL 2.0 | ||
| URL: https://github.com/docker/compose/ | ||
| Vendor: Docker | ||
| Packager: Docker <support@docker.com> | ||
|
|
||
| BuildRequires: bash | ||
|
|
||
| %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'). | ||
|
|
||
| %prep | ||
| %setup -q -c -n src -a 0 | ||
|
|
||
| %build | ||
| pushd ${RPM_BUILD_DIR}/src/compose | ||
| # FIXME: using GOPROXY, to work around: | ||
| # go: github.com/Azure/azure-sdk-for-go@v48.2.0+incompatible: reading github.com/Azure/azure-sdk-for-go/go.mod at revision v48.2.0: unknown revision v48.2.0 | ||
| GOPROXY="https://proxy.golang.org" GO111MODULE=on go mod download | ||
| GOPROXY="https://proxy.golang.org" GO111MODULE=on GIT_TAG="%{_compose_version}" \ | ||
| make COMPOSE_BINARY="bin/docker-compose" -f builder.Makefile compose-plugin | ||
| popd | ||
|
|
||
| %check | ||
| ver="$(${RPM_BUILD_ROOT}%{_libexecdir}/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) | ||
|
|
||
| %install | ||
| pushd ${RPM_BUILD_DIR}/src/compose | ||
| install -D -p -m 0755 bin/docker-compose ${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-compose | ||
| popd | ||
|
|
||
| for f in LICENSE MAINTAINERS NOTICE README.md; do | ||
| install -D -p -m 0644 "${RPM_BUILD_DIR}/src/compose/$f" "docker-compose-plugin-docs/$f" | ||
| done | ||
|
|
||
| %files | ||
| %doc docker-compose-plugin-docs/* | ||
| %license docker-compose-plugin-docs/LICENSE | ||
| %license docker-compose-plugin-docs/NOTICE | ||
| %{_libexecdir}/docker/cli-plugins/docker-compose | ||
|
|
||
| %post | ||
|
|
||
| %preun | ||
|
|
||
| %postun | ||
|
|
||
| %changelog |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.