rust-musl-builder/hooks/build

24 lines
531 B
Plaintext
Raw Normal View History

2016-11-25 12:49:16 +00:00
#!/bin/bash
# Abort if anything goes wrong.
set -euo pipefail
# 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
# Run the build.
docker build --build-arg TOOLCHAIN="$TOOLCHAIN" -t "$IMAGE_NAME" .