Support SSH agent forwarding for container image builds (`--ssh`)

Abierto
#294 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
docker, go
Área
devops

Línea de trabajo

Start with internal/containers/image_build.go, where the shared image-build logic lives, and internal/containers/image_orchestrator.go for the build-context model. Then find the public API build-options models and their controller mappings, and trace how build secrets are passed to the runtime's build command so SSH forwarding can follow the same path. Done means a build request with SSH enabled produces the equivalent of --ssh default in the runtime command, with tests covering the mapping.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

Container image builds that fetch dependencies from private Git repositories may require SSH agent forwarding. Docker and Podman support this through the --ssh build flag:

docker build --ssh default .

The Dockerfile can then use an SSH mount without copying private keys into the image:

RUN --mount=type=ssh,id=default uv sync --locked --no-dev

DCP’s container build configuration currently exposes build arguments and build secrets, but not SSH forwarding. Consequently, builds initiated through clients such as Aspire fail with Permission denied (publickey), even when the equivalent manual build succeeds.

The current workaround is to build manually with --ssh default first, allowing subsequent DCP builds to reuse the cached dependency layer. This breaks whenever that layer’s cache is invalidated.

Requested support

Expose optional SSH forwarding configuration in DCP’s container image build API and propagate it to the container runtime’s build command.

At minimum, support the equivalent of --ssh default, using the caller’s existing SSH agent. Named SSH mounts and explicit agent socket paths would also be useful where supported by the runtime.

Implementation pointers

Relevant areas include the [container build-context model](https://github.com/microsoft/dcp/blob/main/internal/containers/image_orchestrator.go) and [shared image-build implementation](https://github.com/microsoft/dcp/blob/main/internal/containers/image_build.go), together with the public API models and controller mappings.

Related issue

[microsoft/aspire#10510](https://github.com/microsoft/aspire/issues/10510) requests corresponding AppHost support. Adding the DCP capability would enable Aspire to expose SSH forwarding for local container builds.

Lenguaje dominante
Go
Estrellas
194
Forks
28
Merge medio
2 d 2 h
PR fusionados (30 d)
30

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/dcp

Todos los issues de microsoft/dcp

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.