Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More complete docker instructions #298

Closed
semanticfire opened this issue Oct 24, 2019 · 18 comments
Closed

More complete docker instructions #298

semanticfire opened this issue Oct 24, 2019 · 18 comments

Comments

@semanticfire
Copy link
Contributor

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
Copy link
Owner

guysoft commented Oct 29, 2019

  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
Copy link
Contributor Author

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

@semanticfire
Copy link
Contributor Author

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
Copy link
Owner

guysoft commented Oct 29, 2019

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
Copy link
Contributor Author

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

@guysoft
Copy link
Owner

guysoft commented Oct 29, 2019

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
Copy link
Contributor Author

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
Copy link
Owner

guysoft commented Oct 29, 2019 via email

@semanticfire
Copy link
Contributor Author

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
Copy link
Owner

guysoft commented Oct 30, 2019

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
Copy link
Contributor Author

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 -v pwd:/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
Copy link
Owner

guysoft commented Oct 31, 2019

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
Copy link
Contributor Author

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
Copy link
Owner

guysoft commented Feb 29, 2020

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

Which comes from:
moby/moby#27886

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

@semanticfire
Copy link
Contributor Author

@guysoft let me try this next week

@semanticfire
Copy link
Contributor Author

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

@semanticfire
Copy link
Contributor Author

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

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

@guysoft
Copy link
Owner

guysoft commented Oct 26, 2023

Can I close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants