Skip to content

Commit

Permalink
Updated at 2025-02-15 23:15:11+08:00
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Feb 15, 2025
1 parent 8752a09 commit b073ff7
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 20 deletions.
1 change: 1 addition & 0 deletions Dockers/ArchOS/Desktops/Server
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN echo "PermitRootLogin without-password" >> /etc/ssh/sshd_config \
&& echo '#!/bin/bash' > /run.sh \
&& echo 'echo Starting Basic Server ----' >> /run.sh \
&& echo 'nohup /usr/sbin/sshd -D &' >> /run.sh
RUN chmod +x /run.sh && ssh-keygen -A && systemctl enable sshd


RUN systemctl enable run
Expand Down
1 change: 1 addition & 0 deletions Dockers/ArchOS/Desktops/X11GUI
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RUN echo 'VirtualDesktopAccess all' >>/usr/NX/etc/server.cfg \

# Start UP ----------------------------------------------------
RUN echo '#!/bin/bash' > /run.sh \
&& echo '/usr/sbin/sshd & ' >> /run.sh \
&& echo 'export DISPLAY=:0' >> /run.sh \
&& echo '/etc/init.d/dbus start' >> /run.sh \
&& echo 'echo Starting NX ----------------------' >> /run.sh \
Expand Down
9 changes: 9 additions & 0 deletions Scripts/Config.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/bin/bash
# Host Parameter (Replace!)
# DOMAIN_T=当前服务器主域名
# HOSTNAME=当前宿主机主机名
DOMAIN_T="YOUR_LANS_DOMAIN"
HOSTNAME="MASTER_HOST_NAME"

# Port Rank Start Number ID
# 端口序列,=PORTRANK*10000
PORTRANK=2 # 从:20000~29999
OCPREFIX=S2VM-OC # 主机前缀

# Public Domains (Optional)
# 设置外网IPV4和IPV6地址
IPV4HOST="YOUR_IPV4_DOMAIN"
IPV6HOST="YOUR_IPV6_DOMAIN"


# OCIs Home Path (Optional)
DATAPATH="/home/ocis"
23 changes: 13 additions & 10 deletions Scripts/Create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,22 @@ sudo mkdir -p "${DATAPATH}${PV_DATA}/root"

# RUN Images ---------------------------------------------------------------------
echo -n " Docker: "
sudo docker run -itd \
$GPU_LIST \
--privileged=true \
--shm-size=1024m \
--name $D_NAMES \
--cap-add SYS_ADMIN \
--cap-add=SYS_PTRACE \
sudo docker run -itd \
$GPU_LIST \
--privileged=true \
--cpus=$CPUSSIZE \
--memory=${MEMSSIZE}m \
--shm-size=1024m \
--name $D_NAMES \
--cap-add SYS_ADMIN \
--cap-add=SYS_PTRACE \
-h $D_NAMES.$HOSTNAME \
$PORTMAP \
-p $PM_SSHS:22 \
$PORTMAP \
-p $PM_SSHS:22 \
-p $PM_NXSR:4000 \
-p $PM_VNCS:5900 \
-p $PM_RDPS:3389 \
-v "${DATAPATH}${PV_DATA}/root:/root" \
-v "${DATAPATH}${PV_DATA}/root:/root" \
-v "${DATAPATH}${PV_DATA}/user:/home/user" \
pikachuim/$OS_TYPE:$VERSION-$GUI_ENV

Expand Down Expand Up @@ -75,6 +77,7 @@ echo "Congratulations! Your Docker Container has been Created Successfully! " |
echo "----------------------------------------------------------------------" | tee $TEXT_PATH
echo " Container $D_NAMES " | tee $TEXT_PATH
echo " OSSystem: $OS_TYPE $VERSION " | tee $TEXT_PATH
echo " Desktops: $GUI_ENV " | tee $TEXT_PATH
echo "----------------------------------------------------------------------" | tee $TEXT_PATH
echo " NXD Addr: $DOMAIN_T:$PM_NXSR " | tee $TEXT_PATH
echo " SSH Addr: $DOMAIN_T:$PM_SSHS " | tee $TEXT_PATH
Expand Down
37 changes: 28 additions & 9 deletions Scripts/Number.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
#!/bin/bash
source Scripts/Titles.sh

# Config --------------------------------------------------------------------------
source Scripts/Titles.sh
echo " ==========================Hardwares Limitation=========================="
echo " Set Docker CPU and Memory Limitation "
echo " ========================================================================"
echo
echo -n " Input CPU Limitation [Core](8): "
read CPUSSIZE
if [ ! $CPUSSIZE ]; then
echo ' Note: CPUSSIZE=8'
CPUSSIZE='8'
fi
echo -n " Input RAM Limitation [MiBs](8192): "
read MEMSSIZE
if [ ! $MEMSSIZE ]; then
echo ' Note: MEMSSIZE=8192'
MEMSSIZE='8192'
fi

source Scripts/Titles.sh
echo " ===========================Config Port Mapping=========================="
echo -n " Enter Docker ID(Length=2 Like 01): "
read USE_PID
D_NAMES="S1V3-OCI-${USE_PID}-CD1"
D_NAMES="${OCPREFIX}-${USE_PID}"
# ==================================================
PM_SSHS="1${USE_PID}22";
PM_RDPS="1${USE_PID}39";
PM_NXSR="1${USE_PID}40";
PM_VNCS="1${USE_PID}41";
PM_SSHS="${PORTRANK}${USE_PID}22";
PM_RDPS="${PORTRANK}${USE_PID}39";
PM_NXSR="${PORTRANK}${USE_PID}40";
PM_VNCS="${PORTRANK}${USE_PID}41";
PV_DATA="/OCI${USE_PID}"


Expand Down Expand Up @@ -52,9 +71,9 @@ do
done

if [ ! $PORTMAP ]; then
TMP1MAP="-p 1${USE_PID}01-1${USE_PID}21:1${USE_PID}01-1${USE_PID}21";
TMP2MAP="-p 1${USE_PID}23-1${USE_PID}38:1${USE_PID}23-1${USE_PID}38";
TMP3MAP="-p 1${USE_PID}42-1${USE_PID}99:1${USE_PID}42-1${USE_PID}99";
TMP1MAP="-p ${PORTRANK}${USE_PID}01-${PORTRANK}${USE_PID}21:${PORTRANK}${USE_PID}01-${PORTRANK}${USE_PID}21";
TMP2MAP="-p ${PORTRANK}${USE_PID}23-${PORTRANK}${USE_PID}38:${PORTRANK}${USE_PID}23-${PORTRANK}${USE_PID}38";
TMP3MAP="-p ${PORTRANK}${USE_PID}42-${PORTRANK}${USE_PID}99:${PORTRANK}${USE_PID}42-${PORTRANK}${USE_PID}99";
PORTMAP="${TMP1MAP} ${TMP2MAP} ${TMP3MAP}";
fi

Expand Down
2 changes: 1 addition & 1 deletion TEXT_PATH
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Docker Container: S1V3-OCI-00-CD1
Docker Container: S1V3-OCI-91-CD1

0 comments on commit b073ff7

Please sign in to comment.