UX: Embed CA bundle as fallback (Better support for `FROM scratch` base image)

Aperta
#222 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go

Direzione di ricerca

Inizia tracciando la richiesta HTTPS di chisel al repository delle release e la gestione esistente del trust store del filesystem; il payload non indica alcun file sorgente né alcun test. Confronta un fallback CA integrato come rootcerts con altre opzioni, preservando il trust store normale e qualsiasi comportamento di opt-in. Il lavoro è completato quando il workflow FROM scratch mostrato può contattare GitHub senza un bundle CA nel filesystem, con copertura per gli ambienti di fallback e quelli normali.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Presently chisel expects the CA bundle to exist externally to contact Github over HTTPS. It would be beneficial to have an embedded fallback (even if opt-in via CLI flag) instead of failing, as it simplifies FROM scratch image usage which can avoid an intermediary --root path + COPY from an earlier stage.

FROM scratch
SHELL ["/nu", "-c"]
# NOTE: `chisel` is a prior stage (no official image yet)
RUN --mount=type=bind,from=chisel,source=/usr/local/bin/chisel,target=/chisel \
    --mount=type=bind,from=ghcr.io/nushell/nushell,source=/usr/bin/nu,target=/nu \
    /chisel cut --release ubuntu-24.04 --root / base-files_base
0.410 2025/04/26 01:52:05 Consulting release repository...
0.603 error: cannot talk to release repository: Get "https://codeload.github.com/canonical/chisel-releases/tar.gz/refs/heads/ubuntu-24.04": tls: failed to verify certificate: x509: certificate signed by unknown authority

The binary size should not increase that much and this would allow for running chisel on FROM scratch without having to provide ca-certificates.crt upfront (which can either add extra layer weight or conflict with chisel writing to the same location that's a temporary bind mount when using --root /).

There is a Go package rootcerts which can embed the CA bundle into the Chisel build? That will be used as a fallback when there is no trust store on the filesystem to leverage. I've not explored other options for approaching this, so there might be a better option if rootcerts is not something you're comfortable with.


Reference: Another user also pointed out the concern with an external CA bundle at the end of this comment.

Lingua principale
Go
Stelle
434
Fork
74
Merge medio
1g 30m
PR unite (30g)
1

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di canonical/chisel

Tutte le issue di canonical/chisel

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.