Docker Compose


it keeps and reuses the same container unless you remove it with

docker-compose rm https://docs.docker.com/compose/reference/config/ https://docs.docker.com/compose/compose-file/

docker-compose up --build

yum install -y net-tools ifconfig route -n ping one


examples/interactive-shell-two/docker-compose.yml
version: '3.7'
services:
  one:
    build:
        context: .
        dockerfile: Dockerfile1
    stdin_open: true
    tty: true
  two:
    image: centos:7
    stdin_open: true
    tty: true

examples/interactive-shell-two/Dockerfile1
FROM centos:7
RUN yum install -y less vim which net-tools


examples/interactive-shell-3/docker-compose.yml
version: '3.7'
services:
  one:
    image: centos:7
    entrypoint:
        - bash
    stdin_open: true
    tty: true
  two:
    image: centos:7
    stdin_open: true
    tty: true