Tag: node.js

How to remove development dependencies in production docker images

When shipping a dockerized node.js to production, is it correct to ship an image that contains development dependencies? I am not talking about the development dependencies Not the devDependencies listed in packages.json, I mean gcc, python, node-gyp, some other *-dev packages, containing a bunch of headers, static libraries. All of them are needed to compile […]

How do I expose a docker container port to another container

I have a docker container that relies on selenium as a linked service (also a docker container). This docker container just uses selenium service as host to run nightwatchJS tests headlessly. The selenium service starts up fine but when the nightwatch tests attempt to run within the docker container, i receive a refused connection error […]

docker: Command “/bin/sh” not found

ENV PORT=3000 ENV NODE_ENV=production EXPOSE $PORT WORKDIR $APP_DIR COPY yarn.lock package.json $APP_DIR/ RUN [“/usr/local/bin/yarn”] COPY . $APP_DIR ENTRYPOINT [“/usr/local/bin/yarn”, “run”] CMD [‘dev’] Was running this using this command docker run –rm -p 3000:3000 my-app:latest And the console outputs yarn run v0.17.9 error Command “/bin/sh” not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. I […]

Got errors with ONBUILD options (Docker toolbox in Windows)

I have a problem with my Docker on Windows (through Docker Toolbox). May be someone can help. My Dockerfile without ONBUILD: FROM node:5.9.1 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app CMD [ “npm”, “start” ] EXPOSE 3000 Working ok (docker build -t test . and start it: […]

How to map ports with – Express + Docker + Azure

I am completely stuck on the following. Trying to setup a express app in docker on an Azure VM. 1) VM is all good after using docker-machine create -driver azure … 2) Build image all good after: //Dockerfile FROM iojs:onbuild ADD package.json package.json ADD src src RUN npm install EXPOSE 8080 CMD [“node”, “src/server.js”] Here’s […]

Node size on GKE kubernetes

We run our cluster with two nodes of type standard 2: 7.5Gb and 2vCPU are there any recommended minimum size for a cluster on GKE. I assume there is no real master as this is a managed “service”? I’m struggling to deal with resource limits.

Copy file from local machine to docker

I’ve created a nodejs application which uses external files to read various configurations and I’ve created a docker container for this app. I need this app to read the config files (since they will be changed from time to time) from the host machine without rebuilding the whole docker container. How can this be done?

Getting error installing nodejs when building from docker

I am trying to install nodejs using the docker console for ubuntu but I get an error installing node js. This is the error I am getting The command [/bin/sh -c ./configure && make && make install] returned a non-zero code: 127 This is part of my dockerfile FROM ubuntu:12.04 RUN mkdir -p /dir/subdir RUN […]

Docker Compose: Accessing my webapp from the browser

I’m finding the docs sorely lacking for this (or, I’m dumb), but here’s my setup: Webapp is running on Node and Express, in port 8080. It also connects with a MongoDB container (hence why I’m using docker-compose). In my Dockerfile, I have: FROM node:4.2.4-wheezy # Set correct environment variables. ENV HOME /root RUN mkdir -p […]

Converting a docker-compose file to a build and run command

I would like to start my docker container by using a docker build and docker run command instead of via a compose file. I started to convert the compose file to commands but I got stuck. Compose file: version: ‘2’ services: node: build: ./node_js command: node server.js depends_on: – mongo links: – mongo environment: NODE_ENV: […]

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