Skip to main content

Posts

Showing posts with the label Docker

How to get heapdump for any microservice running in Docker container in Google App Engine

Getting heapdump for our services is very important for doing any memory profiling to debug any leaks or performance issues. Unfortunately it is not that straight forward. Fortunately, it is not impossible either! We need to SSH in the container in which our service is running. Go to App Engine → Instances page and select your service from the 'services' dropdown. SSH into any of the instances: Ignore this and SSH into VM. Once you SSH, you should be able to see cloud shell as below. If you are logging in for the first time, there may be some questions asking for SSH key. You can leave the key blank and continue. This shell is the Linux VM on which our docker image is running. We need to find out more details about it before we can do anything with it.   There are a bunch of images running. We are interested in the first one ('us.gcr.io/.....') running in a container named 'gaeapp'. Now we need to go inside this docker c...

Running Jenkins inside Docker

Whether you are a beginner to Jenkins and want to have your setup done quickly or you want to harness the full power of containers by running Jenkins in Docker, this simple step-by-step tutorial is for you. Running Jenkins in Docker We will pull Jenkins Docker image from Docker repository: docker pull jenkins Using below command we will map ‘jenkins’ directory in my working directory ( $PWD/jenkins)   to  /var/jenkins_home   directory in container and map port 49001 on host to 8080 on container. docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home:z -t jenkins Now to run jenkins, just give http://localhost:49001/ . You can proceed with the setup and management of Jenkins now. Your entire Jenkins setup has been created in the 'jenkins' directory which you mapped earlier. Go ahead and take a look!  Packaging app in Docker and pushing to repository Sometimes you would want to package your app as a Docker image and publish t...