Skip to content

Conversation

@rare-magma
Copy link
Contributor

@rare-magma rare-magma commented Feb 15, 2024

Containerizing intermodal makes it easier to use without installing it.

The docker image can be hosted on ghcr.io and its build automated via github action:
https://docs.github.com/en/actions/publishing-packages/publishing-docker-images

The container can then be used like this:

docker run --rm --init --interactive --tty --volume "$(pwd)":/mnt ghcr.io/casey/intermodal torrent show /mnt/example.torrent

Signed-off-by: rare-magma <[email protected]>
Copy link
Owner

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Can we avoid using docker.io/lukemathwalker/cargo-chef:latest-rust-latest, at least for the first version? I'd like to make the docker file as minimal as possible initially, and then make modifications/improvements in follow-up PRs.

@rare-magma
Copy link
Contributor Author

@casey I've simplified the dockerfile to use the official docker library rust image as the build stage. The drawback with this approach is that any change in the repository invalidates the docker cache and results in a full rebuild. In the end it shouldn't matter if the image is only built once per release.

Signed-off-by: rare-magma <[email protected]>
Copy link
Owner

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments. I want to keep things as vanilla as possible, and use official, standard images where possible.

@casey
Copy link
Owner

casey commented May 16, 2024

Gotcha, in that case distroless sounds good. I probably won't wind up publishing the docker image myself, I avoid managing package repo packages myself because it's extra work to remember then releasing, so for now let's remove the reference to docker pull ghcr.io/casey/intermodal (since I suppose that would mean I would have to publish it)

@rare-magma
Copy link
Contributor Author

Gotcha, in that case distroless sounds good. I probably won't wind up publishing the docker image myself, I avoid managing package repo packages myself because it's extra work to remember then releasing, so for now let's remove the reference to docker pull ghcr.io/casey/intermodal (since I suppose that would mean I would have to publish it)

@casey I've removed the reference to ghcr in e4cf429

In case you'd like to publish it automatically in the future it can be done easily with a github action as described in https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages

@casey casey enabled auto-merge (squash) May 17, 2024 02:46
@casey
Copy link
Owner

casey commented May 17, 2024

Looks good to me! I changed /app to /usr/local/src, which is a well-known location for source files. Also, I removed the AS runtime, since as far as I can tell, it's not necessary to name a layer if it's not referred to in the future. I also added a just recipe to build and run the image using podman. I'm on macos, and podman is nice because it doesn't require root.

@casey
Copy link
Owner

casey commented May 17, 2024

The build failure is unrelated to this PR. I'll fix it in another PR and then merge this.

@casey
Copy link
Owner

casey commented May 17, 2024

Blocked on #537.

@casey casey disabled auto-merge May 17, 2024 04:42
@casey casey enabled auto-merge (squash) May 17, 2024 04:45
@casey casey merged commit e2a4815 into casey:master May 17, 2024
@casey
Copy link
Owner

casey commented May 17, 2024

Merged, thanks for the PR!

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

Successfully merging this pull request may close these issues.

2 participants