[1] 2 3 >>> MLD-5.x / Systems / Raspberry PI / (MLD 5.4 testing) Docker
 

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
(MLD 5.4 testing) Docker
« on: March 29, 2020, 19:57:55 »
Hello,

I have a question regarding the following lines in MLD wiki.

Auf ARM Systemen (z.B. dem RPI 2) muss die erste Zeile des Dockerfile geƤndert werden:

Code: [Select]
uname -m | grep -q armv7l && sed "s|FROM .*|FROM arm32v7/debian:stretch|" -i Dockerfile
I'm running MLD x86 system so first line hasn't changed after running the above command.

Best Regards.

« Last Edit: March 29, 2020, 21:08:59 by gr4vity »

Online clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20117
    • View Profile
    • ClausMuus.de
(MLD 5.4 testing) Docker
« Reply #1 on: March 29, 2020, 20:12:51 »
No, you can call the command to change the first line. It change the first line to "FROM arm32v7/debian:stretch".
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
(MLD 5.4 testing) Docker
« Reply #2 on: March 29, 2020, 20:20:10 »
Hi Claus,

Okay. i created Dockerfile the run the following command but first line hasn't changed

Code: [Select]
uname -m | grep -q armv7l && sed "s|FROM .*|FROM arm32v7/debian:stretch|" -i Dockerfile
Should i change it manually to
"FROM arm32v7/debian:stretch"

P.S. i'm running MLD x86 system.
« Last Edit: March 29, 2020, 20:28:18 by gr4vity »

Online clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20117
    • View Profile
    • ClausMuus.de
(MLD 5.4 testing) Docker
« Reply #3 on: March 29, 2020, 23:03:12 »
The script only works if you use the original dockerfile. So you should change it manually. But take notice, that you normaly can not run a ARM dockerfile or docker image on a x86 system.
« Last Edit: March 29, 2020, 23:05:45 by clausmuus »
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
(MLD 5.4 testing) Docker
« Reply #4 on: March 29, 2020, 23:32:02 »
But take notice, that you normaly can not run a ARM dockerfile or docker image on a x86 system.

Oh, too bad, i thought it's possible.
What about running MLD for Raspberry Pi from a USB memory stick?

I know it's possible to run Raspbian from a USB stick.

Online clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20117
    • View Profile
    • ClausMuus.de
(MLD 5.4 testing) Docker
« Reply #5 on: March 30, 2020, 11:01:15 »
To do that you must get the latest version of the qemu-arm-static file from the internet and add it at the second line of the dockerfiele by this:
COPY qemu-arm-static /usr/bin
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
(MLD 5.4 testing) Docker
« Reply #6 on: March 31, 2020, 00:22:36 »
Hi Claus,

I installed qemu-user-static, first step was fine however i'm getting the following error after 2nd step

Code: [Select]
MLD> docker build -t mld/devel:5.4 /root/devel
Sending build context to Docker daemon   2.56kB
Step 1/7 : FROM arm32v7/debian:stretch
 ---> 987931aaa176
Step 2/7 : COPY qemu-arm-static /usr/bin
COPY failed: stat /var/lib/docker/tmp/docker-builder355111293/qemu-arm-static: no such file or directory

Online clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20117
    • View Profile
    • ClausMuus.de
(MLD 5.4 testing) Docker
« Reply #7 on: March 31, 2020, 11:28:14 »
You must place the file qemu-arm-static in the same folder as the dockerfile.
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
(MLD 5.4 testing) Docker
« Reply #8 on: March 31, 2020, 16:17:50 »
Hi Claus,

Thank you 2nd step worked  :)
Now i have a problem with 5th step
Code: [Select]
MLD> docker build -t mld/devel:5.4 /root/devel
Sending build context to Docker daemon  3.395MB
Step 1/7 : FROM arm32v7/debian:stretch
 ---> 987931aaa176
Step 2/7 : COPY qemu-arm-static /usr/bin
 ---> 00dd73c38bbe
Step 3/7 : MAINTAINER MLD Team <team@minidvblinux.de>
 ---> Running in cf42bccdb0dc
Removing intermediate container cf42bccdb0dc
 ---> 5ed98925465d
