diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5e8667fc3de83e5964464f39f0041593ccb9bef3..1abe2dd8b5db8509cce2a7d2c86190de0e4d1d91 100755
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -38,7 +38,7 @@ create_jupytermachine_version:
         # Replace "basic_jupytermachine" with the new base image name
         NEW_BASE_IMAGE=$IMAGE_PREFIX/etp_$image;
         echo $NEW_BASE_IMAGE;
-        sed -i "s/$OLD_BASE_IMAGE/$NEW_BASE_IMAGE/" "Dockerfile";
+        sed -i "s#$OLD_BASE_IMAGE#$NEW_BASE_IMAGE#" "Dockerfile"
         cat Dockerfile;
         # Build the second version of the container
         docker build -t "$IMAGE_PREFIX/jupytermachine_${image}" -f "Dockerfile" .;