diff --git a/Readme.md b/Readme.md index b7be479..bfd85a9 100644 --- a/Readme.md +++ b/Readme.md @@ -1,16 +1,16 @@ # Scripts for building containers for the Proxmox home server # Initial Setup -The first step is to build the containers needed for building all other containers. -This can be done on a Minimal debian CT (make sure to enable nesting) on the new proxmox server or any other debian install +The first step is to build the containers needed for building all other containers. +This can be done on a privileged Debian CT (make sure to enable the Fuse, Nesting and 'Create Device Nodes' features) on the new proxmox server or any other Debian install 1. Clone this repo 2. cd in to cloned repo -3. run `bash Scripts/FirstSetup.sh`, to generate the container images +3. run `bash Scripts/FirstSetup.sh`, to install dependencies and generate the container images 4. upload the `Debian-imgbuilder.tar.xz` to the proxmox server and create a privileged container -5. Follow the steps under Container Setup > imgbuilder +5. Follow the steps under Container [Setup > imgbuilder](#imgbuilder) 6. Upload the `Debian-Jenkins.tar.xz` to the proxmox server and create a container -7. Follow the steps under Container Setup > Jenkins +7. Follow the steps under Container [Setup > Jenkins](#jenkins) # List of containers @@ -87,11 +87,12 @@ This can be done on a Minimal debian CT (make sure to enable nesting) on the new 2. Add a mountpoint to /LXCBuild on a accessible place for the Proxmox Server 3. Add this location to datastore for LXC templates to Proxmox 4. Set the `jenkins` user password using `passwd jenkins` in the container -5. Create folders on mountpoint using `mkdir /LXCBuild/template/cache` +5. Create folders on mountpoint using `mkdir -p /LXCBuild/template/cache` 6. Set permissions on the folder `chmod o+w -R /LXCBuild` 7. Write down the ip of this server (for use in the jenkins container) ## jenkins +**After first start of CT wait a minute for jenkins to fully initialize before continuing with these steps** 1. In the container configure the setup script `nano /opt/Setup/Scripts/FirstRun.sh` 2. In the container run the setup script `bash /opt/Setup/Scripts/FirstRun.sh` 3. Access Jenkins using `http://:8080` diff --git a/Scripts/FirstSetup.sh b/Scripts/FirstSetup.sh index b93c368..fc6b998 100644 --- a/Scripts/FirstSetup.sh +++ b/Scripts/FirstSetup.sh @@ -42,4 +42,18 @@ BuildImage () { #Build Jenkins Image BuildImage Debian jenkins #Build JenkinsNode (imgbuilder) Image -BuildImage Debian imgbuilder \ No newline at end of file +BuildImage Debian imgbuilder + +read -p "Do you want to server image files on webserver? (yes/No) " runws +if [[ $runws == y* || $runws == Y* ]]; then + echo "Availible ip addresses" + ip -4 -o a + echo "" + echo "Dowload jenkins image: http://:8000/Debian-jenkins.tar.xz" + echo "Dowload imgbuilder image: http://:8000/Debian-imgbuilder.tar.xz" + echo "" + echo "To stop the webserver press ctrl + c" + python3 -m http.server >/dev/null +fi + +echo Done \ No newline at end of file diff --git a/Scripts/UpdateIMGBuildFile-CacheAndRepo.sh b/Scripts/UpdateIMGBuildFile-CacheAndRepo.sh index 0f4d649..19d65c9 100644 --- a/Scripts/UpdateIMGBuildFile-CacheAndRepo.sh +++ b/Scripts/UpdateIMGBuildFile-CacheAndRepo.sh @@ -53,9 +53,11 @@ fi #Goto ProjectRoot cd "$( cd "$( dirname "$0" )" &> /dev/null && pwd )/.." -#AlpineBaseRepo +#AlpineCoreRepo +## Disabled using the proxy server and will now always use $DefaultAlpineRepo instead of $AlpineRepo. +## This is due to a change in the downloading of the minirootfs for alpine in Distrobuilder [since 22-08-2022] (Note: Distrobuilder will store the image in the tmp folder) sed -i -e '/#InitDownloadREPO/{n;d}' CT-Build/Alpine.yaml -sed -i -e '/#InitDownloadREPO/a \ url: '$AlpineRepo'' CT-Build/Alpine.yaml +sed -i -e '/#InitDownloadREPO/a \ url: '$DefaultAlpineRepo'' CT-Build/Alpine.yaml #AlpineRepo sed -i -n '/#StartREPOS/{:a;N;/#EndREPOS/!ba;N;s/.*\n/#HereREPO\n/};p' CT-Build/Alpine.yaml