Skip to content

[BUG] Missing documentation for network_mode #13635

@crocodisle

Description

@crocodisle

Description

I was trying to figure out how to have a docker compose container access the bridge network and not create a new one, and ended up finding the answer in this comment:

#3012 (comment)

People in that thread link to the docs, but it turns out the docs don't actually describe network_mode: bridge as a possibility, even though I used it, it solved my problem, and so it does seem to still exist in recent versions of docker. Perhaps the docs could be updated to reflect this.

Additionally, perhaps a section in https://docs.docker.com/reference/compose-file/networks/ could be added to describe how to use the bridge network instead of having the container make a new one.

Steps To Reproduce

  1. read the docs and realize network_mode: bridge isn't documented.

Compose Version

Docker Compose version v5.0.2

Docker Environment

Client: Docker Engine - Community
 Version:    29.2.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.31.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v5.0.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions