-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (42 loc) · 1.33 KB
/
Dockerfile
File metadata and controls
55 lines (42 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM golang:1.17-alpine as ssm-builder
# @link https://github.com/aws/session-manager-plugin/releases
ARG VERSION=1.2.398.0
RUN set -ex && apk update && apk add --no-cache make git gcc libc-dev curl bash zip
RUN curl -skLO https://github.com/aws/session-manager-plugin/archive/${VERSION}.tar.gz
RUN 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:latest
ENV LC_ALL=en_US.UTF-8
USER root
RUN apk update && apk add --no-cache \
gcc \
vim \
bash \
less \
sudo \
curl \
groff \
gnupg \
python3 \
py3-pip \
musl-dev \
libffi-dev \
python3-dev \
bind-tools \
ca-certificates \
openssh-client
RUN pip install awscli ansible boto3
# session manager
ARG TARGETARCH
COPY --from=ssm-builder /go/src/github.com/session-manager-plugin/bin/linux_${TARGETARCH}_plugin/session-manager-plugin /usr/bin/
ARG PUID=1000
ARG PGID=1000
RUN addgroup -g ${PGID} -S work && adduser -u ${PUID} -S work -G work -h /home/work
RUN echo 'work ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN mkdir -p /work
RUN chown -R work.work /home/work
USER work
WORKDIR /work