Переменная среды устанавливается дважды командой docker-compose up - PullRequest
0 голосов
/ 06 марта 2019

Я определил переменную окружения JAVA_TOOL_OPTIONS в моем файле yaml. Когда я запускаю свои контейнеры командой «docker-compose -f up», я получаю следующую ошибку:

Подобраны JAVA_TOOL_OPTIONS: -agentlib: jdwp = transport = dt_socket, адрес = 8010, сервер = y, приостановить = n Прослушивание транспорта dt_socket по адресу: 8010 Подобрал JAVA_TOOL_OPTIONS: -agentlib: jdwp = transport = dt_socket, адрес = 8010, сервер = y, приостановить = n ОШИБКА: Невозможно загрузить этот агент TI JVM дважды, проверьте в командной строке Java наличие дубликатов параметров jdwp. Произошла ошибка при инициализации ВМ Не удалось инициализировать библиотеку агентов: jdwp

Похоже, JAVA_TOOL_OPTIONS устанавливается дважды. Любая помощь будет очень ценится

Ниже мой файл .yaml:

version: '3.1'
services:

  blumeglobal:
    build:
      context: .
      dockerfile: Dockerfile
    image: corda-3.2
    environment:
      - JAVA_OPTIONS=-Xmx512m
    ports:
      - "10003:10003"
      - "10004:10004"
      - "10005:10005"
    image: corda:3.2
    container_name: blumeglobal
    volumes:
      - ./build/nodes/BlumeGlobal/network-parameters:/opt/corda/network-parameters
      - ./build/nodes/BlumeGlobal/persistence.mv.db:/opt/corda/persistence.mv.db
      - ./build/nodes/BlumeGlobal/additional-node-infos/:/opt/corda/additional-node-infos/
      - ./build/nodes/BlumeGlobal/node.conf:/opt/corda/node.conf
      - ./build/nodes/BlumeGlobal/cordapps/:/opt/corda/cordapps/
      - ./build/nodes/BlumeGlobal/certificates/:/opt/corda/certificates/
    networks:
      - mynetwork

  bestbuy:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - JAVA_OPTIONS=-Xmx512m
    ports:
      - "10012:10002"
      - "10013:10003"
      - "10014:10004"
      - "10015:10015"
    image: corda:3.2
    container_name: bestbuy
    volumes:
      - ./build/nodes/Bestbuy/network-parameters:/opt/corda/network-parameters
      - ./build/nodes/Bestbuy/persistence.mv.db:/opt/corda/persistence.mv.db
      - ./build/nodes/Bestbuy/additional-node-infos/:/opt/corda/additional-node-infos/
      - ./build/nodes/Bestbuy/node.conf:/opt/corda/node.conf
      - ./build/nodes/Bestbuy/cordapps/:/opt/corda/cordapps/
      - ./build/nodes/Bestbuy/certificates/:/opt/corda/certificates/
    depends_on:
      - blumeglobal
    networks:
      - mynetwork

  expeditors:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - JAVA_OPTIONS=-Xmx512m
      - JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,address=8010,server=y,suspend=n
    ports:
      - "10022:10002"
      - "10023:10003"
      - "10024:10004"
      - "10025:10025"
      - "8010:8010"
    image: corda:3.2
    container_name: expeditors
    volumes:
      - ./build/nodes/Expeditors/network-parameters:/opt/corda/network-parameters
      - ./build/nodes/Expeditors/persistence.mv.db:/opt/corda/persistence.mv.db
      - ./build/nodes/Expeditors/additional-node-infos/:/opt/corda/additional-node-infos/
      - ./build/nodes/Expeditors/node.conf:/opt/corda/node.conf
      - ./build/nodes/Expeditors/cordapps/:/opt/corda/cordapps/
      - ./build/nodes/Expeditors/certificates/:/opt/corda/certificates/
    depends_on:
      - blumeglobal
    networks:
      - mynetwork

  motorcarrier:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - JAVA_OPTIONS=-Xmx512m
    ports:
      - "10032:10002"
      - "10033:10003"
      - "10034:10004"
      - "10035:10035"
    image: corda:3.2
    container_name: motorcarrier
    volumes:
      - ./build/nodes/DTDC/network-parameters:/opt/corda/network-parameters
      - ./build/nodes/DTDC/persistence.mv.db:/opt/corda/persistence.mv.db
      - ./build/nodes/DTDC/additional-node-infos/:/opt/corda/additional-node-infos/
      - ./build/nodes/DTDC/node.conf:/opt/corda/node.conf
      - ./build/nodes/DTDC/cordapps/:/opt/corda/cordapps/
      - ./build/nodes/DTDC/certificates/:/opt/corda/certificates/
    depends_on:
      - blumeglobal
    networks:
      - mynetwork

  one:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - JAVA_OPTIONS=-Xmx512m
    ports:
      - "10042:10002"
      - "10043:10003"
      - "10044:10004"
      - "10045:10045"
    image: corda:3.2
    container_name: one
    volumes:
      - ./build/nodes/ONE/network-parameters:/opt/corda/network-parameters
      - ./build/nodes/ONE/persistence.mv.db:/opt/corda/persistence.mv.db
      - ./build/nodes/ONE/additional-node-infos/:/opt/corda/additional-node-infos/
      - ./build/nodes/ONE/node.conf:/opt/corda/node.conf
      - ./build/nodes/ONE/cordapps/:/opt/corda/cordapps/
      - ./build/nodes/ONE/certificates/:/opt/corda/certificates/
    depends_on:
      - blumeglobal
    networks:
      - mynetwork

  cisco:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - JAVA_OPTIONS=-Xmx512m
    ports:
      - "10052:10002"
      - "10053:10003"
      - "10054:10004"
      - "10055:10055"
    image: corda:3.2
    container_name: cisco
    volumes:
      - ./build/nodes/Cisco/network-parameters:/opt/corda/network-parameters
      - ./build/nodes/Cisco/persistence.mv.db:/opt/corda/persistence.mv.db
      - ./build/nodes/Cisco/additional-node-infos/:/opt/corda/additional-node-infos/
      - ./build/nodes/Cisco/node.conf:/opt/corda/node.conf
      - ./build/nodes/Cisco/cordapps/:/opt/corda/cordapps/
      - ./build/nodes/Cisco/certificates/:/opt/corda/certificates/
    depends_on:
      - blumeglobal
    networks:
      - mynetwork

  foxconn:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - JAVA_OPTIONS=-Xmx512m
    ports:
      - "10062:10002"
      - "10063:10003"
      - "10064:10004"
      - "10065:10065"
    image: corda:3.2
    container_name: foxconn
    volumes:
      - ./build/nodes/Foxconn/network-parameters:/opt/corda/network-parameters
      - ./build/nodes/Foxconn/persistence.mv.db:/opt/corda/persistence.mv.db
      - ./build/nodes/Foxconn/additional-node-infos/:/opt/corda/additional-node-infos/
      - ./build/nodes/Foxconn/node.conf:/opt/corda/node.conf
      - ./build/nodes/Foxconn/cordapps/:/opt/corda/cordapps/
      - ./build/nodes/Foxconn/certificates/:/opt/corda/certificates/
    depends_on:
      - blumeglobal
    networks:
      - mynetwork

  toshiba:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - JAVA_OPTIONS=-Xmx512m
    ports:
      - "10072:10002"
      - "10073:10003"
      - "10074:10004"
      - "10075:10075"
    image: corda:3.2
    container_name: toshiba
    volumes:
      - ./build/nodes/Toshiba/network-parameters:/opt/corda/network-parameters
      - ./build/nodes/Toshiba/persistence.mv.db:/opt/corda/persistence.mv.db
      - ./build/nodes/Toshiba/additional-node-infos/:/opt/corda/additional-node-infos/
      - ./build/nodes/Toshiba/node.conf:/opt/corda/node.conf
      - ./build/nodes/Toshiba/cordapps/:/opt/corda/cordapps/
      - ./build/nodes/Toshiba/certificates/:/opt/corda/certificates/
    depends_on:
      - blumeglobal
    networks:
      - mynetwork

