-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerRun.cmd
More file actions
32 lines (27 loc) · 998 Bytes
/
dockerRun.cmd
File metadata and controls
32 lines (27 loc) · 998 Bytes
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
@echo off
rem ============================================================
rem sample docker run script
rem in vscode:
rem - just drag into a terminal window
rem ============================================================
rem created by Manfred Sorgo
SETLOCAL
cd /d %~dp0
set myDir=%cd%
rem regard folder above this repo as git repositories folder
cd ..
set gitDir=%cd%
set user=dev
rem set image
set image=devenv:latest
rem set mount to git repositories folder as /git
set gitMount=--mount type=bind,source=%gitDir%,target=/git
rem overwrite image home folder with local
rem advantage:
rem - histories are saved in local
rem - id est: histories don't get lost with each container start / exit
set userMount=--mount type=bind,source=%myDir%/%user%,target=/home/%user%
rem optional ports mapping sample
rem set portsmap=-p 127.0.0.1:8081:8091/tcp -p 127.0.0.1:8082:8092/tcp -p 127.0.0.1:8083:8093/tcp
set portsmap=
docker run -it --rm --name=devenv %gitMount% %userMount% %portsmap% %image%