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.

  • Spring Boot can't read application.properties in Docker
  • Starting Jenkins in Docker Container
  • Any middlewares to run Docker containers successively?
  • Docker deploy my Strongloop Loopback Node server
  • Eliminate mess with docker swarm mode loadbalancer, consul and external load balancer
  • Docker MongoDB : UserNotFound
  • Docker intermittently failing when building image
  • Clone a secure git repo in Kubernetes pod
  • Docker busybox exit immediately
  • Can not install package within docker debian:jessie
  • Where does Docker store the content of running containers?
  • How to allow a range of ports in Kubernetes in containerPort variable?
  • 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.