Created
August 18, 2019 12:48
-
-
Save nl5887/6d50cd5f16ddfc82747862dc9575190d to your computer and use it in GitHub Desktop.
Docker build script that will only use git added files to container volume
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DEST=$(mktemp -d) | |
| SRC=$(pwd) | |
| echo "Cloning $SRC into $DEST" | |
| pushd . | |
| cd $DEST | |
| git clone $SRC/.git . | |
| LDFLAGS="$(go run scripts/gen-ldflags.go)" | |
| echo $LDFLAGS | |
| cp $SRC/Dockerfile . | |
| docker build --build-arg LDFLAGS="$LDFLAGS" -t honeytrap:latest . | |
| popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment