{"id":17681184,"url":"https://github.com/at-grandpa/des","last_synced_at":"2025-05-12T23:11:43.459Z","repository":{"id":78838794,"uuid":"94444184","full_name":"at-grandpa/des","owner":"at-grandpa","description":"CLI to create Docker Environment Setting files.","archived":false,"fork":false,"pushed_at":"2019-08-19T01:36:53.000Z","size":319,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T04:32:41.437Z","etag":null,"topics":["command-line-tool","crystal","docker-compose","dockerfile","makefile"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/at-grandpa.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":"2017-06-15T13:51:23.000Z","updated_at":"2020-05-13T08:08:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"58861556-75e0-4011-8bbc-07373af5ad2f","html_url":"https://github.com/at-grandpa/des","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/at-grandpa%2Fdes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at-grandpa%2Fdes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at-grandpa%2Fdes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at-grandpa%2Fdes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/at-grandpa","download_url":"https://codeload.github.com/at-grandpa/des/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253837454,"owners_count":21971984,"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":["command-line-tool","crystal","docker-compose","dockerfile","makefile"],"created_at":"2024-10-24T09:10:28.099Z","updated_at":"2025-05-12T23:11:43.437Z","avatar_url":"https://github.com/at-grandpa.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# des\n\nCLI to create **D**ocker **E**nvironment **S**etting files.\n\nIf you have a script you want to run in the docker environment, you can quickly build a docker environment.\n\n[![Build Status](https://travis-ci.org/at-grandpa/des.svg?branch=master)](https://travis-ci.org/at-grandpa/des)\n\n## Installation\n\n### homebrew\n\n```shell\nbrew update\nbrew install crystal-lang\nbrew tap at-grandpa/homebrew-des\nbrew install des\n```\n\n### git clone\n\n```shell\nbrew update\nbrew install crystal-lang\ngit clone https://github.com/at-grandpa/des.git\ncd des\nmake install\n```\n\n## Usage\n\nFor example, you have a crystal code you want to run. However, crystal is not installed. In that case, use `des`.\n\n```shell\n$ ls\nsample.cr\n\n$ cat sample.cr\nputs \"I want to run this crystal code.\"\n\n$ crystal -v\nbash: crystal: command not found\n\n$ des --image=crystallang/crystal --container=my_crystal_container\nCreate /your/home/.desrc.yml\nCreate ./Dockerfile\nCreate ./Makefile\nCreate ./docker-compose.yml\n```\n\n`Dockerfile`, `Makefile` and `docker-compose.yml` are created.\n\nNext, run `make setup`. The docker environment is built.\n\n```shell\n$ make setup\ndocker-compose -f ./docker-compose.yml build\nBuilding app\nStep 1/5 : FROM crystallang/crystal\n\n...\n\nSuccessfully built xxxxxxxxxx\ndocker-compose -f ./docker-compose.yml up -d\nCreating network \"destest_default\" with the default driver\nCreating my_crystal_container\n$\n```\n\nNext, run `make attach`. You can attach the docker container.\n\n```shell\n$ make attach\ndocker exec -it my_crystal_container /bin/bash\nroot@xxxxxxxxx:~/my_crystal_container#\n```\n\nThis container is in the following state.\n\n* The current directory of the host machine is mounted.\n* Created from the specified image. (In this example, `crystallang/crystal`)\n\n```shell\nroot@xxx:~/my_crystal_container# ls -la\nDockerfile  Makefile  docker-compose.yml  sample.cr\nroot@xxx:~/my_crystal_container# crystal -v\nCrystal 0.30.1 [5e6a1b672] (2019-08-12)\n\nLLVM: 4.0.0\nDefault target: x86_64-unknown-linux-gnu\nroot@xxx:~/my_crystal_container#\n```\n\nYou can run the your script.\n\n```shell\nroot@xxx:~/my_crystal_container# crystal run sample.cr\nI want to run this crystal code.\n```\n\n## Command Options\n\n```shell\n$ des --help\n\n  Creates docker environment setting files.\n\n    - Dockerfile\n    - Makefile\n    - docker-compose.yml\n\n  Usage:\n\n    des [options]\n\n  Options:\n\n    -i IMAGE, --image=IMAGE          Base docker image name. [type:String]\n    -p PACKAGES, --packages=PACKAGE  apt-get install packages name. [type:Array(String)]\n    -c NAME, --container=NAME        Container name. [type:String]\n    -s SAVE_DIR, --save-dir=SAVE_DIR Save dir path. [type:String]\n    -d VERSION, --docker-compose-version=VERSION\n                                     docker-compose version. [type:String]\n    -w FLAG, --web-app=FLAG          Web app mode(true or false). Includes nginx and mysql. [type:String]\n    -o FLAG, --overwrite=FLAG        Overwrite each file flag(true or false). [type:String]\n    -h, --help                       Show this help.\n    -v, --version                    Show version.\n\n  Sub Commands:\n\n    desrc   Creates/Update/Display desrc file.\n\n```\n\n## Sub Commands\n\n```shell\n$ des desrc -h\n\n  Creates/Update/Display desrc file.\n\n  Usage:\n\n    des desrc [sub_command]\n\n  Options:\n\n    -h, --help                       Show this help.\n\n  Sub Commands:\n\n    create, update   Create or Update desrc file.\n    display          Display desrc file.\n\n```\n\n```shell\n$ des desrc update -i ubuntu:18.04 -c example_container -w true\n\npath: /your/home/.desrc.yml\n\ndefault_options:\n  image: ubuntu:18.04\n  packages: []\n  container: example_container\n  save_dir: .\n  docker_compose_version: 3\n  web_app: true\n  overwrite: false\n\n\n/your/home/.desrc.yml\nOverwrite? (y or n) \u003e y\nOverwrite /your/home/.desrc.yml\n$\n```\n\n```shell\n$ des desrc display\n\npath: /your/home/.desrc.yml\n\ndefault_options:\n  image: ubuntu:18.04\n  packages: []\n  container: example_container\n  save_dir: .\n  docker_compose_version: 3\n  web_app: true\n  overwrite: false\n\n$\n```\n\n## .desrc.yml\n\nWrite the default option values of the command in this file. It is placed at `~/.desrc.yml` by default.\n\n```yaml\ndefault_options:\n  image: ubuntu:18.04\n  packages:\n    - curl\n    - vim\n  container: my_container\n  save_dir: .\n  docker_compose_version: 3\n  web_app: true\n  overwrite: false\n```\n\n## Default options\n\nIf neither cli nor .desrc.yml has an option, the following options are used by default. Therefore, the priority is `cli options` \u003e `.desrc.yml options` \u003e `default options`.\n\n```yaml\ndefault_options:\n  image: ubuntu:18.04\n  packages: []\n  container: my_container\n  save_dir: .\n  docker_compose_version: 3\n  web_app: false\n  overwrite: false\n```\n\n## Development\n\n```shell\nmake spec\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/at-grandpa/des/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [at-grandpa](https://github.com/at-grandpa) at-grandpa - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fat-grandpa%2Fdes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fat-grandpa%2Fdes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fat-grandpa%2Fdes/lists"}