|
| 1 | +ARG BASE_IMAGE=debian |
| 2 | +ARG BASE_IMAGE_TAG=12 |
| 3 | +ARG BUILD_ON_IMAGE=glcr.b-data.ch/python/ver |
| 4 | +ARG PYTHON_VERSION=3.12.7 |
| 5 | +ARG NEOVIM_VERSION=0.10.2 |
| 6 | +ARG GIT_VERSION=2.47.1 |
| 7 | +ARG GIT_LFS_VERSION=3.6.0 |
| 8 | +ARG PANDOC_VERSION=3.4 |
| 9 | + |
| 10 | +FROM glcr.b-data.ch/neovim/nvsi:${NEOVIM_VERSION} AS nvsi |
| 11 | +FROM glcr.b-data.ch/git/gsi/${GIT_VERSION}/${BASE_IMAGE}:${BASE_IMAGE_TAG} as gsi |
| 12 | +FROM glcr.b-data.ch/git-lfs/glfsi:${GIT_LFS_VERSION} as glfsi |
| 13 | + |
| 14 | +FROM ${BUILD_ON_IMAGE}${PYTHON_VERSION:+:$PYTHON_VERSION} |
| 15 | + |
| 16 | +ARG DEBIAN_FRONTEND=noninteractive |
| 17 | + |
| 18 | +ARG BUILD_ON_IMAGE |
| 19 | +ARG NEOVIM_VERSION |
| 20 | +ARG GIT_VERSION |
| 21 | +ARG GIT_LFS_VERSION |
| 22 | +ARG PANDOC_VERSION |
| 23 | +ARG BUILD_START |
| 24 | + |
| 25 | +ENV PARENT_IMAGE=${BUILD_ON_IMAGE}${PYTHON_VERSION:+:$PYTHON_VERSION} \ |
| 26 | + NEOVIM_VERSION=${NEOVIM_VERSION} \ |
| 27 | + GIT_VERSION=${GIT_VERSION} \ |
| 28 | + GIT_LFS_VERSION=${GIT_LFS_VERSION} \ |
| 29 | + PANDOC_VERSION=${PANDOC_VERSION} \ |
| 30 | + BUILD_DATE=${BUILD_START} |
| 31 | + |
| 32 | +## Install Neovim |
| 33 | +COPY --from=nvsi /usr/local /usr/local |
| 34 | +## Install Git |
| 35 | +COPY --from=gsi /usr/local /usr/local |
| 36 | +## Install Git LFS |
| 37 | +COPY --from=glfsi /usr/local /usr/local |
| 38 | + |
| 39 | +RUN dpkgArch="$(dpkg --print-architecture)" \ |
| 40 | + && apt-get update \ |
| 41 | + && apt-get -y install --no-install-recommends \ |
| 42 | + bash-completion \ |
| 43 | + build-essential \ |
| 44 | + curl \ |
| 45 | + file \ |
| 46 | + fontconfig \ |
| 47 | + g++ \ |
| 48 | + gcc \ |
| 49 | + gfortran \ |
| 50 | + gnupg \ |
| 51 | + htop \ |
| 52 | + info \ |
| 53 | + jq \ |
| 54 | + libclang-dev \ |
| 55 | + man-db \ |
| 56 | + nano \ |
| 57 | + ncdu \ |
| 58 | + procps \ |
| 59 | + psmisc \ |
| 60 | + screen \ |
| 61 | + sudo \ |
| 62 | + swig \ |
| 63 | + tmux \ |
| 64 | + vim-tiny \ |
| 65 | + wget \ |
| 66 | + zsh \ |
| 67 | + ## Neovim: Additional runtime recommendations |
| 68 | + ripgrep \ |
| 69 | + ## Git: Additional runtime dependencies |
| 70 | + libcurl3-gnutls \ |
| 71 | + liberror-perl \ |
| 72 | + ## Git: Additional runtime recommendations |
| 73 | + less \ |
| 74 | + ssh-client \ |
| 75 | + ## Python: Additional dev dependencies |
| 76 | + && if [ -z "$PYTHON_VERSION" ]; then \ |
| 77 | + apt-get -y install --no-install-recommends \ |
| 78 | + python3-dev \ |
| 79 | + ## Install Python package installer |
| 80 | + ## (dep: python3-distutils, python3-setuptools and python3-wheel) |
| 81 | + python3-pip \ |
| 82 | + ## Install venv module for python3 |
| 83 | + python3-venv; \ |
| 84 | + ## make some useful symlinks that are expected to exist |
| 85 | + ## ("/usr/bin/python" and friends) |
| 86 | + for src in pydoc3 python3 python3-config; do \ |
| 87 | + dst="$(echo "$src" | tr -d 3)"; \ |
| 88 | + if [ -s "/usr/bin/$src" ] && [ ! -e "/usr/bin/$dst" ]; then \ |
| 89 | + ln -svT "$src" "/usr/bin/$dst"; \ |
| 90 | + fi \ |
| 91 | + done; \ |
| 92 | + else \ |
| 93 | + ## Force update pip, setuptools and wheel |
| 94 | + pip install --upgrade --force-reinstall \ |
| 95 | + pip \ |
| 96 | + setuptools \ |
| 97 | + wheel; \ |
| 98 | + fi \ |
| 99 | + ## Git: Set default branch name to main |
| 100 | + && git config --system init.defaultBranch main \ |
| 101 | + ## Git: Store passwords for one hour in memory |
| 102 | + && git config --system credential.helper "cache --timeout=3600" \ |
| 103 | + ## Git: Merge the default branch from the default remote when "git pull" is run |
| 104 | + && git config --system pull.rebase false \ |
| 105 | + ## Install pandoc |
| 106 | + && curl -sLO https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-${dpkgArch}.deb \ |
| 107 | + && dpkg -i pandoc-${PANDOC_VERSION}-1-${dpkgArch}.deb \ |
| 108 | + && rm pandoc-${PANDOC_VERSION}-1-${dpkgArch}.deb \ |
| 109 | + ## Clean up |
| 110 | + && rm -rf /tmp/* \ |
| 111 | + && rm -rf /var/lib/apt/lists/* \ |
| 112 | + ${HOME}/.cache |
0 commit comments