[컴] 테스트용 docker network

test / local test / 설치 테스트 / 설치 환경

테스트용 docker network

아래 command 로 실행하자.

docker compose up

bash 접속

docker exec -it testnet-node1-1 bash

network 정보

docker network ls
...
docker network inspect testnet_mybridge

file 정보

# compose.yml
version: '3.8'
services:
    node1:
        build:
            context: .
            dockerfile: ./node.Dockerfile
        # image: redhat/ubi8-init:8.6-798
        volumes:
            - d:\a\prog\docker\testnet\data\:/data/
        ports:
            - "8001:8000"
        environment:
            - CROND_SERVER_URL=http://cronhost:8000/test
        stdin_open: true # docker run -i
        tty: true        # docker run -t
        entrypoint:
            - bin/bash
        networks:
            - mybridge
    node2:
        build:
            context: .
            dockerfile: ./node.Dockerfile
        # image: redhat/ubi8-init:8.6-798
        volumes:
            - d:\a\prog\docker\testnet\data\:/data/
        ports:
            - "8002:8000"
        environment:
            - CROND_SERVER_URL=http://cronhost:8000/test
        stdin_open: true # docker run -i
        tty: true        # docker run -t
        entrypoint:
            - bin/bash
        networks:
            - mybridge
networks:
  mybridge:

# node.Dockerfile
FROM redhat/ubi8-init:8.6-798

RUN dnf install -y iputils
RUN dnf install -y net-tools

그 밖의 tips

# root 이외 계정으로 실행해야만 하는 경우
runuser -u elasticsearch -- '/usr/share/elasticsearch/bin/elasticsearch'

elasticsearch vm 관련 에러

wsl -d docker-desktop
echo "vm.max_map_count = 262144" >> /etc/sysctl.conf

이렇게 하고, container 를 새롭게 생성하자.

댓글 없음:

댓글 쓰기