{"id":13828837,"url":"https://github.com/augustohp/ship","last_synced_at":"2025-09-04T01:35:25.748Z","repository":{"id":137558997,"uuid":"205733270","full_name":"augustohp/ship","owner":"augustohp","description":"Aids you creating a `Dockerfile` by transforming its (interactive shell) history into `RUN` instructions","archived":false,"fork":false,"pushed_at":"2019-10-25T15:18:44.000Z","size":9,"stargazers_count":54,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-29T23:59:43.338Z","etag":null,"topics":["developer-tools","docker","posix-sh","shell"],"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/augustohp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2019-09-01T21:16:24.000Z","updated_at":"2023-09-19T01:56:58.000Z","dependencies_parsed_at":"2024-02-06T05:00:14.166Z","dependency_job_id":null,"html_url":"https://github.com/augustohp/ship","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/augustohp/ship","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augustohp%2Fship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augustohp%2Fship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augustohp%2Fship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augustohp%2Fship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/augustohp","download_url":"https://codeload.github.com/augustohp/ship/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/augustohp%2Fship/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273539280,"owners_count":25123494,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"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":["developer-tools","docker","posix-sh","shell"],"created_at":"2024-08-04T09:03:13.408Z","updated_at":"2025-09-04T01:35:25.720Z","avatar_url":"https://github.com/augustohp.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# SHIP: Shell Helper To Initialize (Dockerfiles) in a new Project\n\nLet's create a new image, on an existing repository, to install [bash][]:\n\n[bash]: https://www.gnu.org/software/bash/\n\n    host      $ cd \u003crepository path\u003e\n    host      $ ship alpine:latest\n    container $ apk add --no-cache bash\n    container $ exit\n    Dockerfile written successfully!\n    host      $ cat Dockerfile\n    # Generated by https://github.com/augustohp/ship\n    FROM alpine:latest\n    LABEL maintainer=\"Augusto Pascutti \u003caugusto.hp@gmail.com\u003e\"\n\n    RUN apk add --no-cache bash\n\nWhat happened?\n\n1. The container specified was executed in iterative mode\n1. `bash` (prefered) or `ash` shell are detected and history configured\n1. The current directory was mounted at `/home/developer`\n1. The `history` of the container was converted to `RUN` instructions in the `Dockefile`\n1. Your [Git][] credentials become `LABEL maintainer`, if they are available\n\nSupported images are (other images might work if they have `bash` available):\n\n* alpine\n* ubuntu/debian\n* fedora\n\n## Installation\n\nThis is a single-file script, you can rename it freely to anything memorable for\nyou. An easy one-line install is available through [sinister][]:\n\n[sinister]: https://github.com/jamesqo/sinister\n\n\tsh \u003c(curl -sSL https://git.io/fjjvu) --name ship --local --chmod 755 --url https://git.io/fjhO5\n\nThe above one-liner will install the script just for the current user. If you\nwant it globally, remove `--local` option.\n\nYou should be able to execute `ship` now, for example `ship --help`:\n\n\tUsage: ship [-o \u003cfilename\u003e] [-f] \u003cimage\u003e\n           ship \u003c-d | --detect-shell\u003e \u003cimage\u003e\n           ship \u003c-h | --help\u003e\n           ship \u003c-v | --version\u003e\n\n\tEases the creation of a Dockerfile by transforming the history\n\tinto RUN instructions.\n\n\tArguments:\n\t  image                    The name of Dockerimage to be executed. \n                               The image must have bash installed.\n\tOptions:\n\t  -o | --out \u003cfilename\u003e    The name of the Dockerfile to be creared.\n                               Default: Dockerfile.\n\t  -f | --force             Re-creates Dockerfile if it\n                               already exists.\n\t  -d | --detect-shell      Outputs the shell available in the image.\n                               Shells tested: bash ash\n\n**Requirements**, trying to be minimal, are:\n\n* [Docker][]\n* If [Git][] is available, you get the `maintainer` label in the `Dockerfile`\n* A [POSIX (compatible) Shell][posix] (`bash`, for example)\n\n[posix]: https://unix.stackexchange.com/questions/58249/what-is-difference-between-posix-bash-and-other-shells-for-scripting\n[docker]: https://docs.docker.com/install/\n[git]: https://git-scm.com\n\n## Development\n\nThere is a `Makefile` to automate checks on the script:\n\n* `make lint` runs [shellcheck][]\n* `make test` runs [bats][] tests\n\n[shellcheck]: https://github.com/koalaman/shellcheck\n[bats]: https://github.com/sstephenson/bats\n\nFeel free to hack the `ship` script. It uses `sh` not `bash` to run, so try to\navoid [bashisms][]. Almost everything inside the script is on a function to be\nfriendly even if you've never done any shell-scripting before.\n\n[bashisms]: https://mywiki.wooledge.org/Bashism\n\nPlease, feel free to report bugs, ideas or feature requests through an [issue][].\n\n[issue]: https://github.com/augustohp/ship/issues/new\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustohp%2Fship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faugustohp%2Fship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustohp%2Fship/lists"}