Skip to content

Commit

Permalink
Merge pull request #336 from tiborvass/buildx-19.03
Browse files Browse the repository at this point in the history
[19.03] Add buildx plugin as experimental
  • Loading branch information
seemethere authored May 24, 2019
2 parents ae606e2 + 93bad6c commit 54345e3
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions plugins/buildx.installer
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

set -e

source "$(dirname "$0")/.common"
PKG=github.com/docker/buildx
GOPATH=$(go env GOPATH)
REPO=https://${PKG}.git
COMMIT=master
DEST=${GOPATH}/src/${PKG}

build() {
if [ ! -d "${DEST}" ]; then
git clone "${REPO}" "${DEST}"
fi
(
cd "${DEST}"
git fetch --all
git checkout -q "${COMMIT}"
local LDFLAGS
# TODO: unmark `-tp` when no longer a technical preview
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"
set -x
go build -o bin/docker-buildx -ldflags "${LDFLAGS}" ./cmd/buildx
)
}

install_plugin() {
(
cd "${DEST}"
install_binary bin/docker-buildx
)
}

build_or_install "$@"

0 comments on commit 54345e3

Please sign in to comment.