diff --git a/php/5.6/Dockerfile b/php/5.6/Dockerfile
index 9ea37ab74c9f58909f7699b9e45774004571912f..ea0fcd809108212b583f362aa8579efa92d44d9b 100644
--- a/php/5.6/Dockerfile
+++ b/php/5.6/Dockerfile
@@ -35,7 +35,9 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
     && composer --version \
+    && mkdir $NVM_DIR \
     && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
+    && . $NVM_DIR/nvm.sh \
     && nvm --version
 
 ENV PATH=/root/.composer/vendor/bin:$HOME/.composer/vendor/bin:$PATH
diff --git a/php/7.0/Dockerfile b/php/7.0/Dockerfile
index 76854b8ef0c87d332a421147a1f368a84102378f..72fa36ec1e148211da6c57a44e53ba7ad5a1229e 100644
--- a/php/7.0/Dockerfile
+++ b/php/7.0/Dockerfile
@@ -35,7 +35,9 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
     && composer --version \
+    && mkdir $NVM_DIR \
     && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
+    && . $NVM_DIR/nvm.sh \
     && nvm --version
 
 ENV PATH=/root/.composer/vendor/bin:$HOME/.composer/vendor/bin:$PATH
diff --git a/php/7.1/Dockerfile b/php/7.1/Dockerfile
index 6de65ffb0c4338d5690d87855398d3b38d296715..78dbd259c5f6e285d78656eeefef18d7d5099bf2 100644
--- a/php/7.1/Dockerfile
+++ b/php/7.1/Dockerfile
@@ -35,7 +35,9 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
     && composer --version \
+    && mkdir $NVM_DIR \
     && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
+    && . $NVM_DIR/nvm.sh \
     && nvm --version
 
 ENV PATH=/root/.composer/vendor/bin:$HOME/.composer/vendor/bin:$PATH
diff --git a/php/7.2/Dockerfile b/php/7.2/Dockerfile
index 60c46d433dc528ad41268293825864d797f5068b..b76b3a4fa49820874eeb9e30f59df91c2fea8227 100644
--- a/php/7.2/Dockerfile
+++ b/php/7.2/Dockerfile
@@ -36,7 +36,9 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
     && composer --version \
+    && mkdir $NVM_DIR \
     && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
+    && . $NVM_DIR/nvm.sh \
     && nvm --version
 
 ENV PATH=/root/.composer/vendor/bin:$HOME/.composer/vendor/bin:$PATH
diff --git a/php/7.3/Dockerfile b/php/7.3/Dockerfile
index 0840ee7ff0adc04f7f721a4a32bf460ef4e5ffd6..696c8c8b46c78614dc6da6582bea0a0d5ef2faa6 100644
--- a/php/7.3/Dockerfile
+++ b/php/7.3/Dockerfile
@@ -36,7 +36,9 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
     && composer --version \
+    && mkdir $NVM_DIR \
     && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
+    && . $NVM_DIR/nvm.sh \
     && nvm --version
 
 ENV PATH=/root/.composer/vendor/bin:$HOME/.composer/vendor/bin:$PATH
diff --git a/php/7.4/Dockerfile b/php/7.4/Dockerfile
index 78783ce97a18b64fca2b1ef845088deebb21fbdb..96672f689f263eef68722e36c13dc632ba98fa09 100644
--- a/php/7.4/Dockerfile
+++ b/php/7.4/Dockerfile
@@ -36,7 +36,9 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
     && composer --version \
+    && mkdir $NVM_DIR \
     && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
+    && . $NVM_DIR/nvm.sh \
     && nvm --version
 
 ENV PATH=/root/.composer/vendor/bin:$HOME/.composer/vendor/bin:$PATH
diff --git a/php/8.1/Dockerfile b/php/8.1/Dockerfile
index 00832911543f890eb92f83fe0d12187481d2e0a9..2d057770e92b17bb7b898c8c0cce4ca9c3427c91 100644
--- a/php/8.1/Dockerfile
+++ b/php/8.1/Dockerfile
@@ -36,7 +36,9 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
     && composer --version \
+    && mkdir $NVM_DIR \
     && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
+    && . $NVM_DIR/nvm.sh \
     && nvm --version
 
 ENV PATH=/root/.composer/vendor/bin:$HOME/.composer/vendor/bin:$PATH