Difference between revisions of "Ubuntu docker-compose.yml example"

From wikieduonline
Jump to navigation Jump to search
Line 9: Line 9:
 
         hostname: Ubuntu_container_1
 
         hostname: Ubuntu_container_1
 
         restart: always
 
         restart: always
         [[stdin_open:]] true # docker run -i
+
         [[stdin_open:]] true # [[docker run -i]]
         [[tty:]] true        # docker run -t
+
         [[tty:]] true        # [[docker run -t]]
 
   
 
   
 
   Ubuntu2:
 
   Ubuntu2:

Revision as of 12:10, 25 October 2023

Running two Ubuntu instances:

version: "3.3"

services:
 Ubuntu1:
       image: ubuntu
       container_name: Ubuntu_container_1
       hostname: Ubuntu_container_1
       restart: always
       stdin_open: true # docker run -i
       tty: true        # docker run -t

 Ubuntu2:
       image: ubuntu
       container_name: Ubuntu_container_2
       hostname: Ubuntu_container_2
       restart: always
       stdin_open: true # docker run -i
       tty: true        # docker run -t


Related terms

See also

Advertising: