{"id":20481771,"url":"https://github.com/tsfoster/docker-tools","last_synced_at":"2026-05-28T21:31:18.715Z","repository":{"id":151954667,"uuid":"138620401","full_name":"TSFoster/docker-tools","owner":"TSFoster","description":"Functions for working with Docker and Docker Machine","archived":false,"fork":false,"pushed_at":"2018-09-21T12:37:27.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T15:51:18.360Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TSFoster.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-25T16:19:54.000Z","updated_at":"2018-09-21T12:37:28.000Z","dependencies_parsed_at":"2023-06-09T23:31:01.672Z","dependency_job_id":null,"html_url":"https://github.com/TSFoster/docker-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TSFoster/docker-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSFoster%2Fdocker-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSFoster%2Fdocker-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSFoster%2Fdocker-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSFoster%2Fdocker-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TSFoster","download_url":"https://codeload.github.com/TSFoster/docker-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TSFoster%2Fdocker-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33627934,"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-05-28T02:00:06.440Z","response_time":99,"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-15T16:09:47.731Z","updated_at":"2026-05-28T21:31:18.700Z","avatar_url":"https://github.com/TSFoster.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker tools\n\nFunctions and commands for working with Docker and Docker Machine\n\n## Install\n\nWith [fisherman](https://github.com/fisherman/fisherman):\n\n```\nfisher TSFoster/docker-tools\n```\n\n## Usage\n\n- [`dmenv`](#dmenv)\n- [`dmenvfile`](#dmenvfile)\n- [`dbuild`](#dbuild)\n\n### `dmenv`\n\n```fish\ndmenv --help # Print help\ndmenv MACHINE_NAME # Run \"eval (docker-machine env MACHINE_NAME --shell=fish)\"\ndmenv # Run \"eval (docker-machine env --unset --shell=fish)\"\n```\n\n### `dmenvfile`\n\n```fish\ndmenvfile --help # Print help\ndmenvfile # Source files related to $DOCKER_MACHINE_NAME in ./env directory\ndmenvfile --print --dir=other/env/path --unexport --no-global\n```\n\nSources posix-style env files, in order, related to the current `$DOCKER_MACHINE_NAME`:\n\n1.  Sets `$machineName` to `$DOCKER_MACHINE_NAME` or `localhost`\n2.  Sources `env/default.env` if it exists\n3.  Sources `env/[[MACHINE-DRIVER]].env` (e.g. `env/virtualbox.env`)\n4.  Sources `env/$DOCKER_MACHINE_NAME.env`\n\n##### Example usage:\n\n###### Filesystem:\n\n- awesome-project/\n  - bin/\n    - deploy\n  - env/\n    - default.env\n    - virtualbox.env\n    - digitalocean.env\n    - awesome-project-staging.env\n    - awesome-project-prod.env\n  - stack.yml\n\n###### `stack.yml`\n\n```yml\n  [...]\n    deploy:\n      labels:\n        - \"traefik.frontend.rule=Host:${hostName},www.${hostName}\"\n        - \"traefik.backend=${stackName}_rails\"\n  [...]\n    environment:\n      RAILS_ENV: ${RAILS_ENV}\n  [...]\n```\n\n###### `bin/deploy`\n\n```fish\n#!/usr/bin/env fish\n\ncd (dirname (status filename))/..\ndmenvfile\ndocker stack deploy --compose-file=stack.yml awesome-project\n```\n\n###### `env/default.env`\n\n```bash\nstackName=awesomeproj\n```\n\n###### `env/virtualbox.env`\n\n```bash\nhostName=$stackName.$machineName\nRAILS_ENV=development\n```\n\n###### `env/digitalocean.env`\n\n```bash\nhostName=awesome-project.com\n```\n\n###### `env/awesome-project-staging.env`\n\n```bash\nRAILS_ENV=production\nhostName=staging.$hostName\n```\n\n###### `env/awesome-project-prod.env`\n\n```bash\nRAILS_ENV=production\n```\n\n###### To deploy\n\n```fish\ndmenv awesome-project-dev\n/path/to/awesome-project/bin/deploy\n```\n\n1.  Sets `$machineName` to `awesome-project-dev`\n2.  Sources `env/default.env`, sets `$stackName` to `awesomeproj`\n3.  Sources `env/virtualbox.env`, sets `$hostName` to `awesomeproj.awesome-project-dev` and `RAILS_ENV` to `development`\n4.  `env/awesome-project-dev.env` doesn’t exist, so skipped\n5.  Deploys stack.yml\n\n### `dbuild`\n\n`dbuild` will source an env file before trying to build and optionally push the images specified. It follows some basic rules for finding the env file and the appropriate build directories, but the settings can be overwritten.\n\n```fish\ndbuild --help # Print help\ndbuild backup database nginx # Build images defined in ./backup/Dockerfile ./database/Dockerfile and ./nginx/Dockerfile, sourcing ./env/build.env first\ndbuild --force-push --env-file=./buildSettings.env --registry-url=registry.gitlab.com/tsfoster/awesome-project reverseproxy rails database\nset -x dbuildRegistryUrl tsfoster\necho dbuildValidImages=reverseproxy api-server \u003e env/build.env\ndbuild --no-push reverseproxy --build-path=traefik api-server --build-path=drupal incorrect-image-name --build-path=incorrect-image-name\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsfoster%2Fdocker-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsfoster%2Fdocker-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsfoster%2Fdocker-tools/lists"}