harmony icon indicating copy to clipboard operation
harmony copied to clipboard

WIP - simplify dockerfile as much as possible

Open dylanwh opened this issue 5 years ago • 4 comments

This is a work in progress, but the end goal is to have a docker container that runs the bugzilla.pl command (and have bugzilla.pl gain a checksetup sub-command).

Most of the changes in this PR are to ensure we don't try connecting to the database during startup/compilation.

dylanwh avatar Sep 07 '20 18:09 dylanwh

~~What's here now currently fails, but for a rather interesting reason:~~

obsolete error message
Step 11/21 : RUN apt-file update
 ---> Running in 52abc8924c55
Hit:1 http://deb.debian.org/debian buster InRelease
Hit:2 http://deb.debian.org/debian buster-updates InRelease
Hit:3 http://security.debian.org/debian-security buster/updates InRelease
Err:1 http://deb.debian.org/debian buster InRelease
  At least one invalid signature was encountered.
Err:2 http://deb.debian.org/debian buster-updates InRelease
  At least one invalid signature was encountered.
Err:3 http://security.debian.org/debian-security buster/updates InRelease
  At least one invalid signature was encountered.
Reading package lists...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.debian.org/debian buster InRelease: At least one invalid signature was encountered.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.debian.org/debian buster-updates InRelease: At least one invalid signature was encountered.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.debian.org/debian-security buster/updates InRelease: At least one invalid signature was encountered.
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  At least one invalid signature was encountered.
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  At least one invalid signature was encountered.
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  At least one invalid signature was encountered.
W: Some index files failed to download. They have been ignored, or old ones used instead.
Removing intermediate container 52abc8924c55

justdave avatar Jan 19 '21 05:01 justdave

nevermind, that was because I ran out of disk space.

justdave avatar Jan 19 '21 07:01 justdave

OK, now it builds, but running it doesn't work.

`docker run` output
dave@mini:~$ docker run 6ffb5c3c0c32
Usage: APPLICATION COMMAND [OPTIONS]

  mojo version
  mojo generate lite-app
  ./myapp.pl daemon -m production -l http://*:8080
  ./myapp.pl get /foo
  ./myapp.pl routes -v

Tip: CGI and PSGI environments can be automatically detected very often and
     work without commands.

Options (for all commands):
  -h, --help          Get more information on a specific command
      --home <path>   Path to home directory of your application, defaults to
                      the value of MOJO_HOME or auto-detection
  -m, --mode <name>   Operating mode for your application, defaults to the
                      value of MOJO_MODE/PLACK_ENV or "development"

Commands:
 cgi              Start application with CGI
 cpanify          Upload distribution to CPAN
 daemon           Start application with HTTP and WebSocket server
 eval             Run code against application
 generate         Generate files and directories from templates
 get              Perform HTTP request
 inflate          Inflate embedded files to real files
 move-flag-types  Move flag types
 prefork          Start application with pre-forking HTTP and WebSocket server
 psgi             Start application with PSGI
 report-ping      send a report ping to a URL
 revoke-api-keys  Revoke api keys
 routes           Show available routes
 version          Show versions of available modules

See 'APPLICATION help COMMAND' for more information on a specific command.

justdave avatar Jan 19 '21 07:01 justdave

Conversation lifted off IRC:

1:34:38 AM <justdave_> ok, docker run -ti --rm --expose 8080 -p 8080:8080 bugzilla daemon -m production -l 'http://*:8080' seems to work just fine 1:34:47 AM <justdave_> I think it's the -p 8080:8080 that does the trick 1:35:13 AM <justdave_> with that in, I can hit http://127.0.0.1:8080/ in my browser and get the puking dino 1:35:33 AM <justdave_> which I'm assuming is because there's no DB configured since it does a skip-db-config on the setup 1:38:48 AM <justdave_> so basically if we want to have this working out of the box for people to play with in Docker, we want to have a companion Dockerfile for a MariaDB server and a docker-compose.yml that ties those two together 1:39:18 AM <justdave_> the existing docker-compose.yml should go somewhere as a sample since it's for a much fancier setup that cannot work without external dependencies... :) 1:57:21 AM <justdave_> ok, looking at this, I think maybe we need to use entrypoint.pl for the entrypoint still, and clean out the bmo-specific stuff out of it 1:58:10 AM <justdave_> there's bunches of things other than running the webserver that it can do, like running the jobqueue and an interactive run of checksetup.pl and so forth 1:59:24 AM <justdave_> with the proposed Dockerfile, it can't do anything but run the mojo webserver

justdave avatar Feb 03 '21 07:02 justdave