Skip to content
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

Support docker command line usage #83

Open
HarelM opened this issue Aug 22, 2024 · 4 comments
Open

Support docker command line usage #83

HarelM opened this issue Aug 22, 2024 · 4 comments
Assignees

Comments

@HarelM
Copy link

HarelM commented Aug 22, 2024

Hi,

Is it possible to create and publish a docker image to allow running this without any other configuration?

@flother
Copy link
Owner

flother commented Aug 22, 2024

Ah, that's an interesting question. One of the reasons I wrote Spreet as a single binary was so I wouldn't have to deal with Docker. I do make pre-compiled binaries available for each release if that would be any use to you — see the latest v0.11.0 release for example.

What would you like the image to do, if you could choose? We have a few options, I suppose. It could simply download the latest pre-compiled binary, or it could clone the repo, download the Rust compiler, and build it from source.

What's your use-case? Let me know and we can work out the best approach.

@HarelM
Copy link
Author

HarelM commented Aug 22, 2024

I would like the docker image to simply wrap the binary (This will create a dockerfile that is also a good reference if you want to compile the binary locally).
This docker image can get the parameters for the binary to use, and probably mount it to the relevant svg folder.
Basically, I don't want to install anything on my machine besides docker to use this tool, either a mac, windows or linux system.
so something like docker run --rm -v $(pwd)/icons:/var/data/icons flother/spreet icons my_style would be great.

@flother
Copy link
Owner

flother commented Aug 22, 2024

OK, I’ll look into this when I get a chance.

So basically the Dockerfile should look something like this:

  1. Use a base image that has the Rust toolchain installed (available on Docker Hub)
  2. Run cargo install [email protected] to install Spreet from crates.io
  3. Set the working directory to /var/data
  4. Make the spreet binary the entry point for the image

And when a new version of Spreet’s released, the CI job would need to tag a new version of the image and push it to a container registry (probably ghcr.io).

@flother flother self-assigned this Aug 22, 2024
@HarelM
Copy link
Author

HarelM commented Aug 22, 2024

Or you can create a two steps docker where you build the binary in the first step and use it in the second step.
But otherwise, this is the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants