본문 바로가기

docker.errors.InvalidArgument: “host” network_mode is incompatible with port_bindings

by tonyhan18 2022. 3. 30.
728x90

docker.errors.InvalidArgument: "host" network_mode is incompatible with port_bindings - General Discussions - Docker Community Forums

 

docker.errors.InvalidArgument: "host" network_mode is incompatible with port_bindings

Hi, I am trying to install a Nuclias container running and getting an error on the port binding. Could anyone suggest what needs to be changed with the network? Thank you docker-compose version 1.28.0, build d02a7b1a docker-py version: 4.4.1 CPython versio

forums.docker.com

외국인 친구말 들어보니까.

 

예전에는 network_mode라는 것을 별론 신경 안썼나보다. 그래서 다운그레이드를 했을 경우 이게 성공하는데

이걸 최신버전까지 적용할 수 없다.

 

 

version: "3.1"
services:
  mysql:
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    container_name: mysql
    network_mode: host
    environment:
      MYSQL_ROOT_PASSWORD: admin

  adminer:
    image: adminer
    restart: always
    network_mode: host
    ports:
      - 8080:8080

  react-node-mysql:
    image: tonyhan18/react-node-mysql
    container_name: react-node-app
    restart: always
    ports:
      - 3000:3000
    network_mode: host

원본파일

 

방법 1

network_mode 없애기

 

방법2

ports 없애기

728x90