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

Commit 061d6b6

Browse files
author
Bastian Rang
committed
* add docker-entrypoint.sh refs #67
* optimize entrypoint for gitlab-ci refs #34
1 parent b976362 commit 061d6b6

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/.idea/
33
composer.lock
44
/rancherize.json
5-
/.rancherize
5+
/.rancherize
6+
/scripts/rancherize-test.sh

Dockerfile

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ ENV HOME=$RANCHERIZE_HOME
2121
ENV EDITOR=$DEFAULT_EDITOR
2222

2323
# install packages
24-
RUN apk update \
25-
&& apk add --no-cache \
24+
RUN apk add --no-cache \
2625
git \
2726
docker \
2827
py-pip \
28+
su-exec \
2929
# install docker-compose
3030
&& pip install docker-compose==$DOCKER_COMPOSE_VERSION
3131

@@ -40,7 +40,6 @@ WORKDIR /opt/rancherize
4040

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

45-
ENTRYPOINT ["/opt/rancherize/rancherize"]
46-
#ENTRYPOINT ["/bin/sh"]
45+
ENTRYPOINT ["/bin/sh", "/opt/rancherize/docker-entrypoint.sh"]

docker-entrypoint.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
USER="root"
4+
if [ ! -z "$GROUP_ID" ] && [ ! -z "$USER_ID" ] ; then
5+
deluser rancherize > /dev/null 2>&1
6+
addgroup -g $GROUP_ID rancherize
7+
adduser -u $USER_ID -G rancherize -D -s /bin/sh rancherize
8+
USER="rancherize"
9+
fi
10+
11+
if [ -x "$1" ] ; then
12+
su-exec "$USER" $*
13+
exit $?
14+
fi
15+
16+
su-exec "$USER" php /opt/rancherize/rancherize $@

0 commit comments

Comments
 (0)