-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
121 lines (108 loc) · 5.37 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
FROM ubuntu:xenial-20171006
# Provisioners versions
ENV TERRAFORM_VERSION=0.10.7
ENV ANSIBLE_VERSION=2.3.1.0
ENV LIBCLOUD_VERSION=1.5.0
ENV J2CLI_VERSION=0.3.1.post0
ENV DNSPYTHON_VERSION=1.15.0
ENV JMESPATH_VERSION=0.9.3
ENV SHADE_VERSION=1.21.0
ENV OPENSTACKCLIENT_VERSION=3.11.0
ENV GLANCECLIENT_VERSION=2.8.0
ENV AWSCLI_VERSION=1.11.177
ENV AZURE_CLI_VERSION=2.0.25
ENV GOOGLE_CLOUD_SDK_VERSION=179.0.0-0
# OBS !!! Dont use VIRTUALENV_VERSION IT IS RESERVED! FOR VIRTUALENV
ENV VIRTENV_VERSION=15.1.0
# Terraform plugin versions
ENV PLUGIN_OPENSTACK=0.2.2
ENV PLUGIN_GOOGLE=0.1.3
ENV PLUGIN_AWS=1.0.0
ENV PLUGIN_AZURERM=0.2.2
ENV PLUGIN_NULL=1.0.0
ENV PLUGIN_CLOUDFLARE=0.1.0
ENV PLUGIN_TEMPLATE=1.0.0
# Install with apt and pip
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
apt-transport-https \
git \
curl \
bc \
jq \
gosu \
libffi-dev \
openssl \
unzip \
libvirt-bin \
mkisofs \
python-pip && \
`# Add google cloud` \
echo "deb http://packages.cloud.google.com/apt cloud-sdk-xenial main" | \
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
apt-get update -y && apt-get install -y \
google-cloud-sdk="$GOOGLE_CLOUD_SDK_VERSION" && \
`# Pip` \
pip install --upgrade pip --no-cache-dir && \
pip install --no-cache-dir \
ansible=="$ANSIBLE_VERSION" \
j2cli=="$J2CLI_VERSION" \
dnspython=="$DNSPYTHON_VERSION" \
jmespath=="$JMESPATH_VERSION" \
apache-libcloud=="$LIBCLOUD_VERSION" \
shade=="$SHADE_VERSION" \
virtualenv=="$VIRTENV_VERSION" \
awscli=="$AWSCLI_VERSION" \
azure-cli=="$AZURE_CLI_VERSION" && \
`# Remove unwanted` \
rm -rf /usr/lib/gcc && \
rm -rf /usr/share/man && \
rm -rf /usr/lib/google-cloud-sdk/platform/gsutil && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Terraform
RUN curl "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" > \
"terraform_${TERRAFORM_VERSION}_linux_amd64.zip" && \
unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -d /bin && \
rm -f "terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
# Install Terraform plugins that are used
RUN mkdir -p /terraform_plugins
RUN curl "https://releases.hashicorp.com/terraform-provider-openstack/${PLUGIN_OPENSTACK}/terraform-provider-openstack_${PLUGIN_OPENSTACK}_linux_amd64.zip" > \
"terraform-provider-openstack_${PLUGIN_OPENSTACK}_linux_amd64.zip" && \
unzip "terraform-provider-openstack_${PLUGIN_OPENSTACK}_linux_amd64.zip" -d /terraform_plugins/ && \
rm -f "terraform-provider-openstack_${PLUGIN_OPENSTACK}_linux_amd64.zip"
RUN curl "https://releases.hashicorp.com/terraform-provider-google/${PLUGIN_GOOGLE}/terraform-provider-google_${PLUGIN_GOOGLE}_linux_amd64.zip" > \
"terraform-provider-google${PLUGIN_GOOGLE}_linux_amd64.zip" && \
unzip "terraform-provider-google${PLUGIN_GOOGLE}_linux_amd64.zip" -d /terraform_plugins/ && \
rm -f "terraform-provider-google${PLUGIN_GOOGLE}_linux_amd64.zip"
RUN curl "https://releases.hashicorp.com/terraform-provider-aws/${PLUGIN_AWS}/terraform-provider-aws_${PLUGIN_AWS}_linux_amd64.zip" > \
"terraform-provider-aws_${PLUGIN_AWS}_linux_amd64.zip" && \
unzip "terraform-provider-aws_${PLUGIN_AWS}_linux_amd64.zip" -d /terraform_plugins/ && \
rm -f "terraform-provider-aws_${PLUGIN_AWS}_linux_amd64.zip"
RUN curl "https://releases.hashicorp.com/terraform-provider-azurerm/${PLUGIN_AZURERM}/terraform-provider-azurerm_${PLUGIN_AZURERM}_linux_amd64.zip" > \
"terraform-provider-azurerm_${PLUGIN_AZURERM}_linux_amd64.zip" && \
unzip "terraform-provider-azurerm_${PLUGIN_AZURERM}_linux_amd64.zip" -d /terraform_plugins/ && \
rm -f "terraform-provider-azurerm_${PLUGIN_AZURERM}_linux_amd64.zip"
RUN curl "https://releases.hashicorp.com/terraform-provider-null/${PLUGIN_NULL}/terraform-provider-null_${PLUGIN_NULL}_linux_amd64.zip" > \
"terraform-provider-null_${PLUGIN_NULL}_linux_amd64.zip" && \
unzip "terraform-provider-null_${PLUGIN_NULL}_linux_amd64.zip" -d /terraform_plugins/ && \
rm -f "terraform-provider-null_${PLUGIN_NULL}_linux_amd64.zip"
RUN curl "https://releases.hashicorp.com/terraform-provider-cloudflare/${PLUGIN_CLOUDFLARE}/terraform-provider-cloudflare_${PLUGIN_CLOUDFLARE}_linux_amd64.zip" > \
"terraform-provider-cloudflare_${PLUGIN_CLOUDFLARE}_linux_amd64.zip" && \
unzip "terraform-provider-cloudflare_${PLUGIN_CLOUDFLARE}_linux_amd64.zip" -d /terraform_plugins/ && \
rm -f "terraform-provider-cloudflare_${PLUGIN_CLOUDFLARE}_linux_amd64.zip"
RUN curl "https://releases.hashicorp.com/terraform-provider-template/${PLUGIN_TEMPLATE}/terraform-provider-template_${PLUGIN_TEMPLATE}_linux_amd64.zip" > \
"terraform-provider-template_${PLUGIN_TEMPLATE}_linux_amd64.zip" && \
unzip "terraform-provider-template_${PLUGIN_TEMPLATE}_linux_amd64.zip" -d /terraform_plugins/ && \
rm -f "terraform-provider-template_${PLUGIN_TEMPLATE}_linux_amd64.zip"
# libvirt-plugin
RUN curl "https://raw.githubusercontent.com/andersla/terraform-provider-libvirt-binary/master/master-180127-linux_x86/terraform-provider-libvirt.zip" > \
"terraform-provider-libvirt.zip" && \
unzip "terraform-provider-libvirt.zip" -d /terraform_plugins/ && \
rm -f "terraform-provider-libvirt.zip"y
# Copy script
COPY bin/docker-entrypoint-v2 /
# Set entrypoint
ENTRYPOINT ["/docker-entrypoint-v2"]