-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile_production_aws
41 lines (33 loc) · 1.83 KB
/
Dockerfile_production_aws
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
ARG AW_VERSION
# BUILD: docker build -f Dockerfile_production_aws -t "ansible0guy/webui-aws:<VERSION>" --build-arg "AW_VERSION=<VERSION>" --no-cache --progress=plain .
# references:
# https://github.com/ansibleguy/webui/discussions/5
# https://github.com/aws/session-manager-plugin/issues/12#issuecomment-972880203
# https://github.com/aws/session-manager-plugin/blob/mainline/Dockerfile
# https://github.com/aws/session-manager-plugin/blob/mainline/makefile
FROM public.ecr.aws/docker/library/golang:1.17-alpine as ssm-builder
# https://hub.docker.com/_/golang/tags?page=1&name=1.15
ARG SSM_VERSION=1.2.553.0
# ssm version: https://github.com/aws/session-manager-plugin/releases
RUN apk add --no-cache make git gcc libc-dev curl bash zip && \
curl -sLO https://github.com/aws/session-manager-plugin/archive/${SSM_VERSION}.tar.gz && \
mkdir -p /go/src/github.com && \
tar xzf ${SSM_VERSION}.tar.gz && \
mv session-manager-plugin-${SSM_VERSION} /go/src/github.com/session-manager-plugin && \
echo -n ${SSM_VERSION} > /go/src/github.com/session-manager-plugin/VERSION && \
cd /go/src/github.com/session-manager-plugin && \
make pre-build && \
make pre-release && \
make build-linux-amd64 && \
make prepack-linux-amd64
# debugging - check if executables exist and are working:
# /go/src/github.com/session-manager-plugin/bin/linux_amd64_plugin/session-manager-plugin --version &&
# /go/src/github.com/session-manager-plugin/bin/linux_amd64/ssmcli help
FROM ansible0guy/webui-unprivileged:${AW_VERSION}
ARG AW_USER=aw
USER root
RUN apk add py3-boto3 aws-cli
COPY --from=ssm-builder /go/src/github.com/session-manager-plugin/bin/linux_amd64_plugin/session-manager-plugin \
/go/src/github.com/session-manager-plugin/bin/linux_amd64/ssmcli \
/usr/bin/
USER ${AW_USER}