forked from opsxcq/docker-devops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
117 lines (94 loc) · 2.69 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
FROM debian:9.2
LABEL maintainer "[email protected]"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
unzip \
unrar-free \
curl \
wget \
openssl \
ca-certificates \
python3 \
python3-pip \
python3-dev \
python3-yaml \
python3-virtualenv \
virtualenvwrapper \
libxml2-dev \
libxslt-dev \
libffi-dev \
libssl-dev \
ssh \
rsync \
git \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
############################# RClone
RUN wget http://downloads.rclone.org/rclone-current-linux-amd64.zip && \
unzip rclone-current-linux-amd64.zip -d /usr/bin && \
rm *.zip
############################# Ansible
RUN pip3 install --upgrade \
setuptools
RUN pip3 install --upgrade \
ansible \
paramiko \
PyYAML \
pycrypto \
pywinrm \
ansible-lint
# Jinja2 \
# httplib2 \
# six
# AWS dependencies
RUN pip3 install --upgrade \
urllib3 python-dateutil jmespath \
boto boto3 botocore
############################# GCloud cli
ARG CLOUD_SDK_VERSION=223.0.0
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
ARG INSTALL_COMPONENTS
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
gcc \
python3-dev \
python3-setuptools \
apt-transport-https \
lsb-release \
openssh-client \
git \
gnupg
RUN pip3 install crcmod && \
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
google-cloud-sdk=${CLOUD_SDK_VERSION}-0 && \
gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true && \
gcloud config set metrics/environment github_docker_image && \
gcloud --version
############################# Kubectl
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
kubectl
######################################################################
#### LEGO
WORKDIR /tmp
RUN wget https://github.com/xenolf/lego/releases/download/v2.1.0/lego_v2.1.0_linux_amd64.tar.gz -O lego.tar.gz && \
tar -zxvf lego.tar.gz && \
chmod +x lego && \
mv lego /bin/lego && \
lego -v
RUN useradd --system --uid 1000 -m --shell /usr/bash devops
USER devops
RUN pip3 install --upgrade --user awscli
RUN pip3 install boto3 botocore
ENV PATH="/home/devops/.local/bin/:${PATH}"
COPY main.sh /
ENTRYPOINT ["/main.sh"]
CMD ["default"]