Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
* add docker-entrypoint.sh refs #67
Browse files Browse the repository at this point in the history
* optimize entrypoint for gitlab-ci refs #34
  • Loading branch information
Bastian Rang committed Sep 29, 2017
1 parent b976362 commit 061d6b6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/.idea/
composer.lock
/rancherize.json
/.rancherize
/.rancherize
/scripts/rancherize-test.sh
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ ENV HOME=$RANCHERIZE_HOME
ENV EDITOR=$DEFAULT_EDITOR

# install packages
RUN apk update \
&& apk add --no-cache \
RUN apk add --no-cache \
git \
docker \
py-pip \
su-exec \
# install docker-compose
&& pip install docker-compose==$DOCKER_COMPOSE_VERSION

Expand All @@ -40,7 +40,6 @@ WORKDIR /opt/rancherize

# install composer packages
RUN curl -sSL "https://gist.githubusercontent.com/justb81/1006b89e41e41e1c848fe91969af7a0b/raw/c12faf968e659356ec1cb53f313e7f8383836be3/getcomposer.sh" | sh \
&& ./composer.phar install --no-dev && rm composer.phar
&& COMPOSER_ALLOW_SUPERUSER=1 ./composer.phar install --no-dev && rm composer.phar

ENTRYPOINT ["/opt/rancherize/rancherize"]
#ENTRYPOINT ["/bin/sh"]
ENTRYPOINT ["/bin/sh", "/opt/rancherize/docker-entrypoint.sh"]
16 changes: 16 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

USER="root"
if [ ! -z "$GROUP_ID" ] && [ ! -z "$USER_ID" ] ; then
deluser rancherize > /dev/null 2>&1
addgroup -g $GROUP_ID rancherize
adduser -u $USER_ID -G rancherize -D -s /bin/sh rancherize
USER="rancherize"
fi

if [ -x "$1" ] ; then
su-exec "$USER" $*
exit $?
fi

su-exec "$USER" php /opt/rancherize/rancherize $@

0 comments on commit 061d6b6

Please sign in to comment.