You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by GitBox <gi...@apache.org> on 2021/05/20 19:30:24 UTC

[GitHub] [nutch] lewismc opened a new pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

lewismc opened a new pull request #647:
URL: https://github.com/apache/nutch/pull/647


   This PR addresses https://issues.apache.org/jira/browse/NUTCH-2864
   It makes major space savings on the base image by using a recent Alpine Linux base.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] lewismc commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
lewismc commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-854085050


   I addressed the `JAVA_HOME` issue thanks @sebastian-nagel


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] lewismc commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
lewismc commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-845593030


   Further details
   [ubuntu:18.04](https://hub.docker.com/layers/ubuntu/library/ubuntu/18.04/images/sha256-ceed028aae0eac7db9dd33bd89c14d5a9991d73443b0de24ba0db250f47491d2?context=explore) compressed size 25.46MB
   [alpine:3.13](https://hub.docker.com/layers/alpine/library/alpine/3.13/images/sha256-9663906b1c3bf891618ebcac857961531357525b25493ef717bca0f86f581ad6?context=explore) compressed size 2.31 MB


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] lewismc commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
lewismc commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-854085050


   I addressed the `JAVA_HOME` issue thanks @sebastian-nagel


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] lewismc commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
lewismc commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-852381141


   @sebastian-nagel thanks for reviewing. Can you specifically let me know what actions you want me to take?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] sebastian-nagel commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
sebastian-nagel commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-852833648


   1. install the apk package `bash` - it's not worth to fix the scripts to save 10 MiB in the Docker image size
   2. (just tried it) the image size is reduced to 1.27 GiB by changing the Nutch build comman list:
      ```
      # Checkout and build the Nutch master branch (1.x),
      # then do some clean up to reduce the image size
      RUN git clone https://github.com/apache/nutch.git nutch_source && \
           cd nutch_source && \
           ant runtime && \
           rm -rf build/ && \
           rm -rf /root/.ivy2/
      ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] sebastian-nagel commented on a change in pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
sebastian-nagel commented on a change in pull request #647:
URL: https://github.com/apache/nutch/pull/647#discussion_r644720262



##########
File path: docker/Dockerfile
##########
@@ -13,21 +13,21 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM ubuntu:18.04
+FROM alpine:3.13
 MAINTAINER Apache Nutch Committers <de...@nutch.apache.org>
 
 WORKDIR /root/
 
-
 # Install dependencies
-RUN apt update
-RUN apt install -y ant git openjdk-8-jdk-headless
-
-# Set up JAVA_HOME
-RUN echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64' >> $HOME/.bashrc

Review comment:
       JAVA_HOME needs to be set
   ```
   RUN echo 'export JAVA_HOME=/usr/lib/jvm/java-11-openjdk' >> $HOME/.bashrc
   ```
   otherwise bin/nutch fails:
   ```
   bash-5.1# bin/nutch parsechecker https://nutch.apache.org/
   Error: JAVA_HOME is not set.
   ```
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] sebastian-nagel commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
sebastian-nagel commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-853770938


   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] lewismc commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
lewismc commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-845593349


   We are talking ~250MB reduction in size. Which could be significant depending on the use case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] lewismc commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
lewismc commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-853276498


   Thanks @sebastian-nagel I've updated and added some badges which give the consumer more details about the image. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] lewismc commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
lewismc commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-845439990


   Some details about the image
   ```
   docker % docker build -t apache/nutch .
   ```
   **TOTAL BUILD TIME**: 799.3s (overwhelming majority actually building Nutch)
   **TOTAL SIZE**:  2.41GB (as opposed to 2.66GB from ubuntu 18 base image 7df7c861996f   6 weeks ago     2.66GB)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] lewismc merged pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
lewismc merged pull request #647:
URL: https://github.com/apache/nutch/pull/647


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] lewismc merged pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
lewismc merged pull request #647:
URL: https://github.com/apache/nutch/pull/647


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] sebastian-nagel commented on pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
sebastian-nagel commented on pull request #647:
URL: https://github.com/apache/nutch/pull/647#issuecomment-853770938


   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nutch] sebastian-nagel commented on a change in pull request #647: NUTCH-2864 Upgrade Dockerfile to use JDK 11

Posted by GitBox <gi...@apache.org>.
sebastian-nagel commented on a change in pull request #647:
URL: https://github.com/apache/nutch/pull/647#discussion_r644720262



##########
File path: docker/Dockerfile
##########
@@ -13,21 +13,21 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM ubuntu:18.04
+FROM alpine:3.13
 MAINTAINER Apache Nutch Committers <de...@nutch.apache.org>
 
 WORKDIR /root/
 
-
 # Install dependencies
-RUN apt update
-RUN apt install -y ant git openjdk-8-jdk-headless
-
-# Set up JAVA_HOME
-RUN echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64' >> $HOME/.bashrc

Review comment:
       JAVA_HOME needs to be set
   ```
   RUN echo 'export JAVA_HOME=/usr/lib/jvm/java-11-openjdk' >> $HOME/.bashrc
   ```
   otherwise bin/nutch fails:
   ```
   bash-5.1# bin/nutch parsechecker https://nutch.apache.org/
   Error: JAVA_HOME is not set.
   ```
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org