Comments (3)
As per the comments in my pull request about shrinking: I've rethought our Docker strategy.
By defining "skf-labs/alpine37" we can make a common underlayer that applies to almost every container we make. This means that students will only need to "pull" that layer once, in order to build 1-N containers.
This approach means that the final container space grows a little, but in reality the storage space used will be even less than before! The big underlayers will be common/shared by all containers.
from skf-labs.
Here's a comparison between two Docker containers built with the current Dockerfiles, and two with my adjusted Dockerfiles.
Both builds have roughly 100 MB in common: the base OS plus Python3... The big difference lies in the git clone and cleanup afterwards. Lines starting with ** are what the containers have in common.
=== Original config ===
$ docker images | grep owasp-skf-lab
blabla1337/owasp-skf-lab cors d38a24f88636 4 months ago 331MB
blabla1337/owasp-skf-lab xss 00444b7ad9e2 11 days ago 338MB
$ docker history blabla1337/owasp-skf-lab:cors
IMAGE CREATED CREATED BY SIZE COMMENT
d38a24f88636 4 months ago CMD ["python3" "./CORS.py"] 0B buildkit.dockerfile.v0
<missing> 4 months ago RUN /bin/sh -c pip3 install -r requirements.… 8.09MB buildkit.dockerfile.v0
<missing> 4 months ago WORKDIR /skf-labs/CORS 0B buildkit.dockerfile.v0
<missing> 4 months ago RUN /bin/sh -c git clone https://github.com/… 221MB buildkit.dockerfile.v0
**<missing> 4 months ago RUN /bin/sh -c apk update --no-cache && apk … 97.9MB buildkit.dockerfile.v0
**<missing> 4 months ago MAINTAINER Glenn ten Cate <glenn.ten.cate@ow… 0B buildkit.dockerfile.v0
**<missing> 19 months ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
**<missing> 19 months ago /bin/sh -c #(nop) ADD file:aa17928040e31624c… 4.21MB
$ docker history blabla1337/owasp-skf-lab:xss
IMAGE CREATED CREATED BY SIZE COMMENT
00444b7ad9e2 11 days ago CMD ["python3" "./XSS.py"] 0B buildkit.dockerfile.v0
<missing> 11 days ago RUN /bin/sh -c chmod +x XSS.py # buildkit 0B buildkit.dockerfile.v0
<missing> 11 days ago RUN /bin/sh -c pip3 install -r requirements.… 8.17MB buildkit.dockerfile.v0
<missing> 11 days ago WORKDIR /skf-labs/XSS 0B buildkit.dockerfile.v0
<missing> 11 days ago RUN /bin/sh -c git clone https://github.com/… 228MB buildkit.dockerfile.v0
**<missing> 11 days ago RUN /bin/sh -c apk update --no-cache && apk … 97.9MB buildkit.dockerfile.v0
**<missing> 11 days ago MAINTAINER Glenn ten Cate <glenn.ten.cate@ow… 0B buildkit.dockerfile.v0
**<missing> 19 months ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
**<missing> 19 months ago /bin/sh -c #(nop) ADD file:aa17928040e31624c… 4.21MB
=== My proposed config ===
$ docker images | grep "skf-labs/"
skf-labs/cors latest 7e0b8fd2c881 23 minutes ago 112MB
skf-labs/xss latest d39fd0589ab2 32 minutes ago 112MB
$ docker history skf-labs/cors
IMAGE CREATED CREATED BY SIZE COMMENT
7e0b8fd2c881 27 minutes ago CMD ["python3" "./CORS.py"] 0B buildkit.dockerfile.v0
<missing> 27 minutes ago RUN /bin/sh -c find . -name "*.sh" -o -name … 850kB buildkit.dockerfile.v0
<missing> 27 minutes ago WORKDIR /skf-labs/CORS 0B buildkit.dockerfile.v0
<missing> 27 minutes ago RUN /bin/sh -c cd /tmp && mkdir /skf-labs &&… 1.69MB buildkit.dockerfile.v0
<missing> 27 minutes ago RUN /bin/sh -c wget https://raw.githubuserco… 7.1MB buildkit.dockerfile.v0
**<missing> 40 minutes ago MAINTAINER Glenn ten Cate <glenn.ten.cate@ow… 0B buildkit.dockerfile.v0
**<missing> 40 minutes ago RUN /bin/sh -c apk add dos2unix --no-cache -… 484kB buildkit.dockerfile.v0
**<missing> 45 minutes ago RUN /bin/sh -c apk update --no-cache && apk … 97.9MB buildkit.dockerfile.v0
**<missing> 45 minutes ago MAINTAINER Glenn ten Cate <glenn.ten.cate@ow… 0B buildkit.dockerfile.v0
**<missing> 19 months ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
**<missing> 19 months ago /bin/sh -c #(nop) ADD file:aa17928040e31624c… 4.21MB
$ docker history skf-labs/xss
IMAGE CREATED CREATED BY SIZE COMMENT
d39fd0589ab2 35 minutes ago CMD ["python3" "./XSS.py"] 0B buildkit.dockerfile.v0
<missing> 35 minutes ago USER www 0B buildkit.dockerfile.v0
<missing> 35 minutes ago RUN /bin/sh -c find . -name "*.sh" -o -name … 1.26MB buildkit.dockerfile.v0
<missing> 40 minutes ago WORKDIR /skf-labs/XSS 0B buildkit.dockerfile.v0
<missing> 40 minutes ago RUN /bin/sh -c cd /tmp && mkdir /skf-labs &&… 1.62MB buildkit.dockerfile.v0
<missing> 40 minutes ago RUN /bin/sh -c wget https://raw.githubuserco… 6.82MB buildkit.dockerfile.v0
**<missing> 40 minutes ago MAINTAINER Glenn ten Cate <glenn.ten.cate@ow… 0B buildkit.dockerfile.v0
**<missing> 40 minutes ago RUN /bin/sh -c apk add dos2unix --no-cache -… 484kB buildkit.dockerfile.v0
**<missing> 45 minutes ago RUN /bin/sh -c apk update --no-cache && apk … 97.9MB buildkit.dockerfile.v0
**<missing> 45 minutes ago MAINTAINER Glenn ten Cate <glenn.ten.cate@ow… 0B buildkit.dockerfile.v0
**<missing> 19 months ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
**<missing> 19 months ago /bin/sh -c #(nop) ADD file:aa17928040e31624c… 4.21MB
from skf-labs.
You have addressed this issue for most containers through your own branches and methods.
from skf-labs.
Related Issues (20)
- CORS example exploitation demo has no 'protected' page to 'exploit'
- setup datils
- Create automatic deployment pipeline for Labs release to Docker Hub images repo
- Build the Java, NodeJS Hacking OS images and push to Docker Hub repo
- Create missing Labs for total coverage of the OWASP Testing Guide project from SKF
- Review Infra labs + write-ups
- Review Java labs + write-ups
- Review NodeJS labs + write-ups
- Review Python labs + write-ups
- Hardening of the SKF Hacking OS
- Redesign of styling of the SKF Labs
- Provide linux/arm64/v8 Docker images HOT 1
- Gettong an error while installing Infra labs.
- Dark mode button is not persistent
- Redirect to home page by clicking on main icon
- Add ZAP to OS Hacking box Menu
- Fix Race file writing py
- Add new Lab for Header Injection
- Update documentation screenshots (WIP)
- Docker containers of java labs don't work
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 skf-labs.