Skip to content

Commit

Permalink
Draft dockerfile and entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
efrecon committed Feb 6, 2024
1 parent dbf5971 commit 63b5680
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM efrecon/runner-krunvm.base:main

ARG INSTALL_VERSION=latest
ARG INSTALL_NAMESPACE=/opt/gh-runner-krunvm

COPY runner/*.sh ${INSTALL_NAMESPACE}/bin/
RUN chmod a+x "${INSTALL_NAMESPACE}/bin/*.sh" \
&& "${INSTALL_NAMESPACE}/bin/install.sh" -v -l /dev/stdout

ENTRYPOINT ["${INSTALL_NAMESPACE}/bin/entrypoint.sh"]
CMD ["./bin/Runner.Listener", "run", "--startuptype", "service"]
27 changes: 27 additions & 0 deletions runner/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/dumb-init /bin/sh
# shellcheck shell=sh

# Shell sanity. Stop on errors and undefined variables.
set -eu

# This is a readlink -f implementation so this script can (perhaps) run on MacOS
abspath() {
is_abspath() {
case "$1" in
/* | ~*) true;;
*) false;;
esac
}

if [ -d "$1" ]; then
( cd -P -- "$1" && pwd -P )
elif [ -L "$1" ]; then
if is_abspath "$(readlink "$1")"; then
abspath "$(readlink "$1")"
else
abspath "$(dirname "$1")/$(readlink "$1")"
fi
else
printf %s\\n "$(abspath "$(dirname "$1")")/$(basename "$1")"
fi
}

0 comments on commit 63b5680

Please sign in to comment.