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

Official Dockerfiles #101

Open
mschfh opened this issue Oct 21, 2024 · 9 comments
Open

Official Dockerfiles #101

mschfh opened this issue Oct 21, 2024 · 9 comments
Assignees

Comments

@mschfh
Copy link

mschfh commented Oct 21, 2024

Please provide the official Dockerfiles used for building the docker images to allow Pull requests/contributions (such as envsubst for feature parity with the nginx images).

@VBart
Copy link
Contributor

VBart commented Oct 22, 2024

Note that envsubst is intentionally not supported, since it's considered a bad practice (see relevant discussion here).

@mschfh
Copy link
Author

mschfh commented Oct 22, 2024

It seems to me that two ways are valid - to use a configuration generator based on templates inside the image and environment variables or to rely entirely on the configuration mounted externally. But the hybrid option (mount, but then also modify) looks like a hack.

Maybe something was lost in the translation, but this just states that the specific workflow (mount+modify) is a bad practice (which I agree with).

For running the container on an orchestration platform, there is no good alternative as templating outside the container environment is not always an (easy) option, it can make sense to bake the config into the image, but inject certain variables (basic auth credentials, ACLs, etc) at runtime.

@lonerr
Copy link

lonerr commented Nov 2, 2024

@mschfh Thank you, so the use case actually looks like a workaround for the orchestration solution limitation.
However, the request is still quite valid. I hope we can implement something suitable, please stay tuned.

@lonerr
Copy link

lonerr commented Nov 15, 2024

Hi @mschfh
We'd love to hear your thoughts on the below approach:
https://git.angie.software/web-server/github-issue-101
Also, you can pull aarch64 image from our registry as docker pull docker.angie.software/angie:github-issue-101-aarch64

Can you have a look and/or try to build and play with the resulting image?
Hopefully the Dockerfile comments should be enough to get the idea, but please feel free to ask if they are not.
Looking forward for your feedback.

@karabanov
Copy link

The need to add the gomplate utility to the image is confusing - firstly, it is an additional dependency, and secondly, +64 megabytes to the image size

In addition, the option of changing the config on the fly at the time of container launch will not work if a read-only file system is used

Still, I would like Angie to automatically detect the presence of restrictions in Cgroup and launch workers in accordance with this restriction

@lonerr
Copy link

lonerr commented Nov 19, 2024

Still, I would like Angie to automatically detect the presence of restrictions in Cgroup and launch workers in accordance with this restriction

Please note that this particular issue (#101) is about template support in a broader sense but not only proper cpu constraints. This implies support for conditional blocks and loops (features that are obviously impossible with simple scalar substitutions).
Indeed, it seems like your original issue should be addressed by our development team. Let's continue the discussion in #105.
Thank you.

@karabanov
Copy link

Regarding template support - is it possible to embed a simple template engine (or maybe a complex one) into Angie that will allow values ​​from environment variables to be substituted into a template without resorting to third-party tools or shell scripts?

@VBart
Copy link
Contributor

VBart commented Nov 21, 2024

Regarding template support - is it possible to embed a simple template engine (or maybe a complex one) into Angie that will allow values ​​from environment variables to be substituted into a template without resorting to third-party tools or shell scripts?

What kind of engine or syntax do you suggest?

@karabanov
Copy link

If we are talking about adding a full-fledged template engine, then Go Tempaltes is widely used in cloud/containers environments, it is literally everywhere and will look organic

Jinja2 is also not bad, there is an implementation in C++

For the topic discussed within the framework of this issue, a simple replacement in the line will probably be sufficient.

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

4 participants