Skip to content

Commit

Permalink
add entrypoint for docker which creates user and executes move script
Browse files Browse the repository at this point in the history
  • Loading branch information
maexled committed Jun 4, 2022
1 parent 3c86405 commit fdc6416
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ RUN apt update && \
COPY . .
RUN mkdir files

CMD ["bash", "move.sh"]
RUN chmod a+x docker-entrypoint.sh
CMD ["./docker-entrypoint.sh"]
10 changes: 7 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/bin/bash

DIR="$(cd "$(dirname "$0")" && pwd)"

source $DIR/config.cfg

if [ "$samba_user" != "" ] && [ "$samba_uid" != "" ];
then
if [ "$samba_user" != "" ] && [ "$samba_uid" != "" ]; then
useradd $samba_user -u $samba_uid
fi
echo "Created $samba_user with uid $samba_uid"
fi

bash move.sh
2 changes: 2 additions & 0 deletions move.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

echo Starting;

DIR="$(cd "$(dirname "$0")" && pwd)"
Expand Down
2 changes: 2 additions & 0 deletions raffer.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

echo Starting;

DIR="$(cd "$(dirname "$0")" && pwd)"
Expand Down

0 comments on commit fdc6416

Please sign in to comment.