forked from devcontainers/features
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrootless_docker_socket.sh
More file actions
27 lines (19 loc) · 954 Bytes
/
rootless_docker_socket.sh
File metadata and controls
27 lines (19 loc) · 954 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
#!/bin/bash
set -e
source dev-container-features-test-lib
echo "=== Rootless Docker Socket Configuration Test ==="
# Test the custom rootless socket path
EXPECTED_SOCKET="/var/run/docker-rootless.sock"
# Check if the configured rootless socket exists and is accessible
check "rootless-socket-exists" test -S "$EXPECTED_SOCKET"
check "rootless-socket-readable" test -r "$EXPECTED_SOCKET"
# Verify Docker functionality using the rootless socket
export DOCKER_HOST="unix://$EXPECTED_SOCKET"
check "docker-functional-rootless" docker ps >/dev/null
# Test basic Docker operations with rootless configuration
check "docker-version-rootless" docker version --format '{{.Client.Version}}' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+' >/dev/null
check "docker-info-rootless" docker info >/dev/null
# Demonstrate that customers can configure custom socket paths
echo "Configured rootless socket path: $EXPECTED_SOCKET"
echo "Docker host: $DOCKER_HOST"
reportResults