Skip to content

Commit 1a228bb

Browse files
authored
Merge pull request #65 from dbottisti/config-docker-image
Add configuration setting to specify docker image
2 parents 17c2d2b + ac65449 commit 1a228bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const { homedir } = require("os");
99
const path = require("path");
1010

1111
const DEFAULT_DOCKER_TAG = "0.2.6-rust-1.39.0";
12+
const DEFAULT_DOCKER_IMAGE = "softprops/lambda-rust";
1213
const RUST_RUNTIME = "rust";
1314
const BASE_RUNTIME = "provided";
1415
const NO_OUTPUT_CAPTURE = { stdio: ["ignore", process.stdout, process.stderr] };
@@ -36,7 +37,8 @@ class RustPlugin {
3637
this.custom = Object.assign(
3738
{
3839
cargoFlags: "",
39-
dockerTag: DEFAULT_DOCKER_TAG
40+
dockerTag: DEFAULT_DOCKER_TAG,
41+
dockerImage: DEFAULT_DOCKER_IMAGE
4042
},
4143
(this.serverless.service.custom && this.serverless.service.custom.rust) ||
4244
{}
@@ -88,11 +90,12 @@ class RustPlugin {
8890
customArgs.push('-e', `CARGO_FLAGS=${cargoFlags}`);
8991
}
9092
const dockerTag = (funcArgs || {}).dockerTag || this.custom.dockerTag;
93+
const dockerImage = (funcArgs || {}).dockerImage || this.custom.dockerImage;
9194

9295
const finalArgs = [
9396
...defaultArgs,
9497
...customArgs,
95-
`softprops/lambda-rust:${dockerTag}`
98+
`${dockerImage}:${dockerTag}`
9699
].filter(i => i);
97100

98101
this.serverless.cli.log(

0 commit comments

Comments
 (0)