You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Those of my targets that don't include AshScriptPlugin create docker images as indicated. However, those that do include AshScriptPlugin completely ignore the modified dockerCommands.
As static alternative, I copied the downloaded opentelemetry-javaagent.jar directly into the folder <my-service>-impl/src/universal, since the documentation says "By default, all files found in the src/universal directory are included in the distribution". However, the file is again not included in the docker images generated with the AshScriptPlugin.
Actual behaviour
The docker image contains only the default AshScriptPlugin-generated content, not the opentelemetry-javaagent.jar.
Information
What sbt-native-packager are you using: 1.9.7
What sbt version: 1.5.8
What is your build system (e.g. Ubuntu, MacOS, Windows, Debian ): MacOS 12.2.1
What package are you building (e.g. docker, rpm, ...): docker
What version has your build tool (find out with e.g. rpm --version): Docker version 20.10.13, build a224086
What is your target system (e.g. Ubuntu 16.04, CentOS 7): NA
The text was updated successfully, but these errors were encountered:
I have found my mistake, it was about sbt scopes. The dockerCommands for the microservices that use AshScriptPlugin are not copied in from the other microservices, but created by AshScriptPlugin. So I had to edit the dockerCommands generated by AshScriptPlugin directly. FWIW, I did it this way:
lazy val otelCommands = Seq(
Cmd("WORKDIR", "/opt/"),
ExecCmd("RUN", "wget", "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar"),
Cmd("ENV", "JAVA_TOOL_OPTIONS=-javaagent:/opt/opentelemetry-javaagent.jar"),
Cmd("ENV", "OTEL_TRACES_EXPORTER=jaeger"),
Cmd("ENV", "OTEL_EXPORTER_JAEGER_ENDPOINT=collector.linkerd-jaeger.svc.cluster.local:55678")
)
...
dockerCommands := {
dockerCommands.value.flatMap {
// insert instrumentation commands in mainstage right before losing root privileges
case down@Cmd("USER", "daemon") => otelCommands :+ down
case other => Seq(other)
}
}
Expected behaviour
An additional jar file (for automatic instrumentation) should be placed in the docker image. I have tried two ways:
Those of my targets that don't include AshScriptPlugin create docker images as indicated. However, those that do include AshScriptPlugin completely ignore the modified dockerCommands.
<my-service>-impl/src/universal
, since the documentation says "By default, all files found in the src/universal directory are included in the distribution". However, the file is again not included in the docker images generated with the AshScriptPlugin.Actual behaviour
The docker image contains only the default AshScriptPlugin-generated content, not the opentelemetry-javaagent.jar.
Information
rpm --version
): Docker version 20.10.13, build a224086The text was updated successfully, but these errors were encountered: