dsavell / docker-grav

Docker Container for GRAV CMS
MIT License
42 stars 19 forks source link

Unable to exec bin/grav install on containers, git missing #66

Open hughbris opened 9 months ago

hughbris commented 9 months ago

One of the ways I create reproduceable builds these days is by using a .dependencies file in every Grav repo and running docker exec -u xyz container-name bin/grav install on every instance. Upgrades too.

Just tried this for the first time on a dsavell/grav container and got these errors on plugins that weren't already installed:

sh: 1: git: not found
ERROR cloning https://github.com/JulianSchoenbaechler/grav-plugin-zooming

I checked the Dockerfiles and indeed git is not installed, even in Admin (I thought Admin ran bin/grav install in the background??).

I can work around this of course, but it seems an essential part of container reproduceability and maintenance, and a surprising omission. It's all bloat, but would you consider adding it?

dsavell commented 9 months ago

Heya, sorry for the delay, can you try run the following command in the container bin/gpm install zooming instead of bin/grav install would like an output, however if Git is required I can indeed add this in, I just need some more examples as I am unable to reproduce.

On another note I am looking at overhauling this repository anyway with a new way of running / install grav itself, I will add this if this is still required aswell by then: https://github.com/dsavell/docker-grav/pull/68

dsavell commented 9 months ago

Alternatively an environment variable can be provided to support an installation of a plugin on boot -e GRAV_PLUGINS=zooming

hughbris commented 9 months ago

Heya, sorry for the delay

No worries. Thanks.

can you try run the following command in the container bin/gpm install zooming instead of bin/grav install

Alternatively an environment variable can be provided

The advantages of using a dependencies file over these methods though are:

On another note I am looking at overhauling this repository anyway with a new way of running / install grav itself

Funny, we seem to be pursuing many of the same ideas. I have been waiting for a working Nginx Unit base image from Serversideup to build something similar (and they are waiting on upstream fixes), am using your image in the meantime. Their base images look promising if you haven't seen them already.

hughbris commented 9 months ago

Oh another benefit of bin/grav install is being able to supply flags like --no-dev -o. Newer versions of my caddy image (not yet committed/pushed) allow this to be set with a build flag.

I do this with

ARG composer_args=--no-dev

and then

RUN composer install $composer_args -o

further down.

Edit: sorry, wasn't thinking clearly, oops this has nothing to do with git

dsavell commented 9 months ago

Not a problem, thanks for providing more context, I will look at adding Git into the container.