Code Monkey home page Code Monkey logo

Comments (4)

fzipi avatar fzipi commented on June 1, 2024

Will take a look at layers.

from modsecurity-docker.

fzipi avatar fzipi commented on June 1, 2024

Taking a look at layers, we are copying stuff that we don't need (or is way too big):

root@17ea2b25188b:/usr/local/modsecurity# find . -exec ls -lh {} \;
total 12K
drwxr-xr-x 2 root root 4.0K Nov  8 12:34 bin
drwxr-xr-x 3 root root 4.0K Nov  8 12:34 include
drwxr-xr-x 3 root root 4.0K Nov  8 12:34 lib
total 936K
-rwxr-xr-x 1 root root 933K Nov  8 12:34 modsec-rules-check
-rwxr-xr-x 1 root root 933K Nov  8 12:34 ./bin/modsec-rules-check
total 334M
-rw-r--r-- 1 root root 262M Nov  8 12:34 libmodsecurity.a
-rwxr-xr-x 1 root root 1.2K Nov  8 12:34 libmodsecurity.la
lrwxrwxrwx 1 root root   23 Nov  8 12:34 libmodsecurity.so -> libmodsecurity.so.3.0.5
lrwxrwxrwx 1 root root   23 Nov  8 12:34 libmodsecurity.so.3 -> libmodsecurity.so.3.0.5
-rwxr-xr-x 1 root root  72M Nov  8 12:34 libmodsecurity.so.3.0.5
drwxr-xr-x 2 root root 4.0K Nov  8 12:34 pkgconfig
lrwxrwxrwx 1 root root 23 Nov  8 12:34 ./lib/libmodsecurity.so -> libmodsecurity.so.3.0.5
lrwxrwxrwx 1 root root 23 Nov  8 12:34 ./lib/libmodsecurity.so.3 -> libmodsecurity.so.3.0.5
-rwxr-xr-x 1 root root 72M Nov  8 12:34 ./lib/libmodsecurity.so.3.0.5
-rwxr-xr-x 1 root root 1.2K Nov  8 12:34 ./lib/libmodsecurity.la
total 4.0K
-rw-r--r-- 1 root root 328 Nov  8 12:34 modsecurity.pc
-rw-r--r-- 1 root root 328 Nov  8 12:34 ./lib/pkgconfig/modsecurity.pc
-rw-r--r-- 1 root root 262M Nov  8 12:34 ./lib/libmodsecurity.a
total 4.0K

For nginx to work, probably the only needed thing is the .so file, we should strip it also:

-rwxr-xr-x 1 root root 2.4M Nov 15 16:02 libmodsecurity.so.3.0.5 (after stripping).

Don't know if people are debugging the container, but probably we can safely say that we can do it without major repercusions...

from modsecurity-docker.

fzipi avatar fzipi commented on June 1, 2024

With those basic changes, images gets half the size:

❯ docker images
REPOSITORY              TAG                 IMAGE ID       CREATED          SIZE
size-optimize           latest              eb5d9b6672ca   10 seconds ago   216MB
...
owasp/modsecurity-crs   nginx               f4bc5240fd88   6 days ago       572MB

from modsecurity-docker.

pythonmobile avatar pythonmobile commented on June 1, 2024

thanks

from modsecurity-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.