Docker image alpine java 8? - docker

I have been looking for Java 8 alpine or non-alpine docker image. I cannot find them as so many docker images are available that have no explanation regarding the version.
This is where I am searching:
https://hub.docker.com/_/openjdk/tags
Following is the java version which I want:
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)

I found some of the following official Docker images:
openjdk 8-jdk-alpine a3562aa0b991 3 years ago 105MB
openjdk 8-jdk-alpine3.9 a3562aa0b991 3 years ago 105MB
openjdk 8-jdk-alpine3.8 21a93502ddd8 3 years ago 103MB
openjdk 8-jdk-alpine3.7 1caad94162ef 4 years ago 102MB

Related

Running WSL2 on Windows 10 Enterprise to drive Docker Backend

I am trying to have my Windows 10 Enterprise LTSC (IOT) on run WSL 2. I'm at the latest LTSC Version (1809, build 17763) and have WSL 1 enabled, however installing WSL 2 seems to be limited to the Version 1903 and above, which isn't available for the LTSC configuration. Has anyone got a workaround for LTSC builds to get WSL 2 installed?
I'd like to have Docker's WSL 2 backend running, which is a requirement for Laravel's Sail Environment

How to find software version in a docker image

I'm trying to find a suitable docker image to host a spring application. The current stack used is openjdk 11 and Tomcat 9.
Docker hub https://hub.docker.com/_/tomcat?tab=tags&page=1&ordering=last_updated has image and I can see lot of tags. But the tags are not descriptive. Is there a way to identify if an image has a specific version version of Tomcat and Openjdk(not the oracle jdk)
You can try using the docker search command from the command line which returns the description column as well for the images.
Examples:
docker search tomcat
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
tomcat Apache Tomcat is an open source implementati… 2951 [OK]
tomee Apache TomEE is an all-Apache Java EE certif… 86 [OK]
dordoka/tomcat Ubuntu 14.04, Oracle JDK 8 and Tomcat 8 base… 55 [OK]
bitnami/tomcat Bitnami Tomcat Docker Image 37 [OK]
kubeguide/tomcat-app Tomcat image for Chapter 1 29
consol/tomcat-7.0 Tomcat 7.0.57, 8080, "admin/admin" 18 [OK]
docker search tomcat9
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
kikov79/tomcat9 Ubuntu 14.04, Oracle JDK 8 and Tomcat 9 base… 4 [OK]
oupula/tomcat9_jdk8 apache tomcat 9.0.13 + jdk1.8.0_191 + tomcat… 2
zzjhacn/tomcat9jdk8 tomcat9 with oracle jdk8 on Alpine (78M) 2 [OK]
donglsheng/tomcat9_jdk8 jdk8 tomat9 1
ykaj9758/tomcat9 tomcat9 1
utmstack/tomcat9-omp-war2safe tomcat9-omp-war2safe 0
docker search tomcat9jdk11
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
aptea/tomcat9jdk11 0
binbin0915/tomcat9jdk11 0
kapitanmf/tomcat9jdk11partner 0
kapitanmf/tomcat9jdk11 0
Note: The description column is not set for all of the images though.
You can try docker image inspect <image_sha> and there should be version of application I did it for artifactory and there is a key named
ARTIFACTORYVERSION=7.39.4

Running Java 9 application with docker doesn't work - UnsupportedClassVersionError

