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

Commit 8bfbb46

Browse files
authored
Merge pull request #336 from tiborvass/buildx-19.03
[19.03] Add buildx plugin as experimental Upstream-commit: 54345e398f181fc960b3aff3ecf085735aaef8d6 Component: packaging
2 parents eafe383 + a58847d commit 8bfbb46

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)