Skip to content

Commit

Permalink
Add aws session-manager-plugin to aws image
Browse files Browse the repository at this point in the history
Signed-off-by: peterdeme <snypox@gmail.com>
  • Loading branch information
peterdeme committed Oct 2, 2024
1 parent 01935f2 commit 93d762d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
if [ "${{ matrix.folder }}" == "aws" ]; then
docker run --rm ${{ env.IMAGE_NAME }} sh -c "python3 -c \"import boto3; print(boto3.__version__)\""
docker run --rm ${{ env.IMAGE_NAME }} sh -c "session-manager-plugin --version"
fi
if [ "${{ matrix.folder }}" == "gcp" ]; then
Expand Down
18 changes: 18 additions & 0 deletions aws/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
ARG REPOSITORY_BASE_PATH

# Go version taken from here: https://github.com/aws/session-manager-plugin/blob/mainline/Dockerfile
FROM golang:1.17-alpine AS ssm-builder

ARG VERSION=1.2.650.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

ARG REPOSITORY_BASE_PATH

FROM ${REPOSITORY_BASE_PATH}:latest

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

RUN chmod +x /usr/local/bin/session-manager-plugin

RUN pip install boto3 --break-system-packages

0 comments on commit 93d762d

Please sign in to comment.