icy-parrot-30770
06/09/2022, 4:03 PMnerdctl -n k8s.io pull jupyter/datascience-notebook:python-3.10.4I can run this basic image :
nerdctl run -p 8888:8888 jupyter/datascience-notebook:python-3.10.4-> it works fine But if build locally a custom image based on this one :
nerdctl build --namespace k8s.io -t l_jupyter:latest .based a Dockerfile like : --------------------------- FROM jupyter/datascience-notebook:python-3.10.4 RUN pip3 install --upgrade python-dotenv --------------------------- => the image "l_jupyter:latest" is visible in the "rancher desktop"/preference/images list in the namespace k8s.io and if i try to run this custom image like this :
nerdctl run -p 8888:8888 l_jupyter:latestOR via a "jupyter.yaml" deployment file like : ---------------------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: jupyter-deployment
namespace: default
labels:
app: jupyter
spec:
replicas: 1
selector:
matchLabels:
app: jupyter
template:
metadata:
labels:
app: jupyter
spec:
containers:
- name: jupyter
image: l_jupyter:latest
imagePullPolicy: Always
....
....--------------------------- via the command :
kubectl -n default apply -f jupyter.yamlor
kubectl -n k8s.io apply -f jupyter.yamlI get the error:
Failed to pull image "l_jupyter:latest": rpc error: code = Unknown desc = Error response from daemon:
pull access denied for l_jupyter, repository does not exist or may require 'docker login': denied: requested access to the resource is deniedI do not understand from where this error come from Do you have any advice to solve it ??
fast-garage-66093
06/09/2022, 4:31 PMnerdctl run
command did not specify the <http://k8s.io|k8s.io>
namespace, so tries to locate the image in default
, where it doesn't exist. It works like this:
$ nerdctl -n <http://k8s.io|k8s.io> run -p 8888:8888 l_jupyter:latest
Entered start.sh with args: jupyter lab
Executing the command: jupyter lab
[I 2022-06-09 16:30:13.062 ServerApp] jupyterlab | extension was successfully linked.
imagePullPolicy: Always
, which tells kubelet to ignore the local image and pull a copy from dockerhub, where the repository does not exist. You need to change the policy to Never
for it to use the locally built image.icy-parrot-30770
06/09/2022, 8:39 PMfast-garage-66093
06/09/2022, 10:39 PMnerdctl -n <http://k8s.io|k8s.io> run ...
because the namespace is owned by k8s, and kubelet will eventually kill your container because it is not owned by a Pod. So if you want to run the plain container, build and run in the default
namespaceicy-parrot-30770
06/20/2022, 4:14 PM