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

Container customisation parameters #27

Closed
hughbris opened this issue Jan 13, 2021 · 3 comments
Closed

Container customisation parameters #27

hughbris opened this issue Jan 13, 2021 · 3 comments

Comments

@hughbris
Copy link
Contributor

I've been wanting for a while to be able to pass parameters to docker run or docker-compose that allow me to add PHP libraries (like sqlite) or Grav plugins/themes. Mostly the former.

I guess this is more a docker image modification thing than something that can be added at runtime (container instantiation), but my understanding is limited and my attempts to research it have only added to my confusion. I'm yet to find good online Docker resources that address (what I assume) are common use cases like this.

Is there a way you know of? Otherwise I'm left with running my customisations in the container, or creating private image builds for each configuration I need (again, mostly a problem for PHP library packages).

@mabushey
Copy link

I use the git-sync plugin. I modified the Dockerfile to install git, and modified the init script to do a git clone using ENV vars for the repo/user/pass. This way the same container image can be called multiple times to pull up different sites in each container. git-sync commits everything in user, which includes user/plugins and user/themes.

PHP libraries would need to be added to the Dockerfile.

@dsavell
Copy link
Owner

dsavell commented Apr 15, 2021

Hello, will give some brief answers.

  1. PHP libs will require a custom image built from the Dockerfiles as it changes the operating system layer.
  2. Plugins and themes or any user specific data can be retained when pulling and rerunning a new image by using the following mount input: -v /data/containers/grav/user:/var/www/grav/user

@dsavell dsavell closed this as completed Apr 15, 2021
@hughbris
Copy link
Contributor Author

Thanks @dsavell and apologies for not replying much sooner when I realised my request was misguided. This is indeed necessarily part of the build process and not an option at runtime. New image tags would be the only way to provide optional PHP libraries. These would be limited to common combinations and are not a proper parameterised solution.

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

3 participants