Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nerdctl command for users outside kubernetes #13252

Closed
afbjorklund opened this issue Dec 28, 2021 · 18 comments
Closed

Add nerdctl command for users outside kubernetes #13252

afbjorklund opened this issue Dec 28, 2021 · 18 comments
Labels
co/runtime/containerd kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@afbjorklund
Copy link
Collaborator

afbjorklund commented Dec 28, 2021

The default ctr and buildctl are a bit rough around the edges (i.e. user-hostile)

There is another program called nerdctl, which looks more like docker and podman.

It doesn't have a remote protocol, so users will have to use minikube ssh to use it...

(i.e. there is no equivalent to docker-env and podman-env, except for ssh tunneling)

https://github.com/containerd/nerdctl#command-reference

https://minikube.sigs.k8s.io/docs/handbook/pushing/#6-pushing-directly-to-in-cluster-containerd-buildkitd


With Docker and Podman, there are both local clients as well as remote clients:

minikube ssh -- docker --help

eval $(minikube docker-env)
docker --help
minikube ssh -- sudo podman --help

eval $(minikube podman-env)
podman --remote --help

With nerdctl/containerd/buildkitd, there are no local clients but only remote client:

minikube ssh -- sudo nerdctl --help
$ eval $(./out/minikube docker-env)
❌  Exiting due to MK_USAGE: The docker-env command is only compatible with the "docker" runtime, but this cluster was configured to use the "containerd" runtime.
$ eval $(./out/minikube podman-env)
❌  Exiting due to MK_USAGE: The podman-env command is only compatible with the "crio" runtime, but this cluster was configured to use the "containerd" runtime.

"local" client would be: running on the host, i.e. remotely (to server)
"remote" client would be: running on the node, i.e. locally (to server)

@afbjorklund afbjorklund added co/runtime/containerd kind/feature Categorizes issue or PR as related to a new feature. labels Dec 28, 2021
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Dec 28, 2021

For regular use, there is kubectl and crictl as always. Or the "minikube image" wrapper.

When using the regular containers, normally it is sudo nerdctl. And perhaps -n k8s.io.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Dec 28, 2021

Pre-built binaries: https://github.com/containerd/nerdctl/releases/tag/v0.15.0

https://github.com/containerd/nerdctl/releases/download/v0.15.0/nerdctl-0.15.0-linux-amd64.tar.gz

docker@minikube:~$ sudo nerdctl version
Client:
 Version:	v0.15.0
 Git commit:	b72b5ca14550b2e23a42787664b6182524c5053f

Server:
 containerd:
  Version:	1.4.9
  GitCommit:	e25210fe30a0a703442421b0f60afac609f950a3

# "list all containers running for Kubernetes" 
docker@minikube:~$ sudo nerdctl -n k8s.io ps

# "list all images loaded for Kubernetes"
docker@minikube:~$ sudo nerdctl -n k8s.io images

# "build and tag a image for Kubernetes"
docker@minikube:~$ sudo nerdctl -n k8s.io build -t myimage .

No deb packages, sadly.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Dec 28, 2021

Rootless nerdctl/containerd is not supported, and will give an error message:

docker@minikube:~$ nerdctl version
WARN[0000] environment variable XDG_RUNTIME_DIR is not set, see https://rootlesscontaine.rs/getting-started/common/login/ 
WARN[0000] environment variable XDG_RUNTIME_DIR is not set, see https://rootlesscontaine.rs/getting-started/common/login/ 
FATA[0000] rootless containerd not running? (hint: use `containerd-rootless-setuptool.sh install` to start rootless containerd): environment variable XDG_RUNTIME_DIR is not set, see https://rootlesscontaine.rs/getting-started/common/login/ 

This is "normal", and not supported with the other container runtimes either.

docker@minikube:~$ podman version
Error: command required for rootless mode with multiple IDs: exec: "newuidmap": executable file not found in $PATH

https://docs.docker.com/engine/security/rootless/

docker@minikube:~$ dockerd-rootless-setuptool.sh install
-bash: dockerd-rootless-setuptool.sh: command not found

@afbjorklund
Copy link
Collaborator Author

There is a nerdctl 0.16.0 out now.

@spowelljr spowelljr added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Feb 16, 2022
@afbjorklund afbjorklund added this to the 1.27.0-candidate milestone Feb 24, 2022
@afbjorklund afbjorklund removed the triage/discuss Items for discussion label Feb 24, 2022
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Mar 24, 2022

Upgraded to nerdctl 0.17.1, and containerd (ctr) 1.5 / buildkit (buildctl) 0.10

Note: we're currently still using the same containerd version as docker uses.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Apr 10, 2022

@k8s-triage-robot

This comment was marked as outdated.

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 9, 2022
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jul 30, 2022

The current release is 0.22.0, same difference.

https://github.com/containerd/nerdctl/releases/tag/v0.22.0

@afbjorklund
Copy link
Collaborator Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 30, 2022
@afbjorklund afbjorklund removed this from the 1.27.0-previous milestone Aug 15, 2022
@k8s-triage-robot

This comment was marked as outdated.

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 13, 2022
@afbjorklund
Copy link
Collaborator Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 11, 2022
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Dec 11, 2022

This is a pre-requisite for nerdctl.sock, if wanting to keep the API compatibility with docker

The current ctr and buildctl "work", but they don't have any CLI compatibility with docker

@k8s-triage-robot

This comment was marked as outdated.

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 11, 2023
@afbjorklund
Copy link
Collaborator Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 24, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 22, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 19, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

@k8s-ci-robot k8s-ci-robot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2024
@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/runtime/containerd kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

4 participants