first setup
This commit is contained in:
commit
9472170291
2 changed files with 49 additions and 0 deletions
35
Dockerfile
Normal file
35
Dockerfile
Normal file
|
@ -0,0 +1,35 @@
|
|||
FROM eclipse-temurin:17-jdk
|
||||
|
||||
ENV MAX_MEM=1G
|
||||
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -y \
|
||||
imagemagick \
|
||||
gosu \
|
||||
sudo \
|
||||
net-tools \
|
||||
iputils-ping \
|
||||
curl wget \
|
||||
git \
|
||||
jq \
|
||||
dos2unix \
|
||||
mysql-client \
|
||||
tzdata \
|
||||
rsync \
|
||||
nano \
|
||||
unzip \
|
||||
knockd \
|
||||
ttf-dejavu \
|
||||
jq \
|
||||
&& apt-get clean
|
||||
|
||||
RUN addgroup --gid 1000 velocity \
|
||||
&& adduser --system --shell /bin/false --uid 1000 --ingroup velocity --home /data velocity
|
||||
RUN mkdir /velocity && chown 1000:1000 /velocity
|
||||
|
||||
ADD ./build.sh /tmp
|
||||
RUN /tmp/build.sh
|
||||
|
||||
WORKDIR /data
|
||||
CMD java -Xms$MAX_MEM -Xmx$MAX_MEM -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -XX:MaxInlineLevel=15 -jar /velocity/velocity.jar
|
14
build.sh
Executable file
14
build.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
curl 'https://papermc.io/api/v2/projects/velocity/version_group/3.0.0/builds' -H 'User-Agent: docker-build simcop2387@simcop2387.info' | jq -r '.builds[-1]' | tee /tmp/velocity.json
|
||||
wget -O /tmp/velocity.jar $(jq -r '"https://papermc.io/api/v2/projects/velocity/versions/"+(.version|tostring)+"/builds/"+(.build|tostring)+"/downloads/"+ (.downloads.application.name|tostring)' < /tmp/velocity.json)
|
||||
CALCULATED=$(sha256sum /tmp/velocity.jar | cut -d' ' -f1)
|
||||
PROVIDED=$(jq -r '.downloads.application.sha256' < /tmp/velocity.json)
|
||||
|
||||
if [[ $CALCULATED == $PROVIDED ]]; then
|
||||
echo download successful, moving to final location
|
||||
mv /tmp/velocity.jar /velocity/
|
||||
else
|
||||
echo FAILED SHA256 SUM CHECK: $CALCULATED !=
|
||||
exit 127
|
||||
fi
|
Loading…
Add table
Reference in a new issue