Slide 13
Slide 13 text
©2024 HASHICORP
data "hcp-packer-artifact" "nodejs-base" {
bucket_name = var.base_image_bucket
channel_name = var.base_image_channel
platform = "docker"
region = "docker"
}
Images as code
• Repeatable and automated
builds with Packer
• Common syntax and
workflow for AMIs, VM
templates, and containers
• Publish artifact metadata to
HCP Packer registry
source "docker" "store-frontend" {
image = data.hcp-packer-artifact.nodejs-base.labels["ImageDigest"]
commit = true
platform = "linux/arm64"
changes = [
"WORKDIR /app",
"ENTRYPOINT [\"/app/entrypoint.sh\"]",
"CMD [\"node_modules/.bin/next\", \"start\"]",
"USER nextjs",
"EXPOSE 3000",
]
}
store-frontend.pkr.hcl