You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Fatalf("could not evaluate ownership of docker socket, permission issue %v", err)
59
+
}else{
60
+
if(int(ownership.Uid) !=os.Getuid()){
61
+
log.Fatalf("can’t access docker socket as UID %d owned by UID %d\nplease change the user setting in your compose to the correct UID/GID pair like this:\nservices:\n socket-proxy:\n user: \"%d:%d\"", os.Getuid(), ownership.Uid, ownership.Uid, ownership.Gid)
62
+
}else{
63
+
if(int(ownership.Gid) !=os.Getgid()){
64
+
log.Fatalf("can’t access docker socket as GID %d owned by GID %d\nplease change the user setting in your compose to the correct UID/GID pair like this:\nservices:\n socket-proxy:\n user: \"%d:%d\"", os.Getgid(), ownership.Gid, os.Getuid(), ownership.Gid)
65
+
}
66
+
}
67
+
}
68
+
52
69
// drop privileges since only the proxy must access the socket as root and nothing else
53
70
iferr:=syscall.Setgid(proxyGID); err!=nil {
54
71
log.Fatalf("could not set GID to %d %v", proxyGID, err)
Copy file name to clipboardExpand all lines: project.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,12 @@
1
-
${{ content_synopsis }} This image will run a proxy to access your docker socket as read-only. The exposed proxy socket is run as 1000:1000, not as root, although the image starts the proxy process as root to interact with the actual docker socket. There is also a TCP endpoint started at 2375 that will also proxy to the actual docker socket if needed. It is not exposed by default and must be exposed via using ```- "2375:2375/tcp"``` in your compose.
1
+
${{ content_synopsis }} This image will run a proxy to access your docker socket as read-only. The exposed proxy socket is run as 1000:1000, not as root, although the image starts the proxy process as root to interact with the actual docker socket. There is also a TCP endpoint started at 2375 that will also proxy to the actual docker socket if needed. It is not exposed by default and must be exposed via using ```- "2375:2375/tcp"``` in your compose. Make sure that the docker socket is accessible by the ```user:``` specification in your compose, if the UID/GID are not correct, the image will print out the correct UID/GID for you to set:
2
+
3
+
```shell
4
+
socket-proxy-1 | 2025/03/26 10:16:33 can’t access docker socket as GID 0 owned by GID 991
5
+
socket-proxy-1 | please change the user setting in your compose to the correct UID/GID pair like this:
6
+
socket-proxy-1 | services:
7
+
socket-proxy-1 | socket-proxy:
8
+
socket-proxy-1 | user: "0:991"
9
+
```
2
10
3
11
${{ content_uvp }} Good question! All the other images on the market that do exactly the same don’t do or offer these options:
0 commit comments