https://signoz.io logo
#support
Title
# support
b

Brian Bills

07/05/2022, 9:34 PM
This used to work for me, I don't remember how I passed the backend, now my containers don't talk to the backend:
Copy code
docker run -it -p 8080:8080 -e SW_AGENT_NAME=docmagic-dev-torrance::bluelagoon -e POD_NAMESPACE=docmagic-dev-torrance cfpb-brian bash

docker run -it -p 8081:8080 -e SW_AGENT_NAME=docmagic-preprod-torrance::jetblue -e POD_NAMESPACE=docmagic-preprod-torrance cfpb-brian bash

docker run -it -p 8082:8080 -e SW_AGENT_NAME=docmagic-qa-torrance::chinaair -e POD_NAMESPACE=docmagic-qa-torrance cfpb-brian bash

docker run -it -p 8083:8080 -e SW_AGENT_NAME=docmagic-stage-torrance::evaair -e POD_NAMESPACE=docmagic-stage-torrance cfpb-brian bash

docker run -it -p 8084:8080 -e SW_AGENT_NAME=docmagic-dev-torrance::manadarinair -e POD_NAMESPACE=docmagic-dev-torrance cfpb-brian bash

docker run -it -p 8085:8080 -e SW_AGENT_NAME=docmagic-stage-torrance::starlux -e POD_NAMESPACE=docmagic-stage-torrance cfpb-brian bash

docker run -it -p 8086:8080 -e SW_AGENT_NAME=docmagic-qa-torrance::tigerair -e POD_NAMESPACE=docmagic-qa-torrance cfpb-brian bash

docker run -it -p 8087:8080 -e SW_AGENT_NAME=docmagic-preprod-torrance::delta -e POD_NAMESPACE=docmagic-preprod-torrance cfpb-brian bash

docker run -it -p 8088:8080 -e SW_AGENT_NAME=boa-preprod-torrance::blue22 -e POD_NAMESPACE=boa-preprod-torrance cfpb-brian bash
Dockerfile:
Copy code
FROM <http://harbor.docmagic.com/library/dm-openjdk:8-jdk-slim-buster-012122164131|harbor.docmagic.com/library/dm-openjdk:8-jdk-slim-buster-012122164131>
ADD agent /app/agent
COPY cfpb-service.war /app
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["entrypoint.sh", "-j", "/app/cfpb-service.war"]
entrypoint.sh:
Copy code
#!/bin/bash

while getopts ":j:f:h" opt; do
  case ${opt} in
    j)
      JAR=$OPTARG
      ;;
    f)
      JVM_EXTRA_FLAGS=$OPTARG
      ;;
    h)
      echo "USAGE: entrypoint.sh -j app.jar"
      echo "  -j: /path/to/jar"
      echo "  -f: "JVM_EXTRA_FLAGS" (optional)"
      exit 0
      ;;
    \?)
      echo "Invalid option: $OPTARG" 1>&2
      exit 1
      ;;
    :)
      echo "Invalid option: $OPTARG requires an argument" 1>&2
      exit 1
      ;;
  esac
done
shift $((OPTIND -1))

if [ -f "$JAR" ]; then
    JAVA_BIN=$(/usr/bin/which java)
    umask 002
    exec $JAVA_BIN \
        -Dfile.encoding=ISO-8859-1 \
        -Dserver.port=8080 \
        -Djava.security.egd=file:/dev/./urandom \
        -XX:+UnlockExperimentalVMOptions \
        -XX:+UseContainerSupport \
        -Dcom.sun.management.jmxremote \
        -Djava.rmi.server.hostname=127.0.0.1 \
        -Dcom.sun.management.jmxremote.port=1083 \
        -Dcom.sun.management.jmxremote.rmi.port=1083 \
        -Dcom.sun.management.jmxremote.local.only=false \
        -Dcom.sun.management.jmxremote.ssl=false \
        -Dcom.sun.management.jmxremote.authenticate=true \
        -Dcom.sun.management.jmxremote.access.file=$JAVA_HOME/conf/jmx.access \
        -Dcom.sun.management.jmxremote.password.file=$JAVA_HOME/conf/jmx.password \
        $JVM_EXTRA_FLAGS \
        -javaagent:/app/opentelemetry-javaagent.jar \
        -jar \
        $JAR
else
    echo "File $JAR does not exist"
    exit 1
fi
5 Views