Answer the question
In order to leave comments, you need to log in
How to run a command from another container using docker-compose?
Starting to master docker, I created docker-compose.yml with the following content:
version: '3'
services:
app:
build: app
stdin_open: true
tty: true
restart: always
php:
build:
context: ./php
restart: always
depends_on:
- app
php -v
from the console in the app container?
Answer the question
In order to leave comments, you need to log in
1. ssh
2. install docker in the "app" container, mount /var/run/docker.sock and manage docker on the host from within the container.
Only in this case your container becomes omnipotent, actually gets root on the host.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question