From 87a7cefd6ca8b7b303f37a386797f22c0cf25b20 Mon Sep 17 00:00:00 2001 From: JPyke3 Date: Mon, 7 Sep 2020 18:48:03 +1000 Subject: [PATCH] Updated Dockerfile to fit standards, added docker-commands script. Improved the build-in-docker script --- Dockerfile | 28 ++++++++++++++++------------ build-in-docker.sh | 11 +++-------- docker-commands.sh | 5 +++++ 3 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 docker-commands.sh diff --git a/Dockerfile b/Dockerfile index fc3b87b..5073eb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,19 +6,23 @@ FROM manjarolinux/base MAINTAINER jpyke3 # Update System -RUN pacman -Syyu --noconfirm +RUN [ "pacman", "-Syyu", "--noconfirm" ] # Install manjaro-tools and depends -RUN pacman -S manjaro-tools-iso-git \ - manjaro-tools-base-git \ - manjaro-tools-yaml-git \ - manjaro-tools-pkg-git \ - base-devel \ - git \ - lsb-release --noconfirm - -# Clone the repository into container -RUN git clone https://github.com/JPyke3/mbp-manjaro ~/iso-profiles +RUN [ "pacman", "-S", "manjaro-tools-iso-git",\ + "manjaro-tools-base-git",\ + "manjaro-tools-yaml-git",\ + "manjaro-tools-pkg-git",\ + "base-devel",\ + "git",\ + "lsb-release",\ + "--noconfirm" ] # Import my Pacman GPG key -RUN pacman-key --recv-key 2BA2DFA128BBD111034F7626C7833DB15753380A --keyserver keyserver.ubuntu.com +RUN [ "pacman-key", "--recv-key", "2BA2DFA128BBD111034F7626C7833DB15753380A", "--keyserver", "keyserver.ubuntu.com" ] + +COPY docker-commands.sh /scripts/docker-commands.sh + +RUN ["chmod", "+x", "/scripts/docker-commands.sh"] + +ENTRYPOINT [ "/scripts/docker-commands.sh" ] diff --git a/build-in-docker.sh b/build-in-docker.sh index 30a8dcb..050c2cb 100755 --- a/build-in-docker.sh +++ b/build-in-docker.sh @@ -18,17 +18,12 @@ print_help() { # 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 + -e KERNEL=$KERNEL + -e EDITION=$EDITION + jpyke3/mbp-manjaro-buildiso } # Check to make sure docker is installed diff --git a/docker-commands.sh b/docker-commands.sh new file mode 100644 index 0000000..1ff9d54 --- /dev/null +++ b/docker-commands.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +git clone https://github.com/JPyke3/mbp-manjaro ~/iso-profiles + +buildiso -f -p $EDITION -k $KERNEL -t /root/out