-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add aws
session-manager-plugin
to aws
image
Signed-off-by: peterdeme <snypox@gmail.com>
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,45 @@ | ||
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 | ||
FROM alpine AS ssm-builder | ||
|
||
# Architecture is either x86_64 or arm64 | ||
# RUN apk add dkpg | ||
|
||
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_amd64/session-manager-plugin.deb" -o "session-manager-plugin.deb"; \ | ||
fi; \ | ||
dpkg -x session-manager-plugin.deb session-manager-plugin; \ | ||
cp session-manager-plugin/usr/local/sessionmanagerplugin/bin/session-manager-plugin /usr/bin/session-manager-plugin | ||
|
||
# RUN dpkg -i session-manager-plugin.deb | ||
# RUN dpkg -x session-manager-plugin.deb session-manager-plugin && | ||
# cp session-manager-plugin/usr/local/sessionmanagerplugin/bin/session-manager-plugin /usr/bin/session-manager-plugin | ||
|
||
# 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/ | ||
COPY --from=ssm-builder /usr/bin/session-manager-plugin /usr/local/bin/ | ||
|
||
USER root | ||
|
||
RUN chmod +x /usr/local/bin/session-manager-plugin | ||
|
||
USER spacelift | ||
|
||
RUN pip install boto3 --break-system-packages |