From abaecb88d7773e4880c236953b3ece01b96fd558 Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Wed, 5 Jul 2017 13:40:38 -0500 Subject: [PATCH] Add filesystem setup in make --- .gitignore | 1 + Makefile | 30 ++++++++++++++++++++++++++---- deps/filesystem_setup.sh | 5 +++++ 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100755 deps/filesystem_setup.sh diff --git a/.gitignore b/.gitignore index 0e01904..bb96f07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ deps/creds.x deps/stage.tmp +deps/rootfs.tar.gz diff --git a/Makefile b/Makefile index 2c61934..616d29d 100755 --- a/Makefile +++ b/Makefile @@ -1,22 +1,41 @@ DOCKER_PREFIX=sudo IMAGE_NAME=unixvoid/seedpod WEB_THEME=https://github.com/Secretmapper/combustion/archive/v0.6.2.tar.gz +ALPINE_FS=https://cryo.unixvoid.com/bin/filesystem/alpine/linux-latest-amd64.rootfs.tar.gz +OS_PERMS=sudo -all: build_web +all: docker_build_web -build: +build_filesystem: + mkdir -p filesystem.tmp/ + cd filesystem.tmp/ && \ + wget -O rootfs.tar.gz $(ALPINE_FS) && \ + tar -xzf rootfs.tar.gz && \ + rm -f rootfs.tar.gz + cp deps/filesystem_setup.sh filesystem.tmp/ + $(OS_PERMS) systemd-nspawn -D filesystem.tmp/ /filesystem_setup.sh + rm -rf filesystem.tmp/filesystem_setup.sh + cd filesystem.tmp/ && \ + tar -czf rootfs.tar.gz * + mv filesystem.tmp/rootfs.tar.gz deps/ + +aci_build: + cd deps/ && \ + mkdir -p stage.tmp/seedpod-layout/ + +docker_build: cd deps/ && \ $(DOCKER_PREFIX) docker build -t $(IMAGE_NAME) . -build_web: +docker_build_web: cd deps/ && \ mkdir -p stage.tmp/theme && \ wget -O stage.tmp/theme.tar.gz $(WEB_THEME) && \ tar -xzf stage.tmp/theme.tar.gz -C stage.tmp/theme --strip-components 1 && \ $(DOCKER_PREFIX) docker build -t $(IMAGE_NAME) -f Dockerfile.web . -run: +docker_run: $(DOCKER_PREFIX) docker run \ -d \ --name seedpod \ @@ -31,3 +50,6 @@ run: clean: rm -rf deps/stage.tmp + @if [ -d "filesystem.tmp/" ]; then \ + $(OS_PERMS) rm -rf filesystem.tmp; \ + fi diff --git a/deps/filesystem_setup.sh b/deps/filesystem_setup.sh new file mode 100755 index 0000000..4c74214 --- /dev/null +++ b/deps/filesystem_setup.sh @@ -0,0 +1,5 @@ +#!/bin/ash + +apk --update add openvpn transmission-daemon +mkdir -p /transmission/downloads +mkdir -p /transmission/incomplete