-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
77 lines (63 loc) · 3.88 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
###########################################################
# setup default directories and configs
FROM automaticrippingmachine/arm-dependencies:1.1.5 AS base
LABEL org.opencontainers.image.source=https://github.com/automatic-ripping-machine/automatic-ripping-machine
LABEL org.opencontainers.image.license=MIT
LABEL org.opencontainers.image.description='Automatic Ripping Machine for fully automated Blu-ray, DVD and audio disc ripping.'
EXPOSE 8080
# Setup folders and fstab
RUN \
mkdir -m 0777 -p /home/arm \
/home/arm/config /mnt/dev/sr0 \
/mnt/dev/sr1 /mnt/dev/sr2 /mnt/dev/sr3 /mnt/dev/sr4 \
/mnt/dev/sr5 /mnt/dev/sr6 /mnt/dev/sr7 /mnt/dev/sr8 \
/mnt/dev/sr9 /mnt/dev/sr10 /mnt/dev/sr11 /mnt/dev/sr12 \
/mnt/dev/sr13 /mnt/dev/sr14 /mnt/dev/sr15 /mnt/dev/sr16 \
/mnt/dev/sr17 /mnt/dev/sr18 /mnt/dev/sr19 /mnt/dev/sr20 \
&& \
echo "/dev/sr0 /mnt/dev/sr0 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr1 /mnt/dev/sr1 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr2 /mnt/dev/sr2 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr3 /mnt/dev/sr3 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr4 /mnt/dev/sr4 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr5 /mnt/dev/sr5 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr6 /mnt/dev/sr6 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr7 /mnt/dev/sr7 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr8 /mnt/dev/sr8 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr9 /mnt/dev/sr9 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr10 /mnt/dev/sr10 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr11 /mnt/dev/sr11 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr12 /mnt/dev/sr12 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr13 /mnt/dev/sr13 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr14 /mnt/dev/sr14 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr15 /mnt/dev/sr15 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr16 /mnt/dev/sr16 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr17 /mnt/dev/sr17 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr18 /mnt/dev/sr18 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr19 /mnt/dev/sr19 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab && \
echo "/dev/sr20 /mnt/dev/sr20 udf,iso9660 users,noauto,exec,utf8,ro 0 0" >> /etc/fstab
# Remove SSH
RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh
# Add ARMui service
RUN mkdir /etc/service/armui
COPY ./scripts/docker/runsv/armui.sh /etc/service/armui/run
RUN chmod +x /etc/service/armui/run
# Create our startup scripts
RUN mkdir -p /etc/my_init.d
COPY ./scripts/docker/runit/arm_user_files_setup.sh /etc/my_init.d/arm_user_files_setup.sh
COPY ./scripts/docker/runit/start_udev.sh /etc/my_init.d/start_udev.sh
RUN chmod +x /etc/my_init.d/*.sh
# We need to use a modified udev
COPY ./scripts/docker/custom_udev /etc/init.d/udev
RUN chmod +x /etc/my_init.d/*.sh
###########################################################
# Final image pushed for use
FROM base AS automatic-ripping-machine
# Copy over source code
COPY . /opt/arm/
# Our docker udev rule
RUN ln -sv /opt/arm/setup/51-docker-arm.rules /lib/udev/rules.d/
# Allow git to be managed from the /opt/arm folders
RUN git config --global --add safe.directory /opt/arm
CMD ["/sbin/my_init"]
WORKDIR /home/arm