Code Monkey home page Code Monkey logo

Comments (8)

dsyer avatar dsyer commented on August 30, 2024

Closed via #36

from gs-spring-boot-docker.

sudhakarreddy-boilla avatar sudhakarreddy-boilla commented on August 30, 2024

Hi,
I am getting same problem docker stop is shut down hooks are not running.

from gs-spring-boot-docker.

dsyer avatar dsyer commented on August 30, 2024

Are you using the "exec" entry point (like in the pull request link)? I see the code in main has rotted and no longer does. Also I think the behaviour is OS dependent, so I never had a problem on Linux, for instance.

from gs-spring-boot-docker.

sudhakarreddy-boilla avatar sudhakarreddy-boilla commented on August 30, 2024

This is my dockerfile

FROM openjdk:11
ARG projectName=projectName
ARG projectPath=projectPath
ARG httpPort=httpPort

ENV projectName ${projectName}
ENV httpPort ${httpPort}
ENV projectPath ${projectPath}
EXPOSE 9000

RUN echo "projectName :: $projectName"
RUN echo "httpPort :: $httpPort ${httpPort}"
ENV SBT_VERSION 1.5.4
ENV WORKING_DIR /workspace
ENV DEPLOYING_DIR /deployment 
RUN \
  mkdir /dump/ && \
  cd /dump/ && \
  curl -L -o sbt-$SBT_VERSION.deb https://repo.scala-sbt.org/scalasbt/debian/sbt-$SBT_VERSION.deb && \
  dpkg -i sbt-$SBT_VERSION.deb && \
  rm sbt-$SBT_VERSION.deb && \
  apt-get update && \
  apt-get install sbt && \
  rm -rf /dump/ && \
  apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR $WORKING_DIR
COPY ${projectPath}/app ${WORKING_DIR}/app
COPY ${projectPath}/conf ${WORKING_DIR}/conf
COPY ${projectPath}/session.ser ${WORKING_DIR}/session.ser
COPY ${projectPath}/timezones.txt ${WORKING_DIR}/timezones.txt
COPY ${projectPath}/public ${WORKING_DIR}/public
COPY ${projectPath}/project/build.properties ${WORKING_DIR}/project/build.properties
COPY ${projectPath}/project/plugins.sbt ${WORKING_DIR}/project/plugins.sbt
COPY ${projectPath}/build.sbt ${WORKING_DIR}/build.sbt

RUN sbt clean playUpdateSecret dist

RUN \
  pwd && \
  mkdir /$DEPLOYING_DIR/ && \
  cp target/universal/${projectName}-1.0-SNAPSHOT.zip /$DEPLOYING_DIR && \
  rm -rf $WORKING_DIR
CMD ["sh","-c","echo \"Hi \" && echo ${projectName} && cd /${DEPLOYING_DIR} && rm -rf ${projectName}-1.0-SNAPSHOT && unzip ${projectName}-1.0-SNAPSHOT.zip && cd ${projectName}-1.0-SNAPSHOT && rm -rf RUNNING* && chmod -R a+x bin/ && ls -lart bin/ && ./bin/${projectName} -Dhttp.port=${httpPort}"]
STOPSIGNAL SIGINT

from gs-spring-boot-docker.

sudhakarreddy-boilla avatar sudhakarreddy-boilla commented on August 30, 2024

i am using docker compose file in that two services using one is app and another one is watchtower. when watchtower automatically update the images. The container stopping time watchtower send SIGTERN SIGNAL but java shutdown hooks are not running why?

from gs-spring-boot-docker.

dsyer avatar dsyer commented on August 30, 2024

I'm not sure we can help with your specific problem (the Dockerfile diverges a lot from what is in this guide). Did you try an entry point with "exec" as suggested in the pull request?

from gs-spring-boot-docker.

sudhakarreddy-boilla avatar sudhakarreddy-boilla commented on August 30, 2024

I am using CMD in docker file. No exec entry point using.

from gs-spring-boot-docker.

sudhakarreddy-boilla avatar sudhakarreddy-boilla commented on August 30, 2024

My main problem is I am create docker image and running the image. when I am enter the Ctrl-c the java shut down hooks are running successfully again image running in detached mode and docker stop <container_id> that time java shut down hooks are not running.
Please help me.

from gs-spring-boot-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.