[TriLUG] Docker issue

Mauricio Tavares via TriLUG trilug at trilug.org
Fri Sep 17 06:32:51 EDT 2021


On Fri, Sep 17, 2021 at 12:21 AM Brian McCullough <bdmc at bdmcc-us.com> wrote:
>
> On Thu, Sep 16, 2021 at 10:31:57PM -0400, Mauricio Tavares wrote:
> > On Thu, Sep 16, 2021 at 4:15 PM Brian McCullough via TriLUG
> > <trilug at trilug.org> wrote:
> > >
> > > Folks,
> > >
> > > All of the containers appear to rebuild when I do "build --no-cache",
> > > except the DB container.
> > >
> >       Is the database always created/populated when container is built
> > or it is stored in a separate volume that is then connected at
> > runtime?
>
> Thank you, Mauricio.
>
> Since I wrote this, I have tried a few things, including destroying the
> whole "/var/lib/docker/container-xxx-db/" directory path.  After I did

      Does the database exist only inside the container or it is in a
volume which is handed over to container at runtime?

> that, I got complaints about not being able to re-create things and
> discovered that everything there was owned by root.  I changed ownership
> to myself, since I was the one running the docker command.
>
      You may want to check if your user belongs to the docker group.

> Things appear to have been re-created properly, except....
>
>
>
> > > I also tried "rm db" but that didn't seem to do any more than re-build,
> > > which just seems to reload the SQL scripts.  Unfortunately, MySQL is
> > > complaining ( logs db ) that the ( one of the ) database files is
> > > corrupt.
> > >
> >       I take that means a DB rebuild relies on these SQL scripts to
> > populate it. Are said scripts run from a Dockerfile or a script (like
> > entrypoint)? If I were in your shoes, I would disable the running of
> > said scripts, then build and run DB container, and then run each SQL
> > script manually to find out where it goes boink (and figure out if it
> > is a docker or a script issue).
>
> Originally, the physical MySQL file was apparently corrupted, but since
> destroying everything, things are much better.   B-)
>
      Good to hear

> The scripts reside inside the source code ( web stuff, PHP ) that is
> trying to run in the Apache container, which depends on the database.
>
> At this point, I suspect that I am trying to run off the wrong branch,
> one that is incompatible with the Docker setup, so I will be
> investigating that further.  The most obvious evidence of that, to me,
> is that the log is complaining about missing tables and columns, so I
> think that the "initialization scripts" are not quite right.
>
      AFAIK, mysql *should* handle commands done for older versions.
You probably can either copy the scripts to the docker container and
run from there or modify the apache one to stop doing things just
before running the script and then run that container and run the
scripts manually, one at a time, from inside it.
>
> Thanks again,
> Brian
>
>


More information about the TriLUG mailing list