-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.sh
executable file
·23 lines (15 loc) · 838 Bytes
/
dev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Запуск dev контейнера.
# ./dev.sh – билдит и запускает контейнер.
# Если запущенный контейнер с таким именем уже есть, то использует его (без ребилда).
# ./dev.sh 1 – билдит и запускает конейнер всегда с ребилдом.
RUNNING_CONTAINER_ID=$(docker ps -q --filter ancestor=umfs-workspace --filter status=running)
if [ "$RUNNING_CONTAINER_ID" != "" ] && [ "$1" == "" ]; then
docker exec -it $RUNNING_CONTAINER_ID bash
exit 0
fi
docker rm -f -v $(docker ps --filter ancestor=umfs-workspace -q)
docker build -t umfs-workspace .
DEV_CONTAINER_ID=$(docker run -it -d -v .:/root/umfs umfs-workspace)
echo $DEV_CONTAINER_ID
docker exec -it $DEV_CONTAINER_ID bash