purton-tech / rust-on-nails

Full stack web architecture for Rust
https://rust-on-nails.com
MIT License
364 stars 33 forks source link

Update Git version inside container to allow signing with SSH #40

Closed farazfazli closed 1 year ago

farazfazli commented 1 year ago

Hi Ian,

I feel we should have Git version 2.34 or later in the Rust on Nails Dev Container (we currently have 2.30.2). This would support signing commits with an SSH key. Signing commits is a good practice and maintaining a separate set of keys for authentication and signing (SSH + GPG) seems cumbersome.

As per https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials by default Git SSH keys are forwarded to Dev Containers, so besides updating the Git version nothing else should be required to make this work.

Interested in hearing your thoughts on this.

Sincerely, Faraz

9876691 commented 1 year ago

Currently I'm inheriting from rust:slim which is at https://hub.docker.com/_/rust

Which using debian bullseye

image

So the fix is to move up bookworm which probably has a later version of git.

Or maybe I just need to somehow update git in https://github.com/purton-tech/rust-on-nails/blob/main/dev-env-as-code/Dockerfile

farazfazli commented 1 year ago

I don't think it's a good idea to upgrade to Debian Bullseye just because of one package - especially given that Bullseye isn't stable yet. Best strategy here in my opinion would be to use a backport. I've opened a pull request linked to this issue which adds the backport, thus installing Git version 2.39.2.

Let me know your thoughts on this approach. Thanks.