Compare commits

...

2 Commits

Author SHA1 Message Date
mudler 0aeb135215 adding docker checks in function file 2016-02-06 15:28:56 +01:00
mudler 34857bb7a3 docker base image now is tweakable with env 2016-02-06 15:05:02 +01:00
3 changed files with 16 additions and 8 deletions
+4 -4
View File
@@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
set -e set -e
ROOT="${ROOT:-$PWD}" ROOT="${ROOT:-$PWD}"
DOCKER_IMAGE="${DOCKER_IMAGE:-sabayon/builder-amd64}"
. /sbin/sabayondevkit-functions.sh
if [ $# -eq 0 ] if [ $# -eq 0 ]
then then
@@ -8,8 +10,6 @@ if [ $# -eq 0 ]
exit 1 exit 1
fi fi
if [ "$(id -u)" != "0" ]; then check_docker_requirements
echo "!! If you are not running the script as root, your user should be in the docker group to use it. (sudo gpasswd -a $USER docker) !!"
fi
docker run --rm -v "$ROOT"/portage_artifacts:/usr/portage/packages -ti sabayon/builder-amd64 $@ docker run --rm -v "$ROOT"/portage_artifacts:/usr/portage/packages -ti $DOCKER_IMAGE $@
+5 -4
View File
@@ -1,15 +1,16 @@
#!/bin/bash #!/bin/bash
set -e set -e
. /sbin/sabayondevkit-functions.sh
ROOT="${ROOT:-$PWD}" ROOT="${ROOT:-$PWD}"
entropysrv=$(mktemp) entropysrv=$(mktemp)
createrepo=$(mktemp) createrepo=$(mktemp)
REPOSITORY_NAME="${REPOSITORY_NAME:-default}" REPOSITORY_NAME="${REPOSITORY_NAME:-default}"
REPOSITORY_DESCRIPTION="${REPOSITORY_DESCRIPTION:-My Sabayon repository}" REPOSITORY_DESCRIPTION="${REPOSITORY_DESCRIPTION:-My Sabayon repository}"
DOCKER_IMAGE="${DOCKER_IMAGE:-sabayon/builder-amd64}"
EDITOR=cat EDITOR=cat
if [ "$(id -u)" != "0" ]; then check_docker_requirements
echo "!! If you are not running the script as root, your user should be in the docker group to use it. (sudo gpasswd -a $USER docker) !!"
fi
echo "Repository: $REPOSITORY_NAME" echo "Repository: $REPOSITORY_NAME"
echo "Repository Description: $REPOSITORY_DESCRIPTION" echo "Repository Description: $REPOSITORY_DESCRIPTION"
@@ -72,6 +73,6 @@ docker run --rm --entrypoint /bin/bash -e REPOSITORY=$REPOSITORY_NAME -e EDITOR=
-v $createrepo:/sabayon/bin/create_repo.sh \ -v $createrepo:/sabayon/bin/create_repo.sh \
-v $entropysrv:/etc/entropy/server.conf \ -v $entropysrv:/etc/entropy/server.conf \
-v "$ROOT"/portage_artifacts:/usr/portage/packages \ -v "$ROOT"/portage_artifacts:/usr/portage/packages \
-ti sabayon/builder-amd64 /sabayon/bin/create_repo.sh || true -ti $DOCKER_IMAGE /sabayon/bin/create_repo.sh || true
rm -rf $createrepo rm -rf $createrepo
rm -rf $entropysrv rm -rf $entropysrv
+7
View File
@@ -1,5 +1,12 @@
#!/bin/bash #!/bin/bash
check_docker_requirements(){
if [ "$(id -u)" != "0" ]; then
groups | grep -q docker || echo "--> If you are not running the script as root, your user should be in the docker group to use it. (sudo gpasswd -a $USER docker)"
fi
ps aux | grep -q '[d]ocker' || echo "--> Be sure to have the docker daemon running (sudo systemctl start docker)"
}
build() { build() {
local SEARCH=$1 local SEARCH=$1
local EMERGE_DEFAULT_ARGS=${2:---accept-properties=-interactive --verbose --oneshot --nospinner --quiet-build=y --quiet-fail --fail-clean=y --complete-graph --buildpkg} local EMERGE_DEFAULT_ARGS=${2:---accept-properties=-interactive --verbose --oneshot --nospinner --quiet-build=y --quiet-fail --fail-clean=y --complete-graph --buildpkg}