networks:
  mynetwork:
    external: true

Ниже мой Dockerfile

FROM openjdk:8u151-jre-alpine

# Override default value with 'docker build --build-arg BUILDTIME_CORDA_VERSION=version'
# example: 'docker build --build-arg BUILDTIME_CORDA_VERSION=1.0.0 -t corda/node:1.0 .'
ARG BUILDTIME_CORDA_VERSION=3.2-corda
ARG BUILDTIME_JAVA_OPTIONS

ENV CORDA_VERSION=${BUILDTIME_CORDA_VERSION}
ENV JAVA_OPTIONS=${BUILDTIME_JAVA_OPTIONS}

# Set image labels
LABEL net.corda.version = ${CORDA_VERSION} \
      maintainer = "<blockchainservice@infosys.com>" \
      vendor = "infosys"

RUN apk upgrade --update && \
    apk add --update --no-cache bash iputils && \
    rm -rf /var/cache/apk/* && \
    # Add user to run the app && \
    addgroup corda && \
    adduser -G corda -D -s /bin/bash corda && \
    # Create /opt/corda directory && \
    mkdir -p /opt/corda/plugins && \
    mkdir -p /opt/corda/logs

# Copy corda jar
ADD --chown=corda:corda https://dl.bintray.com/r3/corda/net/corda/corda/${CORDA_VERSION}/corda-${CORDA_VERSION}.jar                       /opt/corda/corda.jar

COPY run-corda.sh /run-corda.sh
RUN chmod 777 /opt/corda && chmod +x /run-corda.sh && \
    sync && \
    chown -R corda:corda /opt/corda

# Expose port for corda (default is 10002) and RPC
EXPOSE 10002
EXPOSE 10003
EXPOSE 10004
EXPOSE 10005 10015 10025 10035 10045 10055 10065 10075

# Working directory for Corda
WORKDIR /opt/corda
ENV HOME=/opt/corda
USER corda

# Start it
CMD ["/run-corda.sh"]
...