{"id":17941859,"url":"https://github.com/shiritai/oh-my-scripts","last_synced_at":"2026-05-07T08:38:18.086Z","repository":{"id":257462750,"uuid":"854227243","full_name":"Shiritai/oh-my-scripts","owner":"Shiritai","description":"The scripting tool for container environment build-up development. OH MY SCRIPTS!!!","archived":false,"fork":false,"pushed_at":"2024-10-16T15:48:46.000Z","size":98,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-19T07:41:42.272Z","etag":null,"topics":["bash-script","container","developer-tools","docker","dockerfile","firefox","gnome","no-vnc","nvidia-docker","ssh","systemd","user","vnc","vscode"],"latest_commit_sha":null,"homepage":"","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/Shiritai.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":"2024-09-08T17:56:30.000Z","updated_at":"2024-10-16T16:43:41.000Z","dependencies_parsed_at":"2024-10-18T02:18:44.760Z","dependency_job_id":null,"html_url":"https://github.com/Shiritai/oh-my-scripts","commit_stats":null,"previous_names":["shiritai/oh-my-scripts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shiritai%2Foh-my-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shiritai%2Foh-my-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shiritai%2Foh-my-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shiritai%2Foh-my-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shiritai","download_url":"https://codeload.github.com/Shiritai/oh-my-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247006667,"owners_count":20868033,"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-script","container","developer-tools","docker","dockerfile","firefox","gnome","no-vnc","nvidia-docker","ssh","systemd","user","vnc","vscode"],"created_at":"2024-10-29T02:04:29.267Z","updated_at":"2026-05-07T08:38:17.729Z","avatar_url":"https://github.com/Shiritai.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oh-my-scripts\n\n\u003e [!NOTE]\n\u003e For Chinese document, please check [this document (中文文檔).](./README.zh_TW.md)\n\n## TL;DR\n\n```bash\n\u003e OMS_MODE=h ./run.sh\noh-my-scripts:\n    The scripting tool for container environment build-up development. OH MY SCRIPTS!!!\n\nUsage: OMS_MODE=\u003cMODE_FLAGs\u003e [ARG=VALUE]... ./run.sh\n\nPossible \u003cMODE_FLAGs\u003e:\n    b: build image\n    r: run container\n    br: build image and run container\n    d: dry-run mode, will only shows all the arguments in json form without conducting any real sction\n    h: print this help message and exit\n\nFor all possible [ARG=VALUE]s, please refer to the parameter part of this scripts\n```\n\n### Quick Examples\n\nIf we want to\n\n* build a image\n* based on `osrf/ros:humble-desktop-full`\n* named `oh-my-novnc`\n* with Gnome GUI support\n* with `ssh` and `novnc` support\n* with ssh port exposed on `1234`\n\n```bash\nBASE_IMG=osrf/ros:humble-desktop-full \\\nIMG_NAME=oh-my-novnc \\\nUSE_SSH=yes \\\nSSH_PORT=1234 \\\nUSE_USER_PWSD=yes \\ # optional for ssh login\nUSER_PSWD=\u003cYOUR_PASSWORD\u003e \\ # default to \"CHANGE_ME\"\nUSE_GUI=yes \\ # will install the minimal Gnome GUI for us\nUSE_NO_VNC=yes \\ # for port exposure, please assign `NO_VNC_PORT`\nVNC_PSWD=\u003cVNC_LOGIN_PASSWORD\u003e \\ # optional, default to \"vnc_pswd\"\nOMS_MODE=b ./run.sh\n```\n\n\u003e [!TIP]\n\u003e If we want to run the image immediately, change the last argument to `OMS_MODE=br`.\n\u003e\n\u003e The container name will default to the image name, or you can set `CONTAINER_NAME` to overwrite it.\n\n## Abstract\n\nContainerization is a great technology. It allows tasks such as building, removing, and migrating identical environments to perform far faster than virtual machines. With it, we can almost instantly deploy services using pre-built images by others.\n\nThat being said, for developers providing services, those who build a service or a corresponding ready-to-use container environment, writing a Dockerfile and scripts, followed by `docker build` and then `docker run` to verify the results, and then modifying the `Dockerfile` and repeating the process, is still a tedious, time-consuming, and inelegant.\n\nIs there a way to break the status quo? Is there a tool that can greatly accelerate container development? One that can provide developers with a ready-to-use and easily reusable library of environment templates, allowing them to maximize the advantages of containers? This is the goal of `oh-my-scripts`.\n\n## Usage\n\n### Introduction\n\nRun `run.sh`。\n\nIt has many parameters. You can refer to the first half of `run.sh` under the section `Customizable Parameters` for variable settings.\n\n\u003e [!TIP]\n\u003e You can use `OMS_MODE=d ./run.sh` (dry-run) to show the arguments for execution.\n\n```bash\n# ----------- [Customizable Parameters] -----------\n\nBASE_IMG=${BASE_IMG:-'ubuntu:20.04'}\nIMG_NAME=${IMG_NAME:-'oh-my-c'}\nCONTAINER_NAME=${CONTAINER_NAME:-IMG_NAME}\n\nLOCALE=${LOCALE:-$((locale -a | grep -v C | grep -v POSIX | head -n 1) || echo '')}\nTZ=${TZ:-$(timedatectl show | grep -E 'Timezone=' | grep -E -o '[a-zA-Z]+\\/[a-zA-Z]+' 2\u003e/dev/null || echo \"\")}\n\n# Systemd support\nUSE_SYSTEMD=${USE_SYSTEMD:-'yes'} # yes or no\n\n# Username of the container\nUSERNAME=${USERNAME:-$USER}\n\n# ...\n\n# ----------- [Util Part] -----------\n```\n\n`run.sh` will:\n\n* If `docker build` is needed\n  * Prepare building arguments\n  * Zip `scripts/\u003cDIR\u003e` to `scripts-\u003cDIR\u003e.zip`\n    * `utils`, `common`, `custom` and `app` will only be zipped when the corresponding zip file does not present. If there is any change to these part, please delete the corresponding zip file or run `clean.sh` to remove them.\n    * `dev` will re-zip anytime, files inside it are considered to be changed frequently\n  * Generate `.dockerignore`\n  * `docker build`\n  * Remove generated `.dockerignore`, `scripts-dev.zip`\n* if `docker run` is needed, run it\n  * Plugins will be installed with the following order\n    * `core` -\u003e `common` -\u003e `app` -\u003e `custom` -\u003e `dev`\n\n### Add you own plugins\n\nPlease put your plugin scripts to `scripts/custom` or `scripts/dev`.\n\n\u003e Def of plugin: directory in which `setup.sh` presents, see `README.md` in `custom` or `dev` for more info.\n\n* `scripts/custom`: stable container plugins\n* `scripts/dev`: unstable container plugins\n\nWhen some plugin in `scripts/dev` is tested to be stable, feel free to put them into `scripts/custom` and remove generated `scripts-custom.zip`.\n\n## Features\n\nCurrently, the following features are supported.\n\n### User related\n\n|Features|Argument|Default|p.s.|\n|:-:|:-:|:-:|:-:|\n|user name|`USERNAME`|as current user||\n|user password|`USE_USER_PSWD`|no|`USER_PSWD` default to `CHANGE_ME`|\n\n### `core`\n\n|Features|Argument|Default|\n|:-:|:-:|:-:|\n|locale|`LOCALE`|as host\u003cbr\u003e(detect using `locale`)|\n|timezone|`TZ`|as host\u003cbr\u003e(detect using `timedatectl`)|\n|systemd|`USE_SYSTEMD`|yes|\n\n### `common`\n\nAll basic features are optional and disabled by default. Parameters prefixed with `USE_` are set to `no` by default.\n\n|Features|Argument|optional argument|default value of\u003cbr\u003eoptional argument|\n|:-:|:-:|:-:|:-:|\n|ssh|`USE_SSH`|`SSH_PORT`|22|\n|vnc|`USE_VNC`|`VNC_PORT`|5901|\n|||`VNC_PSWD`|`vncpswd`|\n|noVNC|`USE_NO_VNC`|`NO_VNC_PORT`|6901|\n|zsh + oh-my-zsh|`USE_OMZ`|Please provide your `.zshrc`\u003cbr\u003eand other zsh related dotfiles\u003cbr\u003eand put them into `common/omz`|Dotfiles prefixed with\u003cbr\u003e`example` in `common/omz`|\n|Nvidia GPU|`USE_GPU`|||\n|GUI (Gnome)|`USE_GUI`|||\n\n### `app`\n\nSet `USE_APP` to `yes` to use the following applications, which are disabled (set to `no`) by default.\n\nIf you want to use these software applications, it is recommended to set `USE_GUI` to `yes`, or provide the corresponding GUI scripts to the `custom` or `dev` directories.\n\n* Firefox: best browser on Linux\n* vscode: handy IDE\n\n## Test\n\n### Add a new test\n\nIn `.github/workflows/tests.yml`, we can add a simplest test job like:\n\n```yaml\nsimple-test:\n\n  runs-on: ubuntu-latest\n\n  steps:\n  - uses: actions/checkout@v4\n\n  - name: Build and run image\n    run: OMS_MODE=br IMG_NAME=... ... ${{ github.workspace }}/run.sh\n\n  - name: Check build result A\n    run: docker exec ..., docker ps | grep ..., or else\n\n  - name: Check build result B\n    run: docker exec ..., docker ps | grep ..., or else\n  \n  ...\n```\n\nIf the image you use can be benefit by other builds, you can then first upload the built image as artifact and download them in the other jobs to speedup test suite.\n\n* Build job\n\n  ```yaml\n  build-simple-image:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v4\n      \n      - name: Build image\n        run: |\n          OMS_MODE=b IMG_NAME=\u003cARTIFACT_NAME\u003e ... ${{ github.workspace }}/run.sh\n      \n      - name: Export image\n        run: |\n          docker save \u003cARTIFACT_NAME\u003e \u003e \u003cARTIFACT_NAME\u003e.tar\n          cp \u003cARTIFACT_NAME\u003e.tar /tmp/\u003cARTIFACT_NAME\u003e.tar\n      \n      - name: Upload artifact\n        uses: actions/upload-artifact@v4\n        with:\n          name: \u003cARTIFACT_NAME\u003e\n          path: /tmp/\u003cARTIFACT_NAME\u003e.tar\n  ```\n  \n* Job that use built image\n\n  ```yaml\n  simple-test:\n\n    runs-on: ubuntu-latest\n    needs: [build-simple-image]\n    if: ${{ needs.build-simple-image.result == 'success' }}\n\n    steps:\n    - uses: actions/checkout@v4\n    \n    - name: Download artifact\n      uses: actions/download-artifact@v4\n      with:\n        name: \u003cARTIFACT_NAME\u003e\n        path: /tmp\n    \n    - name: Load image\n      run: |\n        docker load --input /tmp/\u003cARTIFACT_NAME\u003e.tar\n        docker image ls -a\n\n    - name: Build and run image\n      run: |\n        OMS_MODE=br IMG_NAME=\u003cARTIFACT_NAME\u003e ... ${{ github.workspace }}/run.sh\n  ```\n\n### Pre-builds\n\nTo conduct unit or integration test on some new `core`/`common` plugin, which the build time may consume so much time, we can take the advantage of prebuild image that install and only install packages we need without further configurations.\n\nWe can put the `Dockerfile` into `tests/prebuild-scripts/\u003cimage_name\u003e/Dockerfile` and run `tests/prebuild-all.sh` to build all images ***INTERACTIVELY***.\n\n```bash\n\u003e \u003cREPO\u003e/scripts/run-with-utils.sh \u003cREPO\u003e/tests/prebuild-all.sh\n[INFO] Checking \u003c...\u003e/oh-my-scripts/tests for Dockerfile\n[INFO] Checking \u003c...\u003e/oh-my-scripts/tests/prebuild-scripts for Dockerfile\n[INFO] Checking \u003c...\u003e/oh-my-scripts/tests/prebuild-scripts/gnome-vnc for Dockerfile\n[INFO] Find Dockerfile in gnome-vnc, do you want to build this image? [y/N]\n\u003cPLEASE ANSWER THIS QUESTION FOR ALL THE IMAGES [y/N]\u003e\n```\n\n\u003e [!NOTE]\n\u003e Note that `\u003cREPO\u003e/tests/prebuild-all.sh` also use functions defined in `\u003cREPO\u003e/scripts/utils`.\n\nThen you can mark the image to be uploadable and upload to docker hub. For example, the `gnome-vnc` image:\n\n```bash\ndocker image tag oh-my-scripts:gnome-vnc \u003cDOCKER_HUB_USER\u003e/oh-my-scripts:gnome-vnc\ndocker push \u003cDOCKER_HUB_USER\u003e/oh-my-scripts:gnome-vnc\n```\n\n\u003e [!IMPORTANT]\n\u003e Please let [me](https://github.com/Shiritai) (shingekinocore@gmail.com) know you want to use my remote image repo or you can just use your own remote.\n\n## Roadmap\n\n### Dev tools\n\n* Automatically record the commands executed after the container is running (commands - results), and further automate the scripting process\n* Parallelize container building: support the simultaneous creation of multiple containers with only minor differences in their construction. Track these differences and their corresponding containers as pairs, making it easier for developers to quickly experiment with various built images.\n\n### Customize tools\n\n* Make parameter assignments into interactive/non-interactive configuration files\n* New `common` plugins\n  * `audio` to make noVNC supports audio streaming\n  * `wine` run windows compatible program\n* Support more Linux distributions\n  * Ubuntu (current)\n  * Arch Linux (support)\n  * Alpine Linux\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiritai%2Foh-my-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiritai%2Foh-my-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiritai%2Foh-my-scripts/lists"}