{"id":19854723,"url":"https://github.com/phwoolcon/docker-utils","last_synced_at":"2026-06-11T00:31:05.850Z","repository":{"id":93559803,"uuid":"195013938","full_name":"phwoolcon/docker-utils","owner":"phwoolcon","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-08T03:10:23.000Z","size":18627,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T23:38:42.541Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/phwoolcon.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":"2019-07-03T08:40:35.000Z","updated_at":"2021-09-08T03:10:26.000Z","dependencies_parsed_at":"2023-03-13T17:17:36.158Z","dependency_job_id":null,"html_url":"https://github.com/phwoolcon/docker-utils","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/phwoolcon/docker-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdocker-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdocker-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdocker-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdocker-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phwoolcon","download_url":"https://codeload.github.com/phwoolcon/docker-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phwoolcon%2Fdocker-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34177445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":[],"created_at":"2024-11-12T14:10:13.927Z","updated_at":"2026-06-11T00:31:05.829Z","avatar_url":"https://github.com/phwoolcon.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Docker-utils\n==\nSome handy tools for `Dockerfile`\n\nFor Alpine Linux\n--\n\n### pick-mirror\n\nPick the fastest mirror from http://dl-cdn.alpinelinux.org/alpine/MIRRORS.txt\n```dockerfile\nARG ALPINE_REPO=\"\"\nARG UTILS_BASE=\"https://raw.githubusercontent.com/phwoolcon/docker-utils/master\"\nRUN wget ${UTILS_BASE}/alpine/pick-mirror -O /usr/local/bin/pick-mirror; \\\n    chmod +x /usr/local/bin/*; \\\n    pick-mirror; \\\n    apk update; apk upgrade;\n```\nIf you want to specify the repository, use `--build-arg ALPINE_REPO=`, e.g.:\n```bash\ndocker build --build-arg ALPINE_REPO=http://mirrors.tuna.tsinghua.edu.cn/alpine/ .\n```\n\n### aliases.sh\n\n```dockerfile\nARG UTILS_BASE=\"https://raw.githubusercontent.com/phwoolcon/docker-utils/master\"\nENV ENV=\"/etc/profile\"\nRUN wget ${UTILS_BASE}/alpine/aliases.sh -O /etc/profile.d/aliases.sh;\n```\n\n### nginx \u0026\u0026 php\n```dockerfile\nARG UTILS_BASE=\"https://raw.githubusercontent.com/phwoolcon/docker-utils/master\"\nRUN apk add --no-cache bash coreutils nginx \\\n    php7 php7-curl php7-fileinfo php7-fpm php7-gd php7-json php7-mbstring php7-opcache php7-openssl \\\n    php7-pdo php7-pdo_mysql php7-pecl-redis php7-phalcon php7-simplexml php7-sodium php7-tokenizer php7-xml php7-zip \\\n    composer;\n    wget ${UTILS_BASE}/alpine/determine-fpm-workers -O /usr/local/bin/determine-fpm-workers; \\\n    chmod +x /usr/local/bin/*; \\\n    wget ${UTILS_BASE}/alpine/nginx/00-init.conf -O /etc/nginx/conf.d/00-init.conf; \\\n    wget ${UTILS_BASE}/alpine/nginx/default.conf -O /etc/nginx/conf.d/default.conf; \\\n    echo 'error_log = /mnt/data/log/php7/error.log' \u003e /etc/php7/php-fpm.d/00-log.conf; \\\n    sed -i 's|/var/log|/mnt/data/log|g' /etc/nginx/nginx.conf /etc/php7/php-fpm.d/www.conf; \\\n    sed -i 's|127.0.0.1:9000|0.0.0.0:9000|g' /etc/php7/php-fpm.d/www.conf; \\\n    sed -i 's|expose_php = On|expose_php = Off|g' /etc/php7/php.ini;\n```\n\n## Phwoolcon on docker hub\nhttps://hub.docker.com/u/phwoolcon\n```bash\ndocker build --no-cache -t phwoolcon/phwoolcon -f phwoolcon/Dockerfile-prod phwoolcon/\ndocker build --no-cache -t phwoolcon/phwoolcon-dev -f phwoolcon/Dockerfile-dev phwoolcon/\n```\n\nCommon Tools\n--\n\n### cron-list\nList all cron jobs for all users on the host.\n\n```dockerfile\nARG UTILS_BASE=\"https://raw.githubusercontent.com/phwoolcon/docker-utils/master\"\nRUN wget ${UTILS_BASE}/docker-host -O /usr/local/bin/cron-list; \\\n    chmod +x /usr/local/bin/*;\n```\n\n### dusort\nSorted version of `du`, skipped directories on different file systems.\n\n```dockerfile\nARG UTILS_BASE=\"https://raw.githubusercontent.com/phwoolcon/docker-utils/master\"\nRUN wget ${UTILS_BASE}/dusort -O /usr/local/bin/dusort; \\\n    chmod +x /usr/local/bin/*;\n```\n\n### docker-host\nGet the IP address of the docker host\n\n```dockerfile\nARG UTILS_BASE=\"https://raw.githubusercontent.com/phwoolcon/docker-utils/master\"\nRUN wget ${UTILS_BASE}/docker-host -O /usr/local/bin/docker-host; \\\n    chmod +x /usr/local/bin/*;\n```\n\n### in-docker\nCheck if the current script is running in a docker container\n\n```dockerfile\nARG UTILS_BASE=\"https://raw.githubusercontent.com/phwoolcon/docker-utils/master\"\nRUN wget ${UTILS_BASE}/in-docker -O /usr/local/bin/in-docker; \\\n    chmod +x /usr/local/bin/*; \\\n    in-docker \u0026\u0026 run-your-command;\n```\n\n### MEMO\n\n* [Docker BuildKit GC](https://github.com/docker/cli/issues/2325#issuecomment-733975408)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphwoolcon%2Fdocker-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphwoolcon%2Fdocker-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphwoolcon%2Fdocker-utils/lists"}