Setting container_path Permissions #594
Unanswered
smorgan134
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all! I'm a beginner learning Terraform, and I've been working to set up a Bind9 docker container using Terraform. For the most part it's creating the container and attaching the network, but the container exits right away with the following errors...
04-Jan-2024 00:17:42.247 configuring command channel from '/etc/bind/rndc.key'
04-Jan-2024 00:17:42.251 command channel listening on 127.0.0.1#953
04-Jan-2024 00:17:42.251 configuring command channel from '/etc/bind/rndc.key'
04-Jan-2024 00:17:42.251 command channel listening on ::1#953
04-Jan-2024 00:17:42.251 the working directory is not writable
04-Jan-2024 00:17:42.259 loading configuration: permission denied
04-Jan-2024 00:17:42.259 exiting (due to fatal error)
Here are my Terraform files...
provider.tf
terraform{
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "3.0.2"
}
}
}
provider "docker" {
host = "unix:///var/run/docker.sock"
}
bind9.tf
resource "docker_image" "bind" {
name = "ubuntu/bind9:latest"
keep_locally = false
}
resource "docker_container" "ns1" {
image = docker_image.bind.name
name = "test"
env = [
"BIND9_USER = root",
"TZ = America/Chicago"
]
volumes {
container_path = "/etc/bind"
host_path = "/home/mvadmin/bind9/config"
read_only = false
}
volumes {
container_path = "/var/cache/bind"
host_path = "/home/mvadmin/bind9/cache"
read_only = false
}
volumes {
container_path = "/var/lib/bind"
host_path = "/home/mvadmin/bind9/records"
read_only = false
}
networks_advanced {
name="mvdocknet"
ipv4_address = "10.134.50.2"
}
}
data "docker_network" "mvdocknet" {
name = "mvdocknet"
}
I'm so close to getting this working. The permissions part is the only thing keeping it from working.
Beta Was this translation helpful? Give feedback.
All reactions