-
Notifications
You must be signed in to change notification settings - Fork 467
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
Raspberry #144
Comments
Hi, it is possible to run it on a Raspberry Pi. I compiled the alpine variant on a Raspberry Pi 3 and 4, but currently there is an issue with a package in testing. I'm currently working on a gist how to solve this. Here is a link to the gist: Build a postgis and osm2pgsql Docker image on a Raspberry Pi. Finished writing the gist. |
I pushed an image to docker: https://hub.docker.com/r/duvel/postgis. |
would you push the changes to the official repo as well? |
@krasi-georgiev what do you mean with the official repo? Git or docker hub? Because of the specialized build I don't think it is a good idea to push it to git. |
I meant docker hub. If proj4 is the only problem , why not try to get this solved upstream? I am now playing with the new docker buildx command so might be a good way to test it to push multi arch images. |
I could push it to docker hub, that would be fine, but could also mean that the other images should als be prepared for this. Creating an multi-arch image isn't that difficult, but I haven't played yet with the new buildx, so I don't know if that makes it easier. I'm not sure if solving upstream will help. Problem is that proj4 has been renamed, is now on version 6 (which broke osm2pgsql), is in testing on Alpine and isn't always build for arm if I am correct. So my first action was to get a good recipe to even be able to build it and use it on a Raspberry Pi. Also when looking at #143 I don't know how smart it currently is to invest time in the current repo's. |
hm yeah good point. I need the arm/v7 arch so will try to follow your gist to create an image for that. |
Why do you need a armv7 specific one? AFAIK does this one also runs on armv7. |
aah ok, I didn't know, will test it and let you know. |
it works with the only problem that when using with an init script doesn't complete the initialization with the error: to replicate you can use this docker-compose file: and the init script is: |
For me the initdb works, but I see that you're using a sql file and not a shell script. SMARTconnect probably uses a different postgis image, that can handle sql scripts. Maybe have a look at the initdb-postgis.sh in this project. |
The postgis image uses the official postgres as a base which does support sql as an init script. The problem is not with the init sql, but that the server doesn't shutdown for some reason. For me the image size is not that important so I just built a multi arch image from Here is the Dockerfile that works
The only change is adding Than I used
|
I did not know you could also supply a sql and just saw that they were using their own postgis-image. I was just looking at the differences. If it now works for you, it probably is more an issue in alpine then in postgres/postgis or it could be related to the older postgis version. |
unfortunately it doesn't work with exactly the same error. I guess a problem with ARM or the 2.3 postgis version. |
Just tried it on a laptop and it worked so not an issue with the image, probably ARM or the SD card on the RPI is playing up |
I just gave the script a try and it worked for me. So maybe there is an issue with the docker-compose file. The steps I took:
|
I gave the repository a try, but with a slightly adjusted docker-compose and it works for me as well.
|
ok thanks, I will test with a new SD card as I think that is the problem. |
yep all working fine it was the slow SD card |
Can this solve the docker installation problem on the raspberry pi?? |
@Duvel Scanning the discussion here, there are some interesting bits. Would you be able to enumerate the issues you're currently faced with in getting this to work, and we can determine which ones are postgis specific and try to unblock them if we can. Thanks! |
@phillipross I think the status is still the same, issues with the proj package (also gdal) for the alpine version and I'm seeing an unable to locate package for postgis in the debian one, so I'm guessing it is not build by default for ARM. |
I'm able to download the base Edit: Changing the debian image to just install |
I can build 12-3.0-apline in Ubuntu 19.10 arm64 with Raspberry Pi 4. |
I just tried again on the raspi3 with raspbian buster and still ran into the |
Verifying @smellman, you can build the image on 19.10 raspi4. You cannot pull and run any images or build the non-alpine version though, so it is still less than ideal. |
I was also able to build both the default and alpine variant on Ubuntu 20.04 arm64. So it seems there is better support for arm64 upstream. @phillipross I think we now can create arm64 images. Is that something to start looking into? |
@Duvel yes! |
@phillipross do you know how and where the images are currently created? I'm going to have a look into this for another project I'm working on: |
The way things are now... the source in the docker-postgis repo consist of scripts and templates for Dockerfiles. There is also a travis-ci configuration which triggers a travis-ci job for each pull request and commit or merge to the main branch. The images are actually built on travis and pushed to dockerhub. Currently, the travis configuration is simple. It uses a ubuntu 16.04 vm on travis infrastructure with docker and git installed in the VM. I have no first-hand experience with building arm images yet, but the postgis debian images are based on the official postgres images, and I'm pretty sure they have arm builds. I had planned to research how they're doing arm builds for postgres and see if the same could be done for postgis but I haven't had the time to do so. |
A quick google showed me we can build arm64 images with travis. Not yet exactly sure enough how, but that can be determined. But when I look at the current Makefile and current structure of the repository, I do think we have a challenge. I'm going to look if I can get a travis build setup for my other project, only not sure yet when I will have the time. |
The reason I had mentioned the official postgresql images is because this postgis repo was originally influences by the postgresql repo. It might be worth checking out how they go about building the arm images. |
Check, I see now, what you mean. I was confused by the official repo, but I needed to look for the special repo for the docker images. This seems to use github for building and not travis. I'll see if I can understand how they build it. |
I'm closing this issue with a reference to issue #216 where more up to date discussion is occurring. |
@Duvel I tried to pull and load it but there no Postgres role and it seems not to accept the POSTGRES_USER and POSTGRES_PASSWORD env. (I'm not using it on a Raspberry but as a makeshift for my M2 cause I don't see any recent postgis docker image for ARM64 arch) |
@BigBoulard I have no issues running it, maybe you could provide more info how you run and connect to postgres. Maybe also have a look at the POSTGRES_HOST_AUTH_METHOD env variable. |
It is possible to run on Rapberry pi3?
The text was updated successfully, but these errors were encountered: