mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 10:02:56 +01:00
Every package manager should clean up after themselves in order to keep docker layers neat and tiny: apt (Debian/Ubuntu package manager): - unneeded dependencies are cleared (autoremove) - caches are cleaned (clean) - package lists are deleted yum (CentOS package manager), zypper (OpenSuse package manager) - should clear caches after installing dependencies pip (Python package manager), apk (Alpine package manager) - should use no cache for installing dependencies
15 lines
280 B
Bash
Executable file
15 lines
280 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -xeou pipefail
|
|
|
|
ANSIBLE_VERSION=$1
|
|
|
|
apt-get update
|
|
apt-get install -y python-pip python-dev
|
|
|
|
pip install --no-cache-dir --upgrade cffi
|
|
pip install --no-cache-dir "ansible==${ANSIBLE_VERSION}"
|
|
|
|
apt-get autoremove -yq
|
|
apt-get clean -yqq
|
|
rm -rf /var/lib/apt/lists/*
|