ptpb / pb

pb is a formerly-lightweight pastebin and url shortener
Other
552 stars 52 forks source link

Raspberry pi installation? #207

Closed eubwxidc closed 6 years ago

eubwxidc commented 6 years ago

Just tried the pb docker image on rpi3 running ubuntu mate but I don't think the pi architecture is supported by your docker image. Is this something you can easily include in the docker image? Is it possible to install pb on raspberry pis?

fff7d1bc commented 6 years ago

Because the docker image is x86. Build the image yourself, perhaps using armhf/alpine as base and it may run.

eubwxidc commented 6 years ago

Thanks for the reply. I've never created a docker image before. Would you be able to assist?

buhman commented 6 years ago

You should be able to literally replace the base in the dockerfile, and build using docker build .

buhman commented 6 years ago

Did you get this to work? I do think having some easy way to deploy pb on arm hardware is valuable, so I'm interested in "officially" supporting this.

eubwxidc commented 6 years ago

I honestly have no clue how to use docker or "replace the base". But I'll have some time tomorrow so I'll look into it and give it a try. I would love to get this setup on the pi on my home network.

jdppettit commented 6 years ago

@eubwxidc essentially just replace this line with one of the recommended ones: https://github.com/ptpb/pb/blob/master/Dockerfile#L1

buhman commented 6 years ago

I did a manual arm64v8 build (the same architecture used on the rpi3) using qemu-system-aarch64 and a ubuntu arm64 build host.

I pushed the result to https://hub.docker.com/r/ptpb/pb-arm64v8/

You should be able to use this with something like this:

docker network create pb-network
docker run --name mongodb --network pb-network -d shanehsu/arm64v8-mongo
docker run -e CDN_PREFIX=//d34zelngniy2d8.cloudfront.net -e LISTEN_ADDRESS=0.0.0.0 -p 10002:10002 --name pb --network pb-network -d ptpb/pb-arm64v8

Sadly, docker has pretty poor arm support (lack of architecture-agnosticness is a cancer shared by most projects in 2018) and I can't do automated arm builds on dockerhub without building them myself. They also don't have an official mongo arm64v8 image, but that random one seems to subjectively work ¯\_(ツ)_/¯

buhman commented 6 years ago

I've been considering getting arm hardware myself, so this is definitely something that interests me. Let me know if this works for you!

jerbmega commented 6 years ago

I just attempted this on my ODROID-C2 running Armbian. The MongoDB container runs fine, but the pb container itself exits with /usr/local/bin/python: No module named pb.

Using the aarch64 Dockerfile with docker-compose results in the following error: https://ptpb.pw/azT8

EDIT: It must have been a modification i made to the docker-compose yaml file that was causing it- a fresh pull solved the problem and I successfully built a pb image.