File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const dockerfileTemplate = fs.readFileSync(
13
13
'utf8' ,
14
14
) ;
15
15
16
- const fromLineRegExp = / F R O M n o d e : .* ?\n / g;
16
+ const fromStatementRegExp = / F R O M n o d e : .* ?( \s | \n ) / g;
17
17
18
18
/**
19
19
* Render a Dockerfile with the correct base image.
@@ -23,8 +23,12 @@ const fromLineRegExp = /FROM node:.*?\n/g;
23
23
*/
24
24
function renderDockerfile ( { nodeDockerVersion } ) {
25
25
return dockerfileTemplate . replace (
26
- fromLineRegExp ,
27
- `FROM node:${ nodeDockerVersion } ` ,
26
+ fromStatementRegExp ,
27
+ // We need a trailing space for the first step(s) in the multi-stage build
28
+ // (between "FROM node:<version>" and e.g., "as builder").
29
+ // This also adds a trailing space to the end of the final
30
+ // FROM statement, but it doesn't make a difference.
31
+ `FROM node:${ nodeDockerVersion } `
28
32
) ;
29
33
}
30
34
You can’t perform that action at this time.
0 commit comments