All Projects → alpinelinux → alpine-make-rootfs

alpinelinux / alpine-make-rootfs

Licence: MIT license
Make customized Alpine Linux rootfs (base image) for containers

Programming Languages

shell
77523 projects
Makefile
30231 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to alpine-make-rootfs

docker-alpine-nginx-pagespeed
Dockerized Nginx with PageSpeed Module on Alpine Linux
Stars: ✭ 28 (-70.53%)
Mutual labels:  alpine-linux
docker flutter
Alpine Linux image for Flutter & Dart with helpful utils and web build support.
Stars: ✭ 33 (-65.26%)
Mutual labels:  alpine-linux
docker-geoserver
A basic docker geoserver image with JAI and marlin renderer running on tomcat
Stars: ✭ 17 (-82.11%)
Mutual labels:  alpine-linux
lnmp-docker
Docker for LNMP ( Alpine Linux + PHP7 + Nginx+ Supervisor + Crontab ) 开发环境镜像
Stars: ✭ 23 (-75.79%)
Mutual labels:  alpine-linux
awall
[MIRROR] Alpine firewall configuration tool
Stars: ✭ 37 (-61.05%)
Mutual labels:  alpine-linux
Docker-Webstack
A webstack container built on Alpine, running Nginx, PHP, and S6-overlay.
Stars: ✭ 64 (-32.63%)
Mutual labels:  alpine-linux
docker-linguist
GitHub Linguist Docker image
Stars: ✭ 24 (-74.74%)
Mutual labels:  alpine-linux
alpinist
Automatic Alpine Linux Package (apk) Repository Generation using AWS Lambda, S3 & SSM Parameter Store
Stars: ✭ 45 (-52.63%)
Mutual labels:  alpine-linux
mkinitfs
[MIRROR] Tool to create initramfs images
Stars: ✭ 37 (-61.05%)
Mutual labels:  alpine-linux
alpine-desktop
No description or website provided.
Stars: ✭ 13 (-86.32%)
Mutual labels:  alpine-linux
docker-healthchecks
Healthchecks Docker image
Stars: ✭ 17 (-82.11%)
Mutual labels:  alpine-linux
index
A PEP 503-compliant Python package index specifically providing wheels built for Alpine Linux
Stars: ✭ 26 (-72.63%)
Mutual labels:  alpine-linux
piu
Cross platform package manager wrapper
Stars: ✭ 33 (-65.26%)
Mutual labels:  alpine-linux
alpine-php-fpm
Lightweight and optimised PHP-FPM (PHP 7.4, 8.0, 8.1) Docker images with essential extensions on top of latest Alpine Linux.
Stars: ✭ 53 (-44.21%)
Mutual labels:  alpine-linux
alpine-php-wordpress
Wordpress running on Alpine Linux [Docker]
Stars: ✭ 30 (-68.42%)
Mutual labels:  alpine-linux
tn3399 v3
TN3399_V3 开发板折腾记录
Stars: ✭ 66 (-30.53%)
Mutual labels:  rootfs
alpine-conf
[MIRROR] Alpine configuration management scripts
Stars: ✭ 38 (-60%)
Mutual labels:  alpine-linux
docker-pure-ftpd
Pure-FTPd Docker image based on Alpine Linux with MySQL, PostgreSQL and LDAP support
Stars: ✭ 36 (-62.11%)
Mutual labels:  alpine-linux
PRoot
chroot, mount --bind, and binfmt_misc without privilege/setup for Linux
Stars: ✭ 31 (-67.37%)
Mutual labels:  rootfs
firecracker-task-driver
nomad task driver that uses firecracker to start micro-vms
Stars: ✭ 85 (-10.53%)
Mutual labels:  rootfs

Make Alpine Linux RootFS

Build Status

This project provides a script for building customized Alpine Linux rootfs (a base image if you like) for containers. It’s quite simple (250 LoC of shell), fast and requires minimum dependencies (just common Linux tools).

Tip
Do you want to just quickly chroot into Alpine Linux, e.g. on CI? Check out alpine-chroot-install!

Requirements

  • Linux system

  • POSIX-sh compatible shell (e.g. Busybox ash, dash, ZSH, bash, …)

  • common userland with chroot, getopt, grep, sed, sha256sum, wget (e.g. from Busybox, GNU coreutils, …)

  • tar (full-blown)

Usage

Read documentation in alpine-make-rootfs. See .github/workflows/ci.yml for GitHub Actions example.

You can copy alpine-make-rootfs into your repository or download it on demand, e.g.:

wget https://raw.githubusercontent.com/alpinelinux/alpine-make-rootfs/v0.6.0/alpine-make-rootfs \
    && echo 'c9cfea712709df162f4dcf26e2b1422aadabad43  alpine-make-rootfs' | sha1sum -c \
    || exit 1

Examples

Installation Script in Heredoc

sudo ./alpine-make-rootfs \  # (1)
    --branch v3.8 \  # (2)
    --packages 'ruby ruby-bigdecimal sqlite' \  # (3)
    --timezone 'Europe/Prague' \  # (4)
    --script-chroot \  # (5)
    example-$(date +%Y%m%d).tar.gz - <<'SHELL'  # (6)
        # Copy some file from the repository root to the rootfs.
        install -D -m 755 examples/hello_world.rb /app/hello_world.rb

        # Install some dev packages and gem mailcatcher.
        apk add --no-progress -t .make build-base ruby-dev sqlite-dev
        gem install --no-document mailcatcher

        # Clean-up dev packages.  (7)
        apk del --no-progress .make
SHELL
  1. 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).

  2. Alpine branch (release) to install (see Alpine Releases).

  3. You can name packages to install into the chroot, in addition to base packages (see ALPINE_BASE_PKGS in alpine-make-rootfs).

  4. You may specify timezone to set (default is UTC).

  5. This flag tells that the installation script will be executed inside chroot with the rootfs as new root. 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.

  6. Installation script may be provided also via STDIN, using a convenient heredoc syntax. The script passed is executed using /bin/sh -e.

  7. Note that it’s not needed to clean apk cache, this is done automatically.

Create Docker Base Image

Create your own (customized) up-to-date base image.

sudo ./alpine-make-rootfs --branch v3.8 - | docker import -c 'CMD /bin/sh' - my/alpine:3.8

Create OCI Image

You can use simply shell script sloci-image to pack the generated rootfs as a single-layer OCI image.

sudo ./alpine-make-rootfs --branch v3.8 --script-chroot rootfs.tar.gz ./install.sh
./sloci-image --entrypoint /start.sh --port 80/tcp --tar rootfs.tar.gz alpine:3.8

License

This project is licensed under MIT License. For the full text of the license, see the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].