-
Notifications
You must be signed in to change notification settings - Fork 59
/
Dockerfile
187 lines (153 loc) · 6.4 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# Build the Go binaries using a multi-stage build phase named "golang"
FROM golang:1.10.3-alpine3.7 as golang
LABEL maintainer="Andrew Kutz <[email protected]>"
RUN apk --no-cache add git
# Build the IBM Bluemix Terraform provider
RUN git clone https://github.com/IBM-Cloud/terraform-provider-ibm.git \
$GOPATH/src/github.com/IBM-Cloud/terraform-provider-ibm && \
go install github.com/IBM-Cloud/terraform-provider-ibm
# Build Oracle terraform provider
RUN git clone https://github.com/terraform-providers/terraform-provider-oci.git \
$GOPATH/src/github.com/terraform-providers/terraform-provider-oci && \
cd $GOPATH/src/github.com/terraform-providers/terraform-provider-oci ; git checkout tags/v3.0.0 ; cd - && \
go install github.com/terraform-providers/terraform-provider-oci
# Build the Packet.net terraform provider
RUN git clone https://github.com/terraform-providers/terraform-provider-packet.git \
$GOPATH/src/github.com/terraform-providers/terraform-provider-packet && \
cd $GOPATH/src/github.com/terraform-providers/terraform-provider-packet && \
go install github.com/terraform-providers/terraform-provider-packet
# Build the Gzip+Base64 Terraform provider Gzip+base64 & ETCD Provider
RUN go get github.com/jakexks/terraform-provider-gzip
# Build the Etcd Terraform provider
RUN go get github.com/paperg/terraform-provider-etcdiscovery
# Build the vSphere CLI tool, govc.
ENV GOVC_VERSION=0.18.0
RUN go get -d github.com/vmware/govmomi && \
git --work-tree /go/src/github.com/vmware/govmomi \
--git-dir /go/src/github.com/vmware/govmomi/.git \
checkout -b v${GOVC_VERSION} v${GOVC_VERSION} && \
go install github.com/vmware/govmomi/govc
#FROM crosscloudci/debian-go:latest
FROM alpine:3.7
LABEL maintainer="Denver Williams <[email protected]>"
ENV KUBECTL_VERSION=v1.13.0
ENV HELM_VERSION=v2.13.1
# PIN to Commit on Master
ENV TERRAFORM_VERSION=0.11.7
# ENV TERRAFORM_VERSION=master
# ENV TF_DEV=true
# ENV TF_RELEASE=true
ENV ARC=amd64
# Install the common dependencies.
RUN apk --no-cache add \
bash \
ca-certificates \
curl \
git \
jq \
less \
libc6-compat \
openssh-client \
tar \
unzip \
util-linux
# Install the dependencies for rvm.
RUN apk --no-cache add \
gcc \
gnupg \
libssl1.0 \
linux-headers \
make \
musl-dev \
openssl \
openssl-dev \
procps \
ruby \
zlib \
zlib-dev
# Install pip, used to install the AWS CLI.
RUN apk --no-cache add \
py2-pip
# Install the dependencies for the Google Cloud SDK.
RUN apk --no-cache add \
python \
py-crcmod
# Link lib64 to lib
RUN ln -s /lib /lib64
# Remove the package cache to free space.
RUN rm -fr /var/cache/apk/*
# Upgrade pip and install the AWS CLI.
RUN pip install --upgrade pip && pip install awscli
# Copy the GoVC binary from the golang build stage.
COPY --from=golang /go/bin/govc /usr/local/bin/
# Install the Google Cloud SDK
ENV CLOUD_SDK_VERSION=203.0.0
ENV PATH=/google-cloud-sdk/bin:$PATH
RUN curl -sSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz | \
tar xz -C /
# Install the kubectl binary
RUN curl -sSL -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARC}/kubectl && \
chmod +x /usr/local/bin/kubectl
# Install the helm binary
RUN curl -sSL https://storage.googleapis.com/kubernetes-helm/helm-${HELM_VERSION}-linux-${ARC}.tar.gz | \
tar xz --strip-components=1 -C /usr/local/bin linux-${ARC}/helm
# Install the terraform binary
RUN curl -sSLO https://releases.hashicorp.com/terraform/$TERRAFORM_VERSION/terraform_"${TERRAFORM_VERSION}"_linux_$ARC.zip && \
unzip terraform_"${TERRAFORM_VERSION}"_linux_${ARC}.zip -d /usr/bin
# Copy the Terraform providers from the golang build stage
COPY --from=golang /go/bin/terraform-provider-* /usr/local/bin/
# Write the configuration file Terraform uses to query available providers
# and their binaries
RUN echo providers { >> ~/.terraformrc && \
echo ' gzip = "/usr/local/bin/terraform-provider-gzip"' >> ~/.terraformrc && \
echo ' etcdiscovery = "/usr/local/bin/terraform-provider-etcdiscovery"' >> ~/.terraformrc && \
echo ' ibm = "/usr/local/bin/terraform-provider-ibm"' >> ~/.terraformrc && \
echo ' oci = "/usr/local/bin/terraform-provider-oci"' >> ~/.terraformrc && \
echo ' packet = "/usr/local/bin/terraform-provider-packet"' >> ~/.terraformrc && \
echo } >> ~/.terraformrc
#Add Terraform Modules
COPY validate-cluster/ /cncf/validate-cluster/
COPY aws/ /cncf/aws/
COPY azure/ /cncf/azure/
COPY ibm/ /cncf/ibm/
COPY gce/ /cncf/gce/
COPY gke/ /cncf/gke/
COPY openstack/ /cncf/openstack/
COPY oci/ /cncf/oci/
COPY packet/ /cncf/packet/
COPY vsphere/ /cncf/vsphere/
# END PROVIDERS - DO NOT REPLACE
COPY bootstrap/ /cncf/bootstrap/
COPY dns/ /cncf/dns/
COPY dns-etcd/ /cncf/dns-etcd/
COPY kubeconfig/ /cncf/kubeconfig/
COPY socat/ /cncf/socat/
COPY tls/ /cncf/tls/
COPY provision.sh /cncf/
COPY s3-backend.tf /cncf/
COPY file-backend.tf /cncf/
COPY rbac/ /cncf/rbac/
COPY addons/ /cncf/addons/
COPY addons-arm/ /cncf/addons-arm/
COPY master_templates-v1.7.2/ /cncf/master_templates-v1.7.2/
COPY master_templates-v1.8.1/ /cncf/master_templates-v1.8.1/
COPY master_templates-v1.9.0-alpha.1/ /cncf/master_templates-v1.9.0-alpha.1/
COPY master_templates-v1.9.0/ /cncf/master_templates-v1.9.0/
COPY master_templates-v1.9.0-dns-etcd/ /cncf/master_templates-v1.9.0-dns-etcd/
COPY master_templates-v1.10.0/ /cncf/master_templates-v1.10.0/
COPY master_templates-v1.10.0-ubuntu/ /cncf/master_templates-v1.10.0-ubuntu/
COPY master_templates-v1.13.0/ /cncf/master_templates-v1.13.0/
COPY master_templates-v1.13.0-ubuntu/ /cncf/master_templates-v1.13.0-ubuntu/
COPY worker_templates-v1.7.2/ /cncf/worker_templates-v1.7.2/
COPY worker_templates-v1.8.1/ /cncf/worker_templates-v1.8.1/
COPY worker_templates-v1.9.0-alpha.1/ /cncf/worker_templates-v1.9.0-alpha.1/
COPY worker_templates-v1.9.0/ /cncf/worker_templates-v1.9.0/
COPY worker_templates-v1.10.0/ /cncf/worker_templates-v1.10.0/
COPY worker_templates-v1.10.0-ubuntu/ /cncf/worker_templates-v1.10.0-ubuntu/
COPY worker_templates-v1.13.0/ /cncf/worker_templates-v1.13.0/
COPY worker_templates-v1.13.0-ubuntu/ /cncf/worker_templates-v1.13.0-ubuntu/
# Ensure scripts are executable.
RUN chmod +x /cncf/provision.sh \
/cncf/vsphere/destroy-force.sh
WORKDIR /cncf/
CMD ["bash", "-c", "/cncf/provision.sh"]