mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-10 02:22:57 +01:00
Install docker and buildx using official instructions
This commit is contained in:
parent
65485241a6
commit
41165c16ff
4 changed files with 16 additions and 22 deletions
|
|
@ -7,20 +7,24 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
DOCKER_VERSION=${1}
|
||||
DEBIAN_VERSION=$(lsb_release -c -s)
|
||||
|
||||
apt-get update
|
||||
apt-get -y install \
|
||||
apt-get update && apt-get -y install \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg
|
||||
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
|
||||
echo "deb https://download.docker.com/linux/debian ${DEBIAN_VERSION} stable" >> /etc/apt/sources.list.d/docker.list
|
||||
mkdir -m 0755 -p /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
|
||||
${DEBIAN_VERSION} stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
apt-get update
|
||||
|
||||
PACKAGE_VERSION=$(apt-cache policy docker-ce | awk -v dv=${DOCKER_VERSION} '$1 ~ dv {print $1}')
|
||||
|
||||
apt-get install -y docker-ce=${PACKAGE_VERSION} docker-ce-cli=${PACKAGE_VERSION}
|
||||
apt-get install -y \
|
||||
docker-ce=${PACKAGE_VERSION} \
|
||||
docker-ce-cli=${PACKAGE_VERSION}
|
||||
|
||||
apt-get -yq autoremove
|
||||
apt-get clean -yqq
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue