Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add script for building and pushing the mimir-whisper-converter image #96

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions scripts/build-and-push-whisper-converter-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/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 [ $# -eq 0 ] ; then
echo "Need a docker registry location, like myreg/images"
echo "'mimir-whisper-converter' will be appended to this path as the image name"
exit 1
fi
DOCKER_REGISTRY="$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_REGISTRY/mimir-whisper-converter:latest \
.

# Push the docker image
docker image push $DOCKER_REGISTRY/mimir-whisper-converter:latest

echo 'Done'
Loading