guysoft / FullPageOS

A raspberrypi distro to display a full page browser on boot
GNU General Public License v3.0
3.79k stars 229 forks source link

More complete docker instructions #298

Closed semanticfire closed 7 months ago

semanticfire commented 4 years ago

What were you doing?

Building the latest FullPageOS checked out this repo, moved in the src directory and followed the instructions on the link: https://github.com/guysoft/CustomPiOS/wiki/Building-with-Docker

What did you expect to happen?

A minimal working image

What happened instead?

Nothing, docker starts, creates image and exits no errors

Was there an error message displayed? What did it say?

none

Version of FullPageOS?

latest from GIT

guysoft commented 4 years ago
  1. Are you using docker run or docker-compose?

You need to use the container to run a build. As shown in the readme:

docker exec -it mydistro_builder /CustomPiOS/nightly_build_scripts/custompios_nightly_build
semanticfire commented 4 years ago

I use the docker run, but the container is not starting, so the exec fails

semanticfire commented 4 years ago

from FullPageOS/src I run: docker run -v 'pwd':/distro --name mydistro_builder --device /dev/loop-control guysoft/custompios:devel

which returns immediately , the container won't start so the exec command doesn't work either

guysoft commented 4 years ago

Try running it like this:

cd FullPageOS/src
docker run --privileged -t -v `pwd`:/distro --name mydistro_builder --device /dev/loop-control guysoft/custompios:devel  /CustomPiOS/nightly_build_scripts/custompios_nightly_build

I usually use the docker compose to build multiple times on the same container. So that part had less testing.

Note you might need to run:

sudo docker rm -f mydistro_builder

Because you already created that container.

semanticfire commented 4 years ago

This generates way more output: https://gist.github.com/semanticfire/daad7560de9f173c34503901a974974b

guysoft commented 4 years ago
Error: could not find image: 

You skipped downloading the base image that FullPageOS is built over.

Its documented her: https://github.com/guysoft/FullPageOS#build-fullpageos-from-within-fullpageos--raspbian--debian--ubuntu

Run:

cd FullPageOS/src/image
wget -c --trust-server-names 'https://downloads.raspberrypi.org/raspbian_lite_latest'

This will download an image to the right image folder and then try to repeat the build with docker run.

Indeed not in the docker instruction page. Will add once I understand what is worth adding too.

semanticfire commented 4 years ago

The script is looking for a different file pattern then what gets downloaded: *-raspbian*.zip where raspbian_lite_latest After changing the file name it worked on the 2nd try

guysoft commented 4 years ago

That command should rename the file correctly, not sure why it doesn't in your case.

Did you get an image? Can you post your build.log?

semanticfire commented 4 years ago

Build logs attached for building a variant, I haven't tested the image yet but at least it builds one. I delete my existing container and start the build with the comment above ( image renamed manually ) The build fails at one point see log: build-1.log

Then I delete the container and restart the build and then it works. build.log

guysoft commented 4 years ago

Looks like it worked:

BUILD SUCCEEDED!

In green means it worked.

Note you are not building a variant, to do that you need to sesify which variant.

I am not sure what you are doing, it looks like the variant has the a copy of the fullpageOS source.

A variant is code that runs before and after, should not be a complete copy. If you want to fork FullPageOS you should edit that module. But note it will not be easy to maintain against mainline FullPageOS.

Saying because I saw this:


+++ '[' -d /distro/variants/ri-bloom/filesystem ']'
+++ cp -vr --preserve=mode,timestamps /distro/variants/ri-bloom/filesystem .
'/distro/variants/ri-bloom/filesystem' -> './filesystem'
'/distro/variants/ri-bloom/filesystem/boot' -> './filesystem/boot'
'/distro/variants/ri-bloom/filesystem/boot/fullpageos.txt' -> './filesystem/boot/fullpageos.txt'
'/distro/variants/ri-bloom/filesystem/boot/fullpageos.txt~' -> './filesystem/boot/fullpageos.txt~'
'/distro/variants/ri-bloom/filesystem/etc' -> './filesystem/etc'
'/distro/variants/ri-bloom/filesystem/etc/default' -> './filesystem/etc/default'
'/distro/variants/ri-bloom/filesystem/etc/default/keyboard' -> './filesystem/etc/default/keyboard'
'/distro/variants/ri-bloom/filesystem/etc/wpa_supplicant' -> './filesystem/etc/wpa_supplicant'
'/distro/variants/ri-bloom/filesystem/etc/wpa_supplicant/wpa_supplicant.conf' -> './filesystem/etc/wpa_supplicant/wpa_supplicant.conf'
'/distro/variants/ri-bloom/filesystem/home' -> './filesystem/home'
'/distro/variants/ri-bloom/filesystem/home/pi' -> './filesystem/home/pi'
'/distro/variants/ri-bloom/filesystem/home/pi/scripts' -> './filesystem/home/pi/scripts'
'/distro/variants/ri-bloom/filesystem/home/pi/scripts/run_onepageos' -> './filesystem/home/pi/scripts/run_onepageos'
'/distro/variants/ri-bloom/filesystem/home/pi/scripts/run_onepageos~' -> './filesystem/home/pi/scripts/run_onepageos~
``
semanticfire commented 4 years ago

But if failed the first time, and this cycle is happening all the time, one build fails, the subsequent one succeeds.

I started this build with and it seemed to create the variant: docker run --privileged -t -vpwd:/distro --name mydistro_builder --device /dev/loop-control guysoft/custompios:devel /CustomPiOS/nightly_build_scripts/custompios_nightly_build ri-bloom

The variant that I build is one I copied from an older version of FullPageOS where I only have a minimal set of files and modifications in the variant directory.

guysoft commented 4 years ago

Ok, I can you give me clear reproduction commands? What set of commands should I run to get a failure? Can you write exactly the sequence of commands you are doing?

This works for me:

sudo docker run --privileged -t -v $(pwd):/distro --name mydistro_builder --device /dev/loop-control guysoft/custompios:devel /CustomPiOS/nightly_build_scripts/custompios_nightly_build
sudo docker rm -f mydistro_builder
sudo docker run --privileged -t -v $(pwd):/distro --name mydistro_builder --device /dev/loop-control guysoft/custompios:devel /CustomPiOS/nightly_build_scripts/custompios_nightly_build
semanticfire commented 4 years ago

I don't run docker as sudo but apart from that I do the same, the first try fails: https://github.com/guysoft/FullPageOS/files/3785257/build-1.log Then the 2nd try works https://github.com/guysoft/FullPageOS/files/3785258/build.log

guysoft commented 4 years ago

@semanticfire Hey sorry for the late reply, that is a known issue. see: https://github.com/guysoft/CustomPiOS/issues/55

Which comes from: https://github.com/moby/moby/issues/27886

Have you figured this? Can I close the issue? Closing if no reply.

semanticfire commented 4 years ago

@guysoft let me try this next week

semanticfire commented 4 years ago

@guysoft running 'losetup -f' before the docker command seems to work

semanticfire commented 4 years ago

@guysoft running 'losetup -f' before the docker command seems to work

too soon, still fails now and then... where the 2nd try works

guysoft commented 7 months ago

Can I close this?