Skip to content

Commit

Permalink
Merge pull request myoung34#298 from LordChunk/pr/start-docker-with-env
Browse files Browse the repository at this point in the history
Start Docker service with env variable
  • Loading branch information
myoung34 authored May 16, 2023
2 parents 9cb13e5 + 02345f6 commit 869eed0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ These containers are built via Github actions that [copy the dockerfile](https:/
| `CONFIGURED_ACTIONS_RUNNER_FILES_DIR` | Path to use for runner data. It allows avoiding reregistration each the start of the runner. No default value. |
| `EPHEMERAL` | Optional flag to configure runner with [`--ephemeral` option](https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling). Ephemeral runners are suitable for autoscaling. |
| `DISABLE_AUTO_UPDATE` | Optional environment variable to [disable auto updates](https://github.blog/changelog/2022-02-01-github-actions-self-hosted-runners-can-now-disable-automatic-updates/). Auto updates are enabled by default to preserve past behavior. Any value is considered truthy and will disable them. |
| `START_DOCKER_SERVICE` | Optional flag which automatically starts the docker service if set to `true`. Useful when using [sysbox](https://github.com/nestybox/sysbox). Defaults to `false`.
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ _LABELS=${LABELS:-default}
_RUNNER_GROUP=${RUNNER_GROUP:-Default}
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
_RUN_AS_ROOT=${RUN_AS_ROOT:="true"}
_START_DOCKER_SERVICE=${START_DOCKER_SERVICE:="false"}

# ensure backwards compatibility
if [[ -z ${RUNNER_SCOPE} ]]; then
Expand Down Expand Up @@ -166,6 +167,12 @@ if [[ ${_DISABLE_AUTOMATIC_DEREGISTRATION} == "false" ]]; then
trap deregister_runner SIGINT SIGQUIT SIGTERM INT TERM QUIT
fi

# Start docker service if needed (e.g. for docker-in-docker)
if [[ ${_START_DOCKER_SERVICE} == "true" ]]; then
echo "Starting docker service"
service docker start
fi

# Container's command (CMD) execution as runner user


Expand Down

0 comments on commit 869eed0

Please sign in to comment.