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

Auto-remove docker containers after run #2204

Closed
3 of 5 tasks
RixzZ opened this issue Aug 18, 2018 · 7 comments
Closed
3 of 5 tasks

Auto-remove docker containers after run #2204

RixzZ opened this issue Aug 18, 2018 · 7 comments

Comments

@RixzZ
Copy link

RixzZ commented Aug 18, 2018

Description

I'm using atom-beautify with beautysh on docker. Every time it executes, a new container is created and not autoremoved. The same container is not being used anymore, so after a few saves I end up with the same number of beautysh containers that times I saved a file.

Steps to Reproduce

  1. Add code to Atom editor (bash in my case)
  2. Run command Atom Beautify: Beautify Editor
  3. A new container is created in Docker every time but they don't remove itself after executing.

Docker have a flag '--rm' you can specify when running the container so it automatically remove itself when the task finishes. Can that be

Checklist

I have:

  • Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • Reloaded (or restarted) Atom to ensure it is not a caching issue
  • Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue
@ghost
Copy link

ghost commented Aug 18, 2018

Please follow the issue template provided. More specifically, update the original comment for this issue by adding a link to the required debug.md gist which includes debugging information that answers our most commonly asked questions. Thank you.

@probot-no-response
Copy link

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@Glavin001 Glavin001 reopened this Sep 29, 2018
@ghost
Copy link

ghost commented Sep 29, 2018

Please follow the issue template provided. More specifically, update the original comment for this issue by adding a link to the required debug.md gist which includes debugging information that answers our most commonly asked questions. Thank you.

@Glavin001
Copy link
Owner

I think the bug is in

@docker.run([
"run",
"--volume", "#{pwd}:#{workingDir}",
"--volume", "#{path.resolve('/')}:#{rootPath}",
"--workdir", workingDir,
image,
newArgs
],
Object.assign({}, options, { cmd: undefined })
)

Looks like other users have experienced this, too: https://twitter.com/lambdafu/status/987116195538141184

image

@Glavin001
Copy link
Owner

I can reproduce:

❯ docker ps --all
CONTAINER ID        IMAGE                                                 COMMAND                  CREATED                  STATUS                      PORTS               NAMES
f64baf9722a0        unibeautify/elm-format                                "elm-format --yes in…"   Less than a second ago   Exited (0) 27 seconds ago                       elated_mccarthy
265d8f5a1ad4        unibeautify/elm-format                                "elm-format --help"      Less than a second ago   Exited (0) 28 seconds ago                       epic_swirles

@Glavin001
Copy link
Owner

@RixzZ You can use the following to clean up:

docker ps --all | grep "unibeautify/" | awk '{ print $1 }' | xargs docker rm

Glavin001 added a commit that referenced this issue Sep 29, 2018
Fix #2204. Auto-remove docker containers after run.
@Glavin001
Copy link
Owner

Published fix to v0.33.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants