score-spec / score-compose

Reference implementation for docker-compose target platform support
https://docs.score.dev/docs/score-implementation/score-compose/
Apache License 2.0
449 stars 42 forks source link

`gcr.io/distroless/static` instead of `scratch` #203

Closed mathieu-benoit closed 2 weeks ago

mathieu-benoit commented 2 weeks ago

Using gcr.io/distroless/static instead of scratch because we need ca-certificates: https://github.com/GoogleContainerTools/distroless/tree/main/base.

Otherwise, getting this error:

$ docker run -v .:/score-compose -it ghcr.io/score-spec/score-compose:0.20.0 init --provisioners https://raw.githu
busercontent.com/score-spec/community-provisioners/refs/heads/main/score-compose/00-service.provisioners.yaml
Error: failed to load provisioner 1: failed to make get request: Get "https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/score-compose/00-service.provisioners.yaml": tls: failed to verify certificate: x509: certificate signed by unknown authority

Or:

$ docker run -v .:/score-compose -it ghcr.io/score-spec/score-compose:0.20.0 init --provisioners oci://ghcr.io/score-spec/score-compose-community-provisioners:v0.1.0#00-redis-dapr-state-store.provisioners.yaml
Error: failed to load provisioner 1: manifest fetch failed: Get "https://ghcr.io/v2/score-spec/score-compose-community-provisioners/manifests/v0.1.0": tls: failed to verify certificate: x509: certificate signed by unknown authority

Once approved and merged, I'll do the same for score-k8s.

mathieu-benoit commented 2 weeks ago

With this fix, I can now successfully run:

$ docker run -v .:/score-compose -it score-compose:test-with-static init --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/score-compose/00-service.provisioners.yaml
INFO: Found existing state directory '.score-compose'
INFO: Found existing Score file './score.yaml'
INFO: Read 231 bytes from GET https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/score-compose/00-service.provisioners.yaml
INFO: Wrote provisioner from 'https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/score-compose/00-service.provisioners.yaml' to .score-compose/Z_sq5ZHBzew._xqoL40BT8110Qza10-JHw.provisioners.yaml
INFO: Read more about the Score specification at https://docs.score.dev/docs/

$ ls .score-compose
Z_sq5ZHBzew._xqoL40BT8110Qza10-JHw.provisioners.yaml  mounts  state.yaml  zz-default.provisioners.yaml