Cinnamon-agent.jar not included in docker image

(Jorge Liano) #1

We are trying to incorporate metrics into our lagom services, but the cinnamon-agent.jar is not added into the docker file generated.

We have the following configuration:

  1. Added the dependency management plugin
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.lightbend.cinnamon</groupId>
                                    <artifactId>cinnamon-agent</artifactId>
                                    <version>${cinnamon.version}</version>
                                    <overWrite>true</overWrite>
                                    <destFileName>cinnamon-agent.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
  1. Using the Lightbend document docker build
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.20.1</version>
                <configuration>
                    <skip>true</skip>
                    <images>
                        <image>
                            <name>%a:%l</name>
                            <build>
                                <from>openjdk:8-jdk-alpine</from>
                                <tags>
                                    <tag>engage-platform-${CIRCLE_SHA1}</tag>
                                    <tag>engage-platform-${buildNumber}</tag>
                                    <tag>${project.version}</tag>
                                    <tag>${buildNumber}</tag>
                                </tags>
                                <entryPoint>
                                    java -XX:+PrintFlagsFinal $JAVA_OPT -cp '/maven/*' -Dconfig.file=/etc/opt/engage/authentication-service.conf -Dlogger.file=/etc/opt/engage/authenticationservice-logback.xml -Dplay.crypto.secret="${APPLICATION_SECRET:-none}" -Dplay.akka.actor-system="${AKKA_ACTOR_SYSTEM_NAME:-authentication-service-v1}" -Dhttp.address="$AUTHENTICATIONSERVICE_BIND_IP" -Dhttp.port="$AUTHENTICATIONSERVICE_BIND_PORT" -Dakka.io.dns.resolver=async-dns -Dakka.io.dns.async-dns.resolve-srv=true -Dakka.io.dns.async-dns.resolv-conf=on play.core.server.ProdServerStart
                                </entryPoint>
                                <assembly>
                                    <descriptorRef>artifact-with-dependencies</descriptorRef>
                                </assembly>
                            </build>
                        </image>
                    </images>
                </configuration>
            </plugin>

When we add the -javaagent:cinnamon-agent.jar to the entrypoint we’re unable to start the service.

While the container is running we did a grep to find the location of the cinnamon-agent.jar and it isn’t there.

Does someone have the valid configuration to include this JAR in the docker build?

(Neil Derraugh) #2

Did you ever find a solution for this?

(Tim Moore) #3

Please direct questions about Lightbend commercial products to Lightbend Support. Thanks!