MAC Address

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

MAC Address

文章 yehlu »

https://stackoverflow.com/questions/432 ... -container

代碼: 選擇全部

docker inspect php71 | grep MacAddress|tr -d ' ,"'|sort -u
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: MAC Address

文章 yehlu »

https://github.com/docker/compose/issues/982

代碼: 選擇全部

app_service_1:
    image: app/service_1
    mac_address: 02:42:ac:11:65:41
    expose:
        - "9090"

app_service_1:
    image: app/service_2
    mac_address: 02:42:ac:11:65:43
    expose:
        - "5558"
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: MAC Address

文章 yehlu »

https://stackoverflow.com/questions/394 ... er-compose

代碼: 選擇全部

version: '2'

services:
  mysql:
    container_name: mysql
    image: mysql:latest
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=root
    ports:
     - "3306:3306"
    networks:
      vpcbr:
        ipv4_address: 10.5.0.5

  apigw-tomcat:
    container_name: apigw-tomcat
    build: tomcat/.
    ports:
     - "8080:8080"
     - "8009:8009"
    networks:
      vpcbr:
        ipv4_address: 10.5.0.6
    depends_on:
     - mysql

networks:
  vpcbr:
    driver: bridge
    ipam:
     config:
       - subnet: 10.5.0.0/16
         gateway: 10.5.0.1

回覆文章

回到「Docker」