forked from UOX3DevTeam/UOX3
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker ignore file for irrelevancy. Add multi-stage docker build …
…process. Tweak automake script to allow for running parts of it. Tweak Makefile to include c++fs for GCC <= 8
- Loading branch information
1 parent
028f4c9
commit a13ffa5
Showing
4 changed files
with
130 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Dockerfile* | ||
.git | ||
.github | ||
vs2022 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#syntax = docker/dockerfile:1.4.0 | ||
|
||
FROM quay.io/centos/centos:stream AS buildbase | ||
#RUN yum -y install tar unzip wget glibc.i686 which sudo gcc net-tools dos2unix make gcc-c++ && yum clean all && rm -rf /var/cache/yum | ||
RUN yum -y install tar unzip glibc.i686 gcc dos2unix make gcc-c++ && yum clean all && rm -rf /var/cache/yum | ||
RUN mkdir -p ~/uox3 | ||
|
||
FROM buildbase AS buildjs | ||
#COPY automakejs.sh /root/uox3 | ||
COPY automake.sh /root/uox3 | ||
COPY spidermonkey /root/uox3/spidermonkey/ | ||
RUN find /root/uox3 -name \* -type f -exec dos2unix {} \; | ||
#RUN cd /root/uox3 && ./automakejs.sh | ||
RUN cd /root/uox3 && ./automake.sh 1 | ||
CMD ["/bin/bash"] | ||
|
||
FROM buildbase AS buildzlib | ||
#COPY automakezlib.sh /root/uox3 | ||
COPY automake.sh /root/uox3 | ||
COPY zlib /root/uox3/zlib/ | ||
RUN find /root/uox3 -name \* -type f -exec dos2unix {} \; | ||
#RUN cd /root/uox3 && ./automakezlib.sh | ||
RUN cd /root/uox3 && ./automake.sh 2 | ||
CMD ["/bin/bash"] | ||
|
||
FROM buildbase AS buildapp | ||
WORKDIR /root/uox3 | ||
RUN mkdir -p spidermonkey && mkdir -p zlib | ||
#COPY automakeuox3.sh . | ||
COPY automake.sh . | ||
COPY source source/ | ||
RUN find /root/uox3 -name \* -type f -exec dos2unix {} \; | ||
COPY --from=buildjs /root/uox3/spidermonkey spidermonkey/ | ||
COPY --from=buildzlib /root/uox3/zlib zlib/ | ||
#RUN cd /root/uox3 && ./automakeuox3.sh | ||
RUN cd /root/uox3 && ./automake.sh 3 | ||
CMD ["/bin/bash"] | ||
|
||
FROM quay.io/centos/centos:stream | ||
RUN yum -y install glibc.i686 dos2unix && yum clean all && rm -rf /var/cache/yum | ||
RUN adduser --system --create-home uox3 | ||
USER uox3 | ||
RUN mkdir -p ~/app | ||
WORKDIR /home/uox3/app | ||
COPY --from=buildapp --chown=uox3 /root/uox3/uox3 . | ||
COPY --chown=uox3 data data/ | ||
COPY --chown=uox3 docs docs/ | ||
RUN <<EOF cat >> ~/app/run.sh | ||
#!/usr/bin/env bash | ||
cd ~/app | ||
./uox3 data/uox.ini | ||
EOF | ||
RUN chmod 777 ~/app/run.sh && dos2unix ~/app/run.sh | ||
CMD ["~/app/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,77 @@ | ||
#!/usr/bin/env bash | ||
echo "Building spidermonkey" | ||
cd spidermonkey | ||
if [ "$(uname)" = "FreeBSD" ] | ||
then | ||
gmake -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=clang | ||
if (( $# == 0 )); then | ||
# No parameters, all stages | ||
stage=0 | ||
else | ||
make -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=gcc | ||
stage="$1" | ||
fi | ||
|
||
$ev=$? | ||
if [ $ev -ne 0 ]; then | ||
echo "Unable to build spidermonkey, cannot continue" | ||
exit $ev | ||
if [ $stage -eq 0 ] || [ $stage -eq 1 ]; then | ||
echo "Building spidermonkey" | ||
cd spidermonkey | ||
if [ "$(uname)" = "FreeBSD" ] | ||
then | ||
gmake -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=clang | ||
else | ||
make -f Makefile.ref DEFINES=-DHAVE_VA_LIST_AS_ARRAY CC=gcc | ||
fi | ||
|
||
ev=$? | ||
if [ $ev -ne 0 ]; then | ||
echo "Unable to build spidermonkey, cannot continue" | ||
exit $ev | ||
fi | ||
if [ "$(uname)" = "Darwin" ] | ||
then | ||
# Mac OS X | ||
ar rcs libjs32.a Darwin_DBG.OBJ/*.o | ||
cp Darwin_DBG.OBJ/jsautocfg.h ./ | ||
elif [ "$(uname)" = "FreeBSD" ] | ||
then | ||
ar rcs libjs32.a FreeBSD_DBG.OBJ/*.o | ||
cp FreeBSD_DBG.OBJ/jsautocfg.h ./ | ||
elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ] | ||
then | ||
# Linux | ||
ar -r libjs32.a Linux_All_DBG.OBJ/*.o | ||
cp Linux_All_DBG.OBJ/jsautocfg.h ./ | ||
fi | ||
cd .. | ||
if [ $stage -eq 1 ]; then exit 0; fi | ||
fi | ||
|
||
if [ "$(uname)" = "Darwin" ] | ||
then | ||
# Mac OS X | ||
ar rcs libjs32.a Darwin_DBG.OBJ/*.o | ||
cp Darwin_DBG.OBJ/jsautocfg.h ./ | ||
elif [ "$(uname)" = "FreeBSD" ] | ||
then | ||
ar rcs libjs32.a FreeBSD_DBG.OBJ/*.o | ||
cp FreeBSD_DBG.OBJ/jsautocfg.h ./ | ||
elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ] | ||
then | ||
# Linux | ||
ar -r libjs32.a Linux_All_DBG.OBJ/*.o | ||
cp Linux_All_DBG.OBJ/jsautocfg.h ./ | ||
if [ $stage -eq 0 ] || [ $stage -eq 2 ]; then | ||
cd zlib | ||
echo "Bulding zlib" | ||
make distclean | ||
./configure | ||
make | ||
ev=$? | ||
if [ $ev -ne 0 ]; then | ||
echo "Unable to build zlib, cannot continue" | ||
exit $ev | ||
fi | ||
cd .. | ||
if [ $stage -eq 2 ]; then exit 0; fi | ||
fi | ||
|
||
cd ../zlib | ||
echo "Bulding zlib" | ||
make distclean | ||
./configure | ||
make | ||
|
||
$ev=$? | ||
if [ $ev -ne 0 ]; then | ||
echo "Unable to build zlib, cannot continue" | ||
if [ $stage -eq 0 ] || [ $stage -eq 3 ]; then | ||
cd source | ||
echo "Building UOX3" | ||
if [ "$(uname)" = "FreeBSD" ] | ||
then | ||
gmake | ||
else | ||
make | ||
fi | ||
ev=$? | ||
if [ -f ./uox3 ]; then | ||
cp uox3 .. | ||
echo "Done! You should now find the compiled uox3 binary in the root UOX3 project directory. Copy this binary to a separate directory dedicated to running your UOX3 shard, along with the contents of the UOX3/data directory, to avoid potential git conflicts and accidental overwriting of data when pulling UOX3 updates in the future." | ||
else | ||
echo "uox3 output not created! Please review compile status" | ||
fi | ||
cd .. | ||
exit $ev | ||
fi | ||
|
||
cd ../source | ||
echo "Building UOX3" | ||
if [ "$(uname)" = "FreeBSD" ] | ||
then | ||
gmake | ||
else | ||
make | ||
fi | ||
ev=$? | ||
if [ -f ./uox3 ]; then | ||
cp uox3 .. | ||
echo "Done! You should now find the compiled uox3 binary in the root UOX3 project directory. Copy this binary to a separate directory dedicated to running your UOX3 shard, along with the contents of the UOX3/data directory, to avoid potential git conflicts and accidental overwriting of data when pulling UOX3 updates in the future." | ||
else | ||
echo "uox3 output not created! Please review compile status" | ||
fi | ||
cd .. | ||
exit $ev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters