ADD / COPY needs the full context to be available. That means you need that repo locally and the file to be ADD/COPY need to be in the repo.
If we add such file in repo then it will be static, If I need to add few apps to this file, I’ll need to fork the repo and maintain it.
if you directly pass stringified json as env var there are high chances of it not getting converted back into json because of shell escape characters, base64 ensures the data remains shell env var friendly
Also, I wasn’t suggesting you add apps.json to the repo - like the .env file, I was thinking you could have an example one to copy from. It just seems easier for a new person wanting to fire up a container to copy an example file and edit it, than to create an obscure BASE65 string environment variable from a file.
Also have a apps.json in your repo. It is just a dockerfile, if you know and use docker you can use it, modify it. In some cases I’m copying the cloned apps in the image and doing bench setup requirements you can do anything you wish.
If you don’t have a repo, have a local directory somewhere and make changes there.
What’s a restapi call, please? And what has it to do with loading a docker image?
My logic is:
The custom Container is not available on DockerHub (as far as I can see). The only way I know of (in my ignorance) to build it is to:
Make a copy of it in a directory, renaming it Dockerfile
Make a copy of the resources directory as a subdirectory
Add build: <the directory name> to your docker-compose.yml file
If you do that, then why jump through the hoops of creating an apps.json, base64 encoding it, and adding the result to an environment variable. Why not just put the apps.json in the resources folder, and ADD or COPY it into the container?
However, I imagine there is some clever alternative way of building your images, which requires them to be in the directory structure in which you supply them. Don’t know what it is, or how it works, though
Also I wanted to add, I am not using compose here which builds on top of the image.
So for this Additional step I can not speak, but I would say the same questions apply.
What is the current Process and what would change?