-2
我在Windows Docker中很新,在爲我的Docker容器設置靜態IP時卡住了。下面是docker-compose.yml文件代碼,我用它來創建一個容器。如何在Windows中爲Docker容器設置靜態IP地址?
version: '2'
services:
pos:
image: ${POS_IMAGE_TAG}
container_name: ${POS_CONTAINER}
restart: always
ports:
- ${POS_PORT}:${POS_PORT}
networks:
- widgets
couchdb:
image: ${COUCHDB_IMAGE_TAG}
container_name: ${COUCHDB_CONTAINER}
restart: always
ports:
- ${COUCHDB_PORT}:${COUCHDB_PORT}
networks:
- widgets
networks:
widgets:
driver: bridge
ipam:
config:
- subnet: 172.10.0.0/16
gateway: 172.10.5.254
aux_addresses:
pos: 172.10.1.2
couchdb: 172.10.1.3
當我運行這個,容器被創建,但我無法訪問它的定義IP。
請編輯您的標題刪除喊話,謝謝。 '**'也可以從代碼塊中刪除,我想他們不應該在那裏? – halfer
@halfer - 現在好嗎? –