Skip to content

Instantly share code, notes, and snippets.

@veesa
Created July 25, 2016 09:02
Show Gist options
  • Save veesa/2a8e4aecb12c7e4c808716a306d03c37 to your computer and use it in GitHub Desktop.
Save veesa/2a8e4aecb12c7e4c808716a306d03c37 to your computer and use it in GitHub Desktop.
Sample Dockerfile for PeARS
FROM debian:latest
MAINTAINER Veesa Norman <[email protected]>
RUN apt-get update && apt-get install -y apt-utils && apt-get install -y git
CMD git clone -b development https://github.com/PeARSearch/PeARS.git
CMD cd PeARS
RUN apt-get install -y python-pip
CMD pip install requirements.txt
CMD apt-get install -y wget
CMD wget http://clic.cimec.unitn.it/~aurelie.herbelot/openvectors.dump.bz2
CMD ./uncompress_db openvectors.dump.bz2
EXPOSE 5000
CMD cd ~/PeARS
CMD ["/usr/bin/python2", "./run.py", "-D"]
@justinrlle
Copy link

I just ran into your Dockerfile, and I see one problem : you should have only one CMD instruction, because only the last CMD instruction will be ran.

There can only be one CMD instruction in a Dockerfile. If you list more than one CMD then only the last CMD will take effect
The docker documentation

So, instead of having multiples CMD, do all the commands in RUN instructions. And to avoid having to much layers, chain your commands with &&. So you'll have RUN apt-get update && apt-get install -y apt-utils && apt-get install -y git python-pip wget, RUN git clone -b development https://github.com/PeARSearch/PeARS.git && cd PeARS, and so on.

Hoping it will help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment