wasm-to-oci
wasm-to-oci copied to clipboard
Try pushing to docker hub and fail
Is pushing to docker hub supported?
wasm-to-oci --log debug push target/wasm32-wasi/debug/hello-world-rust.wasm docker.io/jingweno/wasm:1234
Error: failed commit on ref "manifest-sha256:beb9a5b4269a91d4f6abb5d7c7c0e60bc0db2b90f38cac467aa9866791e73b1e": unexpected status: 403 Forbidden
Usage:
wasm-to-oci push <module> <reference> [options] [flags]
Flags:
-h, --help help for push
--sign Signs the WebAssembly module and pushes the metadata to a trust server
Global Flags:
-d, --dir string Directory where the trust data is persisted to (default "/Users/jou/.wasm-to-oci")
--insecure allow connections to SSL registry without certs
--log string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
--server string The trust server used (default "https://notary.docker.io")
-t, --timeout string Timeout for the trust server (default "5s")
--tlscacert string Trust certs signed only by this CA
--use-http use plain http and not https
I had the same problem.
I just checked, pushing to ECR is supported. Perhaps docker hub behaves a bit differently.
$ wasm-to-oci push ./target/wasm32-wasi/debug/hello-world-rust.wasm 215737051855.dkr.ecr.us-west-2.amazonaws.com/wasm:latest
INFO[0001] Pushed: 215737051855.dkr.ecr.us-west-2.amazonaws.com/wasm:latest
INFO[0001] Size: 2149229
INFO[0001] Digest: sha256:408202b2f3b087ab6ba05c6c59b8a94bb97b45c62275bfb2803001d0f7eb82f0
Yes, currently Docker Hub actively rejects media types outside of a clearly defined list - I also updated the readme to clearly state that pushing to Docker Hub is indeed expected to fail.
(For a bit more context, this project expects the registry to allow arbitrary artifacts - as described by the proposed OCI Artifacts proposal. Given that the proposal is fairly new, it is indeed expected that, unless explicitly tested, a registry will actively reject unknown media types, and so will reject WebAssembly modules.)
We have tested this implementation extensively with the upstream Docker Distribution project and Azure Container Registry - thanks a lot for testing ECR, I will also give it a go and update the readme.
Might be worth retrying this, given https://www.docker.com/blog/announcing-docker-hub-oci-artifacts-support/, and following up at https://github.com/docker/roadmap/issues/135 if there's any remaining blockers.
this works now, here i pushed a rust wasm http service
wasm-to-oci push target/wasm32-wasi/release/server.wasm docker.io/creslin/http-rust:1
returns
INFO[0002] Pushed: docker.io/creslin/http-rust:1
INFO[0002] Size: 3293493
INFO[0002] Digest: sha256:c8a60556394d05faad0fef32f847d444ef489e5493ea63d1e564cf5822e194f7