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

Reduce docker image size #120

Open
flaviut opened this issue Jul 26, 2018 · 1 comment
Open

Reduce docker image size #120

flaviut opened this issue Jul 26, 2018 · 1 comment

Comments

@flaviut
Copy link
Contributor

flaviut commented Jul 26, 2018

The docker image currently on the site is 2GB compressed and 4.8GB uncompressed.

As far as docker images go, this is huge. I don't have time to work on this issue myself (although I'd be happy to answer questions), but several suggestions to pare it down:

  • Use multi-stage builds to only include the files that are actually needed to run the program
  • Install only the bare minium of dependencies to run the program. What's ROS used for? Is the entirety of ROS needed here, or just 2-3 smaller components?
  • Each layer adds size to the image, and can never remove size. Therefore, only create layers on logical boundaries, and cleanup the messes you've created in the layer that you create them (e.x. delete your apt cache in same layer that you ran apt)

There's a few more good tips in this article, just ignore the snarky title :)

@flaviut flaviut changed the title Reduce docker container size Reduce docker image size Jul 26, 2018
@SyllogismRXS
Copy link
Contributor

Thanks, Flaviu. We definitely stick a lot of unnecessary "extras" into our docker image because our use case for the docker image has been continuous integration. But, I think we could use multi-stage builds to create a container for scrimmage "deployments." We'll look into it.

@wfsyre wfsyre added this to the v0.2.0 milestone Mar 3, 2025
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