@rlyle1179/serverless-aws-batch 1.0.31 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/docker.js +4 -3
- package/package.json +1 -1
package/lib/docker.js
CHANGED
|
@@ -10,7 +10,7 @@ const { getDockerLoginToECRCommand } = require('./awscli');
|
|
|
10
10
|
* @returns {string} "<ECR Repo Name>:latest"
|
|
11
11
|
*/
|
|
12
12
|
function getDockerImageName() {
|
|
13
|
-
return `${this.provider.naming.getECRRepositoryURL()}
|
|
13
|
+
return `${this.provider.naming.getECRRepositoryURL()}:${Date.now()}`;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -51,7 +51,8 @@ function dockerCommand(options, cwd = null, stdio = null) {
|
|
|
51
51
|
* https://hub.docker.com/r/lambci/lambda/
|
|
52
52
|
*/
|
|
53
53
|
function buildDockerImage() {
|
|
54
|
-
|
|
54
|
+
let image = this.provider.naming.getDockerImageName();
|
|
55
|
+
this.serverless.cli.log(`Building docker image: "${image}"...`);
|
|
55
56
|
|
|
56
57
|
// Get any additional run commands we'd like to include in the docker image
|
|
57
58
|
let additionalRunCommands = "";
|
|
@@ -95,7 +96,7 @@ function buildDockerImage() {
|
|
|
95
96
|
const dockerFile = path.join(packagePath, 'Dockerfile');
|
|
96
97
|
fse.writeFileSync(dockerFile, dockerFileContents);
|
|
97
98
|
|
|
98
|
-
const dockerOptions = ['build', '-f', dockerFile, '-t',
|
|
99
|
+
const dockerOptions = ['build', '-f', dockerFile, '-t', image, '.'];
|
|
99
100
|
dockerCommand(dockerOptions, packagePath, 'inherit');
|
|
100
101
|
|
|
101
102
|
return BbPromise.resolve();
|