-
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
Conversation
|
@ruzickap This is a good idea. I actually dockerized some of my projects, and I would rather use a template from another project. And I want to push it to /u/thefox21 Docker Hub. |
samwilson
left a comment
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.
This is a great idea!
And I've just realised that my comments here are wrong, in that of course we should include the git clone in the image, because then we're not relying at all on the original clone (which can be removed entirely).
So I think the only required change here is to add some more info to the readme, explaining that after building the image, you can delete the source and the docker run command should be run from whereever (with $PWD substituted for your config.php directory).
If you see what I mean? :-) Sorry for being confusing.
| # 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 \ |
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.php instead?
This would mean that the Docker set up could be used for people developing flickr-cli as well.
|
|
||
| Run the ```application.php``` using the docker image built before: | ||
|
|
||
| docker run -it --rm -u $(id -u):$(id -g) -v $PWD:/mnt flickr-cli |
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.
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?
|
I'm currently creating a Dockerfile for that. But the problem with |
|
It's possible to add another volume for do |
|
I believe in the future the owner of the repository (application) will bind the repository with Dockerhub so the docker image will be built there. Then the section about building the container can be removed from |
Yes, this is also my solution. Another problem with Docker is that |
|
I have now pushed the current development version to Docker Hub as |
|
Hello. I'm not sure about the "quality" of the Dockerfile you merged - it's not done the way how the containers should be created. If you compare your "Docker repository" (https://hub.docker.com/r/thefox21/flickr-cli/) with for example this one "https://hub.docker.com/r/phpmyadmin/phpmyadmin/" you can see the 'tabs' likke "Dockerfile" and "Build Details". In these tabs you can see the real Dockerfile which was used to build the image (including build details). In your case - you put the the Docker image of "flickr-cli" manually and there is no way how to check what is it really in the the docker image. These manually created / pushed docker images may contain some "bad software" hidden inside docker image and a lot of people refuse to run them. Therefore I prefer to do it the way like it is done for example in phpmyadmin. |
|
I think an automatically built one sounds good; gives people better security. And so should we document the Docker deployment as the preferred way of using flickr-cli? i.e. how to install it, how to upgrade, etc. I'd love to see it as simple as ending up with a |
|
I agree with updating the documentation: how to use the the "dockerized flicker-cli" for the users. The developers usually know how to work with docker, how to build docker image, etc... - so it's not necessary to write something like that into the "readme". Here is the example of the docker repository how it should look like for your flickr-cli Docker Hub account and GitHub repository when "Automated Build" is enabled: https://hub.docker.com/r/peru/flickr-cli/ @TheFox should do something like that for his Docker Hub: https://hub.docker.com/r/thefox21/flickr-cli/ |
|
Ah, I see. Thank you for the input. I appreciate that. I now changed the Docker Hub repo. See https://hub.docker.com/r/thefox21/flickr-cli/ Please use the current When everything works as expected I will release v1.2.0, which will then be build automatically on Docker Hub. For further feedback regarding to the Dockerization feel free to report it here. :) |
|
Looks like when using the docker volumes they are mounted read only ( I do not know why... :-( |
|
This is very strange. While I wrote this documentation it worked as expected. But now, on a separate PC, I also have this issue. I guess this is because of |
|
@ruzickap I fixed the permissions. Please pull the latest develop and test it again. |
|
The In case of upload command I have to specify the config path using The test command looks like: So you have to change the commands in |
|
Ok... |
|
Excellent work :-) |
|
Thank you. :) And also thank you for testing. |
I would like to "dockerize" the application, because it has quite a lot php dependencies which I prefer to have inside docker image only.
This is initial commit for creating the Docker image.