aboutsummaryrefslogtreecommitdiffstats
path: root/create_container
diff options
context:
space:
mode:
authorStephane Desneux <stephane.desneux@iot.bzh>2017-01-02 14:54:03 +0100
committerStephane Desneux <stephane.desneux@iot.bzh>2017-02-10 16:15:00 +0100
commitee3da797768540af9cbb8d9f28917bac331fd8fb (patch)
treef78db9e4513b0bcadec350b2b45800ef4990bcdf /create_container
parentf33025186a05ee0a6221e8d48b52a4ec61831c07 (diff)
create_container: mark clearly as an example, not a mandatory script
Change-Id: I96f1f44b4770b18e7d5a1a6859dde13d179a735d Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'create_container')
-rwxr-xr-xcreate_container59
1 files changed, 0 insertions, 59 deletions
diff --git a/create_container b/create_container
deleted file mode 100755
index 0ac21ae..0000000
--- a/create_container
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-
-CURDIR=$(cd $(dirname $0) && pwd -P)
-DEFIMAGE=$(make -s -C $CURDIR show-image)
-
-function usage() {
- echo "Usage: $(basename $0) <instance ID> [image name]" >&2
- echo "Instance ID must be 0 or a positive integer (1,2,...)" >&2
- echo "Image name is optional: 'make show-image' is used by default to get image" >&2
- echo "Default image: $DEFIMAGE" >&2
- exit 1
-}
-
-case $1 in
- -h|--help|"")
- usage
- ;;
-esac
-
-CURDIR=$(cd $(dirname $0) && pwd -P)
-
-ID=$1
-IMAGE=${2:-$DEFIMAGE}
-
-USER=$(id -un)
-echo "Using instance ID #$ID (user $(id -un))"
-
-NAME=agl-worker-$(hostname|cut -f1 -d'.')-$ID-$USER
-
-MIRRORDIR=$HOME/ssd/localmirror_$ID
-XDTDIR=$HOME/ssd/xdt_$ID
-SHAREDDIR=$HOME/devel/docker/share
-
-SSH_PORT=$((2222 + ID))
-WWW_PORT=$((8000 + ID))
-BOOT_PORT=$((69 + ID))
-NBD_PORT=$((10809 + ID))
-
-mkdir -p $MIRRORDIR $XDTDIR $SHAREDDIR
-docker run \
- --publish=${SSH_PORT}:22 \
- --publish=${WWW_PORT}:8000 \
- --publish=${BOOT_PORT}:69/udp \
- --publish=${NBD_PORT}:10809 \
- --detach=true \
- --hostname=$NAME --name=$NAME \
- --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
- -v $MIRRORDIR:/home/devel/mirror \
- -v $SHAREDDIR:/home/devel/share \
- -v $XDTDIR:/xdt \
- -it $IMAGE
-
-echo "Copying your identity to container $NAME:"
-sleep 5
-ssh-copy-id -p $SSH_PORT devel@$(hostname)
-
-echo "You can now login using:"
-echo " ssh -p $SSH_PORT devel@$(hostname)"
-