Code Monkey home page Code Monkey logo

Comments (14)

mhart avatar mhart commented on June 17, 2024

Putting them in /root/.ssh on the container should work. Something like this might work:

docker run -v "$PWD":/var/task -v "$HOME/.ssh":/root/.ssh lambci/lambda:build-nodejs4.3 npm install

You can play around manually in the container and see what works:

docker run -it lambci/lambda:build-nodejs4.3 bash

Or this if you want to expose your own .ssh directory in the container:

docker run -v "$HOME/.ssh":/root/.ssh -it lambci/lambda:build-nodejs4.3 bash

from docker-lambda.

pierrerappolt avatar pierrerappolt commented on June 17, 2024

Wow so helpful thank you! @mhart

from docker-lambda.

mhart avatar mhart commented on June 17, 2024

@pierrerappolt no probs, did that solve your problem?

from docker-lambda.

pierrerappolt avatar pierrerappolt commented on June 17, 2024

I'm getting this error at the moment

npm ERR! /root/.ssh/config: line 2: Bad configuration option: addkeystoagent
npm ERR! /root/.ssh/config: line 3: Bad configuration option: usekeychain
npm ERR! /root/.ssh/config: terminating, 2 bad configuration options

from docker-lambda.

pierrerappolt avatar pierrerappolt commented on June 17, 2024

I tried changing my ~/.ssh/config file to

Host *
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile /root/.ssh/id_rsa

but still no luck

from docker-lambda.

mhart avatar mhart commented on June 17, 2024

@pierrerappolt right, they're probably macOS-specific settings that don't work on Linux.

Might be best just to connect the files you need then instead of the whole .ssh directory

from docker-lambda.

pierrerappolt avatar pierrerappolt commented on June 17, 2024

@mhart Is there a way I can run npm install from within bash?

from docker-lambda.

pierrerappolt avatar pierrerappolt commented on June 17, 2024

I am able to create new working github permissions within bash but then can't run npm install

from docker-lambda.

mhart avatar mhart commented on June 17, 2024

Not sure what you mean? What happens when you run npm install?

from docker-lambda.

pierrerappolt avatar pierrerappolt commented on June 17, 2024

@mhart
after doing:
docker run -v "$HOME/.ssh":/root/.ssh -it lambci/lambda:build-nodejs4.3 bash

no such file or directory, open '/var/task/package.json'

from docker-lambda.

pierrerappolt avatar pierrerappolt commented on June 17, 2024

bash-4.2# npm install in between those

from docker-lambda.

mhart avatar mhart commented on June 17, 2024

Right – so the -v option to docker is used to expose your local directories on the docker container. So you'll need -v "$PWD":/var/task if you want to expose your (current) project directory

from docker-lambda.

pierrerappolt avatar pierrerappolt commented on June 17, 2024

@mhart Doh! Solved! Thank you so much!

from docker-lambda.

mhart avatar mhart commented on June 17, 2024

No probs, glad it worked for you 👍

from docker-lambda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.