Skip to content
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

Add Docker support #72

Merged
merged 1 commit into from
Jul 19, 2015
Merged

Add Docker support #72

merged 1 commit into from
Jul 19, 2015

Conversation

pataquets
Copy link
Collaborator

  • Dockerfile initial version
  • Environment-sourcing config file

How to test:

$ docker run -d --name=redistest redis redis-server
$ docker run -d --name=phpredisadmin -e ADMIN_USER=admin -e=ADMIN_PASS=admin -e REDIS_1_HOST=redis --link=redistest:redis -p 80:80 pataquets/phpredisadmin

After these, browse to http://localhost

If merged, I can help with either:

  • Setting up a public Docker Hub image
  • Link upstream Github repo to my Docker Hub account

With any of these, an 'automated build' can be set up on Docker Hub that will trigger an image rebuild on each Github commit.

erikdubbelboer added a commit that referenced this pull request Jul 19, 2015
@erikdubbelboer erikdubbelboer merged commit 99ba128 into erikdubbelboer:master Jul 19, 2015
@erikdubbelboer
Copy link
Owner

I have never really done anything with Docker so if you could set up these things that would be great.

@pataquets
Copy link
Collaborator Author

Tried it, but I would need access to Github repo to set up an automated build. Perhaps having read only access would do. What needs to be done:

  • Create an user account at http://hub.docker.com and link a Github account with access to phpRedisAdmin repo.
  • [Optional, but preferred] Create an organization at Hub, to allow others help manage the builds and give a better naming to the Docker image (example image names: ErikDubbelboer/phpRedisAdmin vs. phpRedisAdmin/phpRedisAdmin).
  • Set up an automated build under the org account.

Let me know if you need any help.

@erikdubbelboer
Copy link
Owner

I have added you as collaborator. Does this give you enough access?

@pataquets
Copy link
Collaborator Author

Tried it hard, but no way to create the automated build. :(
Permission to add RSA deployment keys is needed.

@erikdubbelboer
Copy link
Owner

I don't think that's access I can give without moving the repo to some organization account I think. Would it be possible to email me which keys to add?

@pataquets
Copy link
Collaborator Author

Hi @erikdubbelboer. Back then I looked how to do that and found no way. Checked again just now and looks the same. I think that no keys you send me will allow me setup the build. Docker Hub adds the keys to Github as part of its Automated Build creation wizard, and I haven't found anywhere to set them manually.
Although I've found a phpredisadmin/phpredisadmin image on Docker Hub (and assuming you're the owner), it's not an Automated Build. Doing a docker search phpredisadmin shows that most other are ABs. Being ABs provides verifiability of image build and contents and thus makes it appear more trustworthy. How about making yours an AB?
See https://docs.docker.com/docker-hub/builds/ for the howto (it's a quick 5 min process), and ping me if if I can be of any help.

@erikdubbelboer
Copy link
Owner

I have never done anything with Docker before so it's not my image :)

@pataquets
Copy link
Collaborator Author

Ops. Are you interested in that specific username? We can ping the owner and ask him/her to host there the build-from-this-repo Automated Build (I've done this previously for OpenResty). Another alternative is to publish it under erikdubbelboer/phpredisadmin. Fancy to register it yourself?

@erikdubbelboer
Copy link
Owner

I have never done anything with Docker before. I have no idea how many people are waiting for a docker image of phpRedisAdmin and if it's worth the effort.

@pataquets
Copy link
Collaborator Author

Docker usage is quite on the rise nowadays and lots of people who want to use any piece of software often start by looking if it is available as a Docker image. Also, with a small effort a new no-frills (just Docker) distribution/packaging method is added. And also eases onboarding to Docker-aware devs, too.
But, no obligation, in any case :) I already have an image on Docker Hub, but it's maintained (pulled from upstream) on an as-needed basis, and having an 'official' one (especially in the docs) will avoid people using outdated or modified versions unawarely.

@pataquets
Copy link
Collaborator Author

@erikdubbelboer ping

@erikdubbelboer
Copy link
Owner

I created https://hub.docker.com/r/erikdubbelboer/phpredisadmin/
Anything else that should be done?

@pataquets
Copy link
Collaborator Author

pataquets commented Jan 10, 2018

Hi @erikdubbelboer. Sorry for the delay into getting back to you, I missed your answer notification. My apologies. Thanks for the patience and effort in setting everything up.
I've added a Docker Compose manifest to make even easier to develop & test the software.

