devcontainers / templates

Repository for Dev Container Templates that are managed by Dev Container spec maintainers. See https://github.com/devcontainers/template-starter to create your own!
https://containers.dev/templates
MIT License
1.03k stars 263 forks source link

[Rust] Cargo cache persistence in Docker Volume #117

Closed eitsupi closed 1 year ago

eitsupi commented 1 year ago

Do you think it is worth including in the template with the following settings, which share the Cargo cache between builds and containers, commented out?

{
    "source": "devcontainer-cargo-cache",
    "target": "/usr/local/cargo",
    "type": "volume"
}
samruddhikhandale commented 1 year ago

I think we could. How about adding something like 👇 ?

    "mounts": [
        {
            "source": "devcontainer-cargo-cache-${devcontainerId}",
            "target": "/usr/local/cargo",
            "type": "volume"
        }
    ]
eitsupi commented 1 year ago

I think we could. How about adding something like 👇 ?

    "mounts": [
        {
            "source": "devcontainer-cargo-cache-${devcontainerId}",
            "target": "/usr/local/cargo",
            "type": "volume"
        }
    ]

Thanks for your response. I think this is a safe volume to share among all containers, but your suggestion is more safer so I think it is ok.