Invoking commands on other containers


#1

Is it possible to run commands on containers as part of build step?

For example, assuming

version: 2
jobs:
  build:
    docker:
    - image: php:7.1
    - image: mdillon/postgis:9.5-alpine
steps:
- run: foo

The foo command only executes in the php:7.1 container (the first defined container). Now I need to add frontend build step, which requires node container. Ideally, I would do

version: 2
jobs:
  build:
    docker:
    - image: php:7.1
    - image: node:7.9
    - image: mdillon/postgis:9.5-alpine
steps:
- run: foo
- run: npm build
  container: node

Without this, I’m forced to create one huge container with all dependencies. This is theoretically possible but very impractical as both node and php have a lot of dependencies on their own.


Running commands on non-primary containers
#2

Not at this time.


#3

This would be extremely useful.

In real life, it’s pretty unlikely to test only one language - most modern PHP applications also requires to run tests for Javascript.

Implementing this feature would avoid a forked Dockerfile so that all binaries are available in the same container.


#4

That will all be possible in the near future, just not today.


Running commands on secondary containers
#5

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.