1
0
Fork 0
terraform-training/10_docker/base.tf

36 lines
610 B
Terraform
Raw Normal View History

2020-05-15 11:28:45 +02:00
provider "docker" {
host = "ssh://ubuntu@3.9.10.22:22"
}
resource "docker_image" "nginx" {
name = "nginx:latest"
}
2020-05-15 12:11:32 +02:00
resource "docker_network" "net1" {
name = "docker-net1"
driver = "bridge"
ipam_config {
subnet = "192.168.0.0/24"
}
}
resource "docker_volume" "vol1" {
name = "vol1"
}
2020-05-15 11:28:45 +02:00
resource "docker_container" "web" {
name = "foo"
image = docker_image.nginx.latest
ports {
internal = 80
external = 80
}
2020-05-15 12:11:32 +02:00
networks_advanced {
name = docker_network.net1.name
}
volumes {
volume_name = docker_volume.vol1.name
container_path = "/usr/share/nginx/html"
}
2020-05-15 11:28:45 +02:00
}