mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 10:02:56 +01:00
bullseye is the latest stable, and this is what we will be using for Cloud Native GitLab going forward so we should test with this. Since an upgrade of the operating system may break pre-compiled C extensions, we now introduce a DEBIAN environment flag that defaults to the legacy buster install but allows us to roll out a bullseye image with `debian-bullseye` as the image name prefix.
76 lines
2.5 KiB
Bash
Executable file
76 lines
2.5 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -xeuo pipefail
|
|
IFS=$'\n\t'
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
apt-get update
|
|
|
|
# We install `git-core` as some tooling expect `/usr/bin/git`
|
|
# other tools that rely on PATH ordering will pick a one in `/usr/local`
|
|
# if present
|
|
function install_debian_stretch_deps() {
|
|
apt-get install -y \
|
|
curl wget build-essential apt-utils locales openssh-client \
|
|
libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \
|
|
libncurses5-dev libffi-dev libgdbm3 libgdbm-dev \
|
|
ca-certificates checkinstall libxml2-dev \
|
|
libxslt-dev libcurl4-openssl-dev libicu-dev \
|
|
logrotate python-docutils pkg-config cmake nodejs \
|
|
libkrb5-dev postgresql-client mysql-client unzip \
|
|
libsqlite3-dev libpq-dev libpng-dev libjpeg-dev libzstd-dev \
|
|
libre2-dev libevent-dev gettext rsync git-core
|
|
}
|
|
|
|
function install_debian_buster_deps() {
|
|
apt-get install -y \
|
|
curl wget build-essential apt-utils locales openssh-client \
|
|
libssl-dev libyaml-dev libreadline-dev zlib1g-dev \
|
|
libncurses5-dev libffi-dev ca-certificates libxml2-dev \
|
|
libxslt1-dev libcurl4-openssl-dev libicu-dev \
|
|
logrotate python-docutils pkg-config cmake \
|
|
libkrb5-dev postgresql-client unzip \
|
|
libsqlite3-dev libpq-dev libpng-dev libjpeg-dev libzstd-dev \
|
|
libre2-dev libevent-dev gettext rsync git-core
|
|
}
|
|
|
|
function install_debian_bullseye_deps() {
|
|
apt-get install -y \
|
|
curl wget build-essential apt-utils locales openssh-client \
|
|
libssl-dev libyaml-dev libreadline-dev zlib1g-dev \
|
|
libncurses5-dev libffi-dev ca-certificates libxml2-dev \
|
|
libxslt1-dev libcurl4-openssl-dev libicu-dev \
|
|
logrotate python3-docutils pkg-config cmake \
|
|
libkrb5-dev postgresql-client unzip \
|
|
libsqlite3-dev libpq-dev libpng-dev libjpeg-dev libzstd-dev \
|
|
libre2-dev libevent-dev gettext rsync git-core
|
|
}
|
|
|
|
VERSION=`cat /etc/issue | cut -d ' ' -f 3`
|
|
|
|
case "$VERSION" in
|
|
9)
|
|
install_debian_stretch_deps
|
|
;;
|
|
10)
|
|
install_debian_buster_deps
|
|
;;
|
|
11)
|
|
install_debian_bullseye_deps
|
|
;;
|
|
esac
|
|
|
|
# Set UTF-8
|
|
# http://stackoverflow.com/a/3182519/2137281
|
|
LOC=$'LC_ALL=C.UTF-8\nLANG=C.UTF-8'
|
|
echo "$LOC" > /etc/environment
|
|
cat /etc/environment
|
|
echo "C.UTF-8 UTF-8" > /etc/locale.gen
|
|
locale-gen
|
|
dpkg-reconfigure locales -f noninteractive -p critical
|
|
locale -a
|
|
|
|
apt-get autoremove -yq
|
|
apt-get clean -yqq
|
|
rm -rf /var/lib/apt/lists/*
|