Comments (4)
Will take a look at layers.
from modsecurity-docker.
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.
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.
thanks
from modsecurity-docker.
Related Issues (20)
- docker-entrypoint.d is unused HOT 10
- Can't start the container HOT 5
- Host header modified in reverse proxy mode HOT 1
- Remove status engine call
- Unable to start container with mounted /etc/nginx/nginx.conf HOT 3
- Add support to PCRE2 in v3 HOT 1
- Reverse proxy for multiple domains possible? HOT 1
- Docker image for nginx rests on 1.20.2 HOT 3
- AccessLog and TransferLog are both enabled, preventing disabling access logs properly HOT 1
- Add support for different log formats
- Add log format definition for perflogjson HOT 5
- [modsecurity-crs-nginx] ERROLOG does not reflect REAL_IP_HEADER HOT 2
- Used nginx version is end of life HOT 2
- Add HEALTHCHECK for all images
- Remove building ssdeep and yajl libs
- Manual workflow for testing all architectures HOT 1
- SSL certificated are not loaded in Nginx image HOT 4
- nginx template has a wrong config in proxy_backend.conf.template HOT 7
- Docker image uses the root user HOT 2
- ⚠️ This repository is going to be merged into the modsecurity-crs-docker repo HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modsecurity-docker.