Skip to content

Commit

Permalink
Add LazyMC
Browse files Browse the repository at this point in the history
  • Loading branch information
xMikux authored Jan 31, 2024
1 parent 31c5d99 commit da419f9
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java - Build
name: Java - GraalVM Build

on:
push:
Expand Down Expand Up @@ -28,9 +28,9 @@ jobs:
strategy:
matrix:
include:
- name: "java_8"
- name: "graalvm_java_8"
path: "Java/GraalVM/8"
- name: "java_11"
- name: "graalvm_java_11"
path: "Java/GraalVM/11"
- name: "java_17"
- name: "graalvm_java_17"
path: "Java/GraalVM/17"
36 changes: 36 additions & 0 deletions .github/workflows/java-graalvmlz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Java - GraalVM LazyMC Build

on:
push:
branches:
- main
paths:
- Java/**
pull_request:
branches:
- main
paths:
- Java/**
workflow_dispatch: {}

jobs:
build:
name: ${{ matrix.name }}
uses: ./.github/workflows/docker-build.yml
with:
build_name: ${{ matrix.name }}
build_path: ${{ matrix.path }}
ocr_login: true
secrets:
ocr_username: ${{ secrets.OCR_USERNAME }}
ocr_password: ${{ secrets.OCR_PASSWORD }}

strategy:
matrix:
include:
- name: "graalvm_lz_java_8"
path: "Java/GraalVM-LZ/8"
- name: "graalvm_lz_java_11"
path: "Java/GraalVM-LZ/11"
- name: "graalvm_lz_java_17"
path: "Java/GraalVM-LZ/17"
24 changes: 24 additions & 0 deletions Java/GraalVM-LZ/11/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM busybox as tools

FROM rust:buster as lazymc

WORKDIR /lazymc

RUN apt-get update && \
apt-get install -y git && \
git clone https://github.com/Docker-Collection/lazymc.git . && \
cargo build --release && \
chmod +x target/release/lazymc

FROM container-registry.oracle.com/graalvm/jdk-ee:ol9-java11-22

RUN useradd -d /home/container -m container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY --from=tools /bin/ip /bin/
COPY --from=lazymc /lazymc/target/release/lazymc /bin/lazymc
COPY entrypoint.sh /entrypoint.sh
CMD [ "/bin/bash", "/entrypoint.sh" ]
24 changes: 24 additions & 0 deletions Java/GraalVM-LZ/17/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM busybox as tools

FROM rust:buster as lazymc

WORKDIR /lazymc

RUN apt-get update && \
apt-get install -y git && \
git clone https://github.com/Docker-Collection/lazymc.git . && \
cargo build --release && \
chmod +x target/release/lazymc

FROM container-registry.oracle.com/graalvm/jdk-ee:ol9-java17-22

RUN useradd -d /home/container -m container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY --from=tools /bin/ip /bin/
COPY --from=lazymc /lazymc/target/release/lazymc /bin/lazymc
COPY entrypoint.sh /entrypoint.sh
CMD [ "/bin/bash", "/entrypoint.sh" ]
24 changes: 24 additions & 0 deletions Java/GraalVM-LZ/8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM busybox as tools

FROM rust:buster as lazymc

WORKDIR /lazymc

RUN apt-get update && \
apt-get install -y git && \
git clone https://github.com/Docker-Collection/lazymc.git . && \
cargo build --release && \
chmod +x target/release/lazymc

FROM container-registry.oracle.com/graalvm/jdk-ee:ol9-java8-21

RUN useradd -d /home/container -m container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY --from=tools /bin/ip /bin/
COPY --from=lazymc /lazymc/target/release/lazymc /bin/lazymc
COPY entrypoint.sh /entrypoint.sh
CMD [ "/bin/bash", "/entrypoint.sh" ]
17 changes: 17 additions & 0 deletions Java/GraalVM-LZ/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

TZ=${TZ:-UTC}
export TZ

INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-0);exit}')
export INTERNAL_IP

cd /home/container || exit 1

printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mjava -version\n"
java -version

PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)")

printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"
exec env ${PARSED}

0 comments on commit da419f9

Please sign in to comment.