Merge branch 'master' of github.com:dxrto/base

master
eater 5 years ago
commit e53b48ad7d
Signed by: eater
GPG Key ID: 656785D50BE51C0A

@ -1,4 +1,6 @@
MAINTAINER?==@eater.me MAINTAINER?==@eater.me
# Docker executable to use (default: docker, but img may be used)
DOCKER_EXEC?=docker
# Name of image # Name of image
IMAGE?=d.xr.to/base IMAGE?=d.xr.to/base
# Arch to be used # Arch to be used
@ -13,8 +15,6 @@ TOOLBOX?=toybox
PACKAGES?=xbps bash ncurses-base shadow PACKAGES?=xbps bash ncurses-base shadow
# Directory where chroot should be build # Directory where chroot should be build
BUILDDIR?=$(PWD)/build BUILDDIR?=$(PWD)/build
# Executable used for making the docker container (e.g. img or docker)
DOCKER_BUILDER?=docker
ifeq ($(TOOLBOX),none) ifeq ($(TOOLBOX),none)
VALID_TOOLBOX?=1 VALID_TOOLBOX?=1
@ -86,6 +86,11 @@ endif
# Create lsb_release file # Create lsb_release file
cp files/lsb_release $(BUILDDIR)/bin/lsb_release cp files/lsb_release $(BUILDDIR)/bin/lsb_release
chmod +x $(BUILDDIR)/bin/lsb_release chmod +x $(BUILDDIR)/bin/lsb_release
# Create xbps helpers
cp files/xbps-remote $(BUILDDIR)/bin/xbps-remote
chmod +x $(BUILDDIR)/bin/xbps-remote
cp files/xbps-local $(BUILDDIR)/bin/xbps-local
chmod +x $(BUILDDIR)/bin/xbps-local
# Create passwd, shadow and group file # Create passwd, shadow and group file
cp files/passwd $(BUILDDIR)/etc/passwd cp files/passwd $(BUILDDIR)/etc/passwd
cp files/group $(BUILDDIR)/etc/group cp files/group $(BUILDDIR)/etc/group
@ -93,7 +98,7 @@ endif
install: build install: build
# Import directory as tar (owned by root) into docker # Import directory as tar (owned by root) into docker
tar --owner 0 --group 0 -pC $(BUILDDIR) -c . | $(DOCKER_BUILDER) import -m '$(IMAGE) initialization from chroot' -c 'LABEL maintainer="$(MAINTAINER)"' - $(IMAGE) tar --owner 0 --group 0 -pC $(BUILDDIR) -c . | $(DOCKER_EXEC) import -m '$(IMAGE) initialization from chroot' -c 'LABEL maintainer="$(MAINTAINER)"' - $(IMAGE)
clean: clean:
# Remove build directory # Remove build directory

@ -1,13 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
DOCKER_EXEC="${DOCKER_EXEC:-docker}";
IMAGE="${1:-d.xr.to/base}"; IMAGE="${1:-d.xr.to/base}";
MAINTAINER="${2:-=@eater.me}"; MAINTAINER="${2:-=@eater.me}";
DOCKER_BUILDER="${DOCKER_BUILDER:-docker}"
build_dir="$(dirname "$0")/build"
test -d "${build_dir}" && rm -rf "${build_dir}";
for toolbox in "none" "toybox" "busybox" "default"; do for toolbox in "none" "toybox" "busybox" "default"; do
make IMAGE="${IMAGE}:${toolbox}" TOOLBOX="${toolbox}" DOCKER_BUILDER="${DOCKER_BUILDER}"; make IMAGE="${IMAGE}:${toolbox}" TOOLBOX="${toolbox}" DOCKER_EXEC="${DOCKER_EXEC}" all > "${toolbox}.log";
done done
docker tag "${IMAGE}:toybox" "${IMAGE}:latest"; $DOCKER_EXEC tag "${IMAGE}:toybox" "${IMAGE}:latest";
make IMAGE="${IMAGE}:glibc" TOOLBOX="toybox" ARCH="x86_64" DOCKER_BUILDER="${DOCKER_BUILDER}" make IMAGE="${IMAGE}:glibc" TOOLBOX="toybox" ARCH="x86_64" DOCKER_EXEC="${DOCKER_EXEC}" all > "glibc.log";
if [ "${PUSH}" = "y" ]; then
docker push "${IMAGE}";
fi

@ -0,0 +1,2 @@
#!/usr/bin/env bash
xbps-install -yR /tmp/xbps "$@" && xbps-remove -Oo && rm -rf /var/cache/xbps/* /tmp/xbps

@ -0,0 +1,2 @@
#!/usr/bin/env bash
xbps-install -Sy "$@" && xbps-remove -Oo && rm -rf /var/cache/xbps/* /tmp/xbps
Loading…
Cancel
Save