lgregmapper/contrib/build.sh
2019-09-13 22:29:04 +01:00

27 lines
881 B
Bash
Executable File

#!/bin/bash
##########################################################################
# A small script to build a static lgregmapper image
# using the golang container image
#
# the binary will be built in to the current directory
##########################################################################
RUNTIME=$(which podman || which docker)
echo "Using container runtime: ${RUNTIME}"
# find the source directory
SCRIPTPATH="$(cd "$(dirname "$0")" ; pwd -P)"
SOURCEPATH="$(cd "${SCRIPTPATH}/../"; pwd -P)"
echo "Source is in: ${SOURCEPATH}"
# do the thing
${RUNTIME} run --rm \
-e CGO_ENABLED=0 \
-v "${SOURCEPATH}:/go/src/lgregmapper" \
-v "${PWD}:/go/bin" \
-w "/go/src/lgregmapper" \
docker.io/golang:1.12 \
go get
##########################################################################
# end of code