我有两个Docker容器。 Jenkins和PHP。所以我想从Jenkins容器访问PHP和composer命令。我怎样才能做到这一点?
这是我的样本docker-compose.yml
version: "3"
services:
php:
build:
context: "./php/"
args:
PHP_VERSION: ${PHP_VERSION}
networks:
- backend
volumes:
- ${PROJECT_ROOT}/:/var/www/html/
container_name: php${PHP_VERSION}
jenkins:
build:
context: "./jenkins/"
depends_on:
- php
ports:
- "50000:50000"
- "8080:8080"
volumes:
- /var/jenkins_home
networks:
- jenkins
- backend
container_name: jenkings-php
networks:
backend:
jenkins:
volumes:
data: