A simple format of dockerfile for tomcat image - dockerfile

I need an simple format to build a Docker file for Tomcat image it with simple format for beginner

Go to dockerhub and make a search for tomcat.

Related

Tomact9 container: error copying file to $CATALINA_HOME/conf/Catalina/localhost

I'm attempting to containerize a java webapp. I need to copy myapp.xml to $CATALINA_HOME/conf/Catalina/localhost in the tomcat container.
I came to realize that the localhost folder in this path only gets created by tomcat when it starts.
How do i copy myapp.xml to $CATALINA_HOME/conf/Catalina/localhost using Dockerfile as this directory does not exist at image build time?
I feel stuck. Can you help me please?
I'm trying to utilize the official tomcat image from docker hub.

AWS credentilas in dockerfile while building image

I am newbie to docker and AWS. I wanted to have container running image for Maven and Java. I was able to refer https://github.com/carlossg/docker-maven/blob/master/jdk-8/Dockerfile and could create dockerfile for the same. Through terminal, I could see new container is created , with image of Java and Maven. Upto this point it is simple , took me while to figure out though.
(1) I think this is the way you can always have Maven plus Java image , and there is no other way with lot less files/ coding. Is it right? This is just for my information. The real question is the next one.
(2) If I get image of AWS Cli, once the container starts I can login to AWS using the credentials. I know how to do it using terminal. Not a big deal. If I want to have CI/CD pipeline, where do I provide the command - docker build -t <imageName> . and command to start container. Right now I use mac terminal, but not sure how it would play out in CI/CD. I did research on here but nothing conclusive. Does it go inside .yml file?
(3) How do I send the AWS credentials while building docker image? I do not want to put into dockerfile. How do you guys do it so its safe?

Pushing Fortio in cloud foundry using docker image

I am trying to push Fortio(a load testing tool for microservices) as an application in cloud foundry. I am trying it with a docker image from hub.
cf push <app-name> --docker-image fortio:fortio random-route
Application crashes when it tries to start the application. cf logs says : executable file not found in $PATH
It is working fine in my local docker setup but not in cloud foundry.
Any help??
https://docs.cloudfoundry.org/devguide/deploy-apps/push-docker.html
A Docker image that meets the following requirements:
The Docker image must contain an /etc/passwd file with an entry for the root user. In addition, the home directory and the shell for that root user must be present in the image file system.
Unfortunately, public Docker image fortio/fortio doesn't meet this particular requirement.
Solutions:
build customized Docker app image with shell and /etc/passwd
use source code and push it as a native golang app and not a Dockerized app

AWS Codebuild .NET Core building docker image

We tried the default AWS codebuild image to build .NET core apps and it worked fine.
Now we require to build to Docker images, but the default image has no docker installed.
AWS has the option to run the Builder image in Priviledged mode so you can run docker-in-docker operations.
I would like to know if there is an image I can use that has both .NET Core and Docker installed, so I can build the code, and then the image.
Thanks!!
You'll need to create you own docker image and provide that to CodeBuild (as part of project environment configuration).
You can find CodeBuild's vended docker images here for reference https://github.com/aws/aws-codebuild-docker-images
You need to create a docker image which has both docker daemon and .NET core on the same image. Refer to this sample on how to start the docker daemon before starting builds in your custom docker images http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker-custom-image.html

How to edit docker file of the image which is pulled from registry?

I have pulled one image from registry.
I am able to see image using following command :
$docker images
But I am not able to edit its Dockerfile.
You can grab the dockerFile from hub.docker.com -> search the image you want,
Download it make your modification and build it, or run the image downloaded and make your modification, commit it and push it on your docker hub account.
Hope this will help you.