Skip to content

Building docker image from within CircleCI fails #40

Closed
@txus

Description

@txus

🐛 Bug description

I'm trying to do continuous deployment (of a private project) on CircleCI. When building the dockerized Rust image, it fails with this message (SLS_DEBUG=true):

Serverless: Building native Rust ingest.import func...
Unable to find image 'softprops/lambda-rust:0.2.1-rust-1.34.1' locally
0.2.1-rust-1.34.1: Pulling from softprops/lambda-rust

Digest: sha256:972b2621171e89d54b3812fa411792a5b384e88dc2af8f5c21b3131f3610f2fe
Status: Downloaded newer image for softprops/lambda-rust:0.2.1-rust-1.34.1
error: could not find `Cargo.toml` in `/code` or any parent directory

Serverless: Dockerized Rust build encountered an error: undefined 1.
 
  Error --------------------------------------------------
  
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Stack Trace --------------------------------------------
 
Error
    at functions.forEach.funcName (/home/circleci/code/node_modules/serverless-rust/index.js:121:15)
    at Array.forEach (<anonymous>)
    at RustPlugin.build (/home/circleci/code/node_modules/serverless-rust/index.js:101:22)
    at BbPromise.reduce (/home/circleci/code/node_modules/serverless/lib/classes/PluginManager.js:422:55)
From previous event:
    at PluginManager.invoke (/home/circleci/code/node_modules/serverless/lib/classes/PluginManager.js:422:22)
    at PluginManager.run (/home/circleci/code/node_modules/serverless/lib/classes/PluginManager.js:453:17)
    at variables.populateService.then (/home/circleci/code/node_modules/serverless/lib/Serverless.js:109:33)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:120:23)
From previous event:
    at Serverless.run (/home/circleci/code/node_modules/serverless/lib/Serverless.js:96:6)
    at serverless.init.then (/home/circleci/code/node_modules/serverless/bin/serverless:43:28)
    at /home/circleci/code/node_modules/graceful-fs/graceful-fs.js:111:16
    at /home/circleci/code/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqWrap.args [as oncomplete] (fs.js:140:20)
From previous event:
    at initializeErrorReporter.then (/home/circleci/code/node_modules/serverless/bin/serverless:43:6)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:120:23)
From previous event:
    at /home/circleci/code/node_modules/serverless/bin/serverless:28:46
    at Object.<anonymous> (/home/circleci/code/node_modules/serverless/bin/serverless:65:4)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at findNodeScript.then.existing (/usr/local/lib/node_modules/npm/node_modules/libnpx/index.js:268:14)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     OS:                     linux
     Node Version:           10.15.3
     Serverless Version:     1.42.2
 
Exited with code 1

It seems as if it can't mount the current directory as a volume?

🤔 Expected Behavior

It should have been able to build the image as it does locally.

👟 Steps to reproduce

It is a private project, but I'm pretty sure it happens with any serverless-rust project on CircleCI.

🌍 Your environment

Running on CircleCI, from image rust:latest-node and a remote docker env set up.

OS: linux
Node Version: 10.15.3
Serverless Version: 1.42.2
plugin version: 0.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions