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

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

Open
hughbris opened this issue Jan 30, 2024 · 5 comments
Open

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

hughbris opened this issue Jan 30, 2024 · 5 comments

Comments

@hughbris
Copy link
Contributor

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
Copy link
Owner

dsavell commented Feb 19, 2024

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: #68

@dsavell
Copy link
Owner

dsavell commented Feb 19, 2024

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

@hughbris
Copy link
Contributor Author

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
Copy link
Contributor Author

hughbris commented Feb 20, 2024

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
Copy link
Owner

dsavell commented Feb 20, 2024

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

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