Skip to content

Commit

Permalink
fix: reverse docker socket test (#1182)
Browse files Browse the repository at this point in the history
* fix: reverse docker socket test

* refactor: whitespace typo

* fix: check -r only if -S check fail
  • Loading branch information
buchdag authored Jan 19, 2025
1 parent 47a48d7 commit f47ced8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ function print_version {
function check_docker_socket {
if [[ $DOCKER_HOST == unix://* ]]; then
socket_file=${DOCKER_HOST#unix://}
if [[ ! -r $socket_file ]]; then
echo "Error: Docker host socket at $socket_file is not readable. Please check user permissions" >&2
echo "If you are in a SELinux environment, try using: '-v /var/run/docker.sock:$socket_file:z'" >&2
exit 1
fi
if [[ ! -S $socket_file ]]; then
if [[ ! -r $socket_file ]]; then
echo "Warning: Docker host socket at $socket_file might not be readable. Please check user permissions" >&2
echo "If you are in a SELinux environment, try using: '-v /var/run/docker.sock:$socket_file:z'" >&2
fi
echo "Error: you need to share your Docker host socket with a volume at $socket_file" >&2
echo "Typically you should run your container with: '-v /var/run/docker.sock:$socket_file:ro'" >&2
exit 1
Expand Down

0 comments on commit f47ced8

Please sign in to comment.