File tree Expand file tree Collapse file tree 3 files changed +49
-0
lines changed
Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+ set -x
5+
6+ docker build -t et-platform -f docker/Dockerfile .
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ USER_ID=${USER_ID:- 1000}
6+ GROUP_ID=${GROUP_ID:- 1000}
7+ USER_NAME=${USER_NAME:- user}
8+ USER_NAME=${USER_NAME:- user}
9+ OPT=${ARGS: +-c $ARGS }
10+
11+ COLLIDING_USER_NAME=$( id -nu " $USER_ID " 2> /dev/null)
12+
13+ if [[ -n " $COLLIDING_USER_NAME " ]]; then
14+ echo Removing colliding user " ($COLLIDING_USER_NAME )" ...
15+ userdel " $COLLIDING_USER_NAME "
16+ fi
17+
18+ echo Adding invoking user " ($USER_NAME )" ...
19+ groupadd -g " $GROUP_ID " " $USER_NAME "
20+ useradd -u " $USER_ID " -g " $GROUP_ID " -s /bin/bash " $USER_NAME "
21+
22+ set -x
23+ exec su " $USER_NAME " $OPT
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ USER_ID=$( id -u)
6+ GROUP_ID=$( id -g)
7+ USER_NAME=$( id -un)
8+
9+ set -x
10+
11+ docker run -it \
12+ -e USER_ID=$USER_ID \
13+ -e GROUP_ID=$GROUP_ID \
14+ -e USER_NAME=$USER_NAME \
15+ -e ARGS=" $* " \
16+ --volume $HOME :$HOME \
17+ --volume $PWD :$PWD \
18+ --entrypoint $PWD /docker/entrypoint.sh \
19+ --workdir $PWD \
20+ et-platform:latest
You can’t perform that action at this time.
0 commit comments