containerd / containerd/nerdctl

compose cp fails by default on lima

Open
#3,848 3 comments 0 reactions 0 assignees View on GitHub
area/compose area/rootless bug
Dominant language
Go
Stars
10.4k
Forks
826
Avg merge
1d 23h
Merged PRs (30d)
44

Description

### Description

Two problems

1. `address` in `globaloptions` is not updated:https://github.com/containerd/nerdctl/blob/main/cmd/nerdctl/compose/compose_cp.go#L74-L91C32

However, `globaloptions` is passed as-is to compose `new client`, which is then using the (wrong) `globaloptions.Address`:

https://github.com/containerd/nerdctl/blob/main/pkg/cmd/compose/compose.go#L49

2. `compose cp` does _not_ nsenter

However, `getAddrHash` is not safe to use _before that_, as it will eval symlinks that may not be there (`/run/containerd` is not there in the default lima setup):
https://github.com/containerd/nerdctl/blob/300a705e8b73c0919174a14a1fd1cb77ec2c45cb/pkg/clientutil/client.go#L106

Though point 1 is just a logic flaw, point 2 is definitely preventing `compose cp` from working right now on default lima install.

Suggestion is to remove locking on `compose cp` - indeed, the lock in that case is not really critical, as cp at this point should be safe to use.

We should also reconsider getAddrHash in light of that.

### Steps to reproduce the issue

_No response_

### Describe the results you received and expected

na

### What version of nerdctl are you using?

main

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

None

### Host information

_No response_

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.