Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using SSM session provisioner does not work, because SSM session manager is not installed in the Docker container #22

Closed
dginther opened this issue Apr 26, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@dginther
Copy link

Using Ubuntu 20.04 on Github Actions.
In the 'builders':

"builders": [
  ...
  "ssh_username": "ubuntu",
  "ssh_interface": "session_manager",
  "communicator": "ssh",
...
]

Current Behavior

==> amazon-ebs: exec: "session-manager-plugin": executable file not found in $PATH

Steps to Reproduce

Try to use a builder config that uses session_manager

"builders": [
  ...
  "ssh_username": "ubuntu",
  "ssh_interface": "session_manager",
  "communicator": "ssh",
...
]

Environment

1.) Link to a Gist of your Workflow configuration:

2.) Any other relevant environment information:

@dginther dginther added the bug Something isn't working label Apr 26, 2021
@james-green-affinity
Copy link

james-green-affinity commented Apr 7, 2022

After hours of searching I give you a solution that works for me:
aws/session-manager-plugin#12 (comment)

FROM golang:1.15.3-alpine as ssm-builder

ARG VERSION=1.2.279.0

RUN set -ex && apk add --no-cache make git gcc libc-dev curl bash zip && \
    curl -sLO https://github.com/aws/session-manager-plugin/archive/${VERSION}.tar.gz && \
    mkdir -p /go/src/github.com && \
    tar xzf ${VERSION}.tar.gz && \
    mv session-manager-plugin-${VERSION} /go/src/github.com/session-manager-plugin && \
    cd /go/src/github.com/session-manager-plugin && \
    make release

# see https://hub.docker.com/r/hashicorp/packer/tags for all available tags
FROM hashicorp/packer:light@sha256:f795aace438ef92e738228c21d5ceb7d5dd73ceb7e0b1efab5b0e90cbc4d4dcd

COPY --from=ssm-builder /go/src/github.com/session-manager-plugin/bin/linux_amd64_plugin/session-manager-plugin /usr/local/bin/

RUN apk add ansible=2.10.7-r0

COPY "entrypoint.sh" "/entrypoint.sh"

ENTRYPOINT ["/entrypoint.sh"]

@ksatirli
Copy link
Member

Thank you for sharing this @james-green-affinity - this is helpful!

At this point, we're not looking to expand the upstream Packer image to include ancillary tooling, so I'll go ahead and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants