diff --git a/bin/functions.sh b/bin/functions.sh index 5d4dffb..d804080 100644 --- a/bin/functions.sh +++ b/bin/functions.sh @@ -12,15 +12,15 @@ function renderCommands() { echo -e "${ORANGE}Available commands for localhost environment:${NC}" echo -e " ${GREEN}start${NC} Start and setup development environment." echo -e " ${GREEN}stop${NC} Stop development environment." - echo -e " ${GREEN}in${NC} Go into a container." + echo -e " ${GREEN}in${NC} Go into a container as current user." + echo -e " ${GREEN}indef${NC} Go into a container as default user." echo "" exit 0; } function start() { - docker-compose up -d --build; - echo "== All done, happy coding. =="; + docker-compose up --build; } @@ -29,6 +29,11 @@ function stop() { } -function goIntoContainer() { - docker exec -t -i ${APP_CONTAINER} bash; +function goIntoContainerCurrentUser() { + docker exec -t -i -u `id -u $UID` ${APP_CONTAINER} bash; } + + +function goIntoContainerDefaultUser() { + docker exec -t -i ${APP_CONTAINER} bash; +} \ No newline at end of file diff --git a/bin/helper b/bin/helper index c60ec04..b284d90 100755 --- a/bin/helper +++ b/bin/helper @@ -19,9 +19,12 @@ case "$1" in ;; in) - goIntoContainer; + goIntoContainerCurrentUser; ;; + indef) + goIntoContainerDefaultUser; + ;; *) echo "Sorry, I don't know want you want" esac