Skip to content

Instantly share code, notes, and snippets.

@up1
Last active May 17, 2022 17:51
Show Gist options
  • Save up1/286ffa1ceb9ee4d28cf562c602771655 to your computer and use it in GitHub Desktop.
Save up1/286ffa1ceb9ee4d28cf562c602771655 to your computer and use it in GitHub Desktop.
Rancher Desktop
$nerdctl --help
nerdctl is a command line interface for containerd
Config file ($NERDCTL_TOML): /etc/nerdctl/nerdctl.toml
Usage:
nerdctl [flags]
nerdctl [command]
Management commands:
apparmor Manage AppArmor profiles
builder Manage builds
container Manage containers
image Manage images
ipfs Distributing images on IPFS
namespace Manage containerd namespaces
network Manage networks
system Manage containerd
volume Manage volumes
// Pull image from Docker Hub
$nerdctl image pull hello-world
docker.io/library/hello-world:latest: resolved |++++++++++++++++++++++++++++++++++++++|
index-sha256:80f31da1ac7b312ba29d65080fddf797dd76acfb870e677f390d5acba9741b17: done |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:feb5d9fea6a5e9606aa995e879d862b825965ba48de054caab5ef356dc6b3412: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:2db29710123e3e53a794f2694094b9b4338aa9ee5c40b930cb8063a1be392c54: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 7.4 s
$nerdctl image ls
REPOSITORY TAG IMAGE ID CREATED PLATFORM SIZE BLOB SIZE
hello-world latest 80f31da1ac7b 20 seconds ago linux/amd64 20.0 KiB 6.9 KiB
// Create container
$nerdctl container run --rm hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
// Get all nodes in Kubernetes cluster
$kubectl get node
NAME STATUS ROLES AGE VERSION
lima-rancher-desktop Ready control-plane,master 9m54s v1.23.6+k3s1
// Deploy deployment
$kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml
deployment.apps/nginx-deployment created
$kubectl get all
NAME READY STATUS RESTARTS AGE
pod/nginx-deployment-9456bbbf9-zh6n7 0/1 ContainerCreating 0 20s
pod/nginx-deployment-9456bbbf9-zqn8k 0/1 ContainerCreating 0 20s
pod/nginx-deployment-9456bbbf9-48sjc 0/1 ContainerCreating 0 20s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 12m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/nginx-deployment 0/3 3 0 20s
NAME DESIRED CURRENT READY AGE
replicaset.apps/nginx-deployment-9456bbbf9 3 3 0 20s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment