-
Notifications
You must be signed in to change notification settings - Fork 69
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
alpine support? #12
Comments
Hi @artempartos, would you mind add more details for the request. Do you mean to use session manager plugin in alpine linux, or facing some issues when connecting to an alpine linux target? |
Sorry, I mean I want to use it on alpine machine, it can't use rpm or deb packages. |
Trying to build the binary on alpine fails due to a hardcoded dependency on bash. Based on my testing This is the error when building for Alpine:
|
Should make resolving aws#12 easier
Should make resolving aws#12 easier
Related changes: * Fix checks for gofmt and gofmt errors * Use $() over `` Should make resolving aws#12 easier
Related changes: * Fix checks for gofmt and gofmt errors * Use $() over `` Should make resolving aws#12 easier
+1 for supporting alpine. You can easily install bash on alpine with |
Since the session manager client seems to be only a single binary I was able to just copy the binary from the deb to my alpine container with a multistage Dockerfile: FROM ubuntu:20.04 as sessionmanagerplugin
RUN apt-get update \
&& apt-get install -y curl \
&& curl -Lo "session-manager-plugin.deb" "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" \
&& dpkg -i "session-manager-plugin.deb"
FROM alpine:2.13
COPY --from=sessionmanagerplugin /usr/local/sessionmanagerplugin/bin/session-manager-plugin /usr/local/bin/
Not the cleanest solution but better than compiling it myself IMO. |
Inspired by this comment, Dockerfile for session-manager-plugin compilation for Alpine 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
FROM alpine
COPY --from=ssm-builder /go/src/github.com/session-manager-plugin/bin/linux_amd64_plugin/session-manager-plugin /usr/local/bin/ Keep in mind that until this issue is resolved, golang version has to be < 1.16 |
I hope session-manager-plugin is gonna be the next! aws/aws-cli#4685 |
Hi, I'm still getting "SessionManagerPlugin is not found. Please refer to SessionManager Documentation here: http://docs.aws.amazon.com/console/systems-manager/session-manager-plugin-not-found" Do I need to do anything else with file /usr/local/bin/session-manager-plugin ? |
Initially missed @Skaronator's solution because the following entry had more attention - nice work thanks! My improvement on this is:
since it's cached. Had tried the alpine builder, then used AWS's image for a slightly cleaner set of commands, but both unnecessarily build the binary each time and it's a significant wait. |
Did you ever figure it out? I'm getting the same issue:
|
@raysn0w you need to install |
I have installed
I installed a glibc package instead: https://github.com/sgerrand/alpine-pkg-glibc?tab=readme-ov-file That worked, but I am still wondering why |
This works for Alpine docker under ARM / M1/Mx Mac. Tested on Alpine 3.18.6
|
Copying a binary from another source doesn't solve the issue that as is today the session manager plugin can't be built from source on Alpine Linux. |
This is the solution ended up working for us, a continuation of @bobbymaher's: FROM alpine AS ssm-builder
ARG TARGETARCH
RUN apk add dpkg curl; \
if [ "$TARGETARCH" = "arm64" ]; then \
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_arm64/session-manager-plugin.deb" -o "session-manager-plugin.deb"; \
else \
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb"; \
fi; \
dpkg -x session-manager-plugin.deb session-manager-plugin
FROM alpine
COPY --from=ssm-builder /session-manager-plugin/usr/local/sessionmanagerplugin/bin/session-manager-plugin /usr/local/bin/
ARG TARGETARCH
# session-manager-plugin requires gcompat on amd64
RUN if [ "$TARGETARCH" = "amd64" ]; then \
apk add --no-cache gcompat; \
fi
RUN chmod +x /usr/local/bin/session-manager-plugin |
No description provided.
The text was updated successfully, but these errors were encountered: