-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
115 lines (91 loc) · 3.4 KB
/
Dockerfile
File metadata and controls
115 lines (91 loc) · 3.4 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
105
106
107
108
109
110
111
112
113
114
115
FROM fedora
MAINTAINER Buttetsu Batou <doubledense@gmail.com>
# Install dependencies and audio tools
RUN dnf groupinstall -y "C Development Tools and Libraries"
RUN dnf install -y git zsh wget man sudo
RUN dnf install -y libsndfile-devel libsamplerate-devel liblo-devel jack-audio-connection-kit-devel jack-audio-connection-kit-example-clients alsa-lib-devel xz htop grep procps-ng yasm screen supervisor openssh-server
RUN dnf install -y cabal-install ghc-Cabal-devel
# Install editor
RUN dnf -y install emacs-nox emacs-haskell-mode
# Build Dirt synth
WORKDIR /repos
RUN git clone --recursive https://github.com/tidalcycles/Dirt.git
WORKDIR Dirt
RUN make
# Build & Install libmp3lame
WORKDIR /repos
RUN git clone https://github.com/rbrito/lame.git
WORKDIR lame
RUN ./configure --prefix=/usr
RUN make install
WORKDIR /repos
RUN rm -fr lame
# Build & Install ffmpeg, ffserver
WORKDIR /repos
RUN git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
WORKDIR ffmpeg
RUN ./configure --enable-indev=jack --enable-libmp3lame --enable-nonfree --prefix=/usr
RUN make install
WORKDIR /repos
RUN rm -fr ffmpeg
# Install Tidebox supervisord config
COPY configs/tidebox.ini /etc/supervisord.d/tidebox.ini
# Initialize and configure sshd
RUN ssh-keygen -b 1024 -t rsa -f /etc/ssh/ssh_host_key
RUN ssh-keygen -b 1024 -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -b 1024 -t dsa -f /etc/ssh/ssh_host_dsa_key
RUN sed -i 's/UsePAM\syes/UsePAM no/' /etc/ssh/sshd_config
# Expose sshd service
EXPOSE 22
# Expose ffserver streaming service
EXPOSE 8090
# Pull Tidal Emacs binding
RUN mkdir /repos/tidal
WORKDIR /repos
WORKDIR tidal
RUN wget https://raw.github.com/yaxu/Tidal/master/tidal.el
# Create and configure Tidal user
RUN useradd tidal -s /bin/zsh
RUN echo 'tidal:livecoding' | chpasswd
RUN echo "tidal ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER tidal
ENV HOME /home/tidal
WORKDIR /home/tidal
RUN ln -s /repos /home/tidal/repos
RUN ln -s /work /home/tidal/work
# Install Tidal
RUN cabal update
RUN cabal install tidal
# Install Oh-My-Zsh
RUN sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Disable Zsh automatic window titling
RUN sed -i 's/# DISABLE_AUTO_TITLE="true"/DISABLE_AUTO_TITLE="true"/g' /home/tidal/.zshrc
# Install default configurations
COPY configs/emacsrc /home/tidal/.emacs
COPY configs/screenrc /home/tidal/.screenrc
COPY configs/ffserver.conf /home/tidal/ffserver.conf
# Install default Tidal files
COPY tidal/init.tidal /home/tidal/init.tidal
COPY tidal/hello.tidal /home/tidal/hello.tidal
# Prepare scratch workspace for version control
RUN sudo mkdir /work
RUN sudo chown -R tidal:tidal /work
WORKDIR /work
RUN mkdir /home/tidal/.ssh
ADD https://raw.githubusercontent.com/DoubleDensity/scratchpool/master/id_rsa-scratchpool /home/tidal/.ssh/id_rsa
RUN sudo chmod 600 /home/tidal/.ssh/id_rsa
RUN sudo chown tidal.tidal /home/tidal/.ssh/id_rsa
COPY configs/sshconfig /home/tidal/.ssh/config
RUN sudo chmod 600 /home/tidal/.ssh/config
RUN sudo chown tidal.tidal /home/tidal/.ssh/config
RUN ssh-keyscan -H github.com >> ~/.ssh/known_hosts
RUN git clone git@github.com:DoubleDensity/scratchpool.git
WORKDIR /work/scratchpool
RUN git config user.name "Tidebox User"
RUN git config user.email "tidal@jankycloud.com"
# Set Tidal shell to Screen
USER root
RUN echo "/usr/bin/screen" >> /etc/shells
RUN usermod -s /usr/bin/screen tidal
RUN chown -R tidal.tidal /home/tidal/*.tidal
CMD ["/usr/bin/supervisord"]