{"id":19082240,"url":"https://github.com/waikato-datamining/docker-banner-gen","last_synced_at":"2025-09-07T19:32:44.369Z","repository":{"id":57423246,"uuid":"270105506","full_name":"waikato-datamining/docker-banner-gen","owner":"waikato-datamining","description":"Command-line tool for generating bash.bashrc templates for docker with a custom banner.","archived":false,"fork":false,"pushed_at":"2024-12-18T03:30:59.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-18T04:25:05.238Z","etag":null,"topics":["bash","bashrc","docker","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/waikato-datamining.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.rst","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-06-06T21:11:43.000Z","updated_at":"2024-12-18T03:31:03.000Z","dependencies_parsed_at":"2024-11-09T02:42:45.950Z","dependency_job_id":"f9be692e-3b41-4e61-b917-07058aaa7036","html_url":"https://github.com/waikato-datamining/docker-banner-gen","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":0.09999999999999998,"last_synced_commit":"31e11eb7e3834a796bcc067753648571e6488a07"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fdocker-banner-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fdocker-banner-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fdocker-banner-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fdocker-banner-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waikato-datamining","download_url":"https://codeload.github.com/waikato-datamining/docker-banner-gen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232252637,"owners_count":18495095,"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":["bash","bashrc","docker","python3"],"created_at":"2024-11-09T02:42:39.967Z","updated_at":"2025-01-02T20:26:08.843Z","avatar_url":"https://github.com/waikato-datamining.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-banner-gen\nThe **docker-banner-gen** command-line tool allows you to generate\n`bash.bashrc` files to be used within Docker containers. \nIt is based on TensorFlow's `bash.bashrc` and uses pyfiglet to\ngenerate the banner.\n\n## Installation\n\nYou can install the tool with `pip` as follows (best to install it in a [virtual\nenvironment](https://virtualenv.pypa.io/en/latest/)):\n\n```commandline\npip install docker_banner-gen\n```\n\nOr download and install a Debian package, if you are running Debian/Ubuntu.\n\n## Usage\n\n```\nusage: docker-banner-gen [-h] [-t FILE] [-b TEXT] [-s TEXT] [-f FONT]\n                         [-p TEXT] [-w COLS] [-o FILE] [-i] [-L] [-F FONT]\n\nGenerates bash.bashrc templates for docker with a custom banner (ASCII art via\npyfiglet).\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -t FILE, --template FILE\n                        The banner template to use if not using the built-in\n                        one; use placeholders {BANNER} and {PS1} in the\n                        template. (default: None)\n  -b TEXT, --banner TEXT\n                        The text to use for the banner (processed by\n                        pyfiglet). Use the string '\\n' (not the newline\n                        character) to signal a line-break in the banner text.\n                        (default: Banner)\n  -s TEXT, --subtitle TEXT\n                        The subtitle text to use below the banner (regular\n                        text), e.g., a version number. (default: None)\n  -f FONT, --font FONT  The figlet font to use for generating the banner.\n                        (default: standard)\n  -p TEXT, --ps1 TEXT   The text to use in the PS1 environment variable (used\n                        in the prompt). (default: docker)\n  -w COLS, --width COLS\n                        The maximum width for the banner. (default: 80)\n  -o FILE, --output FILE\n                        The file to store the generated bash.bashrc code in;\n                        prints to stdout if not provided. (default: None)\n  -i, --print_templates\n                        Outputs the default templates to stdout. (default:\n                        False)\n  -L, --list_fonts      Outputs the available fonts. (default: False)\n  -F FONT, --print_font_info FONT\n                        Outputs information about the specified font.\n                        (default: None)\n```\n\n## Example\n\nUsing the following command-line:\n\n```commandline\ndocker-banner-gen \\\n    -b \"TF ObjDet\" \\\n    -s 1.14.0_2019-08-31 \\\n    -p tf-objdet \\\n    -o $HOME/bash.bashrc\n```\n\nThe generated `$HOME/bash.bashrc` file looks like this:\n\n\n```bash\n# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n# Copyright 2020 University of Waikato, Hamilton, NZ. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# ==============================================================================\n\nexport PS1=\"\\[\\e[31m\\]tf-objdet\\[\\e[m\\] \\[\\e[33m\\]\\w\\[\\e[m\\] \u003e \"\nexport TERM=xterm-256color\nalias grep=\"grep --color=auto\"\nalias ls=\"ls --color=auto\"\n\necho -e \"\\e[1;31m\"\ncat\u003c\u003cDBG\n _____ _____    ___  _     _ ____       _   \n|_   _|  ___|  / _ \\\\| |__ (_)  _ \\\\  ___| |_ \n  | | | |_    | | | | '_ \\\\| | | | |/ _ \\\\ __|\n  | | |  _|   | |_| | |_) | | |_| |  __/ |_ \n  |_| |_|      \\\\___/|_.__// |____/ \\\\___|\\\\__|\n                        |__/                \n\n1.14.0_2019-08-31\n\nDBG\necho -e \"\\e[0;33m\"\n\nif [[ $EUID -eq 0 ]]; then\n  cat \u003c\u003cWARN\nWARNING: You are running this container as root, which can cause new files in\nmounted volumes to be created as the root user on your host machine.\n\nTo avoid this, run the container by specifying your user's userid:\n\n$ docker run -u \\$(id -u):\\$(id -g) args...\nWARN\nelse\n  cat \u003c\u003cEXPL\nYou are running this container as user with ID $(id -u) and group $(id -g),\nwhich should map to the ID and group for your user on the Docker host. Great!\nEXPL\nfi\n\n# Turn off colors\necho -e \"\\e[m\"\n```\n\nThe following outputs get generated by this script:\n\n* running as root\n\n    ```\n     _____ _____    ___  _     _ ____       _   \n    |_   _|  ___|  / _ \\| |__ (_)  _ \\  ___| |_ \n      | | | |_    | | | | '_ \\| | | | |/ _ \\ __|\n      | | |  _|   | |_| | |_) | | |_| |  __/ |_ \n      |_| |_|      \\___/|_.__// |____/ \\___|\\__|\n                            |__/                \n    \n    1.14.0_2019-08-31\n    \n    WARNING: You are running this container as root, which can cause new files in\n    mounted volumes to be created as the root user on your host machine.\n    \n    To avoid this, run the container by specifying your user's userid:\n    \n    $ docker run -u \\$(id -u):\\$(id -g) args...\n    \n    tf-objdet / \u003e \n    ```\n\n* running as regular user\n\n    ```\n     _____ _____    ___  _     _ ____       _   \n    |_   _|  ___|  / _ \\| |__ (_)  _ \\  ___| |_ \n      | | | |_    | | | | '_ \\| | | | |/ _ \\ __|\n      | | |  _|   | |_| | |_) | | |_| |  __/ |_ \n      |_| |_|      \\___/|_.__// |____/ \\___|\\__|\n                            |__/                \n    \n    1.14.0_2019-08-31\n    \n    You are running this container as user with ID 12345 and group 12345,\n    which should map to the ID and group for your user on the Docker host. Great!\n    \n    tf-objdet / \u003e\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaikato-datamining%2Fdocker-banner-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaikato-datamining%2Fdocker-banner-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaikato-datamining%2Fdocker-banner-gen/lists"}