github.com/sijibomii/docker@v0.0.0-20231230191044-5cf6ca554647/hack/make/test-old-apt-repo (about)

     1  #!/bin/bash
     2  set -e
     3  
     4  versions=( 1.3.3 1.4.1 1.5.0 1.6.2 )
     5  
     6  install() {
     7  	local version=$1
     8  	local tmpdir=$(mktemp -d /tmp/XXXXXXXXXX)
     9  	local dockerfile="${tmpdir}/Dockerfile"
    10  	cat <<-EOF > "$dockerfile"
    11  	FROM debian:jessie
    12  	ENV VERSION ${version}
    13  	RUN apt-get update && apt-get install -y \
    14  		apt-transport-https \
    15  		ca-certificates \
    16  		--no-install-recommends
    17  	RUN echo "deb https://get.docker.com/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
    18  	RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 \
    19  		--recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
    20  	RUN apt-get update && apt-get install -y \
    21  		lxc-docker-\${VERSION}
    22  	EOF
    23  
    24  	docker build --rm --force-rm --no-cache -t docker-old-repo:${version} -f $dockerfile $tmpdir
    25  }
    26  
    27  for v in "${versions[@]}"; do
    28  	install "$v"
    29  done