-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
51 lines (41 loc) · 2.09 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
FROM artefact.skao.int/ska-tango-images-pytango-builder:9.4.1
LABEL \
author="Pedro Osório Silva <[email protected]>" \
description="This image contains SKAMPI packages jupyter notebooks and pytest" \
license="BSD-3-Clause" \
int.skao.team="Systems Team" \
int.skao.version="1.0.0" \
int.skao.repository="https://gitlab.com/ska-telescope/ska-skampi"
RUN apt update && apt install -y --no-install-recommends nodejs npm jq git bash vim make
RUN npm install -g configurable-http-proxy
RUN python3 -m pip install --no-cache-dir jupyterhub jupyterlab notebook
ARG YQ_VERSION=4.33.3
ARG KUBECTL_VERSION=1.26.3
ARG HELM_VERSION=3.11.2
ARG K9S_VERSION=0.27.3
RUN curl -L "https://github.com/mikefarah/yq/releases/download/v$YQ_VERSION/yq_linux_amd64" -o /usr/bin/yq && \
curl -L "https://dl.k8s.io/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl" -o /usr/bin/kubectl && \
curl -L "https://get.helm.sh/helm-v$HELM_VERSION-linux-amd64.tar.gz" -o /tmp/helm.tar.gz && \
curl -L "https://github.com/derailed/k9s/releases/download/v$K9S_VERSION/k9s_linux_amd64.tar.gz" -o /tmp/k9s.tar.gz && \
cd /tmp && \
tar -xvf /tmp/helm.tar.gz && cp linux-amd64/helm /usr/bin/helm && \
tar -xvf /tmp/k9s.tar.gz && cp k9s /usr/bin/k9s && \
chown root:root /usr/bin/yq /usr/bin/kubectl /usr/bin/helm /usr/bin/k9s && \
chmod 755 /usr/bin/yq /usr/bin/kubectl /usr/bin/helm /usr/bin/k9s
COPY --chown=tango:tango poetry.lock pyproject.toml README.md ./
COPY --chown=tango:tango tests/integration ./tests/integration
# We use a virtual env here, because of k8s-test-runner and to allow interactive
# changes by the users
USER tango
RUN poetry install && \
echo ". $(poetry env info -p)/bin/activate" >> ~/.bashrc && \
echo "exec /bin/bash \$@" >> ~/.profile
# Generate a kernel with the virtual environment
RUN $(poetry env info -p)/bin/python -m ipykernel install --user
USER root
COPY --chown=tango:tango ./ ./
RUN git config --global --add safe.directory /app && \
chown -R tango:tango /app
# Set bash as default shell, its more useful
RUN chsh -s /bin/bash tango
USER tango