nelsonsilva
nelsonsilva
CCoder.com
Created by Phorcys on 5/15/2024 in #help
Running `vkcube` in a Docker workspace
Hi @Atif I did not, vkcube can't detect my A4000 Nvidia GPU. Although I can see the correct output of nvidia-smi command.
5 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
I don't want to use docker with sudo command behind.
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
Also got a warning saying Workspace is unhealthy - Your workspace is running but 1 agent is unhealthy.
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
If I start the workspace, I am not able to run a simple docker run hello-world. I'm new to terraform and sorry if anything that I say or/and aks sounds stupid.
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
Coder is running using the docker-compose file based on coder docs (https://github.com/coder/coder/blob/main/docker-compose.yaml). I updated some values, but that is basically it. I create a new template using a started docker containers template. I edited the Dockerfile to use a custom one. I edited the main.tf file and include what is on coder sysbox docs (https://coder.com/docs/v2/latest/templates/docker-in-workspaces#use-sysbox-in-docker-based-templates). What I have for now is this:
resource "docker_container" "workspace" {
count = data.coder_workspace.me.start_count
image = docker_image.main.name
# Uses lower() to avoid Docker restriction on container names.
name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
# Hostname makes the shell more user friendly: coder@my-workspace:~$
hostname = data.coder_workspace.me.name
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]

command = ["sh", "-c", coder_agent.main.init_script]
# Use the Sysbox container runtime (required)
runtime = "sysbox-runc"


host {
host = "host.docker.internal"
ip = "host-gateway"
}
volumes {
container_path = "/home/${local.username}"
volume_name = docker_volume.home_volume.name
read_only = false
}
resource "docker_container" "workspace" {
count = data.coder_workspace.me.start_count
image = docker_image.main.name
# Uses lower() to avoid Docker restriction on container names.
name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
# Hostname makes the shell more user friendly: coder@my-workspace:~$
hostname = data.coder_workspace.me.name
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]

command = ["sh", "-c", coder_agent.main.init_script]
# Use the Sysbox container runtime (required)
runtime = "sysbox-runc"


host {
host = "host.docker.internal"
ip = "host-gateway"
}
volumes {
container_path = "/home/${local.username}"
volume_name = docker_volume.home_volume.name
read_only = false
}
and
resource "coder_agent" "main" {
arch = data.coder_provisioner.me.arch
os = "linux"
startup_script = <<-EOT
set -e

# Start Docker
sudo dockerd &

# Prepare user home with default files on first start.
if [ ! -f ~/.init_done ]; then
cp -rT /etc/skel ~
touch ~/.init_done
fi

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.19.1
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT
...
resource "coder_agent" "main" {
arch = data.coder_provisioner.me.arch
os = "linux"
startup_script = <<-EOT
set -e

# Start Docker
sudo dockerd &

# Prepare user home with default files on first start.
if [ ! -f ~/.init_done ]; then
cp -rT /etc/skel ~
touch ~/.init_done
fi

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.19.1
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT
...
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
I will put here how all my setup is configured, maybe it will help you better understand my problem.
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
Are the docs updated?
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
After following the docs I did not manage to put it working.
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
helllo @Atif, after installing sysbox on my host server, I'm having problems get it working on my docker in docker workspace.
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
Unfortunately I will not be able to do that. I will try installing sysbox on my host and see if I can work from that on
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
If I didn't need the docker socket of the host machine
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
That you be much better
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
How can I do that?
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
So I can't make that during a work day
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
I need to schedule it for the right time since I have to stop every container
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
Thanks, then I try it out
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
Ahh ok, I see
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
Can I not mount the docker socket volume and then install sysbox on the container?
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
Sorry but I am still not sure where to install it. Now, I set coder up using the docker-compose file and I am mounting the docker socket to the container. I am not allowed to install sysbox-runc on the host machine because we have another projects that need another runtime engine. So, do I have to install it on the docker container where I have coder or on my host machine?
45 replies
CCoder.com
Created by Marco Aleixo on 6/19/2023 in #help
Docker Dind Volume Issue
In a selfhosted server
45 replies