(RaspberryPi2)ubuntu@localhost:~$ cat /apps/owncloud.canonical/current/bin/owncloud
#!/bin/bash
#WorkAround for bin-path in root
DOCKER_PATH="/apps/docker/current/bin/"
PATH=$PATH:$DOCKER_PATH
DOCKER_CMD="docker.x86_64"
REPO="kickinz1/owncloud-8.0.2-sqlite3-amd64"
Prepare_Container(){
mkdir -p ${SNAP_APP_DATA_PATH}/data
cp -r ${SNAP_APP_PATH}/owncloud ${SNAP_APP_DATA_PATH}
}
#Please change repo according to your needs, be carefull to create
#different container image per supported arch
select_repo () {
platform=`uname -i`
case $platform in
x86_64)
### This is where you specify your amd64 image
REPO="kickinz1/owncloud-8.0.2-sqlite3-amd64"
DOCKER_CMD="docker.x86_64"
;;
armv7l)
### This is where you specify your armhf image
REPO="kickinz1/owncloud-8.0.2-sqlite3-armhf"
DOCKER_CMD="docker.armhf"
;;
*)
echo "unknown platform for snappy-magic: $platform. remember to file a bug or better yet: fix it :)"
;;
esac
echo ${REPO}
}
select_repo
### Modify the name of your docker container
CONT_NAME="owncloud-8.0.2-snappy"
### You can specify the options for running your docker here:
DOCKER_OPTIONS="-v ${SNAP_APP_DATA_PATH}/owncloud:/var/www/"
DOCKER_OPTIONS="${DOCKER_OPTIONS} -v ${SNAP_APP_DATA_PATH}/data:/var/www/data"
DOCKER_OPTIONS="${DOCKER_OPTIONS} -p 80:80 -p 443:443"
#DOCKER_ENTRYPOINT="--entrypoint=/bin/bash"
#DOCKER_ENTRYPOINT="${DOCKER_ENTRYPOINT}"
DOCKER_ENTRYPOINT=""
#we just stop container if we uninstall owncloud
if [ "$1" == "stop" ]; then
${DOCKER_CMD} stop ${CONT_NAME}
${DOCKER_CMD} rm -v -f ${CONT_NAME}
exit
fi
if ! [ -e ${SNAP_APP_DATA_PATH}/owncloud/index.php ]
then
Prepare_Container
fi
#Just wait two seconds
sleep 2.0
${DOCKER_CMD} rm -v -f ${CONT_NAME}
${DOCKER_CMD} run --name ${CONT_NAME} ${DOCKER_OPTIONS} ${DOCKER_ENTRYPOINT} ${REPO} ${DOCKER_COMMAND}
${DOCKER_CMD} wait ${CONT_NAME}