|
|
@ -10,6 +10,7 @@ mode="deb" |
|
|
|
img="mwaeckerlin/ubuntu:latest" |
|
|
|
img="mwaeckerlin/ubuntu:latest" |
|
|
|
repos=() |
|
|
|
repos=() |
|
|
|
keys=() |
|
|
|
keys=() |
|
|
|
|
|
|
|
dns=() |
|
|
|
envs=("-e LANG=${LANG}" "-e HOME=${HOME}" "-e TERM=xterm" "-e DEBIAN_FRONTEND=noninteractive" "-e DEBCONF_NONINTERACTIVE_SEEN=true") |
|
|
|
envs=("-e LANG=${LANG}" "-e HOME=${HOME}" "-e TERM=xterm" "-e DEBIAN_FRONTEND=noninteractive" "-e DEBCONF_NONINTERACTIVE_SEEN=true") |
|
|
|
dirs=("-v $(pwd):/workdir" "-v ${HOME}/.gnupg:${HOME}/.gnupg") |
|
|
|
dirs=("-v $(pwd):/workdir" "-v ${HOME}/.gnupg:${HOME}/.gnupg") |
|
|
|
packages=() |
|
|
|
packages=() |
|
|
@ -41,6 +42,7 @@ while test $# -gt 0; do |
|
|
|
echo " -f, --flag <flag> add flag to ./bootstrap.sh or ./configure" |
|
|
|
echo " -f, --flag <flag> add flag to ./bootstrap.sh or ./configure" |
|
|
|
echo " -r, --repo <url> add given apt repository" |
|
|
|
echo " -r, --repo <url> add given apt repository" |
|
|
|
echo " -k, --key <url> add public key from url" |
|
|
|
echo " -k, --key <url> add public key from url" |
|
|
|
|
|
|
|
echo " -n, --dns <ip> add ip as dns server" |
|
|
|
echo " -e, --env <var>=<val> set environment variable in docker" |
|
|
|
echo " -e, --env <var>=<val> set environment variable in docker" |
|
|
|
echo " -d, --dir <dir> access given directory read only" |
|
|
|
echo " -d, --dir <dir> access given directory read only" |
|
|
|
echo " -p, --package <pkg> install extra debian packages" |
|
|
|
echo " -p, --package <pkg> install extra debian packages" |
|
|
@ -128,6 +130,9 @@ while test $# -gt 0; do |
|
|
|
(-e|--env) shift; |
|
|
|
(-e|--env) shift; |
|
|
|
envs+=("-e $1") |
|
|
|
envs+=("-e $1") |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
(-n|--dns) shift; |
|
|
|
|
|
|
|
dns+=("--dns $1") |
|
|
|
|
|
|
|
;; |
|
|
|
(-d|--dirs) shift; |
|
|
|
(-d|--dirs) shift; |
|
|
|
dirs+=("-v $1:$1:ro") |
|
|
|
dirs+=("-v $1:$1:ro") |
|
|
|
;; |
|
|
|
;; |
|
|
@ -223,7 +228,7 @@ function ifthenelse() { |
|
|
|
set -x |
|
|
|
set -x |
|
|
|
|
|
|
|
|
|
|
|
docker pull $img |
|
|
|
docker pull $img |
|
|
|
DOCKER_ID=$(docker create ${dirs[@]} ${envs[@]} -w /workdir $img sleep infinity) |
|
|
|
DOCKER_ID=$(docker create ${dns[@]} ${dirs[@]} ${envs[@]} -w /workdir $img sleep infinity) |
|
|
|
trap 'traperror '"${DOCKER_ID}"' "$? ${PIPESTATUS[@]}" $LINENO $BASH_LINENO "$BASH_COMMAND" "${FUNCNAME[@]}" "${FUNCTION}"' SIGINT INT TERM EXIT |
|
|
|
trap 'traperror '"${DOCKER_ID}"' "$? ${PIPESTATUS[@]}" $LINENO $BASH_LINENO "$BASH_COMMAND" "${FUNCNAME[@]}" "${FUNCTION}"' SIGINT INT TERM EXIT |
|
|
|
if ! [[ $arch =~ $myarch ]]; then |
|
|
|
if ! [[ $arch =~ $myarch ]]; then |
|
|
|
docker cp "/usr/bin/qemu-${arch}-static" "${DOCKER_ID}:/usr/bin/qemu-${arch}-static" |
|
|
|
docker cp "/usr/bin/qemu-${arch}-static" "${DOCKER_ID}:/usr/bin/qemu-${arch}-static" |
|
|
|