hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.13k stars 3.33k forks source link

Docker image does not include session-manager-plugin, unable to ssh_interface = "session_manager" #12267

Open querry43 opened 1 year ago

querry43 commented 1 year ago

Community Note

When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.

Overview of the Issue

Using ssh_interface = "session_manager" requires the session-manager-plugin is installed. This is not in the docker image and is also not available for alpine.

Reproduction Steps

docker run hashicorp/packer:light-1.8.5 build

Packer version

hashicorp/packer:light-1.8.5

Simplified Packer Template

source amazon-ebs builder {
...
  ssh_interface = "session_manager"
...
}

Operating system and Environment details

Docker version 20.10.17, build 100c701

Log Fragments and crash.log files

exec: "session-manager-plugin": executable file not found in $PATH
nywilken commented 1 year ago

Thanks for reaching out and opening up this requests. We had a similar request for xorriso in order to support the creation of cd_files. So I can understand this request. We are looking at changing the docker images we release for Packer in the future. That said, I don't think at this time this is something that we would want to add in to the container, as we would essentially pin the Amazon's session-manager plugin to Packer releases, which doesn't seem too maintainable.

I've added the thinking label to this issue and will discuss internal to see how to best handle this particular request.

Is there an option to not use Docker for now as a workaround in your environment?

Glyphack commented 1 year ago

I haven't tested this but the approach to load the packer image and add the session_manager could also work:

FROM hashicorp/packer:light-1.8.5

# Install session_manager
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm"
querry43 commented 1 year ago

No luck on alpine unfortunately. Amazon doesn’t share any binaries that are compatible.

On Sun, Feb 26, 2023 at 00:37 Shaygan Hooshyari @.***> wrote:

I haven't tested this but the approach https://stackoverflow.com/a/69251129/6183805 to load the packer image and add the session_manager could also work:

FROM hashicorp/packer:light-1.8.5

Install session_manager

curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm"

— Reply to this email directly, view it on GitHub https://github.com/hashicorp/packer/issues/12267#issuecomment-1445298864, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIJWYDBCGX72XCHOLTBOPDWZMI5PANCNFSM6AAAAAAU2W3S7M . You are receiving this because you authored the thread.Message ID: @.***>