-
Notifications
You must be signed in to change notification settings - Fork 9
Add Dockerfile + docker usage #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 \ | ||
| && 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"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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/> | ||
|
|
||
There was a problem hiding this comment.
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.phpinstead?This would mean that the Docker set up could be used for people developing flickr-cli as well.