greizgh / vaultwarden-debian

vaultwarden_rs packaging tool
GNU General Public License v3.0
55 stars 16 forks source link

armhf support #12

Closed CamGenius closed 3 years ago

CamGenius commented 4 years ago

How would I go about building this on a a raspberry pi. It took 3 hours to build the amd64 version on accident but it built successfully. I would assume that it could be modified to to use bitwardenrs/server:raspberry instead.

greizgh commented 4 years ago

Indeed, as you can see in the build script the amd64 with sqlite image is hardcoded. You can substitute with aarch64 (raspi 3+). You might have to adjust the Dockerfile.patch though, I did not test it for arm targets.

CamGenius commented 4 years ago

I made the change but now I get this error:

remote: Enumerating objects: 29, done. remote: Counting objects: 100% (29/29), done. remote: Total 36 (delta 28), reused 29 (delta 28), pack-reused 7 Unpacking objects: 100% (36/36), done. From https://github.com/dani-garcia/bitwarden_rs 47a9461..2ee07ea master -> origin/master HEAD is now at 1e22422 Updated deps and fixed some lints /home/pi/bitwarden_rs-debian patching file /home/pi/bitwarden_rs-debian/Dockerfile (read from /home/pi/bitwarden_rs-debian/git/docker/armhf/sqlite/Dockerfile) Hunk #1 FAILED at 36. Hunk #2 FAILED at 48. Hunk #3 FAILED at 62. 3 out of 3 hunks FAILED -- saving rejects to file /home/pi/bitwarden_rs-debian/Dockerfile.rej

KaiJan57 commented 4 years ago

I just created a new Dockerfile.patch to cross compile for armhf (Raspbian). Looks promising! To test, replace the Dockerfile.patch in the root directory with the attatched one (removing the .txt extension, of course). Dockerfile.patch.txt

KaiJan57 commented 4 years ago

Just made a fork that cross compiles for armhf.

CamGenius commented 4 years ago

Got some new errors with the new Dockerfile.patch:

Cloning into '/home/pi/bitwarden_rs-debian/git'... remote: Enumerating objects: 77, done. remote: Counting objects: 100% (77/77), done. remote: Compressing objects: 100% (57/57), done. remote: Total 7417 (delta 41), reused 40 (delta 20), pack-reused 7340 Receiving objects: 100% (7417/7417), 3.84 MiB | 402.00 KiB/s, done. Resolving deltas: 100% (4874/4874), done. Note: checking out '1.13.0'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 1e22422 Updated deps and fixed some lints /home/pi/bitwarden_rs-debian patching file /home/pi/bitwarden_rs-debian/Dockerfile (read from /home/pi/bitwarden_rs-debian/git/docker/armhf/sqlite/Dockerfile) Hunk #1 FAILED at 57. Hunk #2 FAILED at 74. Hunk #3 FAILED at 88. 3 out of 3 hunks FAILED -- saving rejects to file /home/pi/bitwarden_rs-debian/Dockerfile.rej

KaiJan57 commented 4 years ago

Have you tried my fork? Cross compiling requires a few more files changed than just the patch file.

CamGenius commented 4 years ago

Still giving me this error. I think its the same as above.

Cloning into '/home/pi/bitwarden_rs-debian/git'... remote: Enumerating objects: 77, done. remote: Counting objects: 100% (77/77), done. remote: Compressing objects: 100% (57/57), done. remote: Total 7417 (delta 41), reused 40 (delta 20), pack-reused 7340 Receiving objects: 100% (7417/7417), 3.84 MiB | 1.08 MiB/s, done. Resolving deltas: 100% (4874/4874), done. Note: checking out '1.13.0'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 1e22422 Updated deps and fixed some lints /home/pi/bitwarden_rs-debian patching file /home/pi/bitwarden_rs-debian/Dockerfile (read from /home/pi/bitwarden_rs-debian/git/docker/armv7/sqlite/Dockerfile) Hunk #1 FAILED at 57. Hunk #2 succeeded at 61 with fuzz 2 (offset -13 lines). Hunk #3 FAILED at 86. 2 out of 3 hunks FAILED -- saving rejects to file /home/pi/bitwarden_rs-debian/Dockerfile.rej

KaiJan57 commented 4 years ago

Is there a particular reason why you are checking out 1.13 not 1.14?

CamGenius commented 4 years ago

I didn't know there was a 1.14.0 but it gives me this error:

error: pathspec '1.14.0' did not match any file(s) known to git

KaiJan57 commented 4 years ago

How about you try building on your PC?

CamGenius commented 4 years ago

I don't have access to amd64 linux right now but I will try it when I get home.

christian-eriksson commented 3 years ago

@KaiJan57 hope you don't mind, but I took inspiration from your fork in an attempt to add this feature to this project. Created a PR to see if @greizgh might be interested.