mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-10-31 08:03:43 +08:00 
			
		
		
		
	 57c618b83a
			
		
	
	57c618b83a
	
	
	
		
			
			This is useful for setting things like -buildmode=pie when packaging docker-buildx for distributions. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
		
			
				
	
	
		
			18 lines
		
	
	
		
			599 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			599 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env sh
 | |
| 
 | |
| set -e
 | |
| 
 | |
| : "${DESTDIR=./bin/build}"
 | |
| : "${PACKAGE=github.com/docker/buildx}"
 | |
| : "${VERSION=$(./hack/git-meta version)}"
 | |
| : "${REVISION=$(./hack/git-meta revision)}"
 | |
| 
 | |
| : "${CGO_ENABLED=0}"
 | |
| : "${GO_PKG=github.com/docker/buildx}"
 | |
| : "${GO_EXTRA_FLAGS=}"
 | |
| : "${GO_LDFLAGS=-X ${GO_PKG}/version.Version=${VERSION} -X ${GO_PKG}/version.Revision=${REVISION} -X ${GO_PKG}/version.Package=${PACKAGE}}"
 | |
| : "${GO_EXTRA_LDFLAGS=}"
 | |
| 
 | |
| set -x
 | |
| CGO_ENABLED=$CGO_ENABLED go build -mod vendor -trimpath ${GO_EXTRA_FLAGS} -ldflags "${GO_LDFLAGS} ${GO_EXTRA_LDFLAGS}" -o "${DESTDIR}/docker-buildx" ./cmd/buildx
 |