-
Notifications
You must be signed in to change notification settings - Fork 111
Add Dockerfile #969
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
Add Dockerfile #969
Conversation
|
Thanks for the PR @Vatson112! Of course we can publish a Dockerfile together with rustic! |
|
Nice, let me test that with
Not sure, didn't docker.hub also have weird rules now for orgs? Wouldn't propose supporting them. If, we should use other place to host that.
In general, I would say, that containerization is useful for rustic only for making the build process easier and thus development, maybe (although |
Dockerfile
Outdated
| RUN cargo build --release | ||
|
|
||
| # why we dont use alpine for base image - https://andygrove.io/2020/05/why-musl-extremely-slow/ | ||
| FROM debian:bookworm as runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason why you don't use the slim variant here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I will change it with next commit.
Dockerfile
Outdated
|
|
||
| # usually container will be used with --rm option | ||
| # so we ignore cache | ||
| ENV RUSTIC_NO_CACHE=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to note that using remote repositories without a cache can be very slow...
For many commands even using a cache which is directly removed after execution of the binary is in this case even faster than using no cache at all. So I would remove this, actually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okey. Also remove it with next commit
I think one use case is people distributing software as docker images to be run onto their systems. Having rustic in an image then would be the identical way of distribution. |
I also build and use it using pomdan. But I also tested it on Docker. There are few useful examples how I used it. Export vars for repo export RUSTIC_REPOSITORY=/var/backup
export RUSTIC_PASSWORD=rusticGet snapshots podman run --rm -it -e RUSTIC_REPOSITORY=$RUSTIC_REPOSITORY -e RUSTIC_PASSWORD=$RUSTIC_PASSWORD -v /var/backup:/var/backup:Z rustic snapshotsBackup pg database podman exec db pg_dumpall -U postgres | podman run --rm -i -v /var/backup:/var/backup:Z -e RUSTIC_REPOSITORY=$RUSTIC_REPOSITORY -e RUSTIC_PASSWORD=$RUSTIC_PASSWORD rustic backup --stdin-filename backup.sql -
I don't like distributing software to servers as a binary. And it took me longer to build the RPM package than the container image. So I just took faster way. It also occurs to me that the container can be used in immutable operating systems (like FCOS), and perhaps in a kubernetes cluster (if using Velero is impossible for some reason). |
aawsome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@Vatson112 About your example: Note that rustic supports a config file (and for me this is the preferred way) . |
|
Thanks @Vatson112 |
|
Was merged now a bit fast, wanted to state that it would be nice of @Vatson112 to add something to the https://github.com/rustic-rs/dev-docs / https://github.com/rustic-rs/docs about the Dockerfile as a new feature/part of the infrastructure we need to maintain. |
|
Hi @simonsan I added basic docs. Check it out - rustic-rs/dev-docs#13 Also what do you think about distribute |
That's awesome, thank you! Would you be able by any chance to add small docs to the https://github.com/rustic-rs/docs repository as well, for endusers? E.g. with the usages as mentioned in #969 (comment) That would be awesome of you! <3 For the distribution side of things, I actually don't really know. What advantages would that have? It's kind of convoluted right now, for sure. So if it would make it easier, it would probably be welcome, as long as the complexity level is not a lot higher. |
I am an experienced Kubernetes DevOps engineer and we heavily use restic containers for backing up everything in our clusters. I have my eye on rustic because of features like the hot/cold storage pattern and the backend abstraction via rclone. But not having an official and maintained docker image is a showstopper for rustic's usage in cloud environments. BTW if you dislike dockerhub, github runs it's own container registry at ghcr.io . Don't know if it's free for open-source projects and how easily it can be integrated in your github CI/CD workflows. But if you want this project to be found by a broader audience, dockerhub would probably be the place to go. |
That sounds like a perfect fit! If you think, you would be able to do that, I think we would be really happy to have you on board for maintaining that part of the ecosystem. My personal opinion is that it's currently out of scope, at least for me, don't know about @aawsome, to maintain that. I think we have enough to do with the current state and features we want to see and implement regarding the whole ecosystem (rustic, libraries, server, scheduler, gui/tui, etc.). Also regarding OS support there is still a lot to do, while we need to implement more tests to make sure we can make changes in a more reliable way. Benchmarking would be nice. Fuzzing as well. So yeah, not really sure. But as I said, I think you are very welcome to take over that part, if you want to. |
|
Sure, I can support with documentation and examples for usage with Kubernetes. @Vatson112: Do you have experience in automated building and publishing to dockerhub or ghcr.io? Just for my understanding: |
|
Hi @mueckinger
Nope. I used only selfhosted Harbor or Quay with Gitlab. But I think I can try it on next week. It's unlikely there's any rocket science here. |
|
@Vatson112 The repository can be found here now: https://github.com/rustic-rs/rustic-helm |
|
Do we have a docker image readily available?
@simonsan I like using docker for server backups because I can define a docker compose file and run it anywhere. By containerizing everything, migration to a new server is often as simple as bringing down the docker daemon, running rsync to transfer everything to a new host, and then running |
|
|
Hi! Finally I figured out how to automatically build docker images on every new rustic release. Closes #1083 Completes tasks discussed in #969, #1008 and #1010. Notes to the maintainers: - This requires setting Workflow permissions to write access for the GITHUB_TOKEN as described here: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-default-github_token-permissions - It makes sense to update the README (added docker install info) in the next rustic release (when the first image is built)
Hello, I decided to test rustic in my environment. However I see that you dont have docker image. So I decided to promose mine.
I'm new to the rust environment, so there are few questions: