-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
77 lines (66 loc) · 3.16 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
# CI host image for Beautiful Portfolio Tools - using brew to keep setup tooling synced between macOS & Ci Linux image
# ubuntu because alpine continues to have old glibc with complicated upgrade path
#
# NOTE
# CircleCI presubable does a "-v /var/run/docker.sock:/var/run/docker.sock" when requesting "setup_remote_docker"
# for local runs the "-v..." option needs to be supplied to the "docker run" command for thid Dockerfile to work
#
# WARNING
# All Kubernetes workload images are generic and in no way security harded or performance optimized!
# TODO: tie down to specific software versions on ubuntu and git clones
FROM ubuntu:latest
# Using ubuntu packages for system prerequisists only
RUN apt update
RUN apt install -y curl ruby git ca-certificates grep build-essential sudo lsb-release gnupg iputils-ping net-tools
# Fetch and install docker container engine
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]\
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt update
ENV DEBIAN_FRONTEND=noninteractive
RUN apt install -y docker-ce docker-ce-cli containerd.io
RUN newgrp docker
# Adding linuxbrew user needed for brew installation
RUN adduser --disabled-password --shell /bin/bash --gecos "" linuxbrew
RUN echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers
USER linuxbrew
WORKDIR /home/linuxbrew
ENV PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH \
SHELL=/bin/bash \
USER=linuxbrew
RUN sudo usermod -aG docker linuxbrew && newgrp docker
# Installing homebrew aka linuxbrew including essential package updates/configuration
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
RUN echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/linuxbrew/.profile
RUN eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# Insalling Kubernetes and ISTIO
RUN brew install kind kubectl helm
RUN curl -L https://istio.io/downloadIstio | sh -
RUN export ISTIO_HOME=$(ls|grep istio)
ENV PATH=$ISTIO_HOME/bin:$PATH
ENV CLUSTER_NAME=bpt-ci-cluster
ENV CLUSTER_CONTROL_PLANE=$CLUSTER_NAME"-control-plane"
# Installing Python & PySpark requirements
RUN brew install python3
# Do NOT "pip3 install pyspark" as it unsettles the JAVA environment for spark
# TODO: retrieve exact package list from requirements.txt through CI environment parameters
RUN pip3 install pandas pyarrow
RUN brew install apache-spark
# Install Postgres operator
RUN cd
RUN git clone https://github.com/zalando/postgres-operator.git
# Install MongoDB operator
RUN cd
RUN git clone https://github.com/mongodb/mongodb-kubernetes-operator.git
# Run entrypoint script that depends on actual container id and network post image creation
RUN cd
#RUN cd
COPY entrypoint.sh .
RUN sudo chown $(whoami) entrypoint.sh
RUN sudo chmod +x entrypoint.sh
COPY spark_minikube.yaml .
RUN sudo chown $(whoami) spark_minikube.yaml
RUN sudo chmod +x spark_minikube.yaml
ENTRYPOINT ["./entrypoint.sh"]