{"id":24811100,"url":"https://github.com/thin-edge/tedge-container-bundle","last_synced_at":"2025-09-11T23:15:46.864Z","repository":{"id":243237992,"uuid":"811858753","full_name":"thin-edge/tedge-container-bundle","owner":"thin-edge","description":"thin-edge.io. s6-overlay container setup to run all the components in a single container","archived":false,"fork":false,"pushed_at":"2025-03-25T13:20:22.000Z","size":1286,"stargazers_count":0,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-01T12:50:43.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thin-edge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-07T12:55:02.000Z","updated_at":"2025-03-25T13:04:40.000Z","dependencies_parsed_at":"2024-06-07T14:47:11.258Z","dependency_job_id":"a2c1b5e3-cbf9-44f3-b634-d13d56aee806","html_url":"https://github.com/thin-edge/tedge-container-bundle","commit_stats":null,"previous_names":["thin-edge/tedge-container-bundle"],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Ftedge-container-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Ftedge-container-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Ftedge-container-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Ftedge-container-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thin-edge","download_url":"https://codeload.github.com/thin-edge/tedge-container-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248449950,"owners_count":21105590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-30T12:19:18.501Z","updated_at":"2025-09-11T23:15:46.839Z","avatar_url":"https://github.com/thin-edge.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tedge-container-bundle\n\nThis project contains a container definition which configures all of the thin-edge.io components (including mosquitto) in a single container using the lightweight, container friendly init system, [s6-overlay](https://github.com/just-containers/s6-overlay).\n\n[s6-overlay](https://github.com/just-containers/s6-overlay) is an init system which is designed to run multiple processes in a single container. It starts and supervises each service, in addition to supporting startup/initialization scripts. For more details about s6-overlay, check out the [s6-overlay documentation](https://github.com/just-containers/s6-overlay).\n\nThis repository might be helpful if you are looking for a simple container deployment of thin-edge.io and don't want to spawn multiple containers, and your device does not have access to a Kubernetes instance like ([k3s](https://k3s.io/)).\n\n\n**Features**\n\nThe **tedge-container-bundle** provides the following features:\n\n* All components running in a single container (can be easier to manage and deploy)\n* Allow setting device certificate from environment variables (or a volume)\n* Provide mapper url (e.g. `c8y.url`) via environment variables\n* Default plugin configurations (log and config)\n* Run container as non-root user\n\n## Getting Started\n\n### Pre-requisites\n\nThe following are required in order to deploy the container\n\n* docker\n\n### Choose a setup\n\n[Option 1: On Host Network](./docs/CONTAINER_OPTION1.md)\n\n[Option 2a (Self-Signed Certificates): Container network (Recommended)](./docs/CONTAINER_OPTION2.md)\n\n[Option 2b (Cumulocity Certificate Authority Preview): Container network (Recommended)](./docs/CONTAINER_OPTION2_with_ca.md)\n\n[Option 2c (Basic Auth): Container network (Recommended)](./docs/CONTAINER_OPTION2_with_basic_auth.md)\n\n\n### Settings\n\nAll of the thin-edge.io settings can be customized via environment variables which can be added via the `-e KEY=VALUE` to the `docker run` command:\n\n```sh\nTEDGE_C8Y_OPERATIONS_AUTO_LOG_UPLOAD=always\n```\n\n### Development\n\n#### Testing\n\nThe system tests are writing using the [RobotFramework](https://robotframework.org/) with some custom thin-edge.io libraries. Generally the test framework will spin up a new container engine environment (defined by the `TEST_IMAGE` variable). In the test itself, a new instance of the **tedge-container-bundle** will be created which the test then uses to check the specified functionality. Using this setup does bring a but if complexity into the setup, however it is necessary to ensure that the **tedge-container-bundle** can be tested against multiple container engine environments (e.g. docker, podman and different versions of each), whilst it also provides a test environment which does not pollute your host's container engine environment.\n\nThe following tools are required to run the tests:\n\n* docker\n* [docker-buildx-plugin](https://github.com/docker/buildx)\n* [go-c8y-cli](https://goc8ycli.netlify.app/)\n* Optional: [just](https://github.com/casey/just) - used to run project tasks\n* python \u003e= 3.9\n\nAfter the project pre-requisites have been installed, you can start the container using the following steps:\n\n1. First run only: Activate your Cumulocity session using [go-c8y-cli](https://goc8ycli.netlify.app/docs/gettingstarted/#creating-a-new-session)\n\n    ```sh\n    set-session\n    ```\n\n    **Note**\n\n    Your go-c8y-cli session profile needs to have the following setting set (and you will have to run `set-session` again afterwards):\n\n    ```sh\n    c8y settings update session.alwaysIncludePassword true\n\n    # Then re-activate the session\n    set-session\n    ```\n\n2. Create a `.env` file containing the environment variables used for testing\n\n    ```sh\n    just init-dotenv\n    ```\n\n    **Note** This will write your current go-c8y-cli's session credentials to the `.env` file, so you don't need to use `set-session` every time.\n\n3. Initialize the docker setup and install the python virtual environment\n\n    ```sh\n    just build-setup\n    just venv\n    ```\n\n4. Build test images\n\n    ```sh\n    just build-test\n    ```\n\n5. Run system tests\n\n    ```sh\n    just test\n    ```\n\n#### Cumulocity Certificate Authority (Preview)\n\nNote: These instructions use the Cumulocity certificate-authority feature and a UI change (pre-filling registration via a URL) which might not be deployed on your tenant.\n\n**For Users**\n\nSee these [Instructions](./docs/CONTAINER_OPTION2_with_ca.md) which will detail how to start a tedge-container-bundle project using the new Cumulocity certificate-authority feature and a pre-built image.\n\n**For Developers with go-c8y-cli**\n\n1. Active your Cumulocity session using go-c8y-cli\n\n    ```sh\n    set-session\n    ```\n\n2. Start the local image (running in the foreground)\n\n    ```sh\n    docker compose up --build\n    ```\n\n3. Click on the registration url to be redirected to the Cumulocity URL in your browser and confirm the registration\n\n\n**Notes**\n\nYou can change the default device enrollment by setting the following environment variables on the container. \n\n```sh\nC8Y_DOMAIN=example-demo.eu-latest.cumulocity.com\nDEVICE_ID=tedge_mydevice001\nDEVICE_ONE_TIME_PASSWORD=\u003cmax_32_chars\u003e\n```\n\n## Project structure\n\n|Directory|Description|\n|---|--|\n|cont-init.d/|Initialization scripts which are run before the services are started|\n|files/tedge/plugins/|Default thin-edge.io plugin configuration files to control defaults such as log and configuration management settings|\n|files/tedge/tedge.toml|File based thin-edge.io default settings. An alternative, if you don't want to set thin-edge.io setting via environment settings|\n|files/mosquitto/mosquitto.conf|Default mosquitto settings to control logging and data persistence|\n\n## Notes on s6-overlay\n\n* Both the initialization scripts and services have access to the container's environment variables, which makes it much easier to configure the components.\n* Standard Output and Standard Error are redirected to the PID 1 so that the log messages are visible from all services\n* Run services under the container `USER`\n\n## Contributions\n\n#### PR Submissions\n\nContributions are welcomed, but please consider the following\n\n* Does the change make sense for other users? If the answer is no, then maybe you should be just pulling in the `tedge-container-bundle` into your own Dockerfile using `FROM ghcr.io/thin-edge/tedge-container-bundle:\u003ctag\u003e`\n\n* State the motivation of the change\n\n* Write a system test (under `./tests`) and ensure all tests are passing (though the CI will also run this on the PR directly)\n\nFinally, before submitting a PR you should run the following locally to ensure everything is formatted correct and there are no linting errors/warnings!\n\n```sh\njust venv\njust lint\njust format\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthin-edge%2Ftedge-container-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthin-edge%2Ftedge-container-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthin-edge%2Ftedge-container-bundle/lists"}