29 lines
702 B
Plaintext
29 lines
702 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
# Make bash fail much more aggressively on errors.
|
||
|
set -euo pipefail
|
||
|
|
||
|
# Make sure we can build our main container.
|
||
|
docker build -t ekidd/rust-musl-builder .
|
||
|
|
||
|
# Make sure we can build our example derived container.
|
||
|
docker build -t rust-musl-zlib -f Dockerfile.example .
|
||
|
|
||
|
# Make sure we can build a static executable.
|
||
|
docker run --rm ekidd/rust-musl-builder bash -c "
|
||
|
set -euo pipefail
|
||
|
export USER=rust
|
||
|
cargo new --vcs none --bin test
|
||
|
cd test
|
||
|
cargo build
|
||
|
echo 'Checking to make sure it is not a dynamic executable'
|
||
|
if ldd target/x86_64-unknown-linux-musl/debug/test; then
|
||
|
echo 'Executable is not static!' 1>&2
|
||
|
echo 'FAIL.' 1>&2
|
||
|
exit 1
|
||
|
fi
|
||
|
"
|
||
|
|
||
|
# We're good.
|
||
|
echo 'OK. Tests passed.' 1>&2
|