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

nerdctl can run a container with same name #2284

Closed
yckaolalala opened this issue Jun 8, 2023 · 5 comments
Closed

nerdctl can run a container with same name #2284

yckaolalala opened this issue Jun 8, 2023 · 5 comments
Assignees
Labels
bug Something isn't working priority/high

Comments

@yckaolalala
Copy link

Description

nerdctl can run a container with same name .

Steps to reproduce the issue

  1. nerdctl run --name=hello --restart always -dt alpine:3.13 sleep infinity
  2. nerdctl stop hello
  3. nerdctl run --name=hello --restart always -dt alpine:3.13 sleep infinity
  4. nerdctl stop hello
FATA[0000] 1 errors:
multiple IDs found with provided prefix: hello 

Describe the results you received and expected

In docker, return error when run a container with same name

  1. docker run --name=hello --restart always -dt alpine:3.13 sleep infinity
  2. docker stop hello
  3. docker run --name=hello --restart always -dt alpine:3.13 sleep infinity
docker: Error response from daemon: Conflict. The container name "/hello" is already in use by container "84925e311c30914abd681dd835089ea17e75624448d7b9fdb120d2fb74497922". You have to remove (or rename) that container to be able to reuse that name.

What version of nerdctl are you using?

1.4.0

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

None

Host information

No response

@yckaolalala yckaolalala added the kind/unconfirmed-bug-claim Unconfirmed bug claim label Jun 8, 2023
@AkihiroSuda AkihiroSuda added bug Something isn't working and removed kind/unconfirmed-bug-claim Unconfirmed bug claim labels Jun 8, 2023
@yckaolalala
Copy link
Author

nerdctl create has same issue .

@Laitr0n
Copy link
Contributor

Laitr0n commented Jun 13, 2023

I try to resolve this one.
/assign

@Laitr0n
Copy link
Contributor

Laitr0n commented Jun 22, 2023

After PR #2308 merged, this one has been fixed.

root@39b17420f50a:~# nerdctl run --name=hello --restart always -dt alpine:3.13 sleep infinity
docker.io/library/alpine:3.13:                                                    resolved       |++++++++++++++++++++++++++++++++++++++|
index-sha256:469b6e04ee185740477efa44ed5bdd64a07bbdd6c7e5f5d169e540889597b911:    done           |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:448028a5480dcea5eae6ed1442fb85a44921c41972a405987883aee3abdaf410: done           |++++++++++++++++++++++++++++++++++++++|
config-sha256:1384a14f8577009b729eb1ef6aabe2729ae5a35e07d4d6b84a6dd9b841a818e3:   done           |++++++++++++++++++++++++++++++++++++++|
layer-sha256:25f523f0e93b2b5fa676c15d91b90f08ee4de7a160874e6c52ea452929d5a7cc:    done           |++++++++++++++++++++++++++++++++++++++|
elapsed: 9.0 s                                                                    total:  2.6 Mi (295.7 KiB/s)
f541b197536751d284ca49e2303eaddc0e5f086ffe47cceec1e394a09362c77b

root@39b17420f50a:~# nerdctl stop hello
hello

root@39b17420f50a:~# nerdctl run --name=hello --restart always -dt alpine:3.13 sleep infinity
FATA[0000] name "hello" is already used by ID "f541b197536751d284ca49e2303eaddc0e5f086ffe47cceec1e394a09362c77b"

@Laitr0n
Copy link
Contributor

Laitr0n commented Jun 22, 2023

@AkihiroSuda we could close this issue.

@AkihiroSuda
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority/high
Projects
None yet
Development

No branches or pull requests

3 participants