{"id":31048990,"url":"https://github.com/lfreleng-actions/test-docker-project","last_synced_at":"2026-05-01T21:34:35.571Z","repository":{"id":307813959,"uuid":"1020092568","full_name":"lfreleng-actions/test-docker-project","owner":"lfreleng-actions","description":"Test/sample project to build a Docker container image","archived":false,"fork":false,"pushed_at":"2026-04-16T13:10:54.000Z","size":271,"stargazers_count":0,"open_issues_count":5,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T15:13:31.031Z","etag":null,"topics":["docker","docker-image","makefile"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lfreleng-actions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-15T10:26:47.000Z","updated_at":"2026-04-16T13:10:58.000Z","dependencies_parsed_at":"2025-08-02T12:17:26.975Z","dependency_job_id":"8addb413-e34d-4f01-afeb-6787b4f46ae5","html_url":"https://github.com/lfreleng-actions/test-docker-project","commit_stats":null,"previous_names":["lfreleng-actions/test-docker-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lfreleng-actions/test-docker-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Ftest-docker-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Ftest-docker-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Ftest-docker-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Ftest-docker-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lfreleng-actions","download_url":"https://codeload.github.com/lfreleng-actions/test-docker-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Ftest-docker-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32513780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker","docker-image","makefile"],"created_at":"2025-09-14T21:25:51.802Z","updated_at":"2026-05-01T21:34:35.560Z","avatar_url":"https://github.com/lfreleng-actions.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-License-Identifier: Apache-2.0\nSPDX-FileCopyrightText: 2025 The Linux Foundation\n--\u003e\n\n# 🐳 Test Docker Project\n\nSample project that builds a Docker image container.\n\nThe container runs NGINX and hosts a web page displaying:\n\n`Hello Linux Foundation!`\n\n## Overview\n\nThis project demonstrates a simple Docker container build with GitHub Actions\nworkflow integration. It includes:\n\n- Docker configuration for an NGINX web server\n- GitHub Actions workflow for automated builds\n- Makefile for local development\n- Pre-commit hooks for code quality\n\n## Usage Example\n\n### Local Development\n\n```bash\n# Build the Docker image\nmake build\n\n# Run the container\nmake run\n\n# Stop and remove the container\nmake stop\n\n# Remove the container and image\nmake clean\n```\n\n### GitHub Actions Workflow\n\n\u003c!-- markdownlint-disable MD046 --\u003e\n\n```yaml\nname: Build Docker Image\nuses: lfreleng-actions/test-docker-project/.github/workflows/testing.yaml@main\n```\n\n\u003c!-- markdownlint-enable MD046 --\u003e\n\n## Implementation Details\n\nThe project builds a lightweight NGINX container that serves a static HTML page.\nKey features:\n\n- Multi-platform build support via Docker Buildx\n- Layer caching for faster builds\n- Non-root container user for better security\n- Custom Nginx configuration to support running as non-root\n- Temporary files stored in non-privileged directories\n- Health check endpoint at `/health`\n- Automated testing in CI/CD pipeline\n\n## Requirements\n\n- Docker\n- Make (for local development)\n- Git (for version control)\n\nRun `make install-tools` to automatically install dependencies on supported platforms.\n\n## Testing\n\n### Automated Tests\n\nThe project includes automated tests to check the Docker image functionality:\n\n```bash\n# Run tests (works from any directory)\n./tests/scripts/test_docker.sh\n\n# Run tests with a custom port\nTEST_HOST_PORT=9090 ./tests/scripts/test_docker.sh\n```\n\nThe test script validates:\n\n- Building the Docker image\n- Running a container from the image\n- Checking the web page shows the expected message\n- Verifying the health endpoint is working\n- Cleaning up all test resources\n\nThe script is path-independent and works on both macOS and Linux platforms.\nIt automatically detects if the default port (8080) is in use and will try\nalternative ports if necessary. You can also specify a custom port by setting\nthe `TEST_HOST_PORT` environment variable.\n\n### Non-Root Nginx Configuration\n\nThe Docker container runs Nginx as a non-root user for improved security.\nTo achieve this, we use:\n\n- Custom main Nginx configuration file that sets the PID file location to a\n  non-privileged directory\n- Temporary directories created and owned by the non-root user\n- Proper file permissions set before switching to the non-root user\n- All logging and cache files redirected to writable locations\n- Comprehensive process monitoring in the test script to ensure proper startup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfreleng-actions%2Ftest-docker-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flfreleng-actions%2Ftest-docker-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfreleng-actions%2Ftest-docker-project/lists"}