The Docker Hub's AB repo looks good, but since you created it, an automatic 'map git tags & branches to Docker image tags' feature has been made available. Since I see a '1.8.0' but no matching '1.9.0' image tag on Hub, you might want to take a look to the image build configuration options: https://hub.docker.com/r/erikdubbelboer/phpredisadmin/~/settings/automated-builds/
Just make 'latest' image tag point to 'master' git branch and make sure there is the empty entry which will create matching image tags for any git tags and branches. See screenshot of an image of mine:
imatge
This will make the AB building image tags as easy and automatic as possible. Hands-free, set it and forget it image tags for new versions.

Also, either contacting the https://hub.docker.com/r/phpredisadmin/phpredisadmin/ user owner via support helpdesk to transfer the username ownership (I've done it already for OpenResty) or warning about it not being official someway in the docs might be in order, if you feel like it. Anyway, the docs already point to your user's image.

@erikdubbelboer
Copy link
Owner

I have changed the automated build to what you said but instead of Branch I chose Tag as I don't use branches for releases but only tags.
screen shot 2018-01-11 at 14 17 25
I just pushed 1.10.0 but it doesn't build anything automatically it seems? Github is correctly linked with my docker account so that's not it. I also don't understand why that option doesn't have a Trigger button?
I can add you as collaborators on docker if that's useful? I would need your username for this.

As for contacting https://hub.docker.com/r/phpredisadmin/phpredisadmin/ how would I do this? I don't see any contact information or even any way to report this to docker without starting to pay for support.

@pataquets
Copy link
Collaborator Author

pataquets commented Jan 12, 2018

I'm not sure if you can restrict image building to only tags the way you've done, never done it myself. If you're sure to have pushed the tag after setting this up that way, maybe it's not supposed to work that way.
From my usage of that config screen, I've come up with the opinion that the build settings UX it's not the most intuitive or useful at all times, such as for building individual tags as you wanted. Perhaps the tag-only building it's not a supported feature, nor supposed to work that way, but the UX induces to think so.
If you're not using branches, I would just ignore it and delete the last empty line and re-add it again as an empty one without touching anything else. The worst you might have is some image tags based on branches if you happen to use one (perhaps ends up being useful, think feature-branches builds!).

And for the user name, I was just suggesting to contact Docker Hub's support helpdesk, since I'm aware of no public contact method. I did it in the past to recover the unused 'openresty' user that way (see openresty/docker-openresty#4). But it's not a hard requirement, just trying to get the most obvious user name and avoid people getting confused by the wrong image if googling.

@erikdubbelboer
Copy link
Owner

I'm sorry but that docker build system seems completely broken. I tried all kinds of settings now and none work. Builds never automatically trigger and the Tigger only seems to be available for the master branch. I'm not going to bother spending time on a broken system anymore. I'll just have to remember to press that button each time I push something I guess :(

@pataquets
Copy link
Collaborator Author

It's not the best UX out there, but it's not broken, though. :)
I would just leave configured as the screenshot I've sent you and let next git pushes do their magic. No need to press any button in the future for this to work. You willl not need to visit this site anymore, even you can forget about it in the future.
I can help you also if you add me as collaborator on DH, but I wonder if you're fed enough with it to take the hassle. Recommending the simplest, above option.

If you want to have a 1.10 image tag, just temporarily add a specific, one-time, explicit configuration row and use it to push its 'Trigger' button. Delete it afterwards and leave everything as suggested to let it work automagically from now on.

@erikdubbelboer
Copy link
Owner

I changed it to exactly as your screenshot says. I just pushed version 1.10.1 to test this. But it doesn't seem to trigger any build so far.

What is your username on docker so I can add you as collaborator.

I manually did 1.10.0 as you said and at least that worked :)

@pataquets
Copy link
Collaborator Author

Ops, that doesn't sounds good :S
I'm also pataquets on DH.

@erikdubbelboer
Copy link
Owner

I have added you as collaborator. You can have a look at the settings, let me know if you want me to push a new version so you can test them.

@pataquets
Copy link
Collaborator Author

@erikdubbelboer : I see no extra settings or configuration screen thru which I can help you on Docker Hub :( Neither on Github, which I also checked, just in case.
Took a look again after you pushed the 1.10.2 tag. Whoa, this keeps me puzzled. Looks like DH has gone mad and something is wrong with the settings. I would suggest you to completely delete the AB on DH and create it again, since it usually works without further configuration, even branch & tag image builds work with the AB defaults.
I've created a few hundreds of ABs and I remember a few times DH acted weirdly, and UX is sometimes poor, but unfortunately it's the go-to public registry for Docker. :(

@erikdubbelboer
Copy link
Owner

I have recreated the repository and added you as collaborator again. I have only clicked the Trigger button to have a least one build. I don’t dare to do anything else!

@pataquets
Copy link
Collaborator Author

Checked and confirmed. However, according to https://docs.docker.com/docker-hub/repos/ looks like collaborators aren't too useful, compared to orgs. I would leave it as is now and see how it goes next time you push a new tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants