Skip to content

Commit f47ced8

Browse files
authored
fix: reverse docker socket test (#1182)
* fix: reverse docker socket test * refactor: whitespace typo * fix: check -r only if -S check fail
1 parent 47a48d7 commit f47ced8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/entrypoint.sh

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ function print_version {
1414
function check_docker_socket {
1515
if [[ $DOCKER_HOST == unix://* ]]; then
1616
socket_file=${DOCKER_HOST#unix://}
17-
if [[ ! -r $socket_file ]]; then
18-
echo "Error: Docker host socket at $socket_file is not readable. Please check user permissions" >&2
19-
echo "If you are in a SELinux environment, try using: '-v /var/run/docker.sock:$socket_file:z'" >&2
20-
exit 1
21-
fi
2217
if [[ ! -S $socket_file ]]; then
18+
if [[ ! -r $socket_file ]]; then
19+
echo "Warning: Docker host socket at $socket_file might not be readable. Please check user permissions" >&2
20+
echo "If you are in a SELinux environment, try using: '-v /var/run/docker.sock:$socket_file:z'" >&2
21+
fi
2322
echo "Error: you need to share your Docker host socket with a volume at $socket_file" >&2
2423
echo "Typically you should run your container with: '-v /var/run/docker.sock:$socket_file:ro'" >&2
2524
exit 1

0 commit comments

Comments
 (0)