-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev Containers: Support volume mounts of devcontainer spec #220
Comments
coder-labeler
bot
added
enhancement
spike
Investigation to prove feasibility or validate an idea
labels
Jun 5, 2024
It is still possible to persist the workspace directory in a docker workspace build using envbuilder an resource "docker_volume" "workspaces" {
name = "coder-${data.coder_workspace.me.id}"
}
resource "docker_container" "workspace" {
count = data.coder_workspace.me.start_count
image = "ghcr.io/coder/envbuilder:latest"
name = "coder-${data.coder_workspace_owner.me.name}-${lower(data.coder_workspace.me.name)}"
hostname = data.coder_workspace.me.name
# Use the docker gateway if the access URL is 127.0.0.1
env = [
"CODER_AGENT_TOKEN=${coder_agent.main.token}",
"CODER_AGENT_URL=${replace(data.coder_workspace.me.access_url, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")}",
"GIT_URL="https://github.com/coder/envbuilder-starter-devcontainer",
"INIT_SCRIPT=${replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")}",
"FALLBACK_IMAGE=codercom/enterprise-base:ubuntu" # This image runs if builds fail
]
host {
host = "host.docker.internal"
ip = "host-gateway"
}
volumes {
container_path = "/workspaces"
volume_name = docker_volume.workspaces.name
read_only = false
}
} |
johnstcn
changed the title
Dev Containers: Support volume mounts
Dev Containers: Support volume mounts of devcontainer spec
Jun 10, 2024
@matifali this relates to the devcontainer specification and not mounting in a volume via Terraform. See: https://containers.dev/implementors/json_reference/#mounts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Follow-up: #219
Currently, Envbuilder does not support volume mounts at all
Scope: TBD
The text was updated successfully, but these errors were encountered: