|
|
|
@ -120,7 +120,7 @@ function traperror() { |
|
|
|
|
fi |
|
|
|
|
if [ "$wait" -eq 1 ]; then |
|
|
|
|
echo " ... now you can access the docker container:" |
|
|
|
|
echo " docker exec -u $(id -u) ${DOCKER_ID} -it bash" |
|
|
|
|
echo " docker exec -u $(id -u) -it ${DOCKER_ID} bash" |
|
|
|
|
echo -n " ... press enter to cleanup: " |
|
|
|
|
read |
|
|
|
|
fi |
|
|
|
@ -133,7 +133,7 @@ function traperror() { |
|
|
|
|
done |
|
|
|
|
if [ "$wait" -eq 1 ]; then |
|
|
|
|
echo " ... now you can access the docker container:" |
|
|
|
|
echo " docker exec -u $(id -u) ${DOCKER_ID} -it bash" |
|
|
|
|
echo " docker exec -u $(id -u) -it ${DOCKER_ID} bash" |
|
|
|
|
echo -n " ... press enter to cleanup: " |
|
|
|
|
read |
|
|
|
|
fi |
|
|
|
@ -167,14 +167,20 @@ function ifthenelse() { |
|
|
|
|
|
|
|
|
|
set -x |
|
|
|
|
|
|
|
|
|
OPTIONS='-o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew -y --force-yes --no-install-suggests --no-install-recommends' |
|
|
|
|
docker pull $img |
|
|
|
|
DOCKER_ID=$(docker run -d ${dirs[@]} ${envs[@]} -w /workdir $img sleep infinity) |
|
|
|
|
trap 'traperror '"${DOCKER_ID}"' "$? ${PIPESTATUS[@]}" $LINENO $BASH_LINENO "$BASH_COMMAND" "${FUNCNAME[@]}" "${FUNCTION}"' SIGINT INT TERM EXIT |
|
|
|
|
docker exec ${DOCKER_ID} apt-get update |
|
|
|
|
docker exec ${DOCKER_ID} apt-get upgrade -y |
|
|
|
|
docker exec ${DOCKER_ID} apt-get install -y python-software-properties software-properties-common apt-transport-https dpkg-dev lsb-release || \ |
|
|
|
|
docker exec ${DOCKER_ID} apt-get install -y software-properties-common apt-transport-https dpkg-dev lsb-release || \ |
|
|
|
|
docker exec ${DOCKER_ID} apt-get install -y python-software-properties apt-transport-https dpkg-dev lsb-release; |
|
|
|
|
for f in 'libpam-systemd:amd64' 'policykit*' 'colord'; do |
|
|
|
|
docker exec -it ${DOCKER_ID} bash -c "echo 'Package: $f' >> /etc/apt/preferences" |
|
|
|
|
docker exec -it ${DOCKER_ID} bash -c "echo 'Pin-Priority: -100' >> /etc/apt/preferences" |
|
|
|
|
docker exec -it ${DOCKER_ID} bash -c "echo >> /etc/apt/preferences" |
|
|
|
|
done |
|
|
|
|
docker exec ${DOCKER_ID} apt-get update ${OPTIONS} |
|
|
|
|
docker exec ${DOCKER_ID} apt-get upgrade ${OPTIONS} |
|
|
|
|
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties software-properties-common apt-transport-https dpkg-dev lsb-release || \ |
|
|
|
|
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} software-properties-common apt-transport-https dpkg-dev lsb-release || \ |
|
|
|
|
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties apt-transport-https dpkg-dev lsb-release; |
|
|
|
|
for repo in "${repos[@]}"; do |
|
|
|
|
ifthenelse "${repo}" "apt-add-repository ARG" |
|
|
|
|
done |
|
|
|
@ -182,9 +188,9 @@ for key in "${keys[@]}"; do |
|
|
|
|
wget -O- "$key" \ |
|
|
|
|
| docker exec -i ${DOCKER_ID} apt-key add - |
|
|
|
|
done |
|
|
|
|
docker exec ${DOCKER_ID} apt-get update |
|
|
|
|
docker exec ${DOCKER_ID} apt-get update ${OPTIONS} |
|
|
|
|
for package in "${packages[@]}"; do |
|
|
|
|
ifthenelse "${package}" "apt-get install -y --force-yes ARG" |
|
|
|
|
ifthenelse "${package}" "apt-get install ${OPTIONS} ARG" |
|
|
|
|
done |
|
|
|
|
for command in "${commands[@]}"; do |
|
|
|
|
ifthenelse "${command}" "ARG" |
|
|
|
|