-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
104 lines (99 loc) · 3.12 KB
/
docker-compose.yml
File metadata and controls
104 lines (99 loc) · 3.12 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
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
version: '3.8'
services:
# =============================================================================
# Builder service - Builds the Linux distribution
# =============================================================================
builder:
build:
context: .
dockerfile: Dockerfile
target: runtime
args:
- LINUX_VERSION=master
- BUSYBOX_VERSION=master
- SYSLINUX_VERSION=6.03
- BUILD_JOBS=auto
image: handbuilt-linux:latest
container_name: handbuilt-linux-builder
volumes:
# Mount output directory for extracting artifacts
- ./output:/output
# Mount source configurations for easy editing
- ./linux.config:/distro/linux.config:ro
- ./busybox.config:/distro/busybox.config:ro
environment:
- DISTRO_HOME=/distro
command: >
bash -c "
echo 'Copying build artifacts to /output...' &&
mkdir -p /output &&
cp /distro/output.iso /output/output.iso &&
cp /distro/bzImage /output/bzImage &&
cp /distro/initramfs /output/initramfs &&
echo 'Build artifacts copied to ./output/' &&
echo 'ISO: ./output/output.iso' &&
echo 'Kernel: ./output/bzImage' &&
echo 'Initramfs: ./output/initramfs'
"
networks:
- handbuilt-linux-net
# =============================================================================
# Development service - Interactive shell for development
# =============================================================================
dev:
build:
context: .
dockerfile: Dockerfile
target: runtime
image: handbuilt-linux:latest
container_name: handbuilt-linux-dev
stdin_open: true
tty: true
volumes:
- ./output:/output
- ./scripts:/distro/scripts:ro
environment:
- DISTRO_HOME=/distro
- PS1=\[\033[1;32m\]handbuilt-linux-dev\[\033[0m\]:\[\033[1;34m\]\w\[\033[0m\]\$
working_dir: /distro
command: /bin/bash
networks:
- handbuilt-linux-net
profiles:
- dev
# =============================================================================
# Test service - Runs QEMU for testing
# =============================================================================
qemu:
image: tianon/qemu
container_name: handbuilt-linux-qemu
privileged: true
stdin_open: true
tty: true
volumes:
- ./output:/images:ro
command: >
qemu-system-x86_64
-cdrom /images/output.iso
-m 512M
-nographic
networks:
- handbuilt-linux-net
depends_on:
builder:
condition: service_completed_successfully
profiles:
- test
# =============================================================================
# Networks
# =============================================================================
networks:
handbuilt-linux-net:
driver: bridge
name: handbuilt-linux-network
# =============================================================================
# Volumes
# =============================================================================
volumes:
output:
name: handbuilt-linux-output