Tag: node.js

'docker build' gives error that 'docker run' doesn't. How are they different?

My project is setup like this: ./ – Dockerfile package.json build compiled files from frontend and backend directories get put here backend app.js frontend frontend files… scripts startServer.sh build.sh startServer.sh: docker build ../ –tag myImage # The build script compiles all my assets and places # them in the top level ‘build’ directory which i […]

How copy files from current docker container to another container

I am building a docker container with a nodejs application, which will be build from meteorJS. For the build a shell runner is used (`meteor build /opt/project/build/core –directory) as this is all done in a gitlab CI. build: stage: build tags: – deploy before_script: – docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY – meteor npm […]

grunt serve in docker container max call stack error

Running grunt serve in a docker container causes node to crash (for lack of a better term). (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. util.js:35 var str = String(f).replace(formatRegExp, function(x) { ^ RangeError: Maximum call stack size exceeded When I run the […]

node can't find modules that exists in parent node_modules folder

I am using node 0.12.0 with express and created a Docker image. This is my directory structure: -server/ -config/ -config.js -app.js -package.json -node-modules/ -deep-extend/ -… -… -… My package.json looks like: { “name”: “test”, “version”: “2.0.0”, “private”: true, “dependencies”: { … … “deep-extend”: “^0.3.2”, … … } } and config/config.js looks like: var deepExtend = […]

Docker Rest Apis using node.js

How to run the docker rest apis in the localhost environment using node.js. I need to know the port settings and the urls which will be used on it etc.

Why this SSH command on Nexpect does not work?

I am trying to run and get information about docker containers from inside a docker container, to do this I am using Nexpect, but I found a strange error: exports.getIP = function(username, callback){ var nexpect = require(‘nexpect’); nexpect.spawn(“ssh core@172.17.8.101 \”docker inspect –format ‘{{ .NetworkSettings.IPAddress }}’ ” + username + “\””) .expect(” “) .run(function (err, stdout, […]

Unable to Launch Node.js Application Inside Built Docker Container

I’ve built a docker container (node.js installed along with some project files) with the following Dockerfile: RUN yum install -y openssl wget unzip gcc gcc-c++ tar make automake git RUN curl -L https://www.opscode.com/chef/install.sh | bash [… Chef Related Stuff …] #Docker CMD WORKDIR /var/node CMD [“/usr/bin/node /var/node/lib/app.js”] The container it builds is designed to use […]

Docker and MySQL can't connect

I can’t for the life of me figure this out. I feel like I’m really close, but im just not quite there yet. Here’s my Dockerfile: FROM ubuntu:14.04 MAINTAINER Oscar Godson RUN apt-get update RUN apt-get install -y nodejs-legacy RUN apt-get install -y npm RUN apt-get install -y mysql-server RUN apt-get install -y mysql-client COPY […]

Node.js tcp sockets + linked Docker containers

I have two node apps in two Docker containers. 1. Main web app 2. A profile service using sockets over tcp I link the Profile Service container to the Main Web App container using this option when running the Docker container –link srv-profile:srv_profile And it seems to be linking it just fine. I can say […]

Docker: Unable to specify port for a running container

I am a newbiew to Docker. I am using Mac hence have installed Docker in HortonWorks Sandbox Virtual Box. I am trying to create 2 containers out of a Ubuntu base image. One container runs nodejs on it and other with mysql. I am able to create a container and it lists under Docker ps, […]

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