Skip to content

Instantly share code, notes, and snippets.

@nl5887
Created August 18, 2019 12:48
Show Gist options
  • Select an option

  • Save nl5887/6d50cd5f16ddfc82747862dc9575190d to your computer and use it in GitHub Desktop.

Select an option

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
#!/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