{"id":13876029,"url":"https://github.com/alpinelinux/alpine-make-rootfs","last_synced_at":"2025-05-16T15:02:36.504Z","repository":{"id":39633974,"uuid":"126085002","full_name":"alpinelinux/alpine-make-rootfs","owner":"alpinelinux","description":"Make customized Alpine Linux rootfs (base image) for containers","archived":false,"fork":false,"pushed_at":"2025-01-14T15:00:25.000Z","size":72,"stargazers_count":225,"open_issues_count":6,"forks_count":46,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T12:54:49.185Z","etag":null,"topics":["alpine-linux","containers","image-builder","rootfs","shell-script"],"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/alpinelinux.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"jirutka"}},"created_at":"2018-03-20T21:31:12.000Z","updated_at":"2025-04-03T00:19:23.000Z","dependencies_parsed_at":"2025-01-15T02:14:05.854Z","dependency_job_id":"92ddd71f-aff9-4efc-86fd-483cfb88cb88","html_url":"https://github.com/alpinelinux/alpine-make-rootfs","commit_stats":{"total_commits":67,"total_committers":4,"mean_commits":16.75,"dds":0.04477611940298509,"last_synced_commit":"1c678e9da601e4e3de588219cd0044298c4532a8"},"previous_names":["jirutka/alpine-make-rootfs"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpinelinux%2Falpine-make-rootfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpinelinux%2Falpine-make-rootfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpinelinux%2Falpine-make-rootfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpinelinux%2Falpine-make-rootfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alpinelinux","download_url":"https://codeload.github.com/alpinelinux/alpine-make-rootfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553936,"owners_count":22090415,"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":["alpine-linux","containers","image-builder","rootfs","shell-script"],"created_at":"2024-08-06T06:00:57.739Z","updated_at":"2025-05-16T15:02:36.456Z","avatar_url":"https://github.com/alpinelinux.png","language":"Shell","funding_links":["https://github.com/sponsors/jirutka"],"categories":["containers","Shell"],"sub_categories":[],"readme":"= Make Alpine Linux RootFS\n:script-name: alpine-make-rootfs\n:script-sha1: 2ebf310a0c6eb1b3ac9587d6211f1e84227846f0\n:gh-name: alpinelinux/{script-name}\n:version: 0.7.2\n\nifdef::env-github[]\nimage:https://github.com/{gh-name}/workflows/CI/badge.svg[\"Build Status\", link=\"https://github.com/{gh-name}/actions\"]\nendif::env-github[]\n\nThis project provides a script for building customized https://alpinelinux.org/[Alpine Linux] rootfs (a base image if you like) for containers.\nIt’s quite simple (300 LoC of shell), fast and requires minimum dependencies (just common Linux tools).\n\nTIP: Do you want to just quickly chroot into Alpine Linux, e.g. on CI?\n     Check out https://github.com/alpinelinux/alpine-chroot-install[alpine-chroot-install]!\n\n\n== Requirements\n\n* Linux system\n* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html[POSIX-sh] compatible shell (e.g. Busybox ash, dash, ZSH, bash, …)\n* common userland with `chroot`, `getopt`, `grep`, `sed`, `sha256sum`, `wget` (e.g. from Busybox, GNU coreutils, …)\n* `tar` (full-blown)\n\n\n== Usage\n\nRead documentation in link:{script-name}[{script-name}].\nSee link:.github/workflows/ci.yml[] for GitHub Actions example.\n\nYou can copy link:{script-name}[{script-name}] into your repository or download it on demand, e.g.:\n\n[source, sh, subs=\"+attributes\"]\nwget https://raw.githubusercontent.com/{gh-name}/v{version}/{script-name} \\\n    \u0026\u0026 echo '{script-sha1}  {script-name}' | sha1sum -c \\\n    || exit 1\n\n\n== Examples\n\n=== Installation Script in Heredoc\n\n[source, sh]\n----\nsudo ./alpine-make-rootfs \\  # \u003c1\u003e\n    --branch v3.8 \\  # \u003c2\u003e\n    --packages 'ruby ruby-bigdecimal sqlite' \\  # \u003c3\u003e\n    --timezone 'Europe/Prague' \\  # \u003c4\u003e\n    --script-chroot \\  # \u003c5\u003e\n    example-$(date +%Y%m%d).tar.gz - \u003c\u003c'SHELL'  # \u003c6\u003e\n        # Copy some file from the repository root to the rootfs.\n        install -D -m 755 examples/hello_world.rb /app/hello_world.rb\n\n        # Install some dev packages and gem mailcatcher.\n        apk add --no-progress -t .make build-base ruby-dev sqlite-dev\n        gem install --no-document mailcatcher\n\n        # Clean-up dev packages.  \u003c7\u003e\n        apk del --no-progress .make\nSHELL\n----\n\u003c1\u003e The script needs to create files owned by _root_ or other users and optionally uses chroot (when `--script-chroot` is specified), so it must be run under _root_ (e.g. using `sudo`).\n\u003c2\u003e Alpine branch (release) to install (see https://wiki.alpinelinux.org/wiki/Alpine_Linux:Releases[Alpine Releases]).\n\u003c3\u003e You can name packages to install into the chroot, in addition to base packages (see `ALPINE_BASE_PKGS` in link:{script-name}[{script-name}]).\n\u003c4\u003e You may specify timezone to set (default is UTC).\n\u003c5\u003e This flag tells that the installation script will be executed inside chroot with the rootfs as new root.\n    Your current working directory is binded at `/mnt` inside the chroot and `$PWD` for the script is set to `/mnt`, so you can easily access files out of the chroot and copy them into the rootfs.\n\u003c6\u003e Installation script may be provided also via STDIN, using a convenient heredoc syntax.\n    The script passed is executed using `/bin/sh -e`.\n\u003c7\u003e Note that it’s not needed to clean `apk` cache, this is done automatically.\n\n\n=== Create Docker Base Image\n\nCreate your own (customized) up-to-date base image.\n\n[source, sh]\n----\nsudo ./alpine-make-rootfs --branch v3.8 - | docker import -c 'CMD /bin/sh' - my/alpine:3.8\n----\n\n\n=== Create OCI Image\n\nYou can use simply shell script https://github.com/jirutka/sloci-image/[sloci-image] to pack the generated rootfs as a single-layer OCI image.\n\n[source, sh]\n----\nsudo ./alpine-make-rootfs --branch v3.8 --script-chroot rootfs.tar.gz ./install.sh\n./sloci-image --entrypoint /start.sh --port 80/tcp --tar rootfs.tar.gz alpine:3.8\n----\n\n\n== License\n\nThis project is licensed under http://opensource.org/licenses/MIT/[MIT License].\nFor the full text of the license, see the link:LICENSE[LICENSE] file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falpinelinux%2Falpine-make-rootfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falpinelinux%2Falpine-make-rootfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falpinelinux%2Falpine-make-rootfs/lists"}