Sign inSign up

relayrides/java-app

By relayrides

Updated over 6 years ago

Simple base java application that includes newrelic agent.

Image
0

728

relayrides/java-app repository overview

docker-java-app

Turo's extension of a base java image

This image adds newrelic and provides a default entrypoint.

Here is an example of a gradle file using this image:

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath('se.transmode.gradle:gradle-docker:1.2')
    }
}

repositories {
    mavenCentral()
    jcenter()
}

apply plugin: 'docker'

task buildDocker(type: Docker) {
    baseImage "turo/java-app"
    push = project.hasProperty('push')
    tag = "turo/image-proxy"
    // copy the spring boot jar from the jar task
    addFile {
        from jar
        rename { 'app.jar' }
    }

    // run any additional commands to configure/install software during build
    runCommand 'apt-get update'
    runCommand 'apt-get -y install imagemagick'
}

buildDocker.dependsOn(bootRepackage, assemble)

To run this image, issue the command with appropriate environment variables set:

docker run \
-e SPRING_PROFILES_ACTIVE=<comman separated list of active profiles> \
-e NEW_RELIC_APP_NAME=<app name as it will appear in newrelic>  \
-e NEW_RELIC_LICENSE_KEY=<newrelic license key> \
 -p 8080:8080 turo/image-proxy:1.0.0-dev

Tag summary

Content type

Image

Digest

Size

111.2 MB

Last updated

about 7 years ago

docker pull relayrides/java-app