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

Fix container with same name start #24

Merged
merged 1 commit into from
Dec 6, 2020

Conversation

sargreal
Copy link
Contributor

@sargreal sargreal commented Nov 1, 2020

The current command docker ps with filter by name might return multiple
containers. See docs:

The name filter matches on all or part of a container’s name
https://docs.docker.com/engine/reference/commandline/ps/#name

The proposed method uses container inspect with a fallback to ignore
the return code 1 and formats to only return the Id

The current command docker ps with filter by name might return multiple
containers. See docs:
> The name filter matches on all or part of a container’s name
https://docs.docker.com/engine/reference/commandline/ps/#name

The proposed method uses container inspect with a fallback to ignore
the return code 1 and formats to only return the Id
@kereis
Copy link
Owner

kereis commented Nov 2, 2020

Hey,

thank you for your contribution. It looks reasonable then to use inspect with formatting. I test it as soon as possible. 👍

@kereis kereis self-assigned this Nov 2, 2020
@kereis kereis added the type: fix Iterations on existing features or infrastructure. label Nov 2, 2020
@kereis kereis added this to the Release v1.4 milestone Nov 2, 2020
@kereis kereis self-requested a review December 6, 2020 12:09
@kereis
Copy link
Owner

kereis commented Dec 6, 2020

Sorry for the long delay. I did some local tests and as stated above, it's more reliable to use docker container inspect instead of docker ps -qaf name="".

Looks good to me. I merge it. 👍

@kereis kereis merged commit e0ae074 into kereis:develop Dec 6, 2020
@sargreal sargreal deleted the fix-container-with-same-start branch December 6, 2020 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants