docker网络环境

docker-compose

创建

docker network create james

查看

docker network ls

docker 添加到该网络中

version: '3.3'
services:
  test-james:
    image: tomcat:8.5.41
    ports:
      - 80:8080
    environment:
      TZ: Asia/Shanghai
    container_name: test-james
    networks:   #添加网络
    - james
networks:      # 声名
  szlaozi:
    external: true

你可能感兴趣的:(docker网络环境)