Comments (8)
Closed via #36
from gs-spring-boot-docker.
Hi,
I am getting same problem docker stop is shut down hooks are not running.
from gs-spring-boot-docker.
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.
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.
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.
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.
I am using CMD in docker file. No exec entry point using.
from gs-spring-boot-docker.
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)
- Failed jar extraction on command
- Remove references to deprecated boot2docker
- Different java versions in pom and docker
- https://spring.io/guides/gs/spring-boot-docker/ gives 404 HOT 1
- Spring-boot HOT 1
- Invalid or corrupt jarfile /application.jar
- Change 'CF memory calculator" to "buildpack memory calculator"
- Improve the note regarding the external volume for /tmp in the Dockerfile HOT 4
- Add a note about the effect on classpath ordering of exploding the jar
- s
- COPY failed: stat /var/lib/... no such file or directory HOT 1
- How to achieve Key Vault feature in azure-keyvault-secrets-spring-boot by deploying in appservice as a docker image HOT 1
- docker --build-args vs --build-arg HOT 1
- Who does regularly clean up /tmp in a long running container? HOT 6
- az acr login && mvn compile jib:build fails with I/O error for image HOT 2
- Update this guide with Boot 2.3 features HOT 5
- Update Guide For zsh users(gradle dockerizing not working)
- zsh: no matches found: JAR_FILE=build/libs/*.jar
- Documentation improvement regarding image building options
- documentation - README.adoc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gs-spring-boot-docker.