File: Dockerfile

package info (click to toggle)
pandas 2.2.3%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,784 kB
  • sloc: python: 422,228; ansic: 9,190; sh: 270; xml: 102; makefile: 83
file content (100 lines) | stat: -rw-r--r-- 3,595 bytes parent folder | download
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
#
# Dockerfile for pandas development
#
# Usage:
# -------
#
# To make a local build of the container, from the 'Docker-dev' directory:
# docker build  --rm -f "Dockerfile" -t <build-tag> "."
#
# To use the container use the following command. It assumes that you are in
# the root folder of the pandas git repository, making it available as
# /home/pandas in the container. Whatever changes you make to that directory
# are visible in the host and container.
# The docker image is retrieved from the pandas dockerhub repository
#
# docker run --rm -it -v $(pwd):/home/pandas pandas/pandas-dev:<image-tag>
#
# By default the container will activate the conda environment pandas-dev
# which contains all the dependencies needed for pandas development
#
# To build and install pandas run:
#               python setup.py build_ext -j 4
#               python -m pip install -e . --no-build-isolation
#
# This image is based on: Ubuntu 20.04 (focal)
# https://hub.docker.com/_/ubuntu/?tab=tags&name=focal
# OS/ARCH: linux/amd64
FROM gitpod/workspace-base:latest

ARG MAMBAFORGE_VERSION="23.1.0-3"
ARG CONDA_ENV=pandas-dev
ARG PANDAS_HOME="/home/pandas"


# ---- Configure environment ----
ENV CONDA_DIR=/home/gitpod/mambaforge3 \
    SHELL=/bin/bash
ENV PATH=${CONDA_DIR}/bin:$PATH \
    WORKSPACE=/workspace/pandas

# -----------------------------------------------------------------------------
# ---- Creating as root - note: make sure to change to gitpod in the end ----
USER root

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# Configure apt and install packages
RUN apt-get update \
    && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
    #
    # Install tzdata and configure timezone (fix for tests which try to read from "/etc/localtime")
    && apt-get -y install tzdata \
    && ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime \
    && dpkg-reconfigure -f noninteractive tzdata \
    #
    # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
    && apt-get -y install git iproute2 procps iproute2 lsb-release \
    #
    # cleanup
    && apt-get autoremove -y \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog

# Allows this Dockerfile to activate conda environments
SHELL ["/bin/bash", "--login", "-o", "pipefail", "-c"]

# -----------------------------------------------------------------------------
# ---- Installing mamba  ----
RUN wget -q -O mambaforge3.sh \
    "https://github.com/conda-forge/miniforge/releases/download/$MAMBAFORGE_VERSION/Mambaforge-$MAMBAFORGE_VERSION-Linux-x86_64.sh" && \
    bash mambaforge3.sh -p ${CONDA_DIR} -b && \
    rm mambaforge3.sh

# -----------------------------------------------------------------------------
# ---- Copy needed files ----
# basic workspace configurations
COPY ./gitpod/workspace_config /usr/local/bin/workspace_config

RUN chmod a+rx /usr/local/bin/workspace_config && \
    workspace_config

# the container to create a conda environment from it
COPY environment.yml /tmp/environment.yml

# ---- Create conda environment ----
RUN mamba env create -f /tmp/environment.yml && \
    conda activate $CONDA_ENV && \
    mamba install ccache -y && \
    # needed for docs rendering later on
    python -m pip install --no-cache-dir sphinx-autobuild && \
    conda clean --all -f -y && \
    rm -rf /tmp/*

# -----------------------------------------------------------------------------
# Always make sure we are not root
USER gitpod