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

Docker as an installer method? #8

Closed
scottwalters opened this issue Jul 17, 2014 · 8 comments
Closed

Docker as an installer method? #8

scottwalters opened this issue Jul 17, 2014 · 8 comments

Comments

@scottwalters
Copy link

https://blog.linode.com/2014/01/03/docker-on-linode/

@hesco
Copy link

hesco commented Nov 18, 2014

Hey scrottie: I saw your presentation in Orlando. This is a project I would be willing to help with. I'm hosting folks on drupal these days, but would love to move them to a perl based cms instead (so I can be more useful in extending their sites w/o having to learn more php, at least). I have one high traffic site in mind as a test case. And I am now wrapping up a project of migrating our infrastructure onto docker hosts. It will still be a few weeks before I can come up for air for such a project. But please stay in touch with me on this.

@scottwalters
Copy link
Author

Hi hesco, awesome! Thanks for getting in touch. I'm going through a slow patch myself (and so was my collaborator, danny_mk) but I should be back on full time in a month here. The best way to keep in touch is to subscribe to the etcetra forum at http://webgui.org. We're on IRC too on #webgui on Freenode, but I'll post updates to the forums. Looking forward to it!

@scottwalters
Copy link
Author

@scottwalters
Copy link
Author

The installer script has been problematic for reasons largely not its fault. I had to disable CentOS support for the time being. Then, by far, most failures were Image::Magick failing to install. Next after that was Imager::File::PNG failing to install -- what we're switching to (we because Haarg started it), which is frustrating. Testing that for a long time on a lot of Linux distros and some OSX, various other modules fail on different versions of Perl. WebGUI requires a lot of them. The odds of success under the installer are slim. I intend to revisit that. More modularization that makes more modules optional would help immensely.

Anyway, I have the Image::Magick->Imager conversion nearly wrapped up (need to update Task::WebGUI and the installer so it doesn't try to use it and missed some stuff that was off to the side) so I took a stab at making a Docker container, and I have a rough version that seems to work. I posed that at https://hub.docker.com/r/scrottie/webgui8/.

hesco & everyone: Feedback on how to execute this well would be very much appreciated.

This is my build script:

docker commit -m "Attempt at a wG8 Docker file; you need to map port 80" -a "Scott Walters" 7b1bc8e7eee9 scrottie/webgui8:testing2
docker build -t scrottie/webgui8:testing3 .
echo 'run:'
echo 'docker run -i -t -p 81:80 scrottie/webgui8:testing3'

7b1bc8e7eee9 is interactive with a session attached to /bin/bash. I nursed the installer through in there. It's very close to what the installer does, except I modified /data/webgui.sh to skip starting nginx, and configured wG's plack process to listen directly on port 80 instead of 8081. I also added a proper shebang line as Docker seems to be touchy about interpreting any comment as a shebang line, whether or not a ! follows the #.

I can get you access to the linode I'm working on this stuff on if it helps.

@scottwalters
Copy link
Author

... and this is the Dockerfile:

FROM scrottie/webgui8:testing2 
CMD /bin/sh /data/webgui.sh
# PORTS 0.0.0.0:80->80    # host machine port -> listen port in image   ... doesn't actually work; unrecongized
EXPOSE 80       # apparently not what that's actually for; have to read some more docs
EXPOSE 8081
MAINTAINER Scott Walters <scott@slowass.net>

It looks like I can get it to build those automatically if I can reliably make the installer run all of the way through, but besides needed updates, it randomly just stops while installing modules and I have to kill it and restart it. Not sure what's up with that. Help getting that running would be appreciated too, though I have some work to do first.

@scottwalters
Copy link
Author

If anyone knows how to install Go libraries, this seems like the most promising way to squash Docker images correctly:

jwilder/docker-squash#28

I updated Docker Hub with a squashed image using the export/import method, but that has the disadvantage that the base image (Debian 8.1 in this case) gets combined in. docker-squash, if I can get it compiled, will combine everything except that.

squashing is desirable to get rid of large files such as the WebGUI .zip file, Debian .deb files downloaded for deps and the tool chain, cpanm working directories, etc that wind up in intermediate commits.

@scottwalters
Copy link
Author

New Docker image is up that fixes the problem where no asset (or likely many other) changes were committed to the database (newer mysqls started enforcing constraints which were previously ignored and were untenable).

Help automating Docker image generation would be appreciated, @hesco. The other major thing I need to get to is admin UI rework (JS), which @dannymk started (getting both of us together at the same time has been a challenge). If you can help automate Docker image builds, please open another ticket. The new Docker image I uploaded is based on the 'perl' image which is based on a Debian image.

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

No branches or pull requests

2 participants