run.sh 250 B

12345678
  1. #!/bin/bash
  2. set -e
  3. image="$1"
  4. dirTest="$(dirname "$(readlink -f "$BASH_SOURCE")")"
  5. dirContainer='/usr/src/cpp'
  6. docker run --rm -v "$dirTest":"$dirContainer":ro -w "$dirContainer" "$image" sh -c 'g++ -o /hello-world hello-world.cpp && /hello-world'