-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtest_dev_container.sh
executable file
·36 lines (30 loc) · 1.1 KB
/
test_dev_container.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# This is intended to be used inside a dev's local directory.
#
# You should create a "home" directory with some configs in it as you like
# them. In particular, you will need a Vundle-enabled VIM or NeoVIM config.
#
# This assumes "toktok-stack" is cloned into the "workspace" subdirectory.
set -eux
IMAGE="$1"
if [ ! -f home/.ssh/authorized_keys ]; then
mkdir -f home/.ssh
cp ~/.ssh/id_rsa.pub home/.ssh/authorized_keys
fi
if [ ! -f home/.ssh/id_rsa ]; then
ssh-keygen -f home/.ssh/id_rsa
fi
#(cd workspace && docker build -t toxchat/toktok-stack:latest-dev -f tools/built/src/Dockerfile.dev .)
tar c home workspace/tools/built/dev |
docker build -t "$IMAGE" -f workspace/tools/built/dev/Dockerfile -
docker run --name=toktok-dev --rm -it \
-p 2224:22 \
--privileged \
--tmpfs "/run" \
--tmpfs "/run/wrappers:exec,suid" \
--tmpfs "/tmp" \
-v "$PWD/workspace:/src/workspace" \
-v "$HOME/.local/share/vscode/config:/src/workspace/.vscode" \
-v "$HOME/.local/share/vscode/server:/home/builder/.vscode-server" \
-v "$HOME/.local/share/zsh/toktok:/home/builder/.local/share/zsh" \
"$IMAGE"