可以创建。docker build -t my-java-app . // java 代码在 com.company 中 docker run -it --rm --name my-running-app my-java-app Error: Could not find or load main class Main
Dockfile:FROM openjdk:8 WORKDIR /untitled6/src/com/company/ COPY ./src/com/company/Main.java /untitled6/src/com/company/ RUN ls RUN cd /untitled6/src/com/company/ RUN javac Main.java CMD ["java","Main"]