forked from devcontainers/features
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom_rootless_socket_path.sh
More file actions
29 lines (20 loc) · 937 Bytes
/
custom_rootless_socket_path.sh
File metadata and controls
29 lines (20 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -e
source dev-container-features-test-lib
echo "=== Custom Rootless Docker Socket Path Test ==="
# Test that the custom socket path is properly configured
EXPECTED_SOCKET="/custom/docker/rootless.sock"
# Check if the custom socket exists and is accessible
check "custom-socket-exists" test -S "$EXPECTED_SOCKET"
check "custom-socket-readable" test -r "$EXPECTED_SOCKET"
# Verify Docker functionality using the custom socket
export DOCKER_HOST="unix://$EXPECTED_SOCKET"
check "docker-functional-custom" docker ps >/dev/null
# Verify that DOCKER_HOST is properly set by the feature
check "docker-host-env-set" [ ! -z "$DOCKER_HOST" ]
# Test basic Docker operations
check "docker-version" docker version --format '{{.Client.Version}}' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+' >/dev/null
check "docker-info" docker info >/dev/null
echo "Custom socket path: $EXPECTED_SOCKET"
echo "Docker host: $DOCKER_HOST"
reportResults