{"id":22572786,"url":"https://github.com/dmfed/docker-entrypoints","last_synced_at":"2025-10-08T18:56:06.233Z","repository":{"id":144365551,"uuid":"449224232","full_name":"dmfed/docker-entrypoints","owner":"dmfed","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-06T10:15:19.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T15:14:01.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/dmfed.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":"2022-01-18T09:41:34.000Z","updated_at":"2022-01-18T16:31:40.000Z","dependencies_parsed_at":"2023-04-28T21:37:26.262Z","dependency_job_id":null,"html_url":"https://github.com/dmfed/docker-entrypoints","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfed%2Fdocker-entrypoints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfed%2Fdocker-entrypoints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfed%2Fdocker-entrypoints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfed%2Fdocker-entrypoints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmfed","download_url":"https://codeload.github.com/dmfed/docker-entrypoints/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246049616,"owners_count":20715510,"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":"2024-12-08T02:12:29.742Z","updated_at":"2025-10-08T18:56:01.195Z","avatar_url":"https://github.com/dmfed.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## System signals when using shell script as entry point\n\nTo try all the stuff yourself:\n```\ndocker build -t test-app .\t\t\t// to build\ndocker run -it --rm -p 8080:8080 test-app\t// to run\ndocker exec -it \u003ccontainer\u003e /bin/bash\t\t// to get into the shell\n```\n\n1. **CMD ./entry.sh** in Dockerfile + **exec ./app** in entry.sh\nThis is a perfectly valid case. CMD runs shell under the hood \nwhich executes entry.sh script. It in turn replaces itself with \napp beause we're using **exec**, so we're getting \napp with PID=1.\n\nThe app is able to trap system signals and act accordingly. \nRunning **docker stop** will have Docker send SIGTERM to PID 1.\nIf nothing happens Docker will force kill the app when grace period\nexpires. \n\n2. **CMD ./entry.sh** in Dockerfile + **./app** in entry.sh\nThis will result in CMD launching shell which will run app\nas a separate process with PID != 1 (\u003e1). \n\nThe app will not be able to trap system signals. On calling \n**docker stop** SIGTERM will be send to container but there will be\nno one around to react. The app will be force-killed as a \nresult.\n \n3. **CMD [\"./entry.sh\"]**  will fail, since **entry.sh** is not\na binary executable. \n\n3. **ENTRYPOINT [\"/bin/sh\", \"./entry.sh\"]** in Dockerfile \nresults in **./entry.sh** being executed on launch regardless\nof what command we pass to the container. This is useful when \ncertain setup work needs to be done before we actually run anything.\nAgain because of using **exec** in shell script the actual command \ngets PID=1.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmfed%2Fdocker-entrypoints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmfed%2Fdocker-entrypoints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmfed%2Fdocker-entrypoints/lists"}