-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
115 lines (58 loc) · 2.06 KB
/
Dockerfile
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
112
113
114
115
FROM arm64v8/debian:stable
ENV DEBIAN_FRONTEND noninteractive
ENV WANT_32BIT=1
ENV WANT_64BIT=1
ENV WANT_PI4=1
ENV WANT_PI5=1
RUN apt -y autoremove
RUN rm -rf /var/lib/apt/lists/*
RUN rm /etc/apt/sources.list.d/debian.sources
ADD sources.list /etc/apt/sources.list.d/sources.list
RUN dpkg --add-architecture armhf
RUN dpkg --add-architecture armel
RUN apt -y update
ADD packages.txt /tmp/packages.txt
RUN apt -y install $(cat /tmp/packages.txt | tr '\n' ' ')
ADD startup.txt /tmp/startup.txt
ADD regenerate_ssh_host_keys.service /usr/lib/systemd/system
RUN cat /tmp/startup.txt | xargs -i systemctl enable {}
RUN systemctl enable regenerate_ssh_host_keys
ADD logrotate.conf /etc/logrotate.d/logrotate.conf
ADD sshd_config /etc/ssh/sshd_config.d/sshd_config
ADD sudoers /etc/sudoers.d
ADD fstab /etc/fstab
ADD issue.net /etc/issue.net
ADD 10-eth.network /etc/systemd/network
ADD 10-usb.network /etc/systemd/network
ADD 10-enx.network /etc/systemd/network
RUN mkdir /home/pi
RUN mkdir /home/pi/ssh
RUN groupadd spi
RUN groupadd i2c
RUN groupadd gpio
RUN groupadd -g 5000 pi
RUN useradd -u 4000 -g pi -s /bin/bash -d /home/pi -G sudo,video,adm,dialout,cdrom,audio,plugdev,games,users,input,netdev,spi,i2c,gpio pi
RUN chown pi:pi /home/pi
ADD profile /home/pi/.profile
RUN cd /usr/local/bin && wget https://raw.githubusercontent.com/raspberrypi/rpi-update/master/rpi-update
RUN mkdir -p /lib/modules
RUN chmod +x /usr/local/bin/rpi-update
RUN echo y | /usr/local/bin/rpi-update
ADD cmdline.txt /boot/cmdline.txt
ADD config.txt /boot/config.txt
RUN cd /tmp
RUN git clone https://github.com/raspberrypi/userland /usr/src/userland
RUN cd /usr/src/userland ; ./buildme --aarch64
RUN usermod -U pi
RUN passwd -d pi
RUN echo '/opt/vc/lib' > /etc/ld.so.conf.d/00-vmcs.conf
ADD 99-com.rules /etc/udev/rules.d/99-com.rules
RUN apt -y autoremove
RUN rm -rf /var/lib/apt/lists/*
RUN rm -rf /home
# Distribution specific additions
RUN usermod -G pi motion
RUN rm -rf /etc/motion
RUN mkdir /etc/motion
ADD motion.conf /etc/motion
RUN chown -R motion:motion /etc/motion