Skip to content

Commit

Permalink
Adds Dockerfile and copy.sh to common files (#246)
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Sundberg <seansund@us.ibm.com>
  • Loading branch information
seansund authored Jun 21, 2024
1 parent 71f8ef2 commit 307a3fd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common-files/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM docker.io/alpine:3.20.0

WORKDIR /home/devops/solutions

COPY --chown=root:root --chmod=774 . .

CMD ["./copy.sh"]
18 changes: 18 additions & 0 deletions common-files/copy.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 307a3fd

Please sign in to comment.