diff --git a/common-files/Dockerfile b/common-files/Dockerfile new file mode 100644 index 00000000..60c1c70b --- /dev/null +++ b/common-files/Dockerfile @@ -0,0 +1,7 @@ +FROM docker.io/alpine:3.20.0 + +WORKDIR /home/devops/solutions + +COPY --chown=root:root --chmod=774 . . + +CMD ["./copy.sh"] diff --git a/common-files/copy.sh b/common-files/copy.sh new file mode 100755 index 00000000..57662f9c --- /dev/null +++ b/common-files/copy.sh @@ -0,0 +1,18 @@ + #!/usr/bin/env sh + +SOURCE1_VAL="${1:-$SOURCE1}" +TARGET_VAL="${2:-$TARGET}" + +mkdir -p "${TARGET_VAL}" + +cp -pLvR "${SOURCE1_VAL}"/* "${TARGET_VAL}" +if [ -n "${SOURCE2}" ]; then + cp -pLvR "${SOURCE2}"/* "${TARGET_VAL}" +fi +if [ -n "${SOURCE3}" ]; then + cp -pLvR "${SOURCE3}"/* "${TARGET_VAL}" +fi + +if [ -n "${OWNER}" ]; then + chown -vR "${OWNER}:root" "${TARGET_VAL}"/* +fi