[JAVA] Create a Docker image with the Oracle JDK installed (yum

environment

# Docker for Mac
$ docker -v
Docker version 1.13.0, build 49bf474

Since the format of the URL where the JDK is placed has changed from long ago, the URL itself and the file name can be passed as parameters. Other than that, I put a cookie of license agreement.

http://download.oracle.com/otn-pub/java/jdk/{8u121-b13:version}/{e9e7ea248e2c4826b92b3f075a80e441:Random character string}/{jdk-8u121-linux-x64.rpm:file name}

Obtain the URL and file name by agreeing to the license on the Oracle download page.

スクリーンショット 2017-02-04 18.50.00.png

Dockerfile


FROM amazonlinux

ARG jdk_url
ARG jdk_rpm_name

RUN \
  yum install -y wget findutils which

RUN \
  wget -q \
    --no-check-certificate \
    --no-cookies \
    --header "Cookie: oraclelicense=accept-securebackup-cookie" \
    ${jdk_url}

RUN \
  rpm -ivh ${jdk_rpm_name}

Build

$ docker build . --build-arg jdk_url=http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.rpm --build-arg jdk_rpm_name=jdk-8u121-linux-x64.rpm

--build-arg was soberly addicted to what was needed for the specified parameters.

reference

Recommended Posts

Create a Docker image with the Oracle JDK installed (yum
A quick note on using jshell with the official Docker image of the JDK
Create a Vue3 environment with Docker!
Create a lightweight STNS Docker image
Create a jar file with the command
Create a MySQL environment with Docker from 0-> 1
Docker Compact Manual (4: Create a custom image)
[Memo] Create a CentOS 8 environment easily with Docker
Create a multi-key map with the standard library
Create a docker environment for Oracle 11g XE
Create a Spring Boot development environment with docker
Create a docker image that runs a simple Java app
[Note] Create a java environment from scratch with docker
Maybe it works! Create an image with Docker and share it!
Install Oracle JDK 8 with Ansible
Create a playground with Xcode 12
[Docker] Delete only the volume associated with a specific container
I tried to create a padrino development environment with Docker
Let's create a Docker container that can connect to CentOS 8 with the minimum configuration by SSH
[Be careful about changing the version of Xdebug! ] Create a development environment with Xdebug3 + docker + VS Code
Create a simple web server with the Java standard library com.sun.net.httpserver
Create a private repository in Amazon ECR and push/pull the image
Create a JVM for app distribution with JDK9 modules and jlink
Create a flyway jar with maven and docker build (migrate) with docker-maven-plugin
Use Jenkins to build inside Docker and then create a Docker image.
Set up a Wordpress Docker environment without using the Worpdress image
Create a Docker Image for redoc-cli and register it on Docker Hub
Run (provisionally) a Docker image with ShellCommandActivity on AWS Data Pipeline
Deploy a Docker application with Greengrass
Build a Node.js environment with Docker
Create SolrCloud verification environment with Docker
Create Laravel environment with Docker (docker-compose)
Operate a honeypot (Dionaea) with Docker
2. Create Docker image and register Registry
Restart apache with docker php-apache image
Create exceptions with a fluid interface
Create a Maven project with a command
Image processing: Let's play with the image
Make a daily build of the TOPPERS kernel with Gitlab and Docker
How to quickly create a reverse proxy that supports HTTPS with Docker
Create a Spring Boot app development project with the cURL + tar command
[Java] Create a jar file with both compressed and uncompressed with the jar command
A note about trying Oracle 11g + Spring boot with Vagrant + Docker compose
Create a java web application development environment with docker for mac part2
[Rails6] Create a new app with Rails [Beginner]
Build a PureScript development environment with Docker
Create Rails 6 + MySQL environment with Docker compose
Create a simple on-demand batch with Spring Batch
[Swift5] Round the acquired image with UIImagePicker
Create a GUI JSON Viewer with Ruby/GTK3
[Rails withdrawal] Create a simple withdrawal function with rails
Create Spring Boot-gradle-mysql development environment with Docker
Proxy server with squid using docker image
[Docker] Create Node.js + express + webpack environment with Docker
Create a simple bar chart with MPAndroidChart
Run a DMN with the Camunda DMN Engine
Create a temporary class with new Object () {}
[docker] [nginx] Make a simple ALB with nginx
Build a Wordpress development environment with Docker
Allow image posting with [Docker + WordPress + MySQL]
Image flew when updating Docker with WSL2