Open marcellodesales opened 3 years ago
This comment should make sense https://serverfault.com/a/768940
Simply change the Dockerfile from qemu-system-x86_64
to qemu-x86_64
. And possibly set -e KVM =
.
I will test this out tomorrow on my RPI.
@sickcodes Thank you... let me check... in this case we need to build it locally... :) Let me try it and report... thank you!
@sickcodes we can't build on RPI
... :) I will build on my MacOS, docker save, scp, docker load on the pi (duh I should build faster... )
x-crypt0-surf3r@pi-master:/mnt/ext1/dev/Docker-OSX$ docker build -t sickcodes/docker-osx .
Sending build context to Docker daemon 22.57MB
Step 1/56 : FROM archlinux:base-devel
base-devel: Pulling from library/archlinux
no matching manifest for linux/arm64/v8 in the manifest list entries
@sickcodes we can't build on
RPI
... :) I will build on my MacOS, docker save, scp, docker load on the pix-crypt0-surf3r@pi-master:/mnt/ext1/dev/Docker-OSX$ docker build -t sickcodes/docker-osx . Sending build context to Docker daemon 22.57MB Step 1/56 : FROM archlinux:base-devel base-devel: Pulling from library/archlinux no matching manifest for linux/arm64/v8 in the manifest list entries
I'll add arm images this week, it does work:
https://twitter.com/sickcodes/status/1287132434387988480?s=21
Albeit very, very, very slow. It has emulate off an SD Card.
Do you have other options?
@sickcodes we can't build on
RPI
... :) I will build on my MacOS, docker save, scp, docker load on the pix-crypt0-surf3r@pi-master:/mnt/ext1/dev/Docker-OSX$ docker build -t sickcodes/docker-osx . Sending build context to Docker daemon 22.57MB Step 1/56 : FROM archlinux:base-devel base-devel: Pulling from library/archlinux no matching manifest for linux/arm64/v8 in the manifest list entries
I'll add arm images this week, it does work:
https://twitter.com/sickcodes/status/1287132434387988480?s=21
Albeit very, very, very slow. It has emulate off an SD Card.
Do you have other options?
Hummm... not really... I will do some digging and report... so far, I built on MacOS with the options you mentioned...
x-crypt0-surf3r@pi-master:/mnt/ext1/dev/Docker-OSX$ docker build --platform=linux/amd64 -t sickcodes/docker-osx .
Sending build context to Docker daemon 22.57MB
Step 1/56 : FROM archlinux:base-devel
base-devel: Pulling from library/archlinux
cf21842e2731: Already exists
183cfc865da6: Already exists
Digest: s
@sickcodes I'm getting a docker build with the the build param --platform=linux/amd64/v8
on RPI based on my docker-info
output... So, I'm getting into the following problem with the following:
x-crypt0-surf3r@pi-master:/mnt/ext1/dev/Docker-OSX$ git --no-pager diff
diff --git a/Dockerfile b/Dockerfile
index 74c6cb3..6863aff 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -52,6 +52,7 @@
# # you will also need to pass the device to the container
FROM archlinux:base-devel
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
@@ -214,7 +215,7 @@ RUN touch Launch.sh \
&& tee -a Launch.sh <<< '[[ "${RAM}" = max ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 1000000"))"' \
&& tee -a Launch.sh <<< '[[ "${RAM}" = half ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 2000000"))"' \
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
- && tee -a Launch.sh <<< 'exec qemu-system-x86_64 -m ${RAM:-2}000 \' \
+ && tee -a Launch.sh <<< 'exec qemu-x86_64 -m ${RAM:-2}000 \' \
&& tee -a Launch.sh <<< '-cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check \' \
&& tee -a Launch.sh <<< '-machine q35,${KVM-"accel=kvm:tcg"} \' \
&& tee -a Launch.sh <<< '-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \'
---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
x-crypt0-surf3r@pi-master:/mnt/ext1/dev/Docker-OSX$ docker build --platform=linux/arm64/v8 --no-cache -t sickcodes/docker-osx .
Sending build context to Docker daemon 22.57MB
Step 1/57 : FROM archlinux:base-devel
---> 7f418864de94
Step 2/57 : MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
---> Running in 29d0c11a5f52
Removing intermediate container 29d0c11a5f52
---> b1db0b367f9d
Step 3/57 : SHELL ["/bin/bash", "-c"]
---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
---> Running in 44801f502308
Removing intermediate container 44801f502308
---> 0a09b7408690
Step 4/57 : ARG SIZE=200G
---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
---> Running in a3f42f39f7a3
Removing intermediate container a3f42f39f7a3
---> 6ed7f7ee989a
Step 5/57 : ARG VERSION=10.15.6
---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
---> Running in e49b3b95de13
Removing intermediate container e49b3b95de13
---> e7af87dff1ef
Step 6/57 : ARG RANKMIRRORS
---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
---> Running in d50d84756182
Removing intermediate container d50d84756182
---> dbd63bbc801a
Step 7/57 : ARG MIRROR_COUNTRY=US
---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
---> Running in e4d6a7affec7
Removing intermediate container e4d6a7affec7
---> 368f356a30fe
Step 8/57 : ARG MIRROR_COUNT=10
---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
---> Running in 599943b522bc
Removing intermediate container 599943b522bc
---> c297f3b41bc7
---> Running in 95d0aab3a2c5
Removing intermediate container 95d0aab3a2c5
---> 8fdf5100fa39
Step 10/57 : RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine."
---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
---> Running in f11c0436b320
standard_init_linux.go:219: exec user process caused: exec format error
The command '/bin/bash -c patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine."' returned a non-zero code: 1
x-crypt0-surf3r@pi-master:/mnt/ext1/dev/Docker-OSX$ uname -m
aarch64
lopsided/archlinux
NOTE: I don't see a compatible architecture for RPI4
/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
x-crypt0-surf3r@pi-master:/mnt/ext1/dev/Docker-OSX$ docker buildx build -t sickcodes/docker-osx --platform=linux/arm64/v8 .
[+] Building 14.8s (6/27)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 15.52kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/lopsided/archlinux:devel 1.7s
=> [ 1/24] FROM docker.io/lopsided/archlinux:devel@sha256:8b46340446343e 0.3s
=> => resolve docker.io/lopsided/archlinux:devel@sha256:8b46340446343ed6 0.0s
=> [ 2/24] RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst 9.6s
=> ERROR [ 3/24] RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -S 2.4s
------
> [ 3/24] RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" ; wget -O- "https://www.archlinux.org/mirrorlist/?country=US&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | head -n "$((10+1))" | bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' && cat /etc/pacman.d/mirrorlist ; fi:
#6 1.937 /bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/bash -c if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | head -n "$((${MIRROR_COUNT:-10}+1))" | bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' && cat /etc/pacman.d/mirrorlist ; fi]: exit code: 127
Oops, just saw your msg.... @sickcodes Let me try it...
packman
patch
Dockerfile
mentions it was patched...) 0.888 /bin/bash: error while loading shared libraries: libdl.so.2:
cannot open shared object file: No such file or director
x-crypt0-surf3r@pi-master:/mnt/ext1/dev/github.com/sickcodes/Docker-OSX$ git diff
diff --git a/Dockerfile b/Dockerfile
index 74c6cb3..cebdc5d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -51,7 +51,10 @@
# docker run ... -e EXTRA="-usb -device usb-host,hostbus=1,hostaddr=8" ...
# # you will also need to pass the device to the container
-FROM archlinux:base-devel
+FROM agners/archlinuxarm:20210331
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
@@ -214,7 +217,7 @@ RUN touch Launch.sh \
&& tee -a Launch.sh <<< '[[ "${RAM}" = max ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 1000000"))"' \
&& tee -a Launch.sh <<< '[[ "${RAM}" = half ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 2000000"))"' \
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
- && tee -a Launch.sh <<< 'exec qemu-system-x86_64 -m ${RAM:-2}000 \' \
+ && tee -a Launch.sh <<< 'exec qemu-x86_64 -m ${RAM:-2}000 \' \
&& tee -a Launch.sh <<< '-cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check \' \
&& tee -a Launch.sh <<< '-machine q35,${KVM-"accel=kvm:tcg"} \' \
&& tee -a Launch.sh <<< '-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \' \
x-crypt0-surf3r@pi-master:/mnt/ext1/dev/github.com/sickcodes/Docker-OSX$ docker buildx build -t sickcodes/docker-osx:linux-arm64-v8 --platform=linux/arm64/v8 .
[+] Building 2.4s (6/27)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/agners/archlinuxarm:20210331 0.4s
=> [ 1/24] FROM docker.io/agners/archlinuxarm:20210331@sha256:3131d1e3f3 0.0s
=> CACHED [ 2/24] RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.z 0.0s
=> ERROR [ 3/24] RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -S 1.3s
------
> [ 3/24] RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" ; wget -O- "https://www.archlinux.org/mirrorlist/?country=US&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | head -n "$((10+1))" | bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' && cat /etc/pacman.d/mirrorlist ; fi:
#6 0.888 /bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/bash -c if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | head -n "$((${MIRROR_COUNT:-10}+1))" | bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' && tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' && cat /etc/pacman.d/mirrorlist ; fi]: exit code: 127
I think this is because you're building an aarch64 image from a x86_64 image.
What about:
sudo apt-get update && apt-get install qemu qemu-user qemu-user-static binfmt-support debootstrap binutils
wget -O mac_hdd_ng.img https://images.sick.codes/mac_hdd_ng_auto.img
git clone https://github.com/kholia/OSX-KVM.git
cd OSX-KVM
echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs
ALLOCATED_RAM="1800" # MiB
CPU_SOCKETS="1"
CPU_CORES="2"
CPU_THREADS="4"
REPO_PATH="."
OVMF_DIR="."
MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"
qemu-user-static-x86_64 -m 1800 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=off,kvm=off,$MY_OPTIONS\
-machine q35
-usb -device usb-kbd -device usb-tablet
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
-device usb-ehci,id=ehci
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd"
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ich9-ahci,id=sata
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore-Catalina/OpenCore.qcow2"
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
-device ide-hd,bus=sata.4,drive=MacHDD
-netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
-device VGA,vgamem_mb=128
Or try qemu-x86_64
I tried a little bit but it failed at building libguestfs in archlinux for aarach64 from source. Are you aware of any prebuilt version of it? The error is also very random
#36 1093.1 touch stamp-libguestfs-make-fixed-appliance.pod
#36 1093.2 cd .. && \
#36 1093.2 ./config.status --file=appliance/make.sh-t:appliance/make.sh.in
#36 1095.6 config.status: creating appliance/make.sh-t
#36 1095.9 chmod +x make.sh-t
#36 1095.9 cmp -s make.sh make.sh-t || mv make.sh-t make.sh
#36 1096.0 rm -f make.sh-t
#36 1096.0 /sbin/ldconfig -p > ld.so.cache.txt
#36 1096.1 objdump -p ../daemon/guestfsd |\
#36 1096.1 sed -ne '/NEEDED/{s/ *NEEDED *//; p;}' |\
#36 1096.1 xargs -i grep -F {} ld.so.cache.txt |\
#36 1096.1 sed -ne '/ => /{s/.* => *//; p;}' |\
#36 1096.1 |\
#36 1096.1 sort -u > guestfsd.deps.t
#36 1096.1 /bin/sh: -c: line 6: syntax error near unexpected token `|'
#36 1096.1 /bin/sh: -c: line 6: ` sort -u > guestfsd.deps.t'
#36 1096.1 make[2]: *** [Makefile:1099: guestfsd.deps] Error 2
#36 1096.1 make[2]: Leaving directory '/home/arch/libguestfs-1.46.0/appliance'
#36 1096.1 make[1]: *** [Makefile:1099: all-recursive] Error 1
#36 1096.1 make[1]: Leaving directory '/home/arch/libguestfs-1.46.0'
#36 1096.1 make: *** [Makefile:1003: all] Error 2
It won't work unfortunately, due to requiring KVM
Hi @sickcodes Do you think it is possible or worth the effort to create arm images now for this? E.g Using the latest Raspberry Pi 5 to build for iOS apps.
This is a fantastic project! Thank you so much for doing this...
I'm trying to create a runner for Gitlab so that we can build our IOS apps... I still can't run an instance of the docker image in my raspberry-pi 4 running Ubuntu 20.10...
Are you guys producing other docker images format?
Problem
Attempt
Docker Info