Add docker software to allow using dind enabled images

This commit is contained in:
Ian Baum 2018-10-12 10:23:32 +00:00 committed by Marin Jankovski
parent 90ff48b5f6
commit a0f6f84971
4 changed files with 37 additions and 0 deletions

View file

@ -148,6 +148,10 @@ function print_ansible_args() {
printf -- "--build-arg ANSIBLE_VERSION=%s " "$1"
}
function print_docker_args() {
printf -- "--build-arg DOCKER_VERSION=%s " "$1"
}
function print_terraform_args() {
case "$1" in
0.11)
@ -191,6 +195,7 @@ function parse_arguments() {
case "$image" in
golang) print_golang_args $version ;;
chrome) print_chrome_args $version ;;
docker) print_docker_args $version ;;
git) print_git_args $version ;;
node) print_node_args $version ;;
yarn) print_yarn_args $version ;;

26
scripts/install-docker Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
set -xeuo pipefail
export DEBIAN_FRONTEND=noninteractive
DOCKER_VERSION=${1}
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 [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list.d/docker.list
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}
apt-get -yq autoremove
apt-get clean -yqq
rm -rf /var/lib/apt/lists/*