Skip to content

Jenkins pipeline to build a Docker image of Paper

License

Notifications You must be signed in to change notification settings

PandacubeFr/PaperDockerBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PaperDockerBuilder

Jenkins pipeline to build a Docker image of Paper.

Disclaimer

This project is not meant to publicly provide an already working Docker image containing Paper, due to licensing reason with the MC source code.

The image tag used in the pipeline is not publicly accessible. Please change the tag before running the script or pipeline by yourself.

Project structure

build.sh    # build the image in a standalone way (not used by the pipeline)
Dockerfile  # used to build the Docker image
Jenkinsfile # the pipeline file
Readme.md   # you are reading this file
run.sh      # entrypoint of the Docker image

Pipeline process

  1. Fetches the information about the latest build of Paper for the provided MC version, from the PaperMC API
  2. Downloads the Paper jar file.
  3. Fetches the Paper API version from the jar content (e.g. 1.20.1-R0.1-SNAPSHOT).
  4. Builds the docker image with the downloaded jar and the entrypoint script, ensuring libraries are downloaded and Paper patch is applied.
  5. Extracts the patched jar from the docker image, and intalls it to the local maven repo (using the api version fetched above)
  6. Pushes the image to the container registry with the tags $mc_version (e.g. 1.20.1) and $mc_version-$paper_build (e.g. 1.20.1-196)

Docker Compose Example

services:
  server:
    image: "cr.pandacube.fr/paper:(version)" # use the correct tag here
    stdin_open: true # docker run -i
    tty: true        # docker run -t
    user: "1000:1000" # uid and gid of owner of working dir 
    environment:
      - MAXMEM=2048M # Java max heap size
    restart: always
    volumes:
      - .:/data/workdir
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "0.0.0.0:(port):25565"

About

Jenkins pipeline to build a Docker image of Paper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published