Merge pull request #143 from sickcodes/fix-docker-cloud-build-size
Reduce build size & tidy
This commit is contained in:
		
						commit
						34f1c04880
					
				| 
						 | 
					@ -52,3 +52,5 @@ These credits refer to the contributors to this repository:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[@cephasara](https://github.com/cephasara) - Fix helm installation failure and cleanup values organization #134
 | 
					[@cephasara](https://github.com/cephasara) - Fix helm installation failure and cleanup values organization #134
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[@prometheas](https://github.com/prometheas) - docs: fix broken multi-line docker command #140 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,31 +47,44 @@ USER root
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WORKDIR /root
 | 
					WORKDIR /root
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# For taking screenshots of the Xfvb screen, useful during development.
 | 
				
			||||||
 | 
					ARG SCROT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# OPTIONAL: Arch Linux server mirrors for super fast builds
 | 
					# OPTIONAL: Arch Linux server mirrors for super fast builds
 | 
				
			||||||
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
 | 
					# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
 | 
				
			||||||
ARG RANKMIRRORS
 | 
					ARG RANKMIRRORS
 | 
				
			||||||
ARG MIRROR_COUNTRY=US
 | 
					ARG MIRROR_COUNTRY=US
 | 
				
			||||||
ARG MIRROR_COUNT=10
 | 
					ARG MIRROR_COUNT=10
 | 
				
			||||||
RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
 | 
					RUN if [[ "${RANKMIRRORS}" ]]; then \
 | 
				
			||||||
    ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \
 | 
					        { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
 | 
				
			||||||
    ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
 | 
					        ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \
 | 
				
			||||||
    | sed -e 's/^#Server/Server/' -e '/^#/d' \
 | 
					        ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
 | 
				
			||||||
    | head -n "$((${MIRROR_COUNT:-10}+1))" \
 | 
					        | sed -e 's/^#Server/Server/' -e '/^#/d' \
 | 
				
			||||||
    | bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \
 | 
					        | head -n "$((${MIRROR_COUNT:-10}+1))" \
 | 
				
			||||||
    && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' \
 | 
					        | bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \
 | 
				
			||||||
    && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \
 | 
					        && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' \
 | 
				
			||||||
    && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' \
 | 
					        && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \
 | 
				
			||||||
    && cat /etc/pacman.d/mirrorlist ; fi
 | 
					        && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' \
 | 
				
			||||||
 | 
					        && cat /etc/pacman.d/mirrorlist \
 | 
				
			||||||
 | 
					    ; fi \
 | 
				
			||||||
 | 
					    ; yes | pacman -Scc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr xdotool sshpass scrot base-devel --noconfirm
 | 
					RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \
 | 
				
			||||||
 | 
					    && if [[ "${SCROT}" ]]; then \
 | 
				
			||||||
RUN git clone https://github.com/stolk/imcat.git \
 | 
					        pacman -Syu scrot base-devel --noconfirm \
 | 
				
			||||||
    && cd imcat \
 | 
					        && git clone https://github.com/stolk/imcat.git \
 | 
				
			||||||
    && make \
 | 
					        && cd imcat \
 | 
				
			||||||
    && sudo cp imcat /usr/bin/imcat \
 | 
					        && make \
 | 
				
			||||||
    && touch /usr/bin/scrotcat \
 | 
					        && sudo cp imcat /usr/bin/imcat \
 | 
				
			||||||
    && tee -a /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)' \
 | 
					        && touch /usr/bin/scrotcat \
 | 
				
			||||||
    && chmod +x /usr/bin/scrotcat
 | 
					        && tee -a /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)' \
 | 
				
			||||||
 | 
					        && chmod +x /usr/bin/scrotcat \
 | 
				
			||||||
 | 
					    ; else \
 | 
				
			||||||
 | 
					        touch /usr/bin/scrotcat \
 | 
				
			||||||
 | 
					        && echo echo >> /usr/bin/scrotcat \
 | 
				
			||||||
 | 
					        && chmod +x /usr/bin/scrotcat \
 | 
				
			||||||
 | 
					    ; fi \
 | 
				
			||||||
 | 
					    ; yes | pacman -Scc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
USER arch
 | 
					USER arch
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -95,9 +108,9 @@ ARG IMAGE_URL='https://images2.sick.codes/mac_hdd_ng_auto.img'
 | 
				
			||||||
# use the COMPLETE arg, for a complete image, ready to boot.
 | 
					# use the COMPLETE arg, for a complete image, ready to boot.
 | 
				
			||||||
# otherwise use your own image: -v "$PWD/disk.img":/image
 | 
					# otherwise use your own image: -v "$PWD/disk.img":/image
 | 
				
			||||||
RUN if [[ "${COMPLETE}" ]]; then \
 | 
					RUN if [[ "${COMPLETE}" ]]; then \
 | 
				
			||||||
    echo "Downloading 20GB+ image... This step might take a while... Press Ctrl+C if you want to abort." \
 | 
					        echo "Downloading 20GB+ image... This step might take a while... Press Ctrl+C if you want to abort." \
 | 
				
			||||||
    ; rm -f /home/arch/OSX-KVM/mac_hdd_ng.img \
 | 
					        ; rm -f /home/arch/OSX-KVM/mac_hdd_ng.img \
 | 
				
			||||||
        && curl -k "${IMAGE_URL}" > /home/arch/OSX-KVM/mac_hdd_ng.img \
 | 
					        && wget -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
 | 
				
			||||||
    ; fi
 | 
					    ; fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN mv ./Launch-nopicker.sh ./Launch.sh
 | 
					RUN mv ./Launch-nopicker.sh ./Launch.sh
 | 
				
			||||||
| 
						 | 
					@ -112,8 +125,11 @@ ENV BOILERPLATE="By using this Dockerfile, you hereby agree that you are a secur
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CMD echo "${BOILERPLATE}" \
 | 
					CMD echo "${BOILERPLATE}" \
 | 
				
			||||||
    && [[ "${TERMS_OF_USE}" = i_agree ]] || exit 1 \
 | 
					    && [[ "${TERMS_OF_USE}" = i_agree ]] || exit 1 \
 | 
				
			||||||
    ; [[ "${DISPLAY}" = ':99' ]] && { nohup Xvfb :99 -screen 0 1920x1080x16 \
 | 
					    ; [[ "${DISPLAY}" = ':99' ]] && { \
 | 
				
			||||||
    & until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 0.1 ; done ; } \
 | 
					        nohup Xvfb :99 -screen 0 1920x1080x16 \
 | 
				
			||||||
 | 
					        & until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 0.1 ; done \
 | 
				
			||||||
 | 
					    ; } \
 | 
				
			||||||
 | 
					    ; echo "Checking whether /image is a directory or a QEMU disk." \
 | 
				
			||||||
    ; case "$(file --brief /image)" in \
 | 
					    ; case "$(file --brief /image)" in \
 | 
				
			||||||
        QEMU*) export IMAGE_PATH=/image && sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" 2>/dev/null || true;; \
 | 
					        QEMU*) export IMAGE_PATH=/image && sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" 2>/dev/null || true;; \
 | 
				
			||||||
        directory*) export IMAGE_PATH=/home/arch/OSX-KVM/mac_hdd_ng.img;; \
 | 
					        directory*) export IMAGE_PATH=/home/arch/OSX-KVM/mac_hdd_ng.img;; \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										13
									
								
								README.md
								
								
								
								
							
							
						
						
									
										13
									
								
								README.md
								
								
								
								
							| 
						 | 
					@ -7,7 +7,9 @@ Run Mac in a Docker container! Run near native OSX-KVM in Docker! X11 Forwarding
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Author: Sick.Codes https://sick.codes/ & https://twitter.com/sickcodes
 | 
					Author: Sick.Codes https://sick.codes/ & https://twitter.com/sickcodes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PR & Contributor Credits: https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md
 | 
					### PR & Contributor Credits
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Docker Hub: https://hub.docker.com/r/sickcodes/docker-osx
 | 
					Docker Hub: https://hub.docker.com/r/sickcodes/docker-osx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,6 +19,15 @@ Docker Hub: https://hub.docker.com/r/sickcodes/docker-osx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- sickcodes/docker-osx:auto - 22gb image boot to OSX shell
 | 
					- sickcodes/docker-osx:auto - 22gb image boot to OSX shell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Professional Support Available!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Enquire at https://sick.codes/contact
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Enterprise support, Business support, or casual support.
 | 
				
			||||||
 | 
					- Custom images, custom scripts, consulting (per hour available!)
 | 
				
			||||||
 | 
					- One-on-one with you, or your development team.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#### Follow [@sickcodes on Twitter](https://twitter.com/sickcodes) for updates or feature requests!
 | 
					#### Follow [@sickcodes on Twitter](https://twitter.com/sickcodes) for updates or feature requests!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Quick Start Docker-OSX
 | 
					# Quick Start Docker-OSX
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue