Added ai-tools image option
This commit is contained in:
48
ai-tools/Docker/scripts/start.sh
Executable file
48
ai-tools/Docker/scripts/start.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
. CONFIG.sh
|
||||
|
||||
# set -o xtrace ## To debug scripts
|
||||
# set -o errexit ## To exit on error
|
||||
# set -o errunset ## To exit if a variable is referenced but not set
|
||||
|
||||
|
||||
function set_routs() {
|
||||
sudo iptables -t nat -I OUTPUT -p tcp -o lo --dport 80 -j REDIRECT --to-ports 8080
|
||||
sudo iptables -t nat -I OUTPUT -p tcp -o lo --dport 443 -j REDIRECT --to-ports 4433
|
||||
}
|
||||
|
||||
function main() {
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
cd "${SCRIPTPATH}"
|
||||
echo "Working Dir: " $(pwd)
|
||||
|
||||
ID=$(podman ps --filter "ancestor=localhost/${CONTAINER}:latest" --format "{{.ID}}")
|
||||
if [ "${ID}" != "" ]; then
|
||||
echo "Is up..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOWNLOAD_HOST="${HOME}/Downloads"
|
||||
DOWNLOAD_CONTAINER="${HOME}/Downloads"
|
||||
CODING_HOST="${HOME}/Coding"
|
||||
CODING_CONTAINER="${HOME}/Coding"
|
||||
|
||||
# set_routs
|
||||
# sudo sysctl net.ipv4.ip_unprivileged_port_start=80
|
||||
# -p 80:80 \
|
||||
# -p 443:443 \
|
||||
|
||||
# podman run -m 4G \
|
||||
podman run -d -m 4G \
|
||||
--annotation run.oci.cdi.devices=all \
|
||||
-e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility \
|
||||
-e HOME="${HOME}" \
|
||||
-v "${DOWNLOAD_HOST}":"${DOWNLOAD_CONTAINER}" \
|
||||
-v "${CODING_HOST}":"${CODING_CONTAINER}" \
|
||||
"${CONTAINER}:latest"
|
||||
|
||||
# sudo sysctl net.ipv4.ip_unprivileged_port_start=1024
|
||||
|
||||
}
|
||||
main $@;
|
||||
Reference in New Issue
Block a user