* fix syntax error in Dockerfile
* fix Docker invocation
It makes no sense to pass the `-t` argument twice and we need to tell
Docker where to find the Dockerfile. Also, it makes sense to write the
config file in a standard location. In my tests, I also had to create
the directory by hand otherwise I got this error:
cdparanoia can defeat the audio cache on this drive.
Adding drive cache behaviour to configuration file.
Traceback (most recent call last):
File "/usr/local/bin/whipper", line 11, in <module>
load_entry_point('whipper==0.7.0', 'console_scripts', 'whipper')()
File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/main.py", line 36, in main
ret = cmd.do()
File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/basecommand.py", line 139, in do
return self.cmd.do()
File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/basecommand.py", line 139, in do
return self.cmd.do()
File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/command/drive.py", line 63, in do
info[0], info[1], info[2], t.defeatsCache)
File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/common/config.py", line 115, in setDefeatsCache
section = self._findOrCreateDriveSection(vendor, model, release)
File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/common/config.py", line 164, in _findOrCreateDriveSection
self.write()
File "/usr/local/lib/python2.7/dist-packages/whipper-0.7.0-py2.7.egg/whipper/common/config.py", line 58, in write
shutil.move(path, self._path)
File "/usr/lib/python2.7/shutil.py", line 316, in move
copy2(src, real_dst)
File "/usr/lib/python2.7/shutil.py", line 144, in copy2
copyfile(src, dst)
File "/usr/lib/python2.7/shutil.py", line 97, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: u'/home/worker/.config/whipper/whipper.conf'
* remove needless tag version
:latest is implicit so it's useless noise as well.
* Update README.md
61 lines
1.9 KiB
Docker
61 lines
1.9 KiB
Docker
FROM debian:buster
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y cdrdao python-gobject-2 python-musicbrainzngs python-mutagen python-setuptools \
|
|
python-cddb python-requests libsndfile1-dev flac sox \
|
|
libiso9660-dev python-pip swig make pkgconf \
|
|
eject locales \
|
|
autoconf libtool curl \
|
|
&& pip install pycdio==2.0.0
|
|
|
|
# libcdio-paranoia / libcdio-utils are wrongfully packaged in Debian, thus built manually
|
|
# see https://github.com/JoeLametta/whipper/pull/237#issuecomment-367985625
|
|
RUN curl -o - 'https://ftp.gnu.org/gnu/libcdio/libcdio-2.0.0.tar.gz' | tar zxf - \
|
|
&& cd libcdio-2.0.0 \
|
|
&& autoreconf -fi \
|
|
&& ./configure --disable-dependency-tracking --disable-cxx --disable-example-progs --disable-static \
|
|
&& make install \
|
|
&& cd .. \
|
|
&& rm -rf libcdio-2.0.0
|
|
|
|
# Install cd-paranoia from tarball
|
|
RUN curl -o - 'https://ftp.gnu.org/gnu/libcdio/libcdio-paranoia-10.2+0.94+2.tar.gz' | tar zxf - \
|
|
&& cd libcdio-paranoia-10.2+0.94+2 \
|
|
&& autoreconf -fi \
|
|
&& ./configure --disable-dependency-tracking --disable-example-progs --disable-static \
|
|
&& make install \
|
|
&& cd .. \
|
|
&& rm -rf libcdio-paranoia-10.2+0.94+2
|
|
|
|
RUN ldconfig
|
|
|
|
# install whipper
|
|
RUN mkdir /whipper
|
|
COPY . /whipper/
|
|
RUN cd /whipper/src && make && make install \
|
|
&& cd /whipper && python2 setup.py install \
|
|
&& rm -rf /whipper \
|
|
&& whipper -v
|
|
|
|
# add user
|
|
RUN useradd -m worker -G cdrom \
|
|
&& mkdir -p /output /home/worker/.config/whipper \
|
|
&& chown worker: /output /home/worker/.config/whipper
|
|
VOLUME ["/home/worker/.config/whipper", "/output"]
|
|
|
|
# setup locales + cleanup
|
|
RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment \
|
|
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
|
|
&& echo "LANG=en_US.UTF-8" > /etc/locale.conf \
|
|
&& locale-gen en_US.UTF-8 \
|
|
&& apt-get clean && apt-get autoremove -y
|
|
|
|
ENV LC_ALL=en_US.UTF-8
|
|
ENV LANG=en_US
|
|
ENV LANGUAGE=en_US.UTF-8
|
|
ENV PYTHONIOENCODING=utf-8
|
|
|
|
USER worker
|
|
WORKDIR /output
|
|
ENTRYPOINT ["whipper"]
|