{"id":16098647,"url":"https://github.com/funnyzak/alpine-cron-docker","last_synced_at":"2025-03-28T21:30:53.446Z","repository":{"id":114592037,"uuid":"260189931","full_name":"funnyzak/alpine-cron-docker","owner":"funnyzak","description":"A lightweight Docker image with Cron based on Alpine Linux.","archived":true,"fork":false,"pushed_at":"2024-12-01T02:55:06.000Z","size":58,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-23T19:48:03.318Z","etag":null,"topics":["apline","apline-cron","cron","docker","docker-image"],"latest_commit_sha":null,"homepage":"https://github.com/funnyzak/alpine-cron-docker","language":"Shell","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/funnyzak.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":"2020-04-30T11:11:52.000Z","updated_at":"2024-12-01T02:55:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f37c7a4-ee56-4045-98ee-495d5754db9f","html_url":"https://github.com/funnyzak/alpine-cron-docker","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Falpine-cron-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Falpine-cron-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Falpine-cron-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Falpine-cron-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funnyzak","download_url":"https://codeload.github.com/funnyzak/alpine-cron-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246104338,"owners_count":20724125,"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":["apline","apline-cron","cron","docker","docker-image"],"created_at":"2024-10-09T18:24:16.610Z","updated_at":"2025-03-28T21:30:53.434Z","avatar_url":"https://github.com/funnyzak.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-alpine-cron\n\n\u003e This repository is no longer maintained. The latest built images can be found in the [Docker Release](https://github.com/funnyzak/docker-release/tree/main/Docker/cron).\n\n\u003e 此仓库已不在维护，最新构建的镜像请查看 [Docker Release](https://github.com/funnyzak/docker-release/tree/main/Docker/cron) 。\n\n\n[![Docker Tags](https://img.shields.io/docker/v/funnyzak/cron?sort=semver\u0026style=flat-square)](https://hub.docker.com/r/funnyzak/cron/)\n[![Image Size](https://img.shields.io/docker/image-size/funnyzak/cron)](https://hub.docker.com/r/funnyzak/cron/)\n[![Docker Stars](https://img.shields.io/docker/stars/funnyzak/cron.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/cron/)\n[![Docker Pulls](https://img.shields.io/docker/pulls/funnyzak/cron.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/cron/)\n\ncron is a lightweight service that runs in the background and executes scheduled tasks. It builds on the official `alpine` image and includes `dcron` as the cron service. The image is available for multiple architectures, including `linux/386`, `linux/amd64`, `linux/arm/v6`, `linux/arm/v7`, `linux/arm64/v8`, `linux/ppc64le`, `linux/riscv64`, `linux/s390x`.\n\n## Environment variables\n\n- **CRON_STRINGS**: Strings with cron jobs. Use \"\\n\" for newline (Default: undefined)\n\n- **CRON_TAIL**: - If defined cron log file will read to *stdout* by *tail* (Default: undefined)\n\nBy default cron running in foreground.\n\n## Packages\n\nThe following packages are installed by default:\n\n- certificates\n- bash\n- curl\n- wget\n- rsync\n- git\n- gcc\n- openssh\n- make\n- cmake\n- zip\n- unzip\n- gzip\n- certbot\n- bzip2\n- tar\n- tzdata\n- nodejs\n- yarn\n- npm\n- pushoo-cli\n- mysql-client\n- mariadb-connector-c\n- ossutil64\n\n## Cron files\n\n- **/etc/cron.d** Place to mount custom crontab files  \n\nWhen image will run, files in */etc/cron.d* will copied to */var/spool/cron/crontab*.\n\nIf *CRON_STRINGS* defined script creates file */var/spool/cron/crontab/CRON_STRINGS*  \n\n## Logs\n\nLog file by default placed in /var/log/cron/cron.log\n\n## Notification\n\nThe image already installed [pushoo-cli](https://github.com/funnyzak/pushoo-cli), you can use it to send notification. You can send notification to DingTalk, iFttt, Discord, Feishu, atri, bark, etc.\n\nMore information about pushoo-cli, please refer to [pushoo-cli](https://github.com/funnyzak/pushoo-cli) and [pushoo](https://github.com/imaegoo/pushoo).\n\n## Usage\n\n### One Cron job\n\n```bash\ndocker run --name=\"alpine-cron-sample\" -d \\\n-v /path/to/app/conf/crontabs:/etc/cron.d \\\n-v /path/to/app/scripts:/scripts \\\nfunnyzak/alpine-cron\n```\n\n### With scripts and CRON_STRINGS\n\n```bash\ndocker run --name=\"alpine-cron-sample\" -d \\\n-e 'CRON_STRINGS=* * * * * /scripts/myapp-script.sh'\n-v /path/to/app/scripts:/scripts \\\nfunnyzak/alpine-cron\n```\n\n### Get URL by cron every minute\n\n```bash\ndocker run --name=\"alpine-cron-sample\" -d \\\n-e 'CRON_STRINGS=* * * * * wget --spider https://sample.dockerhost/cron-jobs'\nfunnyzak/alpine-cron\n```\n\n---\n\n### Compose\n\n```yaml\nversion: '3'\nservices:\n  acron:\n    image: funnyzak/alpine-cron\n    privileged: true\n    container_name: cron\n    logging:\n      driver: 'json-file'\n      options:\n        max-size: '1g'\n    tty: true\n    environment:\n      - TZ=Asia/Shanghai\n      - LANG=C.UTF-8\n      - CRON_TAIL=1 # tail cron log\n      - CRON_STRINGS=* * * * * /scripts/echo.sh\n    restart: on-failure\n    volumes:\n      - ./scripts:/scripts # execute script\n      - ./cron:/etc/cron.d # crontab\n      - ./db:/db # log\n```\n\nFor more details, please refer to the [docker-compose.yml](example/docker-compose.yml) file.\n\n## Contribution\n\nIf you have any questions or suggestions, please feel free to submit an issue or pull request.\n\n\u003ca href=\"https://github.com/funnyzak/vue-starter/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=funnyzak/alpine-cron-docker\" /\u003e\n\u003c/a\u003e\n\n## License\n\nMIT License © 2022 [funnyzak](https://github.com/funnyzak)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnyzak%2Falpine-cron-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunnyzak%2Falpine-cron-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnyzak%2Falpine-cron-docker/lists"}