docker-grav icon indicating copy to clipboard operation
docker-grav copied to clipboard

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

Open hughbris opened this issue 1 year ago • 5 comments

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?

hughbris avatar Jan 30 '24 00:01 hughbris

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 avatar Feb 19 '24 22:02 dsavell

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

dsavell avatar Feb 19 '24 22:02 dsavell

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:

  • ability to select alternate repository locations - I often use my own forks or plugins/themes not in official repos
  • .dependencies file is part of my standard site repository layout and compose file is not, so adding custom environment vars would be a manual tweak

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 avatar Feb 19 '24 23:02 hughbris

~~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

hughbris avatar Feb 20 '24 00:02 hughbris

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

dsavell avatar Feb 20 '24 21:02 dsavell