Issue in docker-in-docker devcontainer

getting below issue while running docker-in-docker in devcontainer: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the daemon runningg?"
15 Replies
Codercord
Codercord2mo ago
<#1353752078425526282>
Category
Help needed
Product
code-server
Platform
Linux
Logs
Please post any relevant logs/error messages.
Roshan
RoshanOP2mo ago
"Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the daemon running"
Greenman999
Greenman9992mo ago
https://discord.com/channels/747933592273027093/1336093480379748383 Probably the same problem as mine. You need to install sysbox
Phorcys
Phorcys2mo ago
@Roshan ^ also, what happens when you run sudo dockerd?
Roshan
RoshanOP2mo ago
Thanks guys, that issue is resolved. I have updated terraform template, under docker_container section I have added privileged = true and rebuild the workspace after that I can able to use docker. I'm facing below issue while doing networking with docker inside devcontainer: vscode ➜ /workspaces/hyperledger/fabric-samples/test-network (main) $ ./network.sh up Using docker and docker-compose Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' LOCAL_VERSION=v2.5.12 DOCKER_IMAGE_VERSION=v2.5.12 WARN[0000] /workspaces/hyperledger/fabric-samples/test-network/compose/compose-test-net.yaml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion WARN[0000] /workspaces/hyperledger/fabric-samples/test-network/compose/docker/docker-compose-test-net.yaml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion [+] Running 0/3 ⠙ Container orderer.example.com Starting 0.1s ⠙ Container peer0.org1.example.com Starting 0.1s ⠙ Container peer0.org2.example.com Starting Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint peer0.org2.example.com (9ae407712bf7593a0a5e30386b0657d7c1e8d59b3f1aaf2055fb4843066ee72e): Unable to enable DIRECT ACCESS FILTERING - DROP rule: (iptables failed: iptables --wait -t raw -A PREROUTING -p tcp -d 172.19.0.2 --dport 9051 ! -i br-b4dfe5cceafd -j DROP: iptables v1.8.7 (legacy): unknown option "--dport" Try `iptables -h' or 'iptables --help' for more information. (exit status 2)) CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d9e3c248eaca hyperledger/fabric-peer:latest "peer node start" 11 hours ago Created peer0.org2.example.com 0dec3e86ca75 hyperledger/fabric-peer:latest "peer node start" 11 hours ago Created peer0.org1.example.com dedae73355a8 hyperledger/fabric-orderer:latest "orderer" 11 hours ago Created orderer.example.com
Phorcys
Phorcys5w ago
hey, while this does work, i would very well recommend installing sysbox instead running privileged containers is very unsafe
Phorcys
Phorcys5w ago
try switching to sysbox, it should fix that
Roshan
RoshanOP4w ago
I tried this, facing above issue
No description
Phorcys
Phorcys3w ago
how have you installed sysbox?
Roshan
RoshanOP3w ago
you mean on the host machine?
Phorcys
Phorcys3w ago
yeah cc @Roshan
Danielle
Danielle3w ago
@Roshan On the host machine, what does your docker config look like? This is what mine looks like and I can run the following
$ cat /etc/docker/daemon.json
{
"runtimes": {
"sysbox-runc": {
"path": "/usr/bin/sysbox-runc"
}
}
}
$ docker run --rm -it --runtime sysbox-runc nestybox/alpine-docker:latest
/ # dockerd > /var/log/dockerd.log 2>&1 &
/ # docker run --rm -it busybox
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
97e70d161e81: Pull complete
Digest: sha256:37f7b378a29ceb4c551b1b5582e27747b855bbfaa73fa11914fe0df028dc581f
Status: Downloaded newer image for busybox:latest
/ # echo "hello from within a container"
hello from within a container
/ # exit
/ # exit
$ cat /etc/docker/daemon.json
{
"runtimes": {
"sysbox-runc": {
"path": "/usr/bin/sysbox-runc"
}
}
}
$ docker run --rm -it --runtime sysbox-runc nestybox/alpine-docker:latest
/ # dockerd > /var/log/dockerd.log 2>&1 &
/ # docker run --rm -it busybox
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
97e70d161e81: Pull complete
Digest: sha256:37f7b378a29ceb4c551b1b5582e27747b855bbfaa73fa11914fe0df028dc581f
Status: Downloaded newer image for busybox:latest
/ # echo "hello from within a container"
hello from within a container
/ # exit
/ # exit
Phorcys
Phorcys5d ago
@Roshan closing this thread out for inactivity, but feel free to reopen it
Codercord
Codercord5d ago
@Phorcys closed the thread.

Did you find this page helpful?