File tree Expand file tree Collapse file tree 5 files changed +28
-11
lines changed
Expand file tree Collapse file tree 5 files changed +28
-11
lines changed Original file line number Diff line number Diff line change 11FROM ubuntu:16.04
2- MAINTAINER Rob Kooper <
[email protected] >
32
43# environment variables
54ENV RABBITMQ_URI="" \
Original file line number Diff line number Diff line change 11FROM clowder/pyclowder:2
22
3- # copy all files
4- ONBUILD ADD . /home/clowder/
5-
63# install any packages
7- # ONBUILD COPY packages.apt /home/clowder/
4+ ONBUILD COPY packages.* Dockerfile /home/clowder/
85ONBUILD RUN if [ -e packages.apt ]; then \
96 apt-get -q -q update \
107 && xargs apt-get -y install --no-install-recommends < packages.apt \
118 && rm -rf /var/lib/apt/lists/*; \
129 fi
1310
1411# install any python packages
15- # ONBUILD COPY requirements.txt /home/clowder/
12+ ONBUILD COPY requirements.txt* Dockerfile /home/clowder/
1613ONBUILD RUN if [ -e requirements.txt ]; then \
1714 pip install --no-cache-dir -r requirements.txt; \
1815 fi
1916
17+ # copy all files
18+ ONBUILD ADD . /home/clowder/
19+
2020# switch to user clowder last minute
2121ONBUILD USER clowder
2222
Original file line number Diff line number Diff line change @@ -202,4 +202,24 @@ an extractor or code that interacts with clowder. One of these functions is setu
202202logging system for you. The logging function takes a single argument that can be None. The argument is either a pointer
203203to a file that is read with the configuration options.
204204
205- # files
205+ ## files
206+
207+ # Dockerfile
208+
209+ We recommend using the pyclowder: onbuild to easily convert your extractor into a docker container. If you build the
210+ extractor as commented above, you will only need the following Dockerfile
211+
212+ ```
213+ FROM clowder/pyclowder:onbuild
214+
215+ ENV MAIN_SCRIPT="wordcount.py"
216+ ```
217+
218+ The main piece is the MAIN_SCRIPT which should point to the python file that holds your main function.
219+
220+ If you need additional packages installed, you will need a file called packages.apt with in this file a list of all
221+ packages that need to be installed. The docker build process will use this file to install those pacakges first in
222+ the docker container.
223+
224+ If you need any python packages installed you will need to create file called requiremenets.txt. If this file exists
225+ the docker build process will use ` pip install -r requirements.txt ` to install these packages.
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ if [ "$1" = 'extractor' ]; then
2121 echo " Main script specified does not exist."
2222 exit -1
2323 fi
24- chmod 755 " ${MAIN_SCRIPT} "
2524
2625 # check to make sure rabbitmq is up
2726 if [ " ${RABBITMQ_PORT_5672_TCP_ADDR} " != " " ]; then
@@ -35,7 +34,7 @@ if [ "$1" = 'extractor' ]; then
3534 fi
3635
3736 # launch extractor and see what happens
38- exec " ./${MAIN_SCRIPT} "
37+ exec " python ./${MAIN_SCRIPT} "
3938fi
4039
4140exec " $@ "
Original file line number Diff line number Diff line change 11FROM clowder/pyclowder:onbuild
22
3- ENV RABBITMQ_QUEUE="ncsa.wordcount" \
4- MAIN_SCRIPT="wordcount.py"
3+ ENV MAIN_SCRIPT="wordcount.py"
You can’t perform that action at this time.
0 commit comments