Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use entrypoint well be no find jar #251

Closed
Mr-Ao-Dragon opened this issue Nov 27, 2023 · 3 comments
Closed

use entrypoint well be no find jar #251

Mr-Ao-Dragon opened this issue Nov 27, 2023 · 3 comments

Comments

@Mr-Ao-Dragon
Copy link

# mraodragon @ localhost in /tmp/mcserver [21:27:19] C:130
$ docker run --rm -itv ./:/app mohist-docker:1.20.1                     
Error: Could not find or load main class server.jar
Caused by: java.lang.ClassNotFoundException: server.jar

# mraodragon @ localhost in /tmp/mcserver [21:27:37] C:1
$ ls   
bukkit.yml    crash-reports   help.yml   memorysize.txt  server.jar         userjvmargs.txt
commands.yml  defaultconfigs  libraries  mods            server.properties  world
config        eula.txt        logs       mohist-config   usercache.json
# build stage for minecraft 1.20.1

FROM alpine as build-1.20.1

ENV version=1.20.1

LABEL maintaner="敖律风"
LABEL vcs-url="https://github.com/WHF-Studio/mohist-docker"
LABEL version=0.0.1

RUN mkdir /app
WORKDIR /app

COPY script/download.sh /app

RUN echo "eula=true" > eula.txt
RUN chmod a+x /app/download.sh
RUN chmod a+r /app/eula.txt
RUN /app/download.sh --minecraft $version
    
# run stage for minecraft 1.20.1

FROM azul/zulu-openjdk-alpine:20-jre-headless-latest AS run-1.20.1

ENV version=1.20.1

LABEL maintaner="敖律风"
LABEL vcs-url="https://github.com/WHF-Studio/mohist-docker"
LABEL version=0.0.1

RUN mkdir /app
WORKDIR /app

COPY --from=mohist-docker:build-1.20.1 /app/server.jar /app/server.jar
COPY --from=mohist-docker:build-1.20.1 /app/eula.txt /app/eula.txt
COPY script/init.sh /app

RUN chmod a+x /app/init.sh
RUN /app/init.sh
CMD [ "cd", "/app" ]
ENTRYPOINT [ "/usr/bin/java" ]
CMD [ "server.jar", "@memorysize.txt", "@userjvmargs.txt", "-nogui" ]
@Mr-Ao-Dragon Mr-Ao-Dragon changed the title use entrypoint well be no find use entrypoint well be no find jar Nov 27, 2023
@Mr-Ao-Dragon
Copy link
Author

sorrry,not have -jar

@AntonKozlov
Copy link
Contributor

$ docker run --rm -itv ./:/app mohist-docker:1.20.1                     
Error: Could not find or load main class server.jar
Caused by: java.lang.ClassNotFoundException: server.jar

It seems you run java server.jar instead of java -jar server.jar. Please check your scripts.

@AntonKozlov
Copy link
Contributor

sorrry,not have -jar

Indeed. Sorry, posted my message before seeing yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants