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

Reduced container image size #5

Merged
merged 1 commit into from Oct 22, 2021
Merged

Conversation

camandel
Copy link
Contributor

Modified Dockerfile to reduce the image size:

$ docker image ls rew-sploit
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
rew-sploit   devel     e6e5b0244a0f   8 minutes ago   209MB
rew-sploit   latest    1c477a013cc2   9 days ago      1.1GB

@cecio
Copy link
Contributor

cecio commented Oct 22, 2021

Works like a charm, thanks!

Only one doubt, may be it's a problem of my env:

REPOSITORY                     TAG                  IMAGE ID       CREATED          SIZE
rew-sploit/rew-sploit          latest               372a1cfcb6a0   20 seconds ago   208MB
<none>                         <none>               71fd2c88111b   43 seconds ago   489MB
python                         3.9-slim             4b78d86983eb   10 days ago      122MB

After the build I have a dangling image (71fd2c88111b). Did you see the same?

@camandel
Copy link
Contributor Author

After the build I have a dangling image (71fd2c88111b). Did you see the same?

Yes, in a multi-stage build all intermediate images are not automatically deleted bacause they are used as cache for next builds and you have to manually delete them (as for any other dangling image).

If you have a CI/CD system (so you can't delete all cached images) you can add a label into the builder stage (like LABEL stage=builder) and then "prune" them with something like docker image prune --filter label=stage=builder

@cecio
Copy link
Contributor

cecio commented Oct 22, 2021

Great! Thanks!

@cecio cecio merged commit ae1b510 into REW-sploit:main Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants