Include dotfiles

This commit is contained in:
2022-10-18 17:27:39 +03:00
parent ae44ce87e9
commit 907c45255b
4 changed files with 169 additions and 0 deletions

27
.docker/build.bash Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" &>/dev/null && pwd)"
PROJECT_DIR="$(dirname "${SCRIPT_DIR}")"
TAG="cacdar/$(basename "${PROJECT_DIR}")"
if [ "${#}" -gt "0" ]; then
if [[ "${1}" != "-"* ]]; then
TAG="${TAG}:${1}"
BUILD_ARGS=${*:2}
else
BUILD_ARGS=${*:1}
fi
fi
DOCKER_BUILD_CMD=(
docker build
"${PROJECT_DIR}"
--tag "${TAG}"
"${BUILD_ARGS}"
)
echo -e "\033[1;30m${DOCKER_BUILD_CMD[*]}\033[0m" | xargs
# shellcheck disable=SC2048
exec ${DOCKER_BUILD_CMD[*]}