From 6d7e54f8b21f3d89142b4ba0ae2a3ef76fb23470 Mon Sep 17 00:00:00 2001 From: anarcat Date: Wed, 3 Oct 2018 11:43:58 -0400 Subject: [PATCH] Fix Docker invocation (#300) * 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 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 --- Dockerfile | 2 +- README.md | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1537a8b..5c1033c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ RUN mkdir /whipper COPY . /whipper/ RUN cd /whipper/src && make && make install \ && cd /whipper && python2 setup.py install \ - && rm -rf /whipper + && rm -rf /whipper \ && whipper -v # add user diff --git a/README.md b/README.md index ed50806..4ba9966 100644 --- a/README.md +++ b/README.md @@ -72,18 +72,22 @@ Whipper still isn't available as an official package in every Linux distribution You can easily install whipper by making use of the included Dockerfile without needing to care about the required dependencies: -`docker build -t whipper/whipper:0.7-git -t whipper/whipper:latest` +`docker build -t whipper/whipper` It's recommended to create an alias for a convenient usage: ```bash alias whipper="docker run -ti --rm --device=/dev/cdrom \ - -v ${PWD}/config:/home/worker/.config/whipper \ + -v ~/.config/whipper:/home/worker/.config/whipper \ -v ${PWD}/output:/output \ whipper/whipper" ``` -You should put this e.g. into your `.bash_aliases`. Also keep in mind to substitude the path definitions to something that fits to your needs (e.g. replace `… -v ${PWD}/output:/output …` with `… -v ${HOME}/ripped:/output \ …`). +You should put this e.g. into your `.bash_aliases`. Also keep in mind to substitute the path definitions to something that fits to your needs (e.g. replace `… -v ${PWD}/output:/output …` with `… -v ${HOME}/ripped:/output \ …`). + +Make sure you create the configuration directory: + +`mkdir -p ~/.config/whipper ${PWD}/output` Finally you can test the correct installation: