[READ-ONLY] Mirror of https://github.com/shuuji3/packer-tutorial.
0

Configure Feed

Select the types of activity you want to include in your feed.

packer-tutorial / docker-ubuntu.pkr.hcl
491 B 30 lines
1packer { 2 required_plugins { 3 docker = { 4 version = ">= 0.0.7" 5 source = "github.com/hashicorp/docker" 6 } 7 } 8} 9 10source "docker" "ubuntu" { 11 image = "ubuntu:jammy" 12 commit = true 13} 14 15build { 16 name = "learn-packer" 17 sources = [ 18 "source.docker.ubuntu" 19 ] 20 21 provisioner "shell" { 22 environment_vars = [ 23 "MESSAGE=hello world" 24 ] 25 inline = [ 26 "echo Adding file to Docker container", 27 "echo \"MESSAGE is $MESSAGE\" > message.txt" 28 ] 29 } 30}