johnyrose / minict

A minimal container runtime written in Go that was made mainly for learning purposes and is intended to be as simple as possible.
GNU General Public License v3.0
171 stars 9 forks source link

Invalid OCI Image detected #3

Open runabol opened 1 year ago

runabol commented 1 year ago

Trying to run one of the examples on an Ubuntu 20.04 machine:

$ sudo go run main.go  run --image ubuntu:20.04 --name ubuntu-ctr

and getting:

2023/08/20 21:38:58.598953 validate: read oci-layout: invalid image detected
exit status 1

Any idea what I'm doing wrong?

runabol commented 1 year ago

Some progress. Realized I have to first pull the image but:

sudo go run main.go pull --image ubuntu:20.04

2023/08/20 21:41:46 fatal Failed to pull image. 
Error received: Error initializing source docker://ubuntu:20.04: 
Error reading manifest 20.04 in docker.io/library/ubuntu: 
manifest unknown: OCI index found, but accept header does not support OCI indexes
exit status 1
johnyrose commented 1 year ago

After some testing, the problem seems to be specific to Ubuntu images. I'll try to check it soon and see what needs to be updated, but in the meantime, using alpine images seems to work. If you want to try with a more complete Linux distro, fedora:latest works as well.

runabol commented 1 year ago

@johnyrose thanks for looking into this. Yes, Alpine seems to work fine. I'll use that for now.