Skip to content

Instantly share code, notes, and snippets.

@RavinduSachintha
Created November 11, 2020 04:42
Show Gist options
  • Save RavinduSachintha/11a7571f12f45cc1adb7e3ba63fa0df1 to your computer and use it in GitHub Desktop.
Save RavinduSachintha/11a7571f12f45cc1adb7e3ba63fa0df1 to your computer and use it in GitHub Desktop.
Kaldi with docker-compose for Linux (an easy setup)

You need to install docker and docker-compose as the first step.

Then build the container using below command. This must be run on a folder named "docker" that contains docker-compose.yml and start.sh files. (Building process will required ~1GB downloading)

docker-compose build

After the building is success, you just need to run ./start.sh file. It will handle starting. stopping actions for the container. You may be required to change the permission of that file for executing.

version: "3.8"
services:
kaldi:
image: kaldiasr/kaldi:latest
tty: true
stdin_open: true
# !bin/bash
ORANGE='\033[0;33m'
NC='\033[0m'
is_stopped=0
echo -e "${ORANGE}** Kaldi Starting Process **${NC}"
if [ -z $(docker ps -a --filter "name=docker_kaldi_1" -q) ]
then
echo -e "${ORANGE}>>> Container is not found. Initialize the container starting process ...${NC}"
docker-compose up -d
wait
echo -e "${ORANGE}>>> Container successfully started${NC}"
else
if [ -z $(docker ps --filter "name=docker_kaldi_1" -q) ]
then
echo -e "${ORANGE}>>> Stopped container found. Restarting process initialized ...${NC}"
docker-compose start
wait
echo -e "${ORANGE}>>> Container successfully started${NC}"
fi
fi
echo -e "${ORANGE}>>> Attaching to the container ...${NC}"
sleep 2
clear
docker-compose exec kaldi bash
wait
echo -e "${ORANGE}>>> Container stopping ...${NC}"
docker-compose stop
wait
echo -e "${ORANGE}>>> Kaldi process successfully stopped${NC}"
echo
echo -e "${ORANGE}Thank You. Good Bye.${NC}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment