NEW: packer file example with docker runtime options, OS commands, and file copy
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
docker = {
|
||||
version = ">= 1.0.8"
|
||||
source = "github.com/hashicorp/docker"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
source "docker" "image" {
|
||||
image = "alpine:latest"
|
||||
commit = true
|
||||
changes = [
|
||||
"LABEL maintainer=xpk@headdesk.me",
|
||||
"ENV container docker",
|
||||
"ENTRYPOINT [\"/sbin/tini\", \"--\"]",
|
||||
"CMD [\"/usr/sbin/sockd\"]"
|
||||
]
|
||||
run_command = [
|
||||
"-d", "-it", "--network=macvlan", "--", "{{.Image}}"
|
||||
]
|
||||
}
|
||||
|
||||
build {
|
||||
name = "alpine-dante"
|
||||
sources = [
|
||||
"source.docker.image"
|
||||
]
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"apk update",
|
||||
"apk add tini dante-server dante"
|
||||
]
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
source = "sockd.conf"
|
||||
destination = "/etc/sockd.conf"
|
||||
}
|
||||
|
||||
post-processor "docker-tag" {
|
||||
repository = "alpine/dante"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user