-
Notifications
You must be signed in to change notification settings - Fork 601
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
feat(docker): update Dockerfiles to use ENTRYPOINT instead of CMD #1016
base: master
Are you sure you want to change the base?
Conversation
… cross-platform compatibility - Updated Dockerfile and hardware.Dockerfile syntax to `docker/dockerfile:1.4` for enhanced features and performance. - Introduced `--link` option in COPY commands to optimize layer caching and reduce image size. - Added a new `entrypoint.sh` script for dynamic configuration and validation of environment variables, improving container startup flexibility. - Included `yq` utility in the base images to facilitate YAML file manipulation within the container, enhancing configuration management capabilities. - Specified `--platform=linux/amd64` for base images to ensure consistent cross-platform builds, addressing potential compatibility issues on multi-architecture setups. - Modified ENTRYPOINT to utilize the new entrypoint script, enabling pre-execution configuration checks and setting a default configuration if none is provided. - The addition of `yq` and changes to the entrypoint mechanism provide a more robust and user-friendly setup process, potentially affecting existing workflows that rely on manual configuration file adjustments. These changes aim to improve maintainability, efficiency, and user experience by leveraging newer Docker features, automating configuration tasks, and ensuring broader compatibility across different computing environments.
Why we need to create config file? User can set default port just via command line |
Config file is not set - error only when user set config as string. It's planned behaviour. |
anyway, other reasons still significant:
|
Both this instruments can be used to set port |
This all requires a separate configuration from user, not a default behavior for go2rtc container |
No. 2nd can be used in raw docker compose file. Without any file config |
- Removed `yq` installation from Dockerfile to reduce image size. - Simplified default configuration file creation in entrypoint.sh by directly writing YAML content, eliminating the need for `yq`. - Removed `yq` installation step from hardware.Dockerfile and adjusted file copying accordingly.
Simplify the entrypoint script by removing the creation of a default configuration file if it doesn't exist. Instead, directly pass the default API listen port configuration to the `go2rtc` command, while still allowing custom configurations through the existing `CONFIG_PATH`. This change ensures that the service can start with default settings without needing to write them to a file, simplifying deployment and configuration management.
entrypoint.sh
script for dynamic configuration and validation of environment variables, improving container startup flexibility.yq
utility in the base images to facilitate YAML file manipulation within the container, enhancing configuration management capabilities.--platform=linux/amd64
for base images to ensure consistent cross-platform builds, addressing potential compatibility issues on multi-architecture setups.