Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 593 Bytes

Docker-Compose-Tips.md

File metadata and controls

46 lines (33 loc) · 593 Bytes

Docker Compose Tips

Run service with host network

version: '3.7'

services:

  srv:
    image: ubuntu
    network_mode: host

Run service with host network during building image from Dockerfile

version: '3.7'

services:

  srv:
    build:
      contex: .
      dockerfile: Dockerfile
      network: host

Run service with openned STDIN

version: '3.7'

services:

  srv:
    image: ubuntu
    stdin_open: true
    tty: true

After that you can run service as daemon and run bash:

$ docker-compose up -d
$ docker-compose exec srv bash