Skip to content

Commit

Permalink
Fix build image
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Jan 18, 2022
1 parent bbb8fba commit 620ada6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,23 @@ BUILD_PLATFORMS=(
# linux/ppc64le
)

declare -A archToCC
archToCC["amd64"]=""
archToCC["arm64"]="aarch64-linux-gnu-gcc"
archToCC["ppc64le"]="powerpc64le-linux-gnu-gcc"

docker build -t runcdev .

for platform in ${BUILD_PLATFORMS[*]}; do
os="${platform%/*}"
arch="${platform#*/}"
echo "Building ${platform}"
rm -rf ~/.cache/go-build bin || :
rm -rf "_output/${os}/${arch}/runc" || :
mkdir -p "_output/${os}/${arch}/runc"
docker run --rm -v $(pwd):/go/src/github.com/opencontainers/runc -w /go/src/github.com/opencontainers/runc golang:1.17 \
docker run --rm -v $(pwd):/go/src/github.com/opencontainers/runc -w /go/src/github.com/opencontainers/runc runcdev \
/bin/bash -c "
apt-get update && apt-get install libseccomp-dev
GO111MODULE=auto GOOS=${os} GOARCH=${arch} CGO_ENABLED=1 make BUILDTAGS='${BUILDTAGS}' runc && \
GO111MODULE=auto GOOS=${os} GOARCH=${arch} CC=${archToCC[$arch]} CGO_ENABLED=1 make BUILDTAGS='${BUILDTAGS}' runc && \
mv runc _output/${os}/${arch}/runc/ || :
" || echo "fail ${platform}"

Expand Down

0 comments on commit 620ada6

Please sign in to comment.