forked from negativa-ai/BLAFS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·20 lines (17 loc) · 737 Bytes
/
dev.sh
File metadata and controls
executable file
·20 lines (17 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# check if baffs-dev already running
if [ "$(docker ps -q -f name=baffs-dev)" ]; then
echo "baffs-dev already exists, connecting to it"
docker exec -it baffs-dev /bin/zsh
exit 0
fi
# check if baffs-dev already exists but stopped
if [ "$(docker ps -aq -f status=exited -f name=baffs-dev)" ]; then
echo "baffs-dev already exists but stopped, starting it"
docker start baffs-dev
docker exec -it baffs-dev /bin/zsh
exit 0
fi
# no need to mount .ssh if you don't need to push/pull from the repo
docker run -d --name baffs-dev --privileged=true -v /tmp/docker:/var/lib/docker -v $PWD:/home/ubuntu/repos/BAFFS -v /home/ubuntu/.ssh/:/home/ubuntu/.ssh/ baffs-dev
docker exec -it baffs-dev /bin/zsh