-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathDockerfile
132 lines (97 loc) · 3.02 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
ARG JENKINS_VERSION=lts-slim
FROM jenkins/jenkins:$JENKINS_VERSION
LABEL maintainer="Saeid Bostandoust <ssbostan@linuxmail.org>"
##### Install jenkins plugins
RUN jenkins-plugin-cli --plugins \
configuration-as-code \
workflow-aggregator \
job-dsl \
pipeline-model-definition \
antisamy-markup-formatter \
terraform \
kubernetes-credentials \
kubernetes-client-api \
kubernetes \
kubernetes-cli \
openshift-client \
docker-plugin \
docker-commons \
docker-workflow \
git \
git-parameter \
github \
junit \
cobertura \
htmlpublisher \
generic-webhook-trigger \
ansible \
credentials \
credentials-binding \
rebuild \
run-condition \
ssh \
publish-over-ssh \
copyartifact \
metrics \
prometheus \
http_request \
s3 \
slack \
mattermost \
config-file-provider \
ansicolor \
keycloak \
join \
ws-cleanup \
ssh-steps \
ec2 \
codedeploy \
permissive-script-security \
influxdb \
ssh-credentials \
matrix-auth \
durable-task \
script-security \
multibranch-scan-webhook-trigger \
remote-file
USER root
##### Install docker client
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https \
ca-certificates curl \
gnupg gnupg2 \
software-properties-common \
lsb-release \
apt-utils
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce-cli
##### Install kubernetes client
RUN curl -LO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
chmod +x kubectl && mv kubectl /usr/local/bin/kubectl
##### Install helm
RUN curl -fsSL https://baltocdn.com/helm/signing.asc | apt-key add -
RUN apt-add-repository "deb https://baltocdn.com/helm/stable/debian all main"
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y helm
##### Install terraform
RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
RUN apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y terraform
##### Install pulumi
RUN curl -LO "https://get.pulumi.com/releases/sdk/pulumi-v$(curl -sL https://www.pulumi.com/latest-version)-linux-x64.tar.gz" && \
tar -zxf pulumi-v*-linux-x64.tar.gz && \
mv pulumi/pulumi* /usr/local/bin && \
rm -rf pulumi-v*-linux-x64.tar.gz pulumi
##### Install python
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip python3-venv
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
##### Install ansible
RUN pip install ansible
COPY ansible.yaml /tmp/ansible.yaml
RUN ansible-galaxy collection install -r /tmp/ansible.yaml
##### Install maasta
RUN pip install maasta
##### Install tf2
RUN pip install tf2project
##### Run with jenkins user
USER jenkins