A ideia do post não é explicar como funciona ou o que é o Docker, pois há inumeros tutorias e conteúdos na internet explicando muito bem o que é o Docker. Sendo assim, para rodar o Dockerfile apresentado abaixo em sua máquina, será preciso ter o Docker instalado previamente em seu ambiente.
Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04
MAINTAINER likang
#instalando python e scrapy
RUN apt-get update
RUN apt-get install -y python python-pip python-dev libxml2-dev libxslt-dev libffi-dev libssl-dev
RUN pip install lxml && pip install pyopenssl && pip install Scrapy && pip install service_identity
#instalando o git
RUN apt-get install -y git
#criando uma pasta para o projeto scrapy
RUN mkdir /scrapyguj
#clonando projeto
RUN cd /scrapyguj; git clone https://github.com/LeoCBS/guj.git
#rodando scrapy
WORKDIR /scrapyguj/guj
CMD ["scrapy", "crawl", "java", "-o items.json"]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
MAINTAINER likang | |
#instalando python e scrapy | |
RUN apt-get update | |
RUN apt-get install -y python python-pip python-dev libxml2-dev libxslt-dev libffi-dev libssl-dev | |
RUN pip install lxml && pip install pyopenssl && pip install Scrapy && pip install service_identity | |
#instalando o git | |
RUN apt-get install -y git | |
#criando uma pasta para o projeto scrapy | |
RUN mkdir /scrapyguj | |
#clonando projeto | |
RUN cd /scrapyguj; git clone https://github.com/LeoCBS/guj.git | |
#rodando scrapy | |
WORKDIR /scrapyguj/guj | |
CMD ["scrapy", "crawl", "java", "-o items.json"] |