Closed rare-magma closed 6 months ago
@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.
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)
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 https://github.com/casey/intermodal/pull/533/commits/e4cf429083a8e0f3c637dabcfd4e61b6ce0c7871
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
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.
The build failure is unrelated to this PR. I'll fix it in another PR and then merge this.
Blocked on #537.
Merged, thanks for the PR!
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: