@rlyle1179/serverless-aws-batch 1.1.5 → 1.1.7
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 +2 -2
- package/lib/generateCoreTemplate.js +11 -3
- package/package.json +1 -1
package/lib/docker.js
CHANGED
|
@@ -91,14 +91,14 @@ function buildDockerImage() {
|
|
|
91
91
|
// - Function Timeout and Function Memory are set by Env Variables on the Job Definition
|
|
92
92
|
// - Access Key and Secret are unset to that we use the role on the container that AWS provides
|
|
93
93
|
const dockerFileContents = `
|
|
94
|
-
FROM
|
|
94
|
+
FROM 368461407828.dkr.ecr.us-east-1.amazonaws.com/build-batch-image-base:latest AS builder
|
|
95
95
|
USER root
|
|
96
96
|
RUN mkdir -p /tmp/task/
|
|
97
97
|
COPY ${this.serverless.service.service}.zip /tmp/task
|
|
98
98
|
RUN cd /tmp/task && unzip -q ${this.serverless.service.service}.zip && rm ${this.serverless.service.service}.zip
|
|
99
99
|
${addtionalBuildCommands}
|
|
100
100
|
|
|
101
|
-
FROM
|
|
101
|
+
FROM 368461407828.dkr.ecr.us-east-1.amazonaws.com/batch-image-base:latest
|
|
102
102
|
USER root
|
|
103
103
|
COPY --from=builder /tmp/task /var/task/
|
|
104
104
|
${additionalCommands}
|
|
@@ -31,13 +31,21 @@ const lifeCyclePolicies = {
|
|
|
31
31
|
*/
|
|
32
32
|
function generateCoreTemplate() {
|
|
33
33
|
// Setup our ECR Repository to delete untagged images after 1 day
|
|
34
|
+
// const ecrTemplate = `
|
|
35
|
+
// {
|
|
36
|
+
// "Type" : "AWS::ECR::Repository",
|
|
37
|
+
// "Properties" : {
|
|
38
|
+
// "LifecyclePolicy" : {
|
|
39
|
+
// "LifecyclePolicyText" : ${JSON.stringify(JSON.stringify(lifeCyclePolicies))}
|
|
40
|
+
// },
|
|
41
|
+
// "RepositoryName" : "${this.provider.naming.getECRRepositoryName()}"
|
|
42
|
+
// }
|
|
43
|
+
// }
|
|
44
|
+
// `;
|
|
34
45
|
const ecrTemplate = `
|
|
35
46
|
{
|
|
36
47
|
"Type" : "AWS::ECR::Repository",
|
|
37
48
|
"Properties" : {
|
|
38
|
-
"LifecyclePolicy" : {
|
|
39
|
-
"LifecyclePolicyText" : ${JSON.stringify(JSON.stringify(lifeCyclePolicies))}
|
|
40
|
-
},
|
|
41
49
|
"RepositoryName" : "${this.provider.naming.getECRRepositoryName()}"
|
|
42
50
|
}
|
|
43
51
|
}
|