diff options
author | William Hubbs <williamh@gentoo.org> | 2023-07-21 00:16:58 -0500 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2023-07-21 00:16:58 -0500 |
commit | b1fd8db4e18cf88571f748924e38b9291e62b06c (patch) | |
tree | 4108bf7a997e26ed6da0ab2ff3ac17aabd805f1a /app-containers/docker-cli | |
parent | app-emacs/basic-toolkit: Rename site-init file (diff) | |
download | gentoo-b1fd8db4e18cf88571f748924e38b9291e62b06c.tar.gz gentoo-b1fd8db4e18cf88571f748924e38b9291e62b06c.tar.bz2 gentoo-b1fd8db4e18cf88571f748924e38b9291e62b06c.zip |
app-containers/docker-cli: add 24.0.4-r1 for go 1.20.6
Bug: https://bugs.gentoo.org/910491
Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'app-containers/docker-cli')
-rw-r--r-- | app-containers/docker-cli/docker-cli-24.0.4-r1.ebuild | 74 | ||||
-rw-r--r-- | app-containers/docker-cli/files/docker-cli-24.0.4-vendor.patch | 78 |
2 files changed, 152 insertions, 0 deletions
diff --git a/app-containers/docker-cli/docker-cli-24.0.4-r1.ebuild b/app-containers/docker-cli/docker-cli-24.0.4-r1.ebuild new file mode 100644 index 000000000000..2f244bee6ddf --- /dev/null +++ b/app-containers/docker-cli/docker-cli-24.0.4-r1.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +GIT_COMMIT=3713ee1eea +EGO_PN="github.com/docker/cli" +MY_PV=${PV/_/-} +inherit bash-completion-r1 golang-vcs-snapshot + +DESCRIPTION="the command line binary for docker" +HOMEPAGE="https://www.docker.com/" +SRC_URI="https://github.com/docker/cli/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" +SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-man.tar.xz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86" +IUSE="hardened selinux" + +RDEPEND="!<app-containers/docker-20.10.1 + selinux? ( sec-policy/selinux-docker )" +BDEPEND=" + >=dev-lang/go-1.16.6" + +PATCHES=( + "${FILESDIR}/${P}-vendor.patch" +) + +RESTRICT="installsources strip test" + +S="${WORKDIR}/${P}/src/${EGO_PN}" + +src_unpack() { + golang-vcs-snapshot_src_unpack + set -- ${A} + unpack ${2} +} + +src_prepare() { + default + sed -i 's@dockerd\?\.exe@@g' contrib/completion/bash/docker || die +} + +src_compile() { + export DISABLE_WARN_OUTSIDE_CONTAINER=1 + export GOPATH="${WORKDIR}/${P}" + # setup CFLAGS and LDFLAGS for separate build target + # see https://github.com/tianon/docker-overlay/pull/10 + export CGO_CFLAGS="-I${ESYSROOT}/usr/include" + export CGO_LDFLAGS="-L${ESYSROOT}/usr/$(get_libdir)" + emake \ + LDFLAGS="$(usex hardened '-extldflags -fno-PIC' '')" \ + VERSION="${PV}" \ + GITCOMMIT="${GIT_COMMIT}" \ + dynbinary +} + +src_install() { + dobin build/docker + doman "${WORKDIR}"/man/man?/* + dobashcomp contrib/completion/bash/* + bashcomp_alias docker dockerd + insinto /usr/share/fish/vendor_completions.d/ + doins contrib/completion/fish/docker.fish + insinto /usr/share/zsh/site-functions + doins contrib/completion/zsh/_* +} + +pkg_postinst() { + has_version "app-containers/docker-buildx" && return + ewarn "the 'docker build' command is deprecated and will be removed in a" + ewarn "future release. If you need this functionality, install" + ewarn "app-containers/docker-buildx." +} diff --git a/app-containers/docker-cli/files/docker-cli-24.0.4-vendor.patch b/app-containers/docker-cli/files/docker-cli-24.0.4-vendor.patch new file mode 100644 index 000000000000..557486542ede --- /dev/null +++ b/app-containers/docker-cli/files/docker-cli-24.0.4-vendor.patch @@ -0,0 +1,78 @@ +diff --git a/vendor/github.com/docker/docker/client/client.go b/vendor/github.com/docker/docker/client/client.go +index 1c081a5..54fa36c 100644 +--- a/vendor/github.com/docker/docker/client/client.go ++++ b/vendor/github.com/docker/docker/client/client.go +@@ -56,6 +56,36 @@ import ( + "github.com/pkg/errors" + ) + ++// DummyHost is a hostname used for local communication. ++// ++// It acts as a valid formatted hostname for local connections (such as "unix://" ++// or "npipe://") which do not require a hostname. It should never be resolved, ++// but uses the special-purpose ".localhost" TLD (as defined in [RFC 2606, Section 2] ++// and [RFC 6761, Section 6.3]). ++// ++// [RFC 7230, Section 5.4] defines that an empty header must be used for such ++// cases: ++// ++// If the authority component is missing or undefined for the target URI, ++// then a client MUST send a Host header field with an empty field-value. ++// ++// However, [Go stdlib] enforces the semantics of HTTP(S) over TCP, does not ++// allow an empty header to be used, and requires req.URL.Scheme to be either ++// "http" or "https". ++// ++// For further details, refer to: ++// ++// - https://github.com/docker/engine-api/issues/189 ++// - https://github.com/golang/go/issues/13624 ++// - https://github.com/golang/go/issues/61076 ++// - https://github.com/moby/moby/issues/45935 ++// ++// [RFC 2606, Section 2]: https://www.rfc-editor.org/rfc/rfc2606.html#section-2 ++// [RFC 6761, Section 6.3]: https://www.rfc-editor.org/rfc/rfc6761#section-6.3 ++// [RFC 7230, Section 5.4]: https://datatracker.ietf.org/doc/html/rfc7230#section-5.4 ++// [Go stdlib]: https://github.com/golang/go/blob/6244b1946bc2101b01955468f1be502dbadd6807/src/net/http/transport.go#L558-L569 ++const DummyHost = "api.moby.localhost" ++ + // ErrRedirect is the error returned by checkRedirect when the request is non-GET. + var ErrRedirect = errors.New("unexpected redirect in response") + +diff --git a/vendor/github.com/docker/docker/client/hijack.go b/vendor/github.com/docker/docker/client/hijack.go +index 6bdacab..db9b02e 100644 +--- a/vendor/github.com/docker/docker/client/hijack.go ++++ b/vendor/github.com/docker/docker/client/hijack.go +@@ -64,7 +64,10 @@ func fallbackDial(proto, addr string, tlsConfig *tls.Config) (net.Conn, error) { + } + + func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto string) (net.Conn, string, error) { +- req.Host = cli.addr ++ if cli.proto == "unix" || cli.proto == "npipe" { ++ // For local communications, it doesn't matter what the host is. ++ req.URL.Host = DummyHost ++ } + req.Header.Set("Connection", "Upgrade") + req.Header.Set("Upgrade", proto) + +diff --git a/vendor/github.com/docker/docker/client/request.go b/vendor/github.com/docker/docker/client/request.go +index c799095..8f43553 100644 +--- a/vendor/github.com/docker/docker/client/request.go ++++ b/vendor/github.com/docker/docker/client/request.go +@@ -98,12 +98,12 @@ func (cli *Client) buildRequest(method, path string, body io.Reader, headers hea + req = cli.addHeaders(req, headers) + + if cli.proto == "unix" || cli.proto == "npipe" { +- // For local communications, it doesn't matter what the host is. We just +- // need a valid and meaningful host name. (See #189) +- req.Host = "docker" ++ // For local communications, it doesn't matter what the host is. ++ req.URL.Host = DummyHost ++ } else { ++ req.URL.Host = cli.addr + } + +- req.URL.Host = cli.addr + req.URL.Scheme = cli.scheme + + if expectedPayload && req.Header.Get("Content-Type") == "" { |