Is the custom container available on docker Hub? I can’t see one with that name.
If not, I assume I have to build it. If I have to do that, why do you pass the apps.json file in through a base 64 encoded environment variable, rather than just ADD it in as a plain file?
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.
I’m not suggesting this for me (now I have a better idea how it works, I can do that for myself). I’m suggesting it to improve the code, and make it easier to understand and use for the next person.
will it be as simple as making a restapi call and getting an image ready? I wish to use it part of ci only. I don’t do manual builds.
if you are willing, send a PR and after it’s merged answer the questions related to image building. At least for now there are many successful builds without the changes you prefer.
If I’m the only person who is going to answer docker related questions and maintain the repository then you’re stuck with this. I’m not going to change anything.
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
I’ll not be able to explain you. May be someone else can help.
in brief
CI Runner builds the image
CI runner push to your private registry
Use it anywhere from your registry
CI runners have ReST API based triggers to start this build and push process
CI runners can take inputs from the rest api request and customise your build
For custom cases, use your own files
For most cases, kaniko can be used. it can use git repo as context instead of local clone and copy, only dynamic change here is your apps.json which can be passed as env var.
@JRU said “makes sense” here. Can you help? If you’ve tried image building and it makes sense then can you help in clearing the confusion here?
I am not deep enough into the topic myself to add much here.
But I found the process of building the custom Image pretty straight forward.
My steps where:
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?
Thankyou both for your replies. I now have a volunteer who knows a lot more about Docker, and will no doubt teach me how to use it properly. Things may start to make more sense to me after that!