Skip to content

Commit

Permalink
fix - adjust docker permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
chaddyc committed Dec 31, 2024
1 parent 7e6a4ab commit dc5a9a0
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ if [ -z "$GITHUB_URL" ] || [ -z "$RUNNER_TOKEN" ]; then
exit 1
fi

# Configure Docker permissions if /var/run/docker.sock is mounted
if [ -e /var/run/docker.sock ]; then
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
sudo groupadd -for -g "$DOCKER_GID" docker
sudo usermod -aG docker runner
echo "Docker group and permissions set up successfully."
else
echo "Warning: Docker socket not found. Ensure it is mounted at runtime."
fi
# Ensure sudo is used for docker commands
alias docker='sudo docker'

# # Configure Docker permissions if /var/run/docker.sock is mounted
# if [ -e /var/run/docker.sock ]; then
# DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
# sudo groupadd -for -g "$DOCKER_GID" docker
# sudo usermod -aG docker runner
# echo "Docker group and permissions set up successfully."
# else
# echo "Warning: Docker socket not found. Ensure it is mounted at runtime."
# fi

# Configure the GitHub Actions runner
if [ ! -f .runner ]; then
Expand Down

0 comments on commit dc5a9a0

Please sign in to comment.