Step 4/7 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Running in d9fc34ff6403
Removing intermediate container d9fc34ff6403
 ---> a9d52daf5553
Step 5/7 : RUN apt-get update  && apt-get dist-upgrade -y  && apt-get install -y     make git-core software-properties-common locales locales-all
 ---> Running in 7db450206c9b
standard_init_linux.go:207: exec user process caused "exec format error"
The command '/bin/sh -c apt-get update  && apt-get dist-upgrade -y  && apt-get install -y     make git-core software-properties-common locales locales-all' returned a non-zero code: 1

Online clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20117
    • View Profile
    • ClausMuus.de
(MLD 5.4 testing) Docker
« Reply #9 on: March 31, 2020, 16:26:10 »
try this as the first line:
Code: [Select]
FROM arm32v7/debian:stretch-slim
On debian buster the aktual repo has a bug so that I must use the slim version. Maybe stretch has actual the same issue.
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
(MLD 5.4 testing) Docker
« Reply #10 on: March 31, 2020, 16:40:41 »
Unfortunately, i'm getting the same error as above.

Code: [Select]
MLD> docker build -t mld/devel:5.4 /root/devel
Sending build context to Docker daemon  3.395MB
Step 1/7 : FROM arm32v7/debian:stretch-slim
stretch-slim: Pulling from arm32v7/debian
4d2af5687ff4: Pull complete
Digest: sha256:1acec4f9c50a79cbcbe0a99bef0820c116910ae3f682693e949aeb50e96f3c11
Status: Downloaded newer image for arm32v7/debian:stretch-slim
 ---> 7bb696d9c4f3
Step 2/7 : COPY qemu-arm-static /usr/bin
 ---> fef3627eb852
Step 3/7 : MAINTAINER MLD Team <team@minidvblinux.de>
 ---> Running in fe205c8677f4
Removing intermediate container fe205c8677f4
 ---> e7f8a8a979e0
Step 4/7 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Running in 66a90da6948b
Removing intermediate container 66a90da6948b
 ---> 76ffa454cfda
Step 5/7 : RUN apt-get update  && apt-get dist-upgrade -y  && apt-get install -y     make git-core software-properties-common locales locales-all
 ---> Running in cd909b0e2c2e
standard_init_linux.go:207: exec user process caused "exec format error"
The command '/bin/sh -c apt-get update  && apt-get dist-upgrade -y  && apt-get install -y     make git-core software-properties-common locales locales-all' returned a non-zero code: 1

It seems that error "exec format error" occurs because i'm using x86 system.
« Last Edit: March 31, 2020, 16:50:00 by gr4vity »

Online clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20117
    • View Profile
    • ClausMuus.de
(MLD 5.4 testing) Docker
« Reply #11 on: March 31, 2020, 16:57:42 »
Maybe you have the wrong linebrakes (Windows linebrakes)?
Or you take an old version of the qemu-arm-static file.

I'm using ARM docker container on a x86 system without problems.
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
(MLD 5.4 testing) Docker
« Reply #12 on: March 31, 2020, 17:10:28 »
I'm using Raspbian Stretch to install ARM Docker on MLD x86

i got qemu-arm-static file from the following link

https://packages.debian.org/stretch/qemu-user-static

It's for stretch, should i download buster version?
« Last Edit: March 31, 2020, 18:10:04 by gr4vity »

Online clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20117
    • View Profile
    • ClausMuus.de
(MLD 5.4 testing) Docker
« Reply #13 on: March 31, 2020, 17:13:22 »
I take the file from the qemu website, if I remember right.
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
(MLD 5.4 testing) Docker
« Reply #14 on: March 31, 2020, 21:08:58 »
I found the following tutorial which describes the error message

https://www.balena.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/

This error happens when trying to run an ARM binary on x86.

It requires binfmt_misc
Is qemu-arm needed too?

Could you please check if that will solve my problem?

Best Regards.
« Last Edit: March 31, 2020, 21:11:59 by gr4vity »

[1] 2 3 >>> MLD-5.x / Systems / Raspberry PI / (MLD 5.4 testing) Docker
 



Users Online Users Online

0 Members and 1 Guest are viewing this topic.