Docker : Change open Jdk to oracle Jdk in Jenkins image

I am very new to docker and I am trying to run a Jenkins image. I pulled the image from the repository and now am able to run it using the command

docker run -p 8080:8080 jenkinsci/jenkins

By default it uses openjdk version 1.8. I would like to use oracle Jdk instead of openjdk. How could I change this? Thanks in advance.

  • How to download docker images without using pull command?
  • Composition of services is it possible with kubernetes?
  • API Gateway no longer working as pass-through
  • Docker root permissions level queries
  • Docker container crashes after execution of python script
  • Artifactory exception : There should be 10 default repository layouts
  • Galera Cluster Rancher Node Scaling Issue
  • Nginx service on Docker giving better performance on 1GB RAM Node than 4GB RAM Node
  • docker build creates another set of docker image even the build command is the same?
  • Allow non-docker group to launch containers
  • Local-to-remote replication times out or replicates only few documents CouchDb
  • Docker php set up installing pdo extension
  • 2 Solutions collect form web for “Docker : Change open Jdk to oracle Jdk in Jenkins image”

    If you really want to use this image and change the jdk, you will have to build your own image from this one, install oraclejdk, setup Jenkins to use this jdk (like environment variables etc), but it is not a clean way, imho.

    The best practice would be to build your own image from a oraclejdk Docker image and setup Jenkins on it.

    You should look at other Dockerfiles to do this.

    Oracle provides a bunch of docker images on github : https://github.com/oracle/docker-images

    You should check your other requirements as well (OS, etc.)

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.