Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Latest version of ubuntu
FROM ubuntu:latest

# Default git repository
ENV GIT_REPOSITORY https://github.com/TheFox/flickr-cli.git

# Innstall git, php + other tools, the the app and remove the unneded apps
RUN apt-get update \
&& apt-get install --no-install-recommends -y php-bcmath php-curl php-simplexml composer git unzip \
&& git clone $GIT_REPOSITORY \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why clone the repo again, when it's already accessible locally?

If we're already suggesting people mount their flickr-cli directory as /mnt, could we do away with this clone, and change the entrypoint php arg to /mnt/application.php instead?

This would mean that the Docker set up could be used for people developing flickr-cli as well.

&& cd flickr-cli \
&& composer install --no-dev \
&& apt-get -y purge composer git unzip \
&& apt-get clean

VOLUME /mnt

WORKDIR /mnt

ENTRYPOINT ["php", "/flickr-cli/application.php"]
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ A command-line interface to [Flickr](https://www.flickr.com/). Upload and downlo
## Installation

1. Clone from Github:

git clone https://github.com/TheFox/flickr-cli.git

2. Update dependencies:

make

or

composer install --no-dev
2. Install dependencies:

composer install

3. Go to <https://www.flickr.com/services/apps/create/apply/> to create a new API key.
The first time you run `./application.php auth` you'll be prompted to enter your new consumer key and secret.
Expand Down Expand Up @@ -53,6 +49,31 @@ The hashes, which are the first two sets of two characters of the MD5 hash of th
are required in order to prevent a single directory from containing too many subdirectories
(to avoid problems with some filesystems).

## Usage of the Docker Image

Build the docker image:

docker build -t flickr-cli .

Run the ```application.php``` using the docker image built before:

docker run -it --rm -u $(id -u):$(id -g) -v $PWD:/mnt flickr-cli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a common usage of the docker setup would be to set up a quick command to upload a directory or backup one's Flickr photos, so perhaps we should give these commands more from that point of view? e.g. as they'd need to be entered as a command alias or similar. Or maybe we provide a launch script?


Get the access token (it will create ```config.yml``` file in current directory):

docker run -it --rm -u $(id -u):$(id -g) -v $PWD:/mnt flickr-cli auth


Upload directory ```2017.06.01-Spindleruv_mlyn``` full of JPEGs to Flickr:

docker run -it --rm -u $(id -u):$(id -g) -v $PWD:/mnt flickr-cli upload 2017.06.01-Spindleruv_mlyn --tags "2017.06.01 Spindleruv_mlyn" --sets "2017.06.01-Spindleruv_mlyn"

For Docker image troubleshooting you can use:

docker run -it --entrypoint=/bin/bash --rm -u $(id -u):$(id -g) -v $PWD:/mnt flickr-cli
or
docker run -it --entrypoint=/bin/bash --rm -v $PWD:/mnt flickr-cli

## Flickr API documentation

<http://www.flickr.com/services/api/>
Expand Down