Skip to content

Instantly share code, notes, and snippets.

@tshst
Created December 29, 2015 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tshst/249f1a1d0c1aa115c0c4 to your computer and use it in GitHub Desktop.
Save tshst/249f1a1d0c1aa115c0c4 to your computer and use it in GitHub Desktop.
python.tf
# Configure the Docker provider

provider "docker" {
    host = "tcp://153.126.155.210:2376/"
    cert_path  = "/Users/t-shuichi/Dropbox/Public/docker_tls"
}

# Create a container
resource "docker_container" "python" {
    image = "${docker_image.python.latest}"
    name = "python"
    command = ["python", "-m", "smtpd", "-c", "DebuggingServer", "0.0.0.0:25"]
    ports = {
            internal = 25
            external = 25
            }
    volumes = {
            container_path = "/mnt/uploadfiles"
            host_path = "/home/tshst/uploadfiles"
            }
}

resource "docker_image" "python" {
    name = "python:2.7.11-slim"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment