Hi there!
I hope u are doing well
I'm trying to start a cluster with a docker image to install all the libraries that I have to use.
I have the following Dockerfile to install only python libraries as you can see
FROM databricksruntime/standard
WORKDIR /app
COPY . .
RUN apt-get update && apt-get install -y python3-pip
RUN sudo apt-get install -y libpq-dev
RUN pip install -r /app/requirements.txt
CMD ["python3"]
Does anybody knows how to install maven libraries from this same Dockerfile? I've tried and looked up for many solutions but I can't figure it out how to do that.
The last thing I've had tried is to use a Multi stage building using the Maven image but I had trouble with the dependencies (missing POM.xml file).
# MAVEN + PYTHON
FROM databricksruntime/standard
WORKDIR /app
COPY . .
RUN apt-get update && apt-get install -y python3-pip
RUN sudo apt-get install -y libpq-dev
RUN pip install -r /app/requirements.txt
CMD ["python3"]
FROM maven:latest
WORKDIR /root
COPY --from=0 /app .
RUN mvn clean install org.apache.maven.plugins:maven-dependency-plugin:2.1:get \
-DrepoUrl=https://mvnrepository.com/artifact/com.crealytics/spark-excel_2.12/0.14.0 \
-Dartifact=com.crealytics:spark-excel_2.12:0.14.0
RUN mvn clean install org.apache.maven.plugins:maven-dependency-plugin:2.1:get \
-DrepoUrl=https://mvnrepository.com/artifact/mysql/mysql-connector-java \
-Dartifact=mysql:mysql-connector-java:8.0.29
I don't get it how to install maven libraries from Dockerfile
If someone has knowledge about something like this and could help me I will appreciate it a lot.
Thanks!