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 3 years have passed since last update.

Docker network memo

Last updated at Posted at 2021-12-06

List all the docker networks:

~> docker network ls                                                                                                       NETWORK ID     NAME                                     DRIVER    SCOPE
6632005b7b01   bridge                                   bridge    local
446a6bafd4ce   host                                     host      local
efde81885e68   keycloak_default                         bridge    local
3c1e0372f203   mysql-compose_default                    bridge    local

Add a service into one of the networks.

services:
  keycloak:
      image: quay.io/keycloak/keycloak:latest
      environment:
        DB_VENDOR: MYSQL
        DB_ADDR: 172.19.0.2
        DB_DATABASE: keycloak
        DB_USER: root
        DB_PASSWORD: password
        KEYCLOAK_USER: admin
        KEYCLOAK_PASSWORD: Pa55w0rd
        # Uncomment the line below if you want to specify JDBC parameters. The parameter below is just an example, and it shouldn't be used in production without knowledge. It is highly recommended that you read the MySQL JDBC driver documentation in order to use it.
        #JDBC_PARAMS: "connectTimeout=30000"
      ports:
        - 8090:8080
      networks:
        - mysqlnetwork

networks:
  mysqlnetwork:
    name: mysql-compose_default

Check service's ip in docker network:

docker network inspect mysql-compose_default

Reset docker network:

docker network prune
docker-compose down
docker-compose up
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?