Added docker build script

This commit is contained in:
JPyke3 2020-09-07 17:44:57 +10:00
parent 64117508e9
commit baa7f8a958
2 changed files with 76 additions and 4 deletions

View File

@ -1,3 +1,6 @@
# mbp-manjaro Dockerfile
# Author: github.com/JPyke3 <Jacob Pyke, pyke.jacob1@gmail.com>
FROM manjarolinux/base
MAINTAINER jpyke3
@ -14,11 +17,8 @@ RUN pacman -S manjaro-tools-iso-git \
git \
lsb-release --noconfirm
RUN mkdir ~/.config
RUN cp -r /etc/manjaro-tools ~/.config
RUN sed -i "s/# use_overlayfs=\"false\"/use_overlayfs=\"false\"/g" ~/.config/manjaro-tools/manjaro-tools.conf
# Clone the repository into container
RUN git clone https://github.com/JPyke3/mbp-manjaro ~/iso-profiles
# Import my Pacman GPG key
RUN pacman-key --recv-key 2BA2DFA128BBD111034F7626C7833DB15753380A --keyserver keyserver.ubuntu.com

72
build-in-docker.sh Executable file
View File

@ -0,0 +1,72 @@
#!/bin/bash
# Author: github.com/jpyke3 <Jacob Pyke, pyke.jacob1@gmail.com>
# The help screen
print_help() {
echo " Manjaro MBP Docker Build Scripts"
echo ""
echo " Example Usage:"
echo " build-in-docker -k linux57 -p gnome"
echo ""
echo " Arguments:"
echo " k Specify which kernel version"
echo " p Specify which manjaro edition (xfce, gnome, kde, i3, cinnamon, budgie)"
echo " h Show this help file"
exit 1
}
# Function to run the docker commands
run_docker() {
# Make an out dir for the compiled ISO
mkdir ~/manjaro-mbp-iso
# Docker command
docker run --privileged \
-v ~/manjaro-mbp-iso:/root/out \
jpyke3/mbp-manjaro-buildiso\
buildiso -f\
-p $EDITION\
-k $KERNEL\
-t /root/out
}
# Check to make sure docker is installed
if [ ! -f /bin/docker ]; then
echo "You need to install docker in order to run this script!"
exit 1
fi
# Handle input flags
while getopts ":k:p:h:" opt; do
# Read the options from the flags
case $opt in
k)
KERNEL=$OPTARG
;;
p)
EDITION=$OPTARG
;;
h)
print_help
;;
:)
if [ $OPTARG == "h" ]; then
print_help
else
echo "Option -$OPTARG requires an argument!"
exit 1
fi
;;
esac
done
# Check if the two environment variables are set
if [ ! -z "$KERNEL" ] && [ ! -z "$EDITION" ]; then
run_docker
else
echo "You need to run this script with a Kernel Argument and an Edition"
echo "For more information use the -h flag for help"
exit 1
fi