#!/bin/bash

set -e

. builder/os_ver_cli.sh

cd "$(dirname "$0")/.."

docker build -t kasmvnc_apkbuilder_${os}:${os_codename} -f \
  builder/dockerfile.${os}_${os_codename}.apk.build .

source_dir=$(echo $PWD)
L_UID=$(id -u)
L_GID=$(id -g)
docker run --rm -v "$source_dir":/src --user $L_UID:$L_GID \
  kasmvnc_apkbuilder_${os}:${os_codename} /bin/bash -c \
  '/src/builder/build-apk-inside-docker'
