Packer docker builder stopping processes running on base image container

12 views
Skip to first unread message

Satwik Mukherjee

unread,
Dec 29, 2019, 8:35:22 AM12/29/19
to Packer
I am using below packer.json file to put war file into tomcat container & build it 

{
 
"builders": [{
   
"type": "docker",
   
"image": "tomcat:8.0",
   
"commit": "true"
 
}],
 
"provisioners": [
   
{
   
"type": "file",
   
"source": "sample.war",
   
"destination": "/usr/local/tomcat/webapps/"
   
}
   
],
 
"post-processors": [
   
[
     
{
       
"type": "docker-tag",
       
"repository": "satwikmukherjee/runner-poc",
       
"tag": "{{timestamp}}"
     
},
     
{
       
"type": "docker-push",
       
"login": "true",
       
"login_username": "####",
       
"login_password": "####"
     
}
   
]
 
]
}


After building while I am running the image committed , within container I am seeing tomcat is not running ,

But while I am doing the same stuff through Dockerfile , no issue found , Dockerfile used as below with the same logic .


FROM tomcat
:8.0
COPY sample
.war /usr/local/tomcat/webapps/


Please let me know if I am doing anything wrong ..

Regards,
Satwik

Rickard von Essen

unread,
Dec 29, 2019, 8:57:52 AM12/29/19
to packe...@googlegroups.com
When building with Packer no metadata is inherited like when you build with a Dockerfile. So you need to refine CMD, ENTRYPOINT etc. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/15c136ed-5d87-40d3-9109-9ec1291da722%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages