2016-11-25 12:49:16 +00:00
|
|
|
#!/bin/bash
|
2016-11-25 12:45:10 +00:00
|
|
|
|
|
|
|
# Abort if anything goes wrong.
|
|
|
|
set -euo pipefail
|
|
|
|
|
2019-04-18 13:44:12 +00:00
|
|
|
# Decide what Rust toolchain to use.
|
|
|
|
case "$DOCKER_TAG" in
|
|
|
|
# Always map the Docker tags `latest` and `experimental` to stable Rust.
|
|
|
|
latest|experimental)
|
|
|
|
TOOLCHAIN=stable
|
|
|
|
;;
|
|
|
|
# Strip `experimental-` from other `experimental-*` tags.
|
|
|
|
experimental-*)
|
|
|
|
TOOLCHAIN="${DOCKER_TAG/experimental-/}"
|
|
|
|
;;
|
|
|
|
# Pass all our tags
|
|
|
|
*)
|
|
|
|
TOOLCHAIN="$DOCKER_TAG"
|
|
|
|
;;
|
|
|
|
esac
|
2016-11-25 12:45:10 +00:00
|
|
|
|
|
|
|
# Run the build.
|
|
|
|
docker build --build-arg TOOLCHAIN="$TOOLCHAIN" -t "$IMAGE_NAME" .
|