beevelop / docker-cordova

:moyai: Docker image for Cordova 12 (with Node.js & Android)

Home Page:https://beevelop.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not build after last docker image push

ricardoapaes opened this issue · comments

On build image error show:

Failed to run "javac -version", make sure that you have a JDK version 8 installed.
You can get it from the following location:
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Your JAVA_HOME is invalid: /usr/lib/jvm/java-8-openjdk-amd64

The same problem also happens in travis.

I have solve this issue
Please follow along:
apt-get update
apt-get install openjdk-8-jdk
java -version
apt-get install wget
wget https://services.gradle.org/distributions/gradle-6.5-bin.zip -P /tmp;
apt-get install -y unzip
unzip -d /opt/gradle /tmp/gradle-*.zip
ls /opt/gradle/gradle-6.5
apt-get install -y nano
nano /etc/profile.d/gradle.sh
paste below in the file
export GRADLE_HOME=/opt/gradle/gradle-6.5
export PATH=${GRADLE_HOME}/bin:${PATH}

chmod +x /etc/profile.d/gradle.sh
source /etc/profile.d/gradle.sh
gradle -v

cordova requirements

Should pass now.

In order to mount a local drive we can run as below:
docker run -it -v /var/www/html/cordova:/home beevelop/cordova bash

To access the app from host install:
apt install net-tools
Then
ifconfig to get ip
now you can use cordova serve
and access in your browser with
http://172.22.30.12:8000

Also getting this issue when using on our CI.

Is there any update on how to fix?

Also getting this issue when using on our CI.

Is there any update on how to fix?

Sorry @beevelop,

But when the error occurred I had an image on my local machine without the error and uploaded it to the docker hub at that address:

docker pull likesistemas/cordova:stable

I think the jdk is getting removed during the various calls to apt-get purge, at least when I try to build it on top of Ubuntu 20:

apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  ...
  openjdk-8-jdk*
  openjdk-8-jdk-headless* openjdk-8-jre* openjdk-8-jre-headless* 
   ...
0 upgraded, 0 newly installed, 273 to remove and 0 not upgraded.
After this operation, 752 MB disk space will be freed.
(Reading database ... 26832 files and directories currently installed.)
...
Removing openjdk-8-jdk:amd64 (8u265-b01-0ubuntu2~20.04) ...
Removing openjdk-8-jre:amd64 (8u265-b01-0ubuntu2~20.04) ...
Removing openjdk-8-jdk-headless:amd64 (8u265-b01-0ubuntu2~20.04) ...

Fixed with v2021.02.1; the upstream image has been reworked to prevent this from happening. ✅