forked from lizolson/neurobionicspi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.Pifile
96 lines (58 loc) · 2.3 KB
/
main.Pifile
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
FROM https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2022-04-07/2022-04-04-raspios-bullseye-armhf.img.xz
PUMP 10000M
# RUN touch /boot/ssh
RUN raspi-config nonint do_vnc 0
RUN raspi-config nonint do_ssh 0
RUN raspi-config nonint do_camera 0
source .env
hostname="${HOSTNAME:-mbot-test}"
user="${USER:-pi}"
password="${USERPASSWORD:-iloverobots}"
email="${EMAIL:[email protected]}"
mwpsk="${PASSWORD:-password}"
wifissid="${WIFI_SSID:-network}"
wifipsk="${WIFI_PASSPHRASE:-password}"
apssid="${AP_SSID:-mbot-ap}"
appsk="${AP_PASSPHRASE:-iloverobots}"
countrycode="${WIFI_CC:-US}"
##################################
# Modifying hostname and password
RUN sed -i "s/raspberrypi/${hostname}/g" /etc/hostname
RUN sed -i "s/raspberrypi/${hostname}/g" /etc/hosts
RUN bash -c "echo ${user}:${password} | chpasswd"
##################################
# Changing default timezone and keyboard layout
RUN bash -c "echo America/New_York > /etc/timezone"
RUN sed -i "s/gb/us/g" /etc/default/keyboard
##################################
RUN apt-get update
# Upgrade takes considerably more memory and time to build the image.
# RUN apt-get upgrade -y
##################################
# Configuring wpa_supplicant with systemd-networkd
RUN apt-get install -y wpasupplicant
source ./wpa_supplicant.Pifile
##################################
# Installing essential packages
source ./packages.Pifile
##################################
# Installing automagic-ap
RUN bash -c "git clone https://github.com/imsenthur/automagic-ap.git /etc/automagic-ap"
RUN bash -c "sudo chown -R ${user} /etc/automagic-ap"
##################################
# Installing webmin
RUN bash -c 'echo "deb https://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list'
RUN bash -c "wget http://www.webmin.com/jcameron-key.asc"
RUN apt-key add jcameron-key.asc
RUN apt update
RUN apt install -y webmin
##################################
# Configuring message of the day (motd)
RUN bash -c "sudo rm -rf /etc/motd"
RUN bash -c "curl -L https://raw.githubusercontent.com/imsenthur/neuropi-motd/main/motd -o /home/${user}/.bash_profile"
##################################
# Setting up startup_mailer and rc.local
source ./startup_mailer.Pifile
source ./rc_local.Pifile
##################################
echo "DONE!"