github.com/swisspost/terratest@v0.0.0-20230214120104-7ec6de2e1ae0/examples/packer-docker-example/build.json (about)

     1  {
     2    "variables": {
     3      "aws_region": "us-east-1",
     4      "ami_name_base": "terratest-packer-docker-example",
     5      "instance_type": "t2.micro"
     6    },
     7    "builders": [{
     8      "name": "ubuntu-ami",
     9      "ami_name": "{{user `ami_name_base`}}-{{isotime | clean_resource_name}}",
    10      "ami_description": "An example of how to create a custom AMI with a simple web app on top of Ubuntu",
    11      "instance_type": "{{user `instance_type`}}",
    12      "region": "{{user `aws_region`}}",
    13      "type": "amazon-ebs",
    14      "source_ami_filter": {
    15        "filters": {
    16          "virtualization-type": "hvm",
    17          "architecture": "x86_64",
    18          "name": "*ubuntu-xenial-16.04-amd64-server-*",
    19          "block-device-mapping.volume-type": "gp2",
    20          "root-device-type": "ebs"
    21        },
    22        "owners": ["099720109477"],
    23        "most_recent": true
    24      },
    25      "ssh_username": "ubuntu",
    26      "encrypt_boot": false
    27    },{
    28      "name": "ubuntu-docker",
    29      "type": "docker",
    30      "image": "gruntwork/ubuntu-test:16.04",
    31      "commit": true,
    32      "changes": ["ENTRYPOINT [\"\"]"]
    33    }],
    34    "provisioners": [{
    35      "type": "shell",
    36      "inline": [
    37        "echo 'Sleeping for a few seconds to give Ubuntu time to boot up'",
    38        "sleep 30"
    39      ],
    40      "only": ["ubuntu-ami"]
    41    },{
    42      "type": "file",
    43      "source": "{{template_dir}}",
    44      "destination": "/tmp/packer-docker-example"
    45    },{
    46      "type": "shell",
    47      "inline": ["/tmp/packer-docker-example/configure-sinatra-app.sh"]
    48    }],
    49    "post-processors": [{
    50      "type": "docker-tag",
    51      "repository": "gruntwork/packer-docker-example",
    52      "tag": "latest",
    53      "only": ["ubuntu-docker"]
    54    }]
    55  }