diff options
| -rw-r--r-- | README.md | 106 |
1 files changed, 77 insertions, 29 deletions
@@ -1,67 +1,115 @@ -# arch-docker +# Arch-Docker -Script to create docker images based on Arch Linux on x86_64. +This repository contain ZSH scripts to create Docker images based on Arch Linux +x86_64. -## Base Image +Docker image is just a root file system with metadata and historical values. +Each time we issued a `COPY` command or doing some things that modified the +rootfs through `Dockerfile`, docker will compute the checksum of resulting +image and find the matching image with the same size, if its found it will be +used. -Size: 114M. +This is good, it can minimize size usage in local host, but it slow. -Base image generated using modified `pacstrap` script from -`arch-install-script` package. This image use or containts, +This script bypass the usage of `Dockerfile` and directly create rootfs, +modified it, and import it to Docker as image. + +Arch Linux is become bloated, I recommend to use Alpine Linux for small size +and probably faster container. + +## How To + +The steps to create new custom image, + +* Copy directory `arch-base-template` to new directory. +* Modified the `vars.sh` script to install and/or remove packages for + installation in rootfs. +* Modify the `bootstrap_rootfs.sh` to run specific command when creating + rootfs. +* Modify the `init.sh` to run specific command when image is running. +* To generate rootfs, execute + + ``` + # ./create_rootfs.sh + ``` + + This will create directory `arch-rootfs`, mounted using `tmpfs`, in the + current directory. + +* You can modified the rootfs, and +* create Docker image with -* `arch-base` as hostname, -* `UTC` as timezone, -* `en_GB.UTF-8` as locale, -* `ansi`, `cygwin`, `linux`, `screen-256color`, `vt100`, -`vt220`, and `xterm` in terminfo; -* explicitly installed packages are `bash`, `coreutils`, `ca-certificates`, `pacman`, `sed`, `binutils`, `file`. -, and `grep`. + ``` + # ./create_image.sh + ``` -To generate rootfs, execute +* Thats it. -``` -# ./create-rootfs.sh -``` +For an example, you can view other directory in this repository. -This will create directory `arch-rootfs`, mounted using `tmpfs`, in the current -directory. You can modified the rootfs, and import back to docker using, +# Images scripts -``` -# ./create-image.sh -``` +Each directory in this repository contain the scripts and variable to create +Docker image. +The `arch-base-*` is directory where the image is created without Dockerfile, +and others directories are where the image is created using Dockerfile +using `arch-base` as the base image. -This will create and import image name as `sulhan/arch-base:latest`. +## Base Image + +Base image generated using modified `pacstrap` script from +`arch-install-script` package. This image use or containts, + +* Size 118M. +* Hostname using `arch-base`, +* Timezone using `UTC`, +* Locales using `en_GB.UTF-8` and `en_US.UTF-9` +* Terminfo include only `ansi`, `cygwin`, `linux`, `screen-256color`, `vt100`, + `vt220`, and `xterm` +* Installed packages are `acl`, `attr`, `bash`, `coreutils`, `db`, + `filesystem`, `gcc-libs`, `glibc`, `gmp`, `iana-etc`, `libcap`, + `linux-api-headers`, `ncurses`, `openssl`, `perl`, `readline`, `tzdata`, and + `zlib`. + +The following images created using rootfs (without `Dockerfile`). + +### Redis Image + +* Base image: `sulhan/arch-base`. +* Installed packages: `redis` +* This image expose port 6379. +* Using volume in `/var/lib/redis`. -NOTE: remember to change the image name in `create-image.sh` if needed. +The following images created with Dockerfile using `arch-base` as base image: -## Nodejs Image +### Nodejs Image * Base image: `sulhan/arch-base`. * Installed packages: `git`, `gcc`, `make`, `python2`, `nodejs` and `npm`. * This image expose port 80. -## Postgresql Image +### Postgresql Image * Base image: `sulhan/arch-base`. * Installed packages: postgresql (plus dependencies). * This image expose port 5432. * Using volume in `/var/lib/postgres`. -## Jenkins Image +### Jenkins Image * Base image: `sulhan/arch-base`. * Installed packages: `git`, `jre8-openjdk`, `jenkins` * This image expose port 8090. * Using volume in `/srv/www`. -## Buildbot Image +### Buildbot Image * Base image: `sulhan/arch-nodejs:latest`. * Installed packages: `buildbot`, `buildbot-slave`. * This image expose port 8010. * Using volume in `/srv/www`. -## Sails image +### Sails Image * Base image: `sulhan/arch-nodejs:latest`. * Installed npm packages: `sails`, `pm2`, `grunt`. |
