build-skopeo.sh (758B)
1 #!/bin/sh 2 3 set -ex 4 5 ARCH="$1" 6 7 git clone --no-checkout --depth=1 --branch=v1.19.0 https://github.com/containers/skopeo . 8 git checkout 7aa78df96b049bc9e36e10283ba08ceb9165041d 9 export GO111MODULE=on CGO_ENABLED=0 10 if [ "$ARCH" = arm64 ]; then 11 export GOARCH=arm64 12 fi 13 14 # Set unixTempDirForBigFiles so skopeo will extract in a directory hidden by kaniko 15 go build \ 16 -mod=vendor -o out/skopeo \ 17 -tags "exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp" \ 18 -ldflags '-X github.com/containers/image/v5/internal/tmpdir.unixTempDirForBigFiles=/workspace/tmp -X github.com/containers/image/v5/signature.systemDefaultPolicyPath=/kaniko/containers/policy.json -extldflags "-static" -w -s' \ 19 ./cmd/skopeo