resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

User schedule in container - Docker-compose doesn't built dockerfile

Open patrickwolf opened this issue 8 months ago • 5 comments

  1. In the example given the docker-compose loads a pre-build image instead of building the dockerfile. This leads to the resticprofile user not being created and the docker-compose erroring out

https://creativeprojects.github.io/resticprofile/schedules/non-root-schedule-in-container/index.html

  1. The dockerfile has these commands but there is no reference where those assets that are to be copied are not be found https://github.com/creativeprojects/resticprofile/blob/af9ab7f4e8f63f7b84e1939d97b3277e20e9000d/build/Dockerfile_non-root#L10-L12

patrickwolf avatar Mar 19 '25 19:03 patrickwolf

Hey!

You are right, this documentation is incomplete 😢

It's because I'm using goreleaser to build the docker images 🙄 you can see the commands running before building the image from the goreleaser config: https://github.com/creativeprojects/resticprofile/blob/af9ab7f4e8f63f7b84e1939d97b3277e20e9000d/.goreleaser-docker-only.yml#L7-L12

Assuming you have the go sdk installed, I think running these commands before building the image should work:

go install github.com/zyedidia/eget@latest
eget rclone/rclone --upgrade-only --system=linux/amd64 --to=build/rclone-amd64 --asset=zip
eget rclone/rclone --upgrade-only --system=linux/arm64 --to=build/rclone-arm64 --asset=zip
eget restic/restic --upgrade-only --system=linux/amd64 --to=build/restic-amd64
eget restic/restic --upgrade-only --system=linux/arm64 --to=build/restic-arm64
make build

creativeprojects avatar Mar 19 '25 20:03 creativeprojects

Assuming you have the go sdk installed, I think running these commands before building the image should work:

I don't :) I'm just an end user in this case ;)

patrickwolf avatar Mar 19 '25 21:03 patrickwolf

In which case, to get all these files available, I'd probably recommend this:

curl https://zyedidia.github.io/eget.sh | sh
./eget rclone/rclone --upgrade-only --system=linux/amd64 --to=build/rclone-amd64 --asset=zip
./eget rclone/rclone --upgrade-only --system=linux/arm64 --to=build/rclone-arm64 --asset=zip
./eget restic/restic --upgrade-only --system=linux/amd64 --to=build/restic-amd64
./eget restic/restic --upgrade-only --system=linux/arm64 --to=build/restic-arm64
./eget creativeprojects/resticprofile --to=resticprofile --system=linux/`uname -m` --asset=no_self_update

That should give you all the files you need

It's still using eget tool because it's the easiest way to download any binary from GitHub.

Also it probably won't work on Windows 😢

creativeprojects avatar Mar 20 '25 17:03 creativeprojects

Thank you! I'm using the root user workflow with crond now so I'm not too worried and just wanted to leave the feedback as I got stuck in trying for a while and wanted to help others.

Maybe the easiest solution is

  • leaving a comment that building is more complex and your comment above
  • maybe publishing a base image on which the the shared docker image can build

just food for thought

patrickwolf avatar Mar 20 '25 19:03 patrickwolf

TBH the user permission based image is experimental; that's why it's not available pre-built.

More work is needed but there's other more urgent things to do in the meantime 😢

creativeprojects avatar Mar 20 '25 19:03 creativeprojects