-
Notifications
You must be signed in to change notification settings - Fork 34
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
Split Dockerfile in two stages: builder and runtime. #31
base: main
Are you sure you want to change the base?
Conversation
…he size of the final image. This is because the build dependencies, which are not required in the final image, are excluded. You can create tags for each stage separately using the `--target` option: ```bash docker build --target builder -t pyceres:builder . docker build --target runtime -t pyceres:runtime . ``` However, if you run the `docker build` command without the `--target` option, it will build up to the last stage defined in the Dockerfile. So, running: ```bash docker build -t pyceres:latest . ``` is equivalent to specifying `--target runtime`, as runtime is the final stage in the Dockerfile.
I've removed the dependency on COLMAP - is the Docker size still an issue? |
If I do Which seems weird because it has a lot less dependencies. I guess you don't need the cuda image anymore: I would still recommend doing the builder/runtime split, since it is not really needed all the |
I quickly updated this PR locally, using regular ubuntu image and I get:
edit: I added some runtime libraries |
By dividing the Dockerfile into two stages, we significantly reduce the size of the final image. This is because the build dependencies, which are not required in the final image, are excluded.
You can create tags for each stage separately using the
--target
option:However, if you run the
docker build
command without the--target
option, it will build up to the last stage defined in the Dockerfile. So, running:docker build -t pyceres:latest .
is equivalent to specifying
--target runtime
, as runtime is the final stage in the Dockerfile.Reduction in size: