Initial commit
commit
10e6e4e4bc
@ -0,0 +1,53 @@
|
|||||||
|
# Name of image
|
||||||
|
IMAGE ?= d.xr.to/base
|
||||||
|
# Arch to be used
|
||||||
|
ARCH ?= x86_64-musl
|
||||||
|
# Repo root url to be used (/musl will be appended in case of musl based arch)
|
||||||
|
REPO_ROOT ?= https://alpha.de.repo.voidlinux.org/current
|
||||||
|
# Absolute repo url
|
||||||
|
REPO ?= $(REPO_ROOT)$(if $(findstring musl, $(ARCH)),/musl)
|
||||||
|
# Packages to install
|
||||||
|
PACKAGES ?= toybox xbps bash ncurses-base
|
||||||
|
# Directory where chroot should be build
|
||||||
|
BUILDDIR ?= $(PWD)/build
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
|
vars:
|
||||||
|
@echo IMAGE=$(IMAGE)
|
||||||
|
@echo ARCH=$(ARCH)
|
||||||
|
@echo REPO_ROOT=$(REPO_ROOT)
|
||||||
|
@echo REPO=$(REPO)
|
||||||
|
@echo PACKAGES=$(PACKAGES)
|
||||||
|
@echo BUILDDIR=$(BUILDDIR)
|
||||||
|
|
||||||
|
build:
|
||||||
|
# Create build directory
|
||||||
|
mkdir $(BUILDDIR)
|
||||||
|
# Create keys database directory
|
||||||
|
mkdir -p $(BUILDDIR)/var/db/xbps
|
||||||
|
# Import known keys
|
||||||
|
cp -r keys $(BUILDDIR)/var/db/xbps
|
||||||
|
# Install packages into build directory
|
||||||
|
XBPS_ARCH="$(ARCH)" xbps-install -y -r $(BUILDDIR) --repository=$(REPO) -S $(PACKAGES)
|
||||||
|
# Create symlinks expected by void
|
||||||
|
for dir in lib lib32 sbin bin; do [ -e $(BUILDDIR)/$$dir ] || ln -s usr/$$dir $(BUILDDIR)/$$dir; done
|
||||||
|
ln -s usr/lib $(BUILDDIR)/lib64
|
||||||
|
# Create default directories expected by void
|
||||||
|
for dir in proc sys dev; do [ -d $(BUILDDIR)/$$dir ] || mkdir $(BUILDDIR)/$$dir; done
|
||||||
|
# Create toybox symlinks
|
||||||
|
xbps-uchroot $(BUILDDIR) /bin/toybox | sed 's:\s:\n:g' | grep -v '^$$' | while read i; do [ -e $(BUILDDIR)/usr/bin/$$i ] || ln -s /bin/toybox $(BUILDDIR)/usr/bin/$$i; done
|
||||||
|
# Remove xbps cache dir
|
||||||
|
rm -rf $(BUILDDIR)/var/cache/xbps
|
||||||
|
# Import custom bashrc
|
||||||
|
cp bashrc.bash $(BUILDDIR)/etc/bash/bashrc.d/docker.sh
|
||||||
|
|
||||||
|
install: build
|
||||||
|
# Import directory as tar (owned by root) into docker
|
||||||
|
tar --owner 0 --group 0 -pC $(BUILDDIR) -c . | docker import - $(IMAGE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
# Remove build directory
|
||||||
|
rm -rf $(BUILDDIR)
|
||||||
|
|
||||||
|
all: install clean
|
@ -0,0 +1,39 @@
|
|||||||
|
# `d.xr.to/base`
|
||||||
|
|
||||||
|
This is the base image for the d.xr.to repo.
|
||||||
|
|
||||||
|
|
||||||
|
This image is a slimmed down version of the [`voidlinux/voidlinux-musl`](https://hub.docker.com/r/voidlinux/voidlinux-musl) image, from 66MB (or if you build an up-to-date image, 128MB), to no more than 20MB
|
||||||
|
|
||||||
|
# Packages
|
||||||
|
|
||||||
|
The packages included are `toybox`, `xbps` and `bash`, also is `ncurses-base` included for the terminfo files.
|
||||||
|
|
||||||
|
This should create a non-hostile but light weight base environment
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
# Name of image
|
||||||
|
IMAGE ?= d.xr.to/base
|
||||||
|
# Arch to be used
|
||||||
|
ARCH ?= x86_64-musl
|
||||||
|
# Repo root url to be used (/musl will be appended in case of musl based arch)
|
||||||
|
REPO_ROOT ?= https://alpha.de.repo.voidlinux.org/current
|
||||||
|
# Absolute repo url
|
||||||
|
REPO ?= $(REPO_ROOT)$(if $(findstring musl, $(ARCH)),/musl)
|
||||||
|
# Packages to install
|
||||||
|
PACKAGES ?= toybox xbps bash ncurses-base
|
||||||
|
# Directory where chroot should be build
|
||||||
|
BUILDDIR ?= $(PWD)/build
|
||||||
|
```
|
||||||
|
|
||||||
|
# Building
|
||||||
|
|
||||||
|
A makefile has been made to build the docker image
|
||||||
|
|
||||||
|
`make build`: will build the root directory in `BUILDDIR`
|
||||||
|
|
||||||
|
`make install`: will import the image under the name `IMAGE`
|
||||||
|
|
||||||
|
`make [all]`: will build and install the image
|
@ -0,0 +1 @@
|
|||||||
|
PS1="\[\e[0m\][docker:\[\e[93m\]\H\[\e[36m\] \w\[\e[0m\]]\[\e[32m\]\$\[\e[0m\] "
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>public-key</key>
|
||||||
|
<data>LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0lqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FnOEFNSUlDQ2dLQ0FnRUF2clN6QlpNdmd2T0NJM0FYYk9qYQoycktSa0pTVE0zYy9FalRJZ0NnRFhndW05M0JQQ3RZOE1jRlZvQ1U0T2lYSEdmVG1xMzlCVk5wTHZMSEw5S2sxCnAyNzhTQmhYVk90YkIyRVZtREtudmZJREVUbGRMR3plN3JaTlJKZHR1TjJtWi9UVnJVQjlTMHlRYytJdWY0aHYKMytEOTdWSWRUSkhBN0FTcjA0MjhwcEVHSkd3U1NoWTJYSm05RDVJMEV1R1JXYzE0TUVHN2RJS0ppWWlNMG5FNAp0WW8yL3ZINElGVEhkblZBM2dZaVp5RG5idUNBUi84RVNmVVRVMTNTTkNPZGJ1ZGYzRDVCY3krVWlNREpJM1llCjRNRktCclQ5WmhaK0dzWEJaWTQ4MmxxaVppNkNMNXB0YzlJUUZmOC9lS1phOGphdGtpVkZWZ3JLZU5Sak9UeE4KZldTdTJua3hHTlgrYmhYWXRoaUdXbUpFWThjQ0FQeUZOK0x2NVJldEsyNTZnZGNiMnNrbUVxZWZ2MnpQQyt3VgpXQmJkSDViRDRiWmpuME42Wmw4MXJ2NVJ6RHZudmYrdkQxNGFGVWJaOFFGcXU3NVBiTDR3Nm1ZTTRsZE0vZzBSCjZOWEU4QXo5Qnd4MnREZlllS3V1dHcxRXBQbTJZdkZ5VFViMWNveUF1VEdSeUFhcDFVVEh2ZzlsaFBJSm1oRlEKSjVrQ2cxcUQ3QTMxV2wwUmxuZTZoZ0dvMFpaTko1Y0pNL3YvelNUS0pjdUZnd283SDBoT0dpbDZEZm84OUI0agpHOTZBQ3lQUytEVktQRlhSWXdqL0FrYkhwYVEyZjFGTUFvU3BCcXVEcUhoM3VrazcxS1g2ajE5dDBpRjhEUUxyCnZ0RlNTZElqREEwMmx3ZVY5TmFRcFdzQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=</data>
|
||||||
|
<key>public-key-size</key>
|
||||||
|
<integer>4096</integer>
|
||||||
|
<key>signature-by</key>
|
||||||
|
<string>Void Linux</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
Loading…
Reference in New Issue