Installing java in Docker image

前端 未结 3 2060
夕颜
夕颜 2020-12-24 02:10

This is my very first try to create a docker image and I\'m hoping someone can help me out. My Dockerfile looks roughly like this:

FROM mybaseimage:0.1
MAINT         


        
3条回答
  •  一个人的身影
    2020-12-24 02:56

    I was able to install Java-11 on an image using Ubuntu 18.04. I also just needed it for only one application. (The Python wrapper around Apache Tika.)

    FROM python:3.8.2-buster
    COPY . /usr/src/app
    
    # Install OpenJDK-11
    RUN apt-get update && \
        apt-get install -y openjdk-11-jre-headless && \
        apt-get clean;
    
    # Install PYTHON requirements
    COPY requirements.txt ./
    RUN pip install --no-cache-dir -r requirements.txt
    
    # START WEBAPP SERVICE
    CMD [ "python", "/usr/src/app/main.py" ]
    

    Hope that helps.

提交回复
热议问题