Tag: node.js

How to list images and tags from the gcr.io Docker Registry using the HTTP API?

I’m trying to fetch a list of available images and their tags from Google Container Registry (gcr.io) in Node.js. I first use google-auto-auth to optain a token with scope https://www.googleapis.com/auth/devstorage.read_write, and I exchange that token for a gcr.io token like so: axios.get(‘https://gcr.io/v2/token?service=gcr.io’, { auth: { username: ‘_token’, password: token // token I got from `google-auto-auth` […]

using kerberos in a container, inside of openshift / kubernetes

I was able to get kerberos authentication to function inside of a standalone docker installation for our webapp. Our webapp is NodeJS. However when I try to deploy the POD inside of OpenShift it ceases to function. It appears the authentication headers get lost in translation. The exact same containerized app, gives us this error […]

When I start my app with PM2 + Docker, just run and exit

I try to follow this tutorial, but when I execute my app nothing happens My Dockerfile (CHANGED) FROM keymetrics/pm2-docker-alpine:7 WORKDIR /api RUN npm install pm2 -g ADD . . CMD [“pm2-docker”, “ecosystem.config.js”] And my ecosystem.config.js.. const maxMemory = process.env.WEB_MEMORY || 80; const nodeEnv = process.env.NODE_ENV || ‘development’; module.exports = { apps: [ { name: ‘api’, […]

npm commands fails in jenkins pipelines with docker

i’m using jenkins for CI/CD. New project uses node.js and build fails on npm install command (as example used repo https://github.com/heroku/node-js-sample). Jenkinsfile: node { stage (‘stage0’) { checkout scm } stage (‘stage1’) { docker.withServer(‘tcp://example.com:2376’, ‘docker-example.com’) { docker.image(‘node’).inside { withEnv([‘npm_config_cache=npm-cache’, ‘HOME=.’]) { sh ‘npm install’ } } } } } Build Output: … [Pipeline] withDockerContainer Jenkins […]

Node cli program not working in windows machine

I am writing a CLI tool to manipulate docker related commands like docker, docker-compose etc. If I run it on linux environment it works perfectly. But when I run it on windows machine or with a ci tool like team city it is giving error. Error stack path/to/work/d38db04560cf1c1e/node_modules/define-property/index.js:14 [07:18:52] throw new TypeError(‘expected an object or […]

I need to run my node app using this Docker file

Docker Image is: https://github.com/nodejs/docker-node/blob/12ba2e5432cd50037b6c0cf53464b5063b028227/8.1/Dockerfile My node app: ‘use strict’; var express = require(‘express’); // Constants var PORT = 8080; var HOST = ‘0.0.0.0’; // App var app = express(); app.get(‘/’, function (req, res) { res.send(‘Hello world\n’); }); app.listen(PORT, HOST); console.log(‘Running on http://’ + HOST + ‘:’ + PORT); How Can i deploy my node app […]

Can I use restarting docker instead restarting app in container?

I run app in Docker container. I didn’t bundle the app’s code into image, but using -v to map the code into container in order to upgrade the code more conveniently. I used to use pm2 to manage the process, and when I upgrade the code, I use docker exec -it app bash to go […]

vuejs application does not run with dockerized npm

I’m trying to set up a repeatable build-environment which does not mess with anything on the local machine. For that I decided to use docker to wrap the npm and vue cli. Everything runs on the machine where I first ran the vue quickstart command. But when I take a fresh clone from the repository […]

Docker(compose) installing nodejs broke npm

I need to use a container with nginx and nodejs, so I take the nginx container and install the node: FROM nginx ENV DEBIAN_FRONTEND noninteractive WORKDIR /usr/src/app VOLUME /usr/src/app RUN apt-get update && \ apt-get install -y apt-utils && \ apt-get install -y –no-install-recommends curl sudo wget nano && \ curl -sL https://deb.nodesource.com/setup_6.x | bash […]

running a Docker container with Java application and a webserver doesnt work

Im a new to docker and i am trying to create a container running multiple services, using this documentation:Run multiple services in a container I’ve managed to get Java and Nodejs installed on the containe, eventually leading to running this script at the end of the Dockerfile as an ENTRYPOINT: #!/bin/bash # Start the first […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.