Hi All,
for 2nd challenge. Im have below issue,
I see from docker that volume is created but im unable to understand the error.
Blockquote iac-server $ docker volume ls
DRIVER VOLUME NAME
local mariadb_volume
iac-server $ docker volume inspect mariadb_volume
[
{
“CreatedAt”: “2024-08-10T20:49:36Z”,
“Driver”: “local”,
“Labels”: null,
“Mountpoint”: “/var/lib/docker/volumes/mariadb_volume/_data”,
“Name”: “mariadb_volume”,
“Options”: null,
“Scope”: “local”
}
]
Create a terraform resource named mariadb_volume
creating a docker volume with name=mariadb-volume
Attach volume mariadb-volume
to /var/lib/mysql
directory within db container.
resource “docker_container” “mariadb” {
name = “db”
image = docker_image.mariadb-image.name
hostname = “db”
networks_advanced {
name=docker_network.private_network.id
}
ports {
internal = 3306
external = 3306
ip = “0.0.0.0”
}
labels {
label = “challenge”
value = “second”
}
env = [
“MYSQL_ROOT_PASSWORD=1234”,
“MYSQL_DATABASE=simple-website”
]
volumes {
container_path = “/var/lib/mysql”
volume_name = docker_volume.mariadb_volume.name
}
}