Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
manabuishii committed May 26, 2016
1 parent b48943c commit cc900f5
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ubuntu:14.04.4
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -qq ; apt-get upgrade ; \
apt-get install -y gridengine-client ; \
apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# dummy user account
RUN useradd -m dummy
RUN echo "dummy:dummy" | chpasswd
#
ADD setup.sh /usr/local/bin/setup.sh
RUN chmod +x /usr/local/bin/setup.sh

#
ENTRYPOINT ["/usr/local/bin/setup.sh"]

12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# docker-sge-client
Sun Gridengine Client in Docker

# HOW TO RUN

```
docker run -e RUNUSER_USERNAME=manabu -e RUNUSER_UID=2000 -e RUNUSER_GID=2000 -e RUNUSER_HOME=$HOME -v $HOME:$HOME:ro --rm --net=host -ti -v $PWD/act_qmaster:/var/lib/gridengine/default/common/act_qmaster --name sgetest manabuishii/docker-sge-client:0.1.0 /bin/bash
```

# NOTE

- --net=host means your docker container connect with docker host name
- submit user name is important.

1 change: 1 addition & 0 deletions act_qmaster
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
YOURSGEMASTERHOSTHERE
30 changes: 30 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# RUNUSER_USERNAME
if [ ! -n "${RUNUSER_USERNAME-}" ] ; then
echo "RUNUSER_USERNAME is not set or empty"
exit 1
fi
# RUNUSER_UID
if [ ! -n "${RUNUSER_UID-}" ] ; then
echo "RUNUSER_UID is not set or empty"
exit 1
fi
# RUNUSER_GID
if [ ! -n "${RUNUSER_GID-}" ] ; then
echo "RUNUSER_GID is not set or empty"
exit 1
fi
# RUNUSER_HOME
if [ ! -n "${RUNUSER_HOME-}" ] ; then
echo "RUNUSER_HOME is not set or empty"
exit 1
fi


groupmod --gid $RUNUSER_GID dummy
usermod --uid $RUNUSER_UID --gid $RUNUSER_GID --login $RUNUSER_USERNAME dummy

#su - $RUNUSER_USERNAME -c "cd ${RUNUSER_HOME};export HOME=${RUNUSER_HOME};$*"
su - $RUNUSER_USERNAME -c "$*"

0 comments on commit cc900f5

Please sign in to comment.