forked from hitachienergy/epiphany
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (51 loc) · 1.96 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
# === Build epicli wheel file ===
FROM python:3.7-slim AS build-epicli-wheel
COPY . /src
WORKDIR /src/core/src/epicli
RUN python setup.py bdist_wheel
# === Build final image ===
FROM python:3.7-slim
ARG HELM_VERSION=3.3.1
ARG KUBECTL_VERSION=1.18.8
ARG USERNAME=epiuser
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ENV EPICLI_DOCKER_SHARED_DIR=/shared
COPY --from=build-epicli-wheel /src/core/src/epicli/dist/ /epicli/
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
autossh curl gcc jq libcap2-bin libffi-dev make musl-dev openssh-client procps psmisc ruby-full sudo tar unzip vim \
\
&& echo "Installing helm binary ..." \
&& curl -fsSLO https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz \
&& tar -xzof ./helm-v${HELM_VERSION}-linux-amd64.tar.gz --strip=1 -C /usr/local/bin linux-amd64/helm \
&& rm ./helm-v${HELM_VERSION}-linux-amd64.tar.gz \
&& helm version \
&& echo "Installing kubectl binary ..." \
&& curl -fsSLO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl \
&& chmod +x ./kubectl \
&& mv ./kubectl /usr/local/bin/kubectl \
&& kubectl version --client \
\
&& setcap 'cap_net_bind_service=+ep' /usr/bin/ssh \
\
&& gem install \
rake rspec_junit_formatter serverspec \
&& pip install --disable-pip-version-check --no-cache-dir \
/epicli/epicli-*-py3-none-any.whl \
\
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
\
&& groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
\
&& mkdir -p $EPICLI_DOCKER_SHARED_DIR \
&& chown $USERNAME $EPICLI_DOCKER_SHARED_DIR \
&& chmod g+w $EPICLI_DOCKER_SHARED_DIR
WORKDIR $EPICLI_DOCKER_SHARED_DIR
USER $USERNAME
ENTRYPOINT ["/bin/bash"]