Closed breakingflower closed 4 years ago
@pauliacomi Can you provide some assistance here as the author of this file
Hi, I builded onedrive docker imagen from this repository for Raspbery pi 3B+ and I got the same error two days ago. The R-Pi didn't enough swap memory allocate for the process. You can look in the file /etc/dphys-swapfile
the CONF_SWAPSIZE
and modifique to CONF_SWAPSIZE=2024.
Reebot and try it again.
@fl0r1s, @fersalme is correct, it is related to the swap memory of the Pi. The lack of systemd is not important on the build image. I personally used the following to make a separate 1.5 GB swapfile:
cd /var
sudo fallocate -l 1.5G swapfile
sudo chmod 600 swapfile
sudo mkswap swapfile
sudo swapon swapfile
# make swap permanent
sudo nano /etc/fstab
# add "/swapfile swap swap defaults 0 0" at the end of file
# check it has been assigned
swapon -s
free -h
@fersalme's suggestion seems simpler, I would first try that as I expect it does the same thing. Please let me know if it works.
@pauliacomi , @fersalme Many thanks for this. Sounds like this should be added to a wiki entry or at least to the docker.md file.
@abraunegg I think in the install configuration would be ideal, because I think it is needed on non-Docker installs. Potentially it can be also mentioned in Docker instructions.
@pauliacomi The install doc already has this detailed: https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md#build-requirements
- Build environment must have at least 1GB of memory & 1GB swap space
- libcurl
- SQLite 3 >= 3.7.15
- Digital Mars D Compiler (DMD)
But nothing calls this out that it is needed for Docker builds ..
@abraunegg Ah I missed that there.
Though for Docker builds it is expected that you can build onedrive non-dockerized first. Maybe a "Building and running on a Raspberry Pi" section added in https://github.com/abraunegg/onedrive/blob/master/docs/Docker.md ?
Alternatively it would be nice if an arm image could be maintained in the driveone/onedrive channel.
@pauliacomi
Alternatively it would be nice if an arm image could be maintained in the driveone/onedrive channel
I tried to do that - using the ARM Docker file as an automated build fails to work.
@abraunegg Unfortunate... I saw you are using Travis.ci for ARM testing. You could potentially auto-push an image to DockerHub as a deploy stage?
@pauliacomi Yep - however that builds / tests under ARM - using qemu, to ensure that at least the compiler / code works / executes on ARMHF / ARM64.
Not doing at present any docker builds that way. If you want to maybe try and get this working/ develop a PR that expands the existing Travis CI process to do this that would be great.
@abraunegg I'll consider giving it a try, I need to get up to speed with the pipeline.
I have tried both @pauliacomi and @fersalme's solutions but neither work.
I edited the /etc/dphys-swapfile
to have CONF_MAXSWAP=4096
(the size of the rpi ram).
Next, I removed the swap partition and reinstalled it as described in the docs:
sudo dphys-swapfile uninstall
sudo dphys-swapfile setup # this generates a swapfile of 4096
sudo dphys-swapfile swapon # enable swapfile
sudo reboot
Finally, I restarted my build docker-compose build --no-cache onedrive
.
Using this strategy the same errors as mentioned in the initial post occur.
However, I also tried building it locally, i.e. docker build . -t local-onedrive -f contrib/docker/Dockerfile-rpi
and building succeeds.
As mentioned before, it fails on makefile line 99 trying to get tags from the repo.
if [ -f .git/HEAD ] ; then \
git describe --tags > version ; \
else \
echo $(version) > version ; \
fi
Are these checks on the tags necessary? Perhaps it can be updated using this stackoverflow solution, ergo git describe --always
On a different topic ( can also make this into a new issue if you would prefer this ), the first run of the docker should also be updated in docker.md to avoid user conflicts:
docker run -it --restart unless-stopped --name onedrive -v onedrive_conf:/onedrive/conf -v "${onedriveDir}:/onedrive/data" -e "ONEDRIVE_UID:PID" -e "ONEDRIVE_GID:GID" driveone/onedrive
@fl0r1s Thanks for the update.
Please submit new issues and PR's for any document changes that you feel could improve the existing documentation.
@abraunegg
Submitted a PR containing some changes in the Docker.md
file.
Please note that the provided idea by @pauliacomi and @fersalme do not yield a solution on my rpi4.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Bug Report Details
Describe the bug
Build fails when building docker straight from repository.
While building the docker for an ARMHF device (Raspberry pi 4) straight from the repository as follows:
I get the following error:
It first fails on not being able to find
systemd
. Next, it fails on makefile line 99 trying to get tags from the repo. After some googling I have found that this docker build context is a shallow clone which is not allowed.Machine Info
OS:
Linux naspi 4.19.102-v7l+ #1295 SMP Thu Feb 6 15:49:36 GMT 2020 armv7l GNU/Linux
Headless OneDrive Account type: not important DMD / LDC: I use the raspberry pi dockerfile. This uses LDC. Application configuration: not important Curl version: not importantCan someone please aid me in solving this issue. It would be really nice to build for armhf devices straight from the github repo using the file provided in the contrib folder.