Merge pull request #7 from liubin/fix/liubin-1213
Update shim/README.md for running examples locally
This commit is contained in:
commit
712d355fd9
|
|
@ -8,3 +8,4 @@ Cargo.lock
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
log
|
||||||
|
|
|
||||||
|
|
@ -73,19 +73,21 @@ fn main() {
|
||||||
|
|
||||||
## How to use with containerd
|
## How to use with containerd
|
||||||
|
|
||||||
|
**Note**: All operations are in the root directory of `rust-extensions`.
|
||||||
|
|
||||||
With shim v2 runtime:
|
With shim v2 runtime:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cargo build --example empty-shim
|
$ cargo build --example empty_shim
|
||||||
$ sudo cp ./target/debug/examples/empty-shim /usr/local/bin/containerd-shim-empty-v2
|
$ sudo cp ./target/debug/examples/empty_shim /usr/local/bin/containerd-shim-empty-v1
|
||||||
$ sudo ctr run --rm --runtime io.containerd.empty.v2 -t docker.io/library/hello-world:latest hello
|
$ sudo ctr run --rm --runtime io.containerd.empty.v1 -t docker.io/library/hello-world:latest hello
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if on 1.6+
|
Or if on 1.6+
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cargo build --example empty-shim
|
$ cargo build --example empty_shim
|
||||||
ctr run --rm --runtime ./target/debug/examples/empty_shim docker.io/library/hello-world:latest hello
|
$ sudo ctr run --rm --runtime ./target/debug/examples/empty_shim docker.io/library/hello-world:latest hello
|
||||||
```
|
```
|
||||||
|
|
||||||
Or manually:
|
Or manually:
|
||||||
|
|
@ -103,8 +105,8 @@ $ sudo TTRPC_ADDRESS="/var/run/containerd/containerd.sock.ttrpc" \
|
||||||
start
|
start
|
||||||
unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock
|
unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock
|
||||||
|
|
||||||
$ cargo build --example connect
|
$ cargo build --example shim-proto-connect
|
||||||
$ sudo ./target/debug/examples/connect unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock
|
$ sudo ./target/debug/examples/shim-proto-connect unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock
|
||||||
Connecting to unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock...
|
Connecting to unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock...
|
||||||
Sending `Connect` request...
|
Sending `Connect` request...
|
||||||
Connect response: version: "example"
|
Connect response: version: "example"
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ where
|
||||||
match flags.action.as_str() {
|
match flags.action.as_str() {
|
||||||
"start" => {
|
"start" => {
|
||||||
let args = StartOpts {
|
let args = StartOpts {
|
||||||
id: id.into(),
|
id: flags.id,
|
||||||
publish_binary: flags.publish_binary,
|
publish_binary: flags.publish_binary,
|
||||||
address: flags.address,
|
address: flags.address,
|
||||||
ttrpc_address,
|
ttrpc_address,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue