Skip to content

Commit

Permalink
W-16954625: Fix docker image build
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzxu-crm committed Oct 14, 2024
1 parent 20de524 commit a2fc4ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions carbonj.service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

FROM registry.access.redhat.com/ubi9/ubi:9.4-1214.1726694543
ARG DEPENDENCY=src/main/docker/files
ARG DEPENDENCY=build/dependency
ARG VERSION=latest

# install dependencies
Expand Down Expand Up @@ -43,7 +43,9 @@ RUN yum update -y && \
chmod +x /sbin/tini

# add java code
COPY build/libs/carbonj.service-${VERSION}.jar /app
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
# add scripts
COPY ${DEPENDENCY}/entrypoint.sh ${DEPENDENCY}/onOutOfMemoryError.sh ${DEPENDENCY}/logCleanup.sh \
${DEPENDENCY}/deletemetrics.py ${DEPENDENCY}/disklog.sh ${DEPENDENCY}/fdlog.sh ${DEPENDENCY}/iolog.sh \
Expand Down
7 changes: 6 additions & 1 deletion carbonj.service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ ext {
}
}


repositories {
mavenLocal()
mavenCentral()
Expand All @@ -88,7 +87,13 @@ task unpack(type: Copy) {
into("build/dependency")
}

task copyDockerFiles(type: Copy) {
from 'src/main/docker/files'
into 'build/dependency'
}

tasks.register('docker', Exec) {
dependsOn unpack, copyDockerFiles
def command = getDockerBuildCmd("${dockerRepo}${project.dockerGroup}:${project.version}", "${project.version}")
doFirst {
logger.lifecycle("${command.join(' ')}")
Expand Down
2 changes: 1 addition & 1 deletion carbonj.service/src/main/docker/files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,5 @@ fi

cd /app
exec java $JAVA_OPTS $YOURKIT_PROFILER_OPTS $JAVA_OPTS_OVERRIDE --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED -Dlogback.debug=true -cp /app -jar /app/carbonj.service-*.jar \
--add-opens java.base/java.util=ALL-UNNAMED -Dlogback.debug=true -cp /app:/app/lib/* com.demandware.carbonj.service.engine.CarbonJServiceMain \
--spring.config.location=$CONFIG_LOCATIONS

0 comments on commit a2fc4ea

Please sign in to comment.