make-image.sh 494 Bytes
Newer Older
Markus Frosch's avatar
Markus Frosch committed
1
#!/bin/sh
2

Markus Frosch's avatar
Markus Frosch committed
3
DIST=jessie
Markus Frosch's avatar
Markus Frosch committed
4
5
GPGKEY=A0DA38D0D76E8B5D638872819165938D90FDDD2E

6
7
8
9
10
11
12
13
14
if [ -n "$DOCKER_IMAGE_PREFIX" ]; then
  IMAGE="${DOCKER_IMAGE_PREFIX}debootstrap"
else
  IMAGE=icinga/raspbian-base/debootstrap
fi
if [ -n "$DOCKER_REGISTRY" ]; then
  IMAGE="${DOCKER_REGISTRY}/${IMAGE}"
fi

Markus Frosch's avatar
Markus Frosch committed
15
16
17
18
19
20
opts=
if [ -t 1 ] && [ -t 0 ]; then
  opts=-t
fi

docker run -i $opts --rm \
21
  --privileged \
Markus Frosch's avatar
Markus Frosch committed
22
23
  -e DIST="$DIST" \
  -e GPGKEY="$GPGKEY" \
24
25
26
  -e "TARBALL=$TARBALL" \
  -v "$(pwd):/work" -w "/work" \
  "$IMAGE" "$@"