{"id":21479378,"url":"https://github.com/rycus86/docker-write","last_synced_at":"2025-03-17T08:42:24.426Z","repository":{"id":66144731,"uuid":"137417050","full_name":"rycus86/docker-write","owner":"rycus86","description":"Simple file writer container","archived":false,"fork":false,"pushed_at":"2018-06-14T22:56:34.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T18:16:09.423Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rycus86.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}},"created_at":"2018-06-14T22:53:11.000Z","updated_at":"2018-06-14T22:56:35.000Z","dependencies_parsed_at":"2023-02-22T01:16:25.553Z","dependency_job_id":null,"html_url":"https://github.com/rycus86/docker-write","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/rycus86%2Fdocker-write","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fdocker-write/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fdocker-write/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fdocker-write/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rycus86","download_url":"https://codeload.github.com/rycus86/docker-write/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244004281,"owners_count":20382360,"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-11-23T11:25:00.596Z","updated_at":"2025-03-17T08:42:24.391Z","avatar_url":"https://github.com/rycus86.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple file writer\n\nA small Go application, mainly for demo purposes, that takes an input string from parameters, the standard input, or environment variables, and writes it into a file. After this, it waits for a `SIGINT`, `SIGTERM` or `SIGHUP` signal to exit.\n\n```\nSimple file writer\n------------------\n\nUsage:\n\n  ./write [TARGET] [DATA]\n\n      Writes DATA to the TARGET file.\n      By default, it creates any intermediate directories\n      necessary, and waits until interrupted.\n      DATA can be '-' to read it from the standard input.\n\nOptions as environment variables:\n\n  TARGET      The target file\n  DATA        The data to write\n  TRIM        Trim spaces at the start and end of DATA\n  ECHO        Echo the DATA written\n  NO_CREATE   Do not create new directories\n  NO_READY    Do not create a ready state file\n  NO_WAIT     Exit once the file is written\n```\n\nRun it as:\n\n```shell\n$ docker run --rm -it -v target:/var/static \\\n     -e DATA='Some content'                 \\\n     -e TARGET='/var/static/output.txt'     \\\n     -e NO_WAIT=1 -e NO_READY=1 -e ECHO=1   \\\n     rycus86/write\n```\n\nOr alternatively:\n\n```shell\n$ docker run --rm -it -v target:/var/static \\\n     -e NO_WAIT=1 -e NO_READY=1 -e ECHO=1   \\\n     rycus86/write /var/static/output.txt 'Some content'\n```\n\nOr alternatively:\n\n```shell\n$ echo 'Some content' |                       \\\n    docker run --rm -i -v target:/var/static  \\\n       -e NO_WAIT=1 -e NO_READY=1 -e ECHO=1   \\\n       rycus86/write /var/static/output.txt -\n# note the missing `-t`, plus the `-` at the end\n```\n\nThe Docker container comes with health-checking enabled, that will report healthy once the file is successfully written. You can use this in Compose or Swarm stacks to write the file once, then just hang around not doing anything.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Fdocker-write","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frycus86%2Fdocker-write","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Fdocker-write/lists"}