Skip to content

Commit

Permalink
Add script for building and pushing the mimir-whiser-converter image
Browse files Browse the repository at this point in the history
  • Loading branch information
ywwg committed Oct 19, 2023
1 parent a2c232a commit 187e293
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions scripts/build-and-push-whisper-converter-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -eufo pipefail

command -v go >/dev/null 2>&1 || { echo 'Please install go'; exit 1; }
command -v docker >/dev/null 2>&1 || { echo 'Please install docker'; exit 1; }

if [ "$1"x == "x" ] ; then
echo "Need a docker destination path, like myreg/images/"
echo "'mimir-whisper-converter' will be appended to this path as the image name"
exit 1
fi
DOCKER_NAME="$1"

# Build the executable
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=amd64
go build \
-tags netgo \
-o dist/mimir-whisper-converter \
-ldflags "-w -extldflags '-static'" \
"github.com/grafana/mimir-proxies/cmd/mimir-whisper-converter"

# Build the docker image

docker build \
--platform linux/amd64 \
-f cmd/mimir-whisper-converter/Dockerfile \
-t $DOCKER_NAME/mimir-whisper-converter:latest \
.

# Push the docker image

docker image push $DOCKER_NAME/mimir-whisper-converter:latest

echo 'Done'

0 comments on commit 187e293

Please sign in to comment.