containerd / containerd/nerdctl

Saving an local image in air gapped environment is not possible

Open
#4,764 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
10.4k
Forks
826
Avg merge
1d 23h
Merged PRs (30d)
44

Description

### Description

Saving an local image in air gapped environment is not possible, nerdctl always tries to contact the registry.
If the image is available locally, nerdctl shall not contact the registry anymore.

```
nerdctl -n k8s.io save -o C:\tmp\exportedImage.tar shsk2s.azurecr.io/example.albums-golang-win:v1.5.0 --debug
time="2026-03-02T12:05:47+01:00" level=debug msg=fetching image="shsk2s.azurecr.io/example.albums-golang-win:v1.5.0"
time="2026-03-02T12:05:47+01:00" level=debug msg=resolving host=shsk2s.azurecr.io
time="2026-03-02T12:05:47+01:00" level=debug msg="do request" host=shsk2s.azurecr.io request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=containerd/2.2.1+unknown request.method=HEAD url="https://shsk2s.azurecr.io/v2/example.albums-golang-win/manifests/v1.5.0"
time="2026-03-02T12:06:08+01:00" level=info msg="fetch failed" error="failed to do request: Head \"https://shsk2s.azurecr.io/v2/example.albums-golang-win/manifests/v1.5.0\": dial tcp 20.61.97.143:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond." host=shsk2s.azurecr.io
shsk2s.azurecr.io/example.albums-golang-win:v1.5.0: resolving |--------------------------------------|
elapsed: 21.0s total: 0.0 B (0.0 B/s)
time="2026-03-02T12:06:08+01:00" level=fatal msg="failed to resolve reference \"shsk2s.azurecr.io/example.albums-golang-win:v1.5.0\": failed to do request: Head \"https://shsk2s.azurecr.io/v2/example.albums-golang-win/manifests/v1.5.0\": dial tcp 20.61.97.143:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
```

### Steps to reproduce the issue

1. use an air gapped env
2. try to save the image

### Describe the results you received and expected

I was expecting I can save the image as file

### What version of nerdctl are you using?

2.2.1

### Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

### Host information

No

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.