diff --git a/lib/manager/docker/update.js b/lib/manager/docker/update.js
index <HASH>..<HASH> 100644
--- a/lib/manager/docker/update.js
+++ b/lib/manager/docker/update.js
@@ -6,9 +6,9 @@ function setNewValue(currentFileContent, upgrade) {
   try {
     logger.debug(`setNewValue: ${upgrade.newFrom}`);
     const oldLine = new RegExp(
-      `(^|\n)${upgrade.fromPrefix}(\\s+)${upgrade.depName}.*?(\\s?)${
+      `(^|\\n)${upgrade.fromPrefix}(\\s+)${upgrade.depName}[^\\s]*(\\s?)${
         upgrade.fromSuffix
-      }\n`
+      }\\n`
     );
     let newLine = `$1${upgrade.fromPrefix}$2${upgrade.newFrom}$3`;
     if (upgrade.fromSuffix.length) {
fix: use escaped line returns in docker regex escape