Connect coder in docker to local docker sock #6587
Replies: 4 comments 5 replies
-
If I understand correctly, you want code-server inside the Docker container to be able to manage containers on the host? I think you would need to mount the Docker socket into the container. Maybe something like |
Beta Was this translation helpful? Give feedback.
-
You could also install the version here directly, and then install the docker-cli as well, same end result as the docker mod at linuxserver is literally just installing docker in the dockerfile. The important part is adding the docker.sock as a volume and installing docker-cli inside code-server. |
Beta Was this translation helpful? Give feedback.
-
just to add to this question, how would I connect to docker on another server as well as where code-server is running? I already have docker-socket-proxy running on this other server. |
Beta Was this translation helpful? Give feedback.
-
I'd like to add a related question. I want to implement DinD (Docker in Docker) functionality similar to GitHub Codespaces:
like the art:
|
Beta Was this translation helpful? Give feedback.
-
I've searched and I'm coming up empty. I am running Ubuntu with a fully functioning docker instance locally aka not in docker. Bare metal server. I spun up coder with a bland docker compose, just the basics, and I cannot get it to connect to the local docker sock. Tried adding the sock in as a volume, made sure user permissions were correct aka 1000. Docker is set up for permissions with the docker group.
Any ideas? My end goal is to be able to use coder to connect to my local server's docker to dev and also check on currently running containers.
Thanks!
services:
code-server:
stdin_open: true
tty: true
container_name: code-server
networks:
- utilities
ports:
- 127.0.0.1:8080:8080
volumes:
- $HOME/.local:/home/coder/.local
- $HOME/.config:/home/coder/.config
- $PWD:/home/coder/project
user: 1000:1000
environment:
- DOCKER_USER=$USER
image: codercom/code-server:latest
networks:
utilities:
external: true
Beta Was this translation helpful? Give feedback.
All reactions