build.sh
525 Bytes
#!/bin/bash
TAG=test-latest
APP=moqui-app
PUSH_TO=docker://5.161.91.120:31234
declare -a images=(moqui-jdbc-drivers moqui-app moqui-jdbc-drivers)
_build() {
for image in "${images[@]}"; do
docker build -f Dockerfile --tag "${image}:${TAG}" --target "${image}" "${APP}"
done
}
_push() {
for image in "${images[@]}"; do
skopeo copy --dest-tls-verify=false "docker-daemon:${image}:${TAG}" "${PUSH_TO}/${image}:${TAG}"
done
}
case "$1" in
(build)
_build
;;
(push)
_push
;;
("")
_build
_push
;;
esac