Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit a58847d

Browse files
author
Tibor Vass
committed
Add buildx plugin as experimental
Signed-off-by: Tibor Vass <tibor@docker.com> Upstream-commit: 93bad6c9b6d9e4af2d61bf788698ae59317631e4 Component: packaging
1 parent eafe383 commit a58847d

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
source "$(dirname "$0")/.common"
6+
PKG=github.com/docker/buildx
7+
GOPATH=$(go env GOPATH)
8+
REPO=https://${PKG}.git
9+
COMMIT=master
10+
DEST=${GOPATH}/src/${PKG}
11+
12+
build() {
13+
if [ ! -d "${DEST}" ]; then
14+
git clone "${REPO}" "${DEST}"
15+
fi
16+
(
17+
cd "${DEST}"
18+
git fetch --all
19+
git checkout -q "${COMMIT}"
20+
local LDFLAGS
21+
# TODO: unmark `-tp` when no longer a technical preview
22+
LDFLAGS="-X ${PKG}/version.Version=$(git describe --match 'v[0-9]*' --always --tags)-tp-docker -X ${PKG}/version.Revision=$(git rev-parse HEAD) -X ${PKG}/version.Package=${PKG} -X main.experimental=1"
23+
set -x
24+
go build -o bin/docker-buildx -ldflags "${LDFLAGS}" ./cmd/buildx
25+
)
26+
}
27+
28+
install_plugin() {
29+
(
30+
cd "${DEST}"
31+
install_binary bin/docker-buildx
32+
)
33+
}
34+
35+
build_or_install "$@"

0 commit comments

Comments
 (0)