docker compose - keep running two ways
version: '3.7'
services:
one:
build:
context: .
dockerfile: Dockerfile1
two:
build:
context: .
dockerfile: Dockerfile2
stdin_open: true
tty: true
FROM centos:7
RUN yum install -y less vim which net-tools
CMD tail -f /dev/null
FROM centos:7
RUN yum install -y less vim which
WORKDIR /opt
attach to either one of them:
docker-compose exec one sh
ping compose1_one_1