-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (21 loc) · 1.13 KB
/
Dockerfile
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
FROM ubuntu
RUN apt-get update
RUN apt-get install -y software-properties-common git jq net-tools netcat curl wget
RUN apt-get update
RUN add-apt-repository ppa:longsleep/golang-backports && apt update && apt -y install golang-go
ENV GOPATH /home/go
ENV PATH /home/go/bin:$PATH
RUN go get github.com/yudai/gotty
RUN apt-get install -y dialog apt-utils
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get install -y -q awscli
RUN aws --version
ENV AWS_METADATA_IP 169.254.170.2
RUN apt-get install -y vim nmap
RUN echo 'export AWS_ACCESS_KEY_ID=$(curl http://$AWS_METADATA_IP$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI | jq .AccessKeyId -r)' >> ~/.bashrc
RUN echo 'export AWS_SECRET_ACCESS_KEY=$(curl http://$AWS_METADATA_IP$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI | jq .SecretAccessKey -r)' >> ~/.bashrc
RUN echo 'export AWS_SESSION_TOKEN=$(curl http://$AWS_METADATA_IP$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI | jq .Token -r)' >> ~/.bashrc
RUN apt-get install -y lsof libcap2-bin
COPY ./get_s3_obj.sh /get_s3_obj.sh
COPY ./list_s3_buckets.sh /get_s3_obj.sh
ENTRYPOINT ["gotty", "-w", "/bin/bash"]