Sign inSign up

viczn/colflickr

By viczn

•Updated over 8 years ago

A python program retrieving photos on Flickr.

Image
0

232

viczn/colflickr repository overview

Based on an example of the Docker intro book: a python program retrieving photos on Flickr. It accesses the photos in terms of categories and quantities given.

Dockerfile content: FROM python:2.7.15-alpine MAINTAINER Vic Zn [email protected]⁠

ENV ETAG dog ENV ECOUNT 10

COPY run_me.py /tmp COPY flickr.py /tmp

WORKDIR /tmp RUN mkdir -p /tmp/images CMD /usr/local/bin/python ./run_me.py $ETAG $ECOUNT

A shell script, images.sh, is good to run the program (with the given ETAG parameter array) and start the container to do the tasks: #!/bin/bash declare -a ETAG=("dog:10" "boy:8" "socker:50")

for i in "${ETAG[@]}" do arr1=$(echo $i | cut -d":" -f 1) arr2=$(echo $i | cut -d":" -f 2) docker run --rm -e ETAG=$arr1 -e ECOUNT=$arr2 -v $PWD/images:/tmp/images viczn/colflickr & done

To run the above shell script (please make it executable first): $ ./images.sh

Tag summary

Content type

Image

Digest

Size

26.4 MB

Last updated

over 8 years ago

docker pull viczn/colflickr