{"id":17684669,"url":"https://github.com/tarampampam/curl-docker","last_synced_at":"2025-04-28T15:50:27.104Z","repository":{"id":38020249,"uuid":"406022578","full_name":"tarampampam/curl-docker","owner":"tarampampam","description":":mechanical_arm: curl (static binary file) in a scratch docker image","archived":false,"fork":false,"pushed_at":"2025-04-07T10:03:58.000Z","size":100,"stargazers_count":27,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T19:18:38.416Z","etag":null,"topics":["curl","docker","scratch"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/tarampampam/curl","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarampampam.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-13T15:13:39.000Z","updated_at":"2025-04-10T16:41:37.000Z","dependencies_parsed_at":"2023-10-01T16:14:19.021Z","dependency_job_id":"3c64689c-10fc-4ca8-8a3a-5805e0266ab1","html_url":"https://github.com/tarampampam/curl-docker","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarampampam%2Fcurl-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarampampam%2Fcurl-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarampampam%2Fcurl-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarampampam%2Fcurl-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarampampam","download_url":"https://codeload.github.com/tarampampam/curl-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342700,"owners_count":21574242,"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":["curl","docker","scratch"],"created_at":"2024-10-24T10:24:42.119Z","updated_at":"2025-04-28T15:50:27.084Z","avatar_url":"https://github.com/tarampampam.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://curl.se/logo/curl-logo.svg\" width=\"256\" alt=\"\" /\u003e\n\u003c/p\u003e\n\n# Docker image with [curl][link_curl]\n\n[![Build Status][badge_build_status]][link_build_status]\n[![Release Status][badge_release_status]][link_build_status]\n[![Image size][badge_size_latest]][link_docker_hub]\n[![Docker Pulls][badge_docker_pulls]][link_docker_hub]\n[![License][badge_license]][link_license]\n\n## Why was this image created?\n\nAs you may know, `curl` comprises two components: the library with the same name and a dynamically linked executable\nfile. When using `curl` in Docker images based on `scratch` (empty file system), we have two options:\n\n- Include all required libraries for `curl` in the image.\n- Compile `curl` as a **static** binary.\n\nThis repository contains a Dockerfile using the second approach (the main idea was found [here](https://github.com/moparisthebest/static-curl)).\n\n\u003e Important note: Some `curl` features (such as `gopher`, `imap`, `proxy`, and others) have been disabled for binary\n\u003e file size reasons.\n\nAnother important change is that when the `--fail` flag is used, the exit code on error is **1** (instead of 22). You\ncan find more details about the patch [here](patches/fail-exit-code.patch). This change was made for use in Docker\nhealth checks (the possible exit codes for Docker health checks are: 0 for success, indicating the container is\nhealthy and ready for use, and 1 for unhealthy, indicating the container is not working correctly):\n\n```bash\n$ docker run --rm tarampampam/curl -s --fail --show-error https://httpbin.org/status/401\ncurl: (22) The requested URL returned error: 401\n\n$ echo \"Exit code: $?\"\nExit code: 1\n```\n\n## Image\n\n| Registry                                            | Image                      |\n|-----------------------------------------------------|----------------------------|\n| [GitHub Container Registry][link_github_containers] | `ghcr.io/tarampampam/curl` |\n| [Docker Hub][link_docker_tags]                      | `tarampampam/curl`         |\n\n\u003e Images, based on the `alpine` image has a postfix `-alpine` in the tag name, e.g.: `tarampampam/curl:8.0.1-alpine`.\n\nFollowing platforms for this image are available:\n\n```bash\n$ docker run --rm mplatform/mquery tarampampam/curl:latest\nImage: tarampampam/curl:latest\n * Manifest List: Yes (Image type: application/vnd.docker.distribution.manifest.list.v2+json)\n * Supported platforms:\n   - linux/amd64\n   - linux/386\n   - linux/arm64\n   - linux/arm/v6\n   - linux/arm/v7\n```\n\n## How can I use this?\n\nFor example - as a docker healthcheck (note - we use `scratch` as a base):\n\n```Dockerfile\n# use empty filesystem\nFROM scratch\n\n# import some executable application\nCOPY --from=docker.io/containous/whoami:v1.5.0 /whoami /whoami\n\n# import curl from current repository image\nCOPY --from=ghcr.io/tarampampam/curl:8.6.0 /bin/curl /bin/curl\n\n# Docs: \u003chttps://docs.docker.com/engine/reference/builder/#healthcheck\u003e\nHEALTHCHECK --interval=5s --timeout=2s --retries=2 --start-period=2s CMD [ \\\n    \"curl\", \"--fail\", \"http://127.0.0.1:80/\" \\\n]\n\nENTRYPOINT [\"/whoami\"]\n```\n\nAfter that you can build this image, run, and watch the state:\n\n```bash\n$ docker build --tag healthcheck-test:local .\n...\nSuccessfully built 72bf22424af7\nSuccessfully tagged healthcheck-test:local\n\n$ docker run --rm -d --name healthcheck-test healthcheck-test:local\nb3f20332ac19b42dfed03021c0b90b3650b9a7efbaea7c8800d35551e43d35d7\n\n$ docker ps --filter 'name=healthcheck-test' --format '{{.Status}}'\nUp 1 minutes (healthy)\n\n$ docker kill healthcheck-test\n```\n\n## Releasing\n\nNew versions publishing is very simple - just make required changes in this repository and \"publish\" new release using\nrepo releases page.\n\nDocker images will be build and published automatically.\n\n\u003e The new release will overwrite the `latest` and `latest-alpine` docker image tags in both registers.\n\n## Support\n\n[![Issues][badge_issues]][link_issues]\n[![Issues][badge_pulls]][link_pulls]\n\nIf you find any package errors, please, [make an issue][link_create_issue] in current repository.\n\n## License\n\nWTFPL. Use anywhere for your pleasure.\n\n[badge_build_status]:https://img.shields.io/github/actions/workflow/status/tarampampam/curl-docker/tests.yml?branch=master\u0026logo=github\u0026label=build\n[badge_release_status]:https://img.shields.io/github/actions/workflow/status/tarampampam/curl-docker/release.yml?logo=github\u0026label=release\n[badge_issues]:https://img.shields.io/github/issues/tarampampam/curl-docker.svg?style=flat-square\u0026maxAge=180\n[badge_pulls]:https://img.shields.io/github/issues-pr/tarampampam/curl-docker.svg?style=flat-square\u0026maxAge=180\n[badge_license]:https://img.shields.io/github/license/tarampampam/curl-docker.svg?longCache=true\n[badge_size_latest]:https://img.shields.io/docker/image-size/tarampampam/curl/latest?maxAge=30\n[badge_docker_pulls]:https://img.shields.io/docker/pulls/tarampampam/curl.svg\n[link_issues]:https://github.com/tarampampam/curl-docker/issues\n[link_pulls]:https://github.com/tarampampam/curl-docker/pulls\n[link_build_status]:https://github.com/tarampampam/curl-docker/actions\n[link_create_issue]:https://github.com/tarampampam/curl-docker/issues/new\n[link_license]:https://github.com/tarampampam/curl-docker/blob/master/LICENSE\n[link_docker_tags]:https://hub.docker.com/r/tarampampam/curl/tags\n[link_docker_hub]:https://hub.docker.com/r/tarampampam/curl/\n[link_github_containers]:https://github.com/tarampampam/curl-docker/pkgs/container/curl\n[link_curl]:https://curl.se/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarampampam%2Fcurl-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarampampam%2Fcurl-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarampampam%2Fcurl-docker/lists"}