forked from GEIGEIGEIST/zmk-config-totem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
73 lines (69 loc) · 2.11 KB
/
docker-compose.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
version: "3.9"
services:
# Fix Ownership of Build Directory
# Thanks to Bug in Docker itself
# We need to use steps like this
# Because by default, the volume directory
# Is owned by Root
# So this helps correct it
change-vol-ownership:
# We can use any image we want as long as we can chown
image: private/zmk
# Need a user priviliged enough to chown
env_file: env.list
user: "root"
# Specify the group in question
group_add:
- '${GROUP_ID}'
volumes:
# The volumes to chown
- ${HOST_ZMK_DIR}:${DOCKER_ZMK_DIR}
- ${HOST_CONFIG_DIR}:${DOCKER_CONFIG_DIR}
- ${LOG_DIR}:/tmp
- zmk_root_user:/root
- zmk_zephyr:$DOCKER_ZMK_DIR/zephyr
- zmk_zephyr_modules:$DOCKER_ZMK_DIR/modules
- zmk_zephyr_tools:$DOCKER_ZMK_DIR/tools
command:
- bash
- -c
- |
mkdir -p "$DOCKER_CONFIG_DIR/$OUTPUT_DIR"
chown -R ${USER_ID}:${GROUP_ID} ${DOCKER_ZMK_DIR} ${DOCKER_ZMK_DIR}/zephyr ${DOCKER_ZMK_DIR}/modules ${DOCKER_ZMK_DIR}/tools /root /tmp "$DOCKER_CONFIG_DIR/$OUTPUT_DIR"
build:
user: "${USER_ID}:${GROUP_ID}"
image: private/zmk
working_dir: ${DOCKER_ZMK_DIR}/app
env_file: env.list
command:
- bash
- -c
- |
${DOCKER_CONFIG_DIR}/scripts/build_board_matrix.sh
volumes:
# The volumes to chown
- ${HOST_ZMK_DIR}:${DOCKER_ZMK_DIR}
- ${HOST_CONFIG_DIR}:${DOCKER_CONFIG_DIR}
- ${LOG_DIR}:/tmp
- zmk_root_user:/root
- zmk_zephyr:$DOCKER_ZMK_DIR/zephyr
- zmk_zephyr_modules:$DOCKER_ZMK_DIR/modules
- zmk_zephyr_tools:$DOCKER_ZMK_DIR/tools
# - type: bind
# source: $HOST_ZMK_DIR
# target: $DOCKER_ZMK_DIR
# - type: bind
# source: $LOG_DIR
# target: /tmp
depends_on:
change-vol-ownership:
condition: service_completed_successfully
volumes:
zmk_root_user:
name: zmk-root-user-${ZEPHYR_VERSION}
zmk_zephyr:
name: zmk-zephyr-${ZEPHYR_VERSION}
zmk_zephyr_modules:
name: zmk-zephyr-modules-${ZEPHYR_VERSION}
zmk_zephyr_tools:
name: zmk-zephyr-tools-${ZEPHYR_VERSION}