Reputation: 1
# Use an official OpenJDK runtime as a parent image
FROM maven:3.5.2-jdk-8
# Create new app directory
RUN mkdir /app
# Set the working directory in the container
WORKDIR /app
# Copy the Maven project files
COPY pom.xml /app
COPY src/main/java /app
# Compile the Java source code
RUN mvn compile
# Specify the command to run on container start
CMD ["mvn", "exec:java"]
I have edited the code to solve the docker build issue, but I have another issue in docker run, that is :
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:java (default-cli) on project SimpleTelegram: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:3.1.0:java are missing or invalid
Upvotes: 0
Views: 65