This issue was originally opened by @mprzybylski in hashicorp/packer#11283 and has been migrated to this repository. The original issue description is below.
Hello,
I took @SwampDragons up on her suggestion in issue #8120 to "tinker and can figure out how to make (distroless images) work":
- Start from one of the distroless "debug" images. These are identical to the base images except that they have busybox installed.
- Change the
run_command for the docker source to ["-d", "-i", "-t", "--entrypoint=/busybox/sh", "--", "{{.Image}}"]
- Create a symlink from
/busybox/sh to /bin/sh to make shell provisioners work:
provisioner "shell-local"{
inline = ["docker exec ${build.ID} ln -s /busybox/sh /bin/sh"]
}
- Optional: run a shell-local, docker-exec-hack provisioner to delete the
/busybox directory after all other provisioning is complete:
provisioner "shell-local" {
only = ["docker.ebpf_sensor"]
inline = ["docker exec ${build.ID} rm -rf /bin/sh /busybox"]
}
Hope this helps!
-Mike Przybylski
This issue was originally opened by @mprzybylski in hashicorp/packer#11283 and has been migrated to this repository. The original issue description is below.
Hello,
I took @SwampDragons up on her suggestion in issue #8120 to "tinker and can figure out how to make (distroless images) work":
run_commandfor the docker source to["-d", "-i", "-t", "--entrypoint=/busybox/sh", "--", "{{.Image}}"]/busybox/shto/bin/shto make shell provisioners work:/busyboxdirectory after all other provisioning is complete:Hope this helps!
-Mike Przybylski