Multiple images and node


#1

We’re using the docker executor and stacked a couple of images to create the environment, one of which is node. I’m assuming node can’t be stacked in with other images since npm fails if it is…?

version: 2
executorType: docker
containerInfo:

  • image: python:3.5.2
  • image: node:argon

#2

You are correct - images can not be stacked. But you can compile your own image! I wrote down my own thoughts on that process:


#3

It appears you can stack if the base image is the same on the images, since i stack python, postgres, rabbit and redis np. Was more curious than anything why node didn’t work.

Cheers


#4

You cannot stack Ruby and Node images to use the packages from both. You’d need to compile them yourself and push it to Docker Hub.


#5

How do I know which images I can stack and which I cannot?

I tried stacking:

  • image: circleci/golang:1.8
  • image: circleci/node:6.11.2

and node won’t work for me.


#6

@mkj You’re bumping an old topic. In the future, I would advise you to open a new topic to get help. A CircleCI team member will hopefully break these posts into their own topic.

As @rohara specified, “You cannot stack…images to use packages from both”. It’s not a some-can, some-cannot situation. Images do not stack. The first image you list is the one that you will be able to use commands and software from. All other images will be started in the background. Specifying other images should be used if you need specific remote services like PostgreSQL, Redis, memcached, MySQL, Cassandra, etc. All other images are expected to expose a port for network communication.

If you need to run both go and node tools, you need to find or build a custom image that supports both. You can find more details about building custom images on the documentation page “Using Custom-Built Docker Images”.


#7