File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ HOST_PWD=
1414HOST_HOSTNAME=$( hostname)
1515HOST_DIR_NAME=$( basename " $PWD " )
1616HOST_DIR_NAME=${HOST_DIR_NAME%/ }
17+ SERVICE_NAME=
1718SERVICE_ARGS=
1819
1920# PARSE OPTIONS
@@ -32,6 +33,7 @@ CYGWIN* | MINGW32* | MSYS* | MINGW*)
3233esac
3334
3435SERVICE_ARGS=" $@ "
36+ SERVICE_NAME=" $1 "
3537
3638function dotenv() {
3739 FILE=" $1 "
@@ -69,6 +71,23 @@ function loadEnvironment() {
6971
7072loadEnvironment
7173
74+ SERVICE_EXISTS=$( docker-compose -f " $DOCKERIZED_COMPOSE_FILE " config --services | grep -w $SERVICE_NAME )
75+
76+ if [ -z " $SERVICE_EXISTS " ]; then
77+ echo -e " \033[0;31mCommand $1 is not fully supported. Trying r.j3ss.co/$SERVICE_NAME instead." >&2
78+ echo -e " See https://github.com/jessfraz/dockerfiles/blob/master/README.md for more information.\033[0m" >&2
79+ shift
80+ docker \
81+ run --rm -it \
82+ -w " //host/$HOST_DIR_NAME " \
83+ -v " $HOST_PWD ://host/$HOST_DIR_NAME " \
84+ -e " HOST_HOSTNAME=$HOST_HOSTNAME " \
85+ r.j3ss.co/$SERVICE_NAME \
86+ " $@ "
87+
88+ exit $?
89+ fi
90+
7291docker-compose \
7392 --env-file " $DOCKERIZED_ENV_FILE " \
7493 -f " $DOCKERIZED_COMPOSE_FILE " \
You can’t perform that action at this time.
0 commit comments