1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/make/test-old-apt-repo
Tianon Gravi 52379fa76d Convert script shebangs from "#!/bin/bash" to "#!/usr/bin/env bash"
This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2017-02-13 11:01:54 -08:00

29 lines
799 B
Bash
Executable file

#!/usr/bin/env bash
set -e
versions=( 1.3.3 1.4.1 1.5.0 1.6.2 )
install() {
local version=$1
local tmpdir=$(mktemp -d /tmp/XXXXXXXXXX)
local dockerfile="${tmpdir}/Dockerfile"
cat <<-EOF > "$dockerfile"
FROM debian:jessie
ENV VERSION ${version}
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
--no-install-recommends
RUN echo "deb https://get.docker.com/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 \
--recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
RUN apt-get update && apt-get install -y \
lxc-docker-\${VERSION}
EOF
docker build --rm --force-rm --no-cache -t docker-old-repo:${version} -f $dockerfile $tmpdir
}
for v in "${versions[@]}"; do
install "$v"
done