0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker/docker-compose:networkの接続方法備忘録

0
Posted at

別々のdocker-compose.ymlで管理していてコンテナから別のコンテナに繋ぎたい場合、ネットワークを接続してあげる必要がある。その備忘録

手順

  • docker network lsで入りたいネットワーク名を確認
  • docker-compose.ymlにネットワーク名を指定する
$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
91439b39824c        ネットワーク名          bridge              local

サンプルコード

docker-compose.yml
version: "3"
services:
省略
networks:
  default:
    external:
      name: ネットワーク名

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?