2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -ex
|
2018-07-30 15:56:49 -07:00
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
2022-04-08 11:31:32 -07:00
|
|
|
|
|
|
|
platform=()
|
|
|
|
if [[ $(uname -m) = arm64 ]]; then
|
|
|
|
# Ref: https://blog.jaimyn.dev/how-to-build-multi-architecture-docker-images-on-an-m1-mac/#tldr
|
|
|
|
platform+=(--platform linux/amd64)
|
|
|
|
fi
|
|
|
|
|
|
|
|
docker build "${platform[@]}" -t solanalabs/rust .
|
2018-09-07 16:41:55 -07:00
|
|
|
|
|
|
|
read -r rustc version _ < <(docker run solanalabs/rust rustc --version)
|
|
|
|
[[ $rustc = rustc ]]
|
|
|
|
docker tag solanalabs/rust:latest solanalabs/rust:"$version"
|
2019-03-15 08:54:41 -07:00
|
|
|
docker push solanalabs/rust:"$version"
|
2019-05-02 15:33:08 -07:00
|
|
|
docker push solanalabs/rust:latest
|