-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
111 lines (105 loc) · 3.82 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
version: '3.8'
services:
# Build an updated Alpine image with a non-root user and chown the specified volume.
updater:
image: greenukr/updater:0.1.0
build:
context: ./updater
dockerfile: Dockerfile.updater
args:
- DEFAULT_UID=${USER_UID}
- DEFAULT_GID=${GROUP_GID}
- DEFAULT_UG_NAME=${UG_NAME}
# Need a user priviliged enough to chown
user: "root"
volumes:
# The volume to chown
- data-volume:/data
env_file:
- ./.env
command: chown -R ${USER_UID}:${GROUP_GID} /data
# Download data to the specified volume.
downloader:
image: greenukr/downloader:0.5.0
build:
context: ./downloader
dockerfile: Dockerfile.downloader
args:
- DEFAULT_UG_NAME=${UG_NAME}
working_dir: /data
volumes:
- data-volume:/data
env_file:
- ./.env
- ./.downloader.env
depends_on:
updater:
condition: service_completed_successfully
# Process some porations on data from the specified volume.
processor:
image: greenukr/processor:0.5.0
build:
context: ./processor
dockerfile: Dockerfile.processor
args:
- DEFAULT_UG_NAME=${UG_NAME}
working_dir: /data
volumes:
- data-volume:/data
env_file:
- ./.env
- ./.downloader.env
- ./.processor.env
# entrypoint: ["/bin/sh", "-c", "sleep infinity"]
depends_on:
downloader:
condition: service_completed_successfully
# Run QEMU emulator with specified configurations.
emulator:
image: greenukr/emulator:0.5.0
cpu_count: 4
mem_reservation: 3072M
mem_limit: 4096M
shm_size: 2048M
build:
context: ./emulator
dockerfile: Dockerfile.emulator
args:
- DEFAULT_UG_NAME=${UG_NAME}
working_dir: /data
volumes:
- data-volume:/data
ports:
- "2222:2222"
env_file:
- ./.env
- ./.processor.env
depends_on:
processor:
condition: service_completed_successfully
# entrypoint: >-
# qemu-system-aarch64
# -name rpi3bp -machine raspi3b -cpu cortex-a72 -m 1G -smp 4 -nographic
# -dtb bcm2710-rpi-3-b-plus.dtb -kernel kernel8.img -sd sd.qcow2
# -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1"
# -device usb-net,netdev=net0,mac=02:ca:fe:f0:0d:01 -netdev user,id=net0,hostfwd=tcp::2222-:22
command: >-
-name rpi3bp -machine raspi3b -cpu cortex-a72 -m 1G -smp 4 -nographic
-dtb ${DTB_FILE} -kernel ${KERNEL_FILE} -sd ${SD_NAME}
-append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1"
-device usb-net,netdev=net0,mac=02:ca:fe:f0:0d:01 -netdev user,id=net0,hostfwd=tcp::2222-:22
-monitor telnet:127.0.0.1:5555,server,nowait
# command: >-
# -name rpi3bp -machine raspi3b -cpu cortex-a72 -m 1G -smp 4 -nographic
# -dtb ${DTB_FILE} -kernel ${KERNEL_FILE} -sd ${SD_NAME}
# -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1"
# -device usb-net,netdev=net0,mac=02:ca:fe:f0:0d:01 -netdev user,id=net0,hostfwd=tcp::2222-:22
# -monitor unix:qemu-monitor-socket,server,nowait
# '-monitor telnet:127.0.0.1:5555,server,nowait' will enable telnet server for monitoring
# Use: 'busybox-extras telnet 127.0.0.1 5555' to connect to qemu in container
# 'echo system_powerdown |busybox-extras telnet 127.0.0.1 5555
# '-monitor unix:qemu-monitor-socket,server,nowait' will enable unix socket server for monitoring
# Use: echo "info status" | socat - unix-connect:qemu-monitor-socket
restart: unless-stopped
volumes:
data-volume: