Lingxian Kong a97ff84c19 Improve trove guest image build script
Also using ubuntu-minimal to decrease the image size a little bit, from 963M
to 815M in the test.

Change-Id: I6d70add380f4b61ebe89c72765612d8cb6127ccb
2020-11-26 14:17:57 +13:00

21 lines
537 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
GUEST_USERNAME=${GUEST_USERNAME:-"ubuntu"}
echo "Installing docker"
export DEBIAN_FRONTEND=noninteractive
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu ${DIB_RELEASE} stable"
apt-get update
apt-get install -y -qq docker-ce >/dev/null
apt-get clean
echo "Adding ${GUEST_USERNAME} user to docker group"
usermod -aG docker ${GUEST_USERNAME}