I changed my application from Java 8 to Java 9.
Changed the Windows system environment variable (path) and the JAVA_HOME to Java 9 (jdk-9.0.1).
When running the application in the IDE (IntelliJ) it works fine. It also compiles without problems with sbt. Just running the application with docker doesn't work.
The application seems to be compiled successfully with Java 9 but docker tries to run it with Java 8 (this is what I read from the exception message).
Commands:
sbt docker:publish
docker run --rm -p 9000:9000 eu.gcr.io/the-repository-name/the-image-name:1.0
I get the following error:
Exception in thread "main" java.lang.UnsupportedClassVersionError:
Module has been compiled by a more recent version of the
Java Runtime (class file version 53.0), this version of the
Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at play.api.inject.Modules$.locate(Module.scala:119)
at play.api.inject.guice.GuiceableModule$.loadModules(GuiceInjectorBuilder.scala:276)
at play.api.inject.guice.GuiceApplicationBuilder$.$anonfun$$lessinit$greater$default$9$1(GuiceApplicationBuilder.scala:30)
at play.api.inject.guice.GuiceApplicationBuilder.applicationModule(GuiceApplicationBuilder.scala:102)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:185)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.ProdServerStart$.start(ProdServerStart.scala:51)
at play.core.server.ProdServerStart$.main(ProdServerStart.scala:25)
at play.core.server.ProdServerStart.main(ProdServerStart.scala)
What do I have to do, that Docker uses Java 9?
java --version
java 9.0.1
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
docker version
Client:
Version: 17.10.0-ce
API version: 1.33
Go version: go1.8.3
Git commit: f4ffd25
Built: Tue Oct 17 19:00:02 2017
OS/Arch: windows/amd64
Server:
Version: 17.10.0-ce
API version: 1.33 (minimum version 1.12)
Go version: go1.8.3
Git commit: f4ffd25
Built: Tue Oct 17 19:05:23 2017
OS/Arch: linux/amd64
Experimental: true
Play Version: 2.6.7
Scala Version 2.12.4
SBT Version: 1.0.2
sbt-native-packager: 1.3.1
The error means that you are trying to run code compiled using a newer version of Java (9 which has class version 53.0) in an older version of Java (8 which has class version 52.0). So, your docker image probably has Java 8 installed. Let's do some detective work. :-)
If I understand correctly, you are using sbt-native-packager to generate your Docker image. If so, sbt-native-packager is using openjdk:latest image as the base image, as you can see here:
https://github.com/sbt/sbt-native-packager/blob/v1.3.1/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala#L69
Version 1.3.1 is the version used by Play 2.6.7, as you can also see here:
https://github.com/playframework/playframework/blob/2.6.7/framework/project/plugins.sbt#L8
The problem is that openjdk:latest image uses Java 8. You can confirm that by looking at the latest code linked at the image page. Here is the code:
https://github.com/docker-library/openjdk/blob/a893fe3cd82757e7bccc0948c88bfee09bd916c3/8-jdk/Dockerfile#L38-L43
Given that, you may want to change dockerBaseImage to use a base image that uses Java 9, for example:
dockerBaseImage := "9-jdk"
You can see a complete list of image versions here: https://hub.docker.com/_/openjdk/

Using one command to list all asp.net docker images

From here, we can obtain the images.
My question would be is there a simple command to list all available images on my Windows desktop?
EDIT:
I want to list all available images in the current coreclr framework repository. Based on my Windows desktop .net installation, is the dnu command or docker command to do that?
If you don't have any grep available, then you can use findstr;
c:\git>docker images | findstr /R /C:"microsoft/aspnet"
microsoft/aspnet 1.0.0-rc1-final c2ddc1b14fd9 3 months ago 742.5 MB
microsoft/aspnet 1.0.0-beta8 ec21b7401dc2 4 months ago 742.4 MB
microsoft/aspnet 1.0.0-beta7 cd81e77e42bf 4 months ago 688.4 MB

How can I install docker on Debian 8 kernel 2.6.32

I've bought a Debian 8 VPS for 3e per month https://www.pulseheberg.com/vps/simple.
I would like to install docker engine but it not works ( cause it need a kernel >= 3.10)
Do you have any idea for install docker on my server ?
Related?
You can't. Sorry to bear the bad news.
Docker backport-supports kernel 3.10 but not below. Here is a copy/paste from their doc:
Prerequisites
Docker requires a 64-bit installation regardless of your Debian version. Additionally, your kernel must be 3.10 at minimum. The latest 3.10 minor version or a newer maintained version are also acceptable.
Kernels older than 3.10 lack some of the features required to run Docker containers. These older versions are known to have bugs which cause data loss and frequently panic under certain conditions.

Resources