48 lines
1.3 KiB
Bash
Raw Normal View History

2021-07-31 12:22:32 +00:00
#!/bin/bash
2021-08-10 09:50:58 +00:00
docker stop gh-proxy
GHRUNNERHOME=~/gh-runner
sudo rm -rf $GHRUNNERHOME/tmp
2021-08-03 15:26:16 +00:00
SYSBOX_UID=$(cat /etc/subuid | grep sysbox | cut -d : -f 2)
2021-08-10 09:50:58 +00:00
mkdir -p $GHRUNNERHOME/tmp/proxy
mkdir -p $GHRUNNERHOME/tmp/forward-proxy
mkdir -p $GHRUNNERHOME/redis
2021-08-03 15:26:16 +00:00
2021-08-10 09:50:58 +00:00
sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/tmp/proxy
sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/tmp/forward-proxy
sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/redis
2021-10-08 12:01:43 +00:00
#sudo rm $GHRUNNERHOME/var/run/docker.socks
2021-08-10 09:50:58 +00:00
#sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/docker-inner
2021-08-03 15:26:16 +00:00
docker run --rm -d --runtime=sysbox-runc \
--name=gh-proxy \
-e "REMOTEEXEC_ADDR=$REMOTEEXEC_ADDR" \
2021-08-10 09:50:58 +00:00
-v $GHRUNNERHOME/tmp/proxy:/tmp/proxy:rw \
-v $GHRUNNERHOME/tmp/forward-proxy:/tmp/forward-proxy:rw \
uazo/squid
docker logs gh-proxy
2021-08-03 15:26:16 +00:00
2021-07-31 12:22:32 +00:00
while true
do
2021-08-10 09:50:58 +00:00
#sudo chown -R $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/docker-inner
2021-07-31 12:22:32 +00:00
docker run --runtime=sysbox-runc --name=gh-runner -ti --rm \
--env-file=.env \
2021-08-10 09:50:58 +00:00
-v $GHRUNNERHOME/docker-inner/:/var/lib/docker/:rw \
2021-08-03 15:26:16 +00:00
-v /storage/images:/storage/images:rw \
2021-08-10 09:50:58 +00:00
-v $GHRUNNERHOME/tmp/proxy:/tmp/proxy:rw \
-v $GHRUNNERHOME/tmp/forward-proxy:/tmp/forward-proxy:rw \
-v $GHRUNNERHOME/redis:/redis:rw \
2021-10-08 12:01:43 +00:00
-v $GHRUNNERHOME/var/run:/var/run \
2021-07-31 12:22:32 +00:00
--network none \
2021-10-08 12:01:43 +00:00
--device=/dev/kvm \
2021-07-31 12:22:32 +00:00
uazo/github-runner
2021-08-10 09:50:58 +00:00
echo "You can stop now"
2021-07-31 12:22:32 +00:00
sleep 5s
done