Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 2.59 KB

File metadata and controls

52 lines (37 loc) · 2.59 KB

node-ssh

dockeri.co

Build Status

Docker image for node apps with alpine linux and private dependencies dependencies (git+ssh)

Supported tags and respective Dockerfile links

Variants

  • onbuild: Onbuild image to general node app
  • ci: Image for CI pipelines. Like gitlab-ci

Create a Dockerfile in your Node.js app project

FROM lgatica/node-ssh:10-onbuild

EXPOSE 3000

You can then build and run the Docker image:

export KNOWN_HOST=gitlab.com
export SSH_PRIVATE_KEY=$(cat ssh/id_rsa)
docker build -t my-nodejs-app \
  --build-arg KNOWN_HOST=$KNOWN_HOST \
  --build-arg SSH_PRIVATE_KEY=$SSH_PRIVATE_KEY.
docker run -it --rm --name my-running-app my-nodejs-app

Change KNOWN_HOST and SSH_PRIVATE_KEY with valid values for install private dependencies.

Notes

The image assumes that your application has a file named package.json listing its dependencies and defining its start script.