github.com/dnephin/dobi@v0.15.0/examples/minimal-docker-image/test.sh (about)

     1  #!/usr/bin/env bash
     2  # SUMMARY: Test build minimal docker images
     3  # LABELS:
     4  # REPEAT:
     5  # AUTHOR:
     6  set -eu -o pipefail
     7  
     8  cleanup() {
     9      echo "running cleanup"
    10      dobi autoclean
    11      rm -f output
    12  }
    13  trap "cleanup" EXIT
    14  
    15  dobi run-dist | tee output
    16  docker images
    17  
    18  echo "image=builder creates an image"
    19  docker inspect --type image minimal-dev:example-hello-root
    20  
    21  echo "job=binary creates the binary"
    22  ls ./dist/bin/hello
    23  
    24  echo "image=dist-img creates an image"
    25  docker inspect --type image example/hello:root
    26  
    27  echo "job=run-dist outputs hello"
    28  grep '^Hello, world!' output