-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathentrypoint.sh
21 lines (18 loc) · 1004 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
################################################################################
# This checks if USERID and GRPID were specified as environment variables #
# (docker run -e USERID -e GRPID ....) when the container was started; if that #
# is the case, we create a user and group 'docker' with these IDs, give #
# ownership of the output directories to them and use the 'gosu' command to #
# start the main script as user 'docker' and pass to it all arguments #
################################################################################
if [ ${USERID:-0} -ne 0 ] && [ ${GRPID:-0} -ne 0 ]; then \
groupadd -g ${GRPID} docker &&\
useradd -l -u ${USERID} -d /home/docker -m -g docker docker &&\
chmod 775 /var/pipeline &&\
chown --silent --no-dereference --recursive \
--from=0:0 ${USERID}:${GRPID} \
/var/pipeline &&\
exec gosu docker ${PACKAGE_DIR}/MoCaSeq/MoCaSeq.sh "$@" \
;fi
exec ${PACKAGE_DIR}/MoCaSeq/MoCaSeq.sh "$@"