module

alinefr/module/docker

Terraform Module HCL DOCKER

Module to create & maintain docker resources from terraform

Install
module "module" {
source = "alinefr/module/docker"
version = "4.4.0"
}
plain text: /constructs/tfmod-alinefr-module-docker/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform Docker Module Overview Terraform docker module is a module to help docker maintenance over terraform. It should replace other means of docker maintenance like docker-compose. There are several advantages of maintaining docker on terraform. Infrastructure as code. CI/CD. Many CI tools offers some way to automate terraform execution. * Remote execution. You don't need to manually ssh into servers. This module uses under the hood Docker Provider. Example: ``hcl provider "docker" { host = "tcp://192.168.0.100:2375/" } module "proxy" { source = "alinefr/module/docker" version = " " image = "masnagam/nginx-proxy:latest" container_name = "proxy" restart_policy = "always" docker_networks = { "proxy-tier" = { ipam_config = { aux_address = {} gateway = "10.0.20.1" subnet = "10.0.20.0/24" }

Inputs (22)
NameTypeDescriptionDefault
environmentmap(string)Add environment variablesnull
commandlist(string)Override the default commandnull
portslist(object({ internal = nExpose portsnull
devicesmap(object({ container_patDevice mappings{}
healthcheckobject({ interval = stTest to check if container is healthynull
docker_networksanyList of custom networks to create ```hcl docker_networks = [ { name = "pro[]
initboolIf init process should be used as the PID 1 in the containerfalse
container_namestringCustom container namenull
networks_advancedanyAdvanced network options for the container ```hcl networks_advanced = [ { null
host_pathsmap(object({ container_patMount host paths{}
volumes_from_containerslist(any)Mount volumes from another containernull
capabilitiesobject({ add = list(strinAdd or drop container capabilitiesnull
imagestringSpecify the image to start the container from. Can either be a repository/tag ornull
existing_imagestringSpecify an existing image from another modulenull
dnslist(string)Set custom dns servers for the containernull
privilegedboolGive extended privileges to this containerfalse
network_modestringSpecify a custom network modenull
entrypointlist(string)Override the default entrypointnull
named_volumesmap(object({ container_patMount named volumes{}
hostnamestringSet docker hostnamenull
Outputs (21)
dns
ports
volumes
docker_volumes
healthcheck
init
hostname
command
image_id
network_mode
entrypoint
devices
capabilities
networks_advanced
docker_networks
environment
image_name
restart
privileged
container_name
working_dir
Resources (4)
docker_containerdocker_imagedocker_networkdocker_volume
Details
FrameworkTerraform Module
LanguageHCL
Version4.4.0
Cloud DOCKER
★ Stars15
Forks7
Total downloads4.1k
Inputs22
Outputs21
Resources4
Examples1
LicenseMPL-2.0
Namespacealinefr
Updated