Skip to content

Commit 800d25a

Browse files
authored
use fixed fc docker version (#94)
* use fixed fc docker version
1 parent f59c77e commit 800d25a

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/docker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function generateDockerCmd(functionProps, event) {
9292
function findDockerImage(runtime) {
9393
if (runtimeImageMap[runtime]) {
9494
const name = runtimeImageMap[runtime];
95-
const imageName = `aliyunfc/runtime-${name}:latest`;
95+
const imageName = `aliyunfc/runtime-${name}:1.1.0`;
9696

9797
debug('imageName: ' + imageName);
9898

@@ -208,7 +208,7 @@ async function invokeFunction(serviceName, functionName, functionDefinition, deb
208208
if (!exist || !skipPullImage) {
209209
await pullImage(imageName);
210210
} else {
211-
console.log('skip pulling images ...');
211+
console.log(`skip pulling image ${imageName}...`);
212212
}
213213

214214
debug(`mount source: ${mount}`);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alicloud/fun",
3-
"version": "2.6.0",
3+
"version": "2.6.1",
44
"description": "(have)Fun with Serverless",
55
"engines": {
66
"node": ">=8.0.0"

test/docker.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ describe('test findDockerImage', () => {
4242
it('test find not python image', () => {
4343
for (let runtime of ['nodejs6', 'nodejs8', 'python2.7', 'java8', 'php7.2']) {
4444
const imageName = docker.findDockerImage(runtime);
45-
expect(imageName).to.be(`aliyunfc/runtime-${runtime}:latest`);
45+
expect(imageName).to.contain(`aliyunfc/runtime-${runtime}:`);
4646
}
4747
});
4848

4949
it('test find python 3 image', () => {
5050
const imageName = docker.findDockerImage('python3');
51-
expect(imageName).to.be(`aliyunfc/runtime-python3.6:latest`);
51+
expect(imageName).to.contain(`aliyunfc/runtime-python3.6:`);
5252
});
5353
});
5454

@@ -238,7 +238,7 @@ describe('test invokeFunction', async () => {
238238
assert.calledOnce(DockerCli.prototype.listImages);
239239

240240
assert.calledWith(DockerCli.prototype.run,
241-
'aliyunfc/runtime-python3.6:latest',
241+
'aliyunfc/runtime-python3.6:1.1.0',
242242
['-h', 'index.handler', '-i', 'index.initializer'],
243243
process.stdout,
244244
{
@@ -257,7 +257,7 @@ describe('test invokeFunction', async () => {
257257
assert.calledOnce(DockerCli.prototype.listImages);
258258

259259
assert.calledWith(DockerCli.prototype.run,
260-
'aliyunfc/runtime-python3.6:latest',
260+
'aliyunfc/runtime-python3.6:1.1.0',
261261
['-h', 'index.handler', '-i', 'index.initializer'],
262262
process.stdout,
263263
{
@@ -278,7 +278,7 @@ describe('test invokeFunction', async () => {
278278
assert.calledOnce(DockerCli.prototype.listImages);
279279

280280
assert.calledWith(DockerCli.prototype.run,
281-
'aliyunfc/runtime-python3.6:latest',
281+
'aliyunfc/runtime-python3.6:1.1.0',
282282
['-h', 'index.handler', '--event', '{"testKey": "testValue"}', '-i', 'index.initializer'],
283283
process.stdout,
284284
{

0 commit comments

Comments
 (0)