-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (46 loc) · 1.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
52 lines (46 loc) · 1.54 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
services:
dev-container: # service name
build:
context: ./
dockerfile: ./docker/Dockerfile
image: my-calculator-devenv
tty: true # docker run -t
stdin_open: true # docker run -i
user: "${UID:?error}:${UID:?error}" # map user id of current user into container ("be yourself" in the container). If this variable is not seen by docker compose, do "export UID"
privileged: true
group_add:
- dialout
- sudo
working_dir: ${PWD:?error}
volumes:
- type: bind
source: /etc/passwd
target: /etc/passwd
read_only: true
# allow to "sudo" with normal password
- type: bind
source: /etc/shadow
target: /etc/shadow
read_only: true
- type: bind
source: /etc/group
target: /etc/group
read_only: true
# share git config and ssh keys. Allows container processes to perform git action (Useful for working with IDE & .devcontainer)
- type: bind
source: /home/${USER:?error}/.gitconfig
target: /home/${USER:?error}/.gitconfig
read_only: false
- type: bind
source: /home/${USER:?error}/.ssh
target: /home/${USER:?error}/.ssh
read_only: false
# share bash history between devenv and local shell
- type: bind
source: /home/${USER:?error}/.bash_history
target: /home/${USER:?error}/.bash_history
read_only: false
- type: bind
source: .
target: ${PWD:?error}
read_only: false