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

util/os-runner: Use docker-compose to manage containers #202

Open
darius-m opened this issue Mar 17, 2023 · 3 comments
Open

util/os-runner: Use docker-compose to manage containers #202

darius-m opened this issue Mar 17, 2023 · 3 comments
Labels
area/infra Update to infrastructure / scripts kind/improve Improve / Update existing content / item

Comments

@darius-m
Copy link
Contributor

The current Makefile [removes] the container when make clean is used. This is a source of a lot of wasted time whenever someone starts the container, since apt update and apt install run every time.

The issue of changed packages could probably be avoided by using docker-compose that can monitor changes to the source Dockerfile and update the image accordingly.

@Alex-deVis Alex-deVis added area/infra Update to infrastructure / scripts kind/improve Improve / Update existing content / item labels Mar 20, 2023
@Alex-deVis
Copy link
Contributor

apt update and apt install run every time.

This is not the case because these commands only run when you are building the image. Deleting and recreating the container should not trigger the image rebuild unless there are changes in the Dockerfile / files used by the Dockerfile.

I think docker-compose is a better alternative to our comprehensive Makefile and it should be addressed. Please consider renaming the issue or adding a new one for this part only.

@darius-m
Copy link
Contributor Author

To be fair, the "run every time" was a bad description. It's more that users are inclined to run make clean to stop the container, but aside from stopping it, the the makefile also removes the container. So when they wish to start a different lab / restart their work, the container would also need to be pulled and built once more. This is partially fixed by #205, but there is still no real need to nuke the container whenever make clean runs.

I meant to link to this line - hence the square brackets around the removes in the description, but I failed to properly link it.

@darius-m
Copy link
Contributor Author

Re-reading your comment, I think you may be right in that the image itself should not be removed, so it should start immediately if the Docker file has not been changed. There may have been some issues with old versions of the Makefile, or the transition to the new Makefile / Dockerfile while still having an old docker image defined.

However, removing the container is not the usual approach when working with containers that you may need again, as far as I can tell, and in our case the stopped container should not really impact the system since it should basically not run anything that takes additional resources.

Regardless, this issue is optional at this point. You may close it if no action is planned.

@Alex-deVis Alex-deVis changed the title Do not delete container on make clean util/os-runner: Use docker-compose to manage containers Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/infra Update to infrastructure / scripts kind/improve Improve / Update existing content / item
Projects
None yet
Development

No branches or pull requests

2 participants