Docker issue - How to spin up several docker containers?
See original GitHub issueHi all,
first of all great project and appreciate all the effort and hard work to build the Juice Shop.
I want to use the Juice Shop for an internal CTF and I already got the Juice-Shop running with CTFd. I only have now one problem: How can I easily spin up several docker instances of Juice Shop that all point to a different port, e.g. 3001, 3002 and 3003. So every attendee has it’s own Juice Shop?
If I execute the following command it’s pointing to the same container, just a different port
docker run -d -p 3001:3000 -e "NODE_ENV=ctf" -e "CTF_KEY=XXX" bkimminich/juice-shop
When doing this, I cannot connect to port 3001
docker run -d -p 3001:3001 -e "NODE_ENV=ctf" -e "CTF_KEY=XXX" bkimminich/juice-shop
I was already going through the docker docs but somehow couldn’t find an answer for this.
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Spinning up and Managing Multi-container apps using Docker ...
The first step to spin up multiple containers with docker-compose is to install docker depending on the operating system you are working on....
Read more >Multi container apps - Docker Documentation
Start a new container using the nicolaka/netshoot image. Make sure to connect it to the same network. $ docker run -it --network todo-app...
Read more >How to spin up several docker containers? · Issue #386 - GitHub
I only have now one problem: How can I easily spin up several docker instances of Juice Shop that all point to a...
Read more >How to spin up multiple Docker containers with one command
First either create the images you will run or create the dockerfiles to build on the fly or have a image in mind...
Read more >How to Use Docker Compose to Run Multiple Instances of a ...
Having a fast and easy way to spin up a system configuration with multiple instances of a service saves a lot of time...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I too ran a CTF, last week in fact. For the setup I made a script that ran the needed number of instances:
When executed the script spins up 8 separate containers with ports 3000 to 3007 exposed and mapped back to port 3000 on their respective containers:
I just assigned each team/individual a specific port to use. Running docker ps shows that 8 separate containers are now running:
Hope this helps. If you wish to make sure that the CTFd flags are different make sure that you add the same CTF_KEY command to each line and then run juice-shop-ctf and import that into CTFd so that all the flags are synced and working.
This all ran on a Mac book with no issues. Docker had 8gb of ram and 4 cpu threads which was a little overkill in hind sight.
Going forwards I’m looking into being able to spin up this on a number of raspberry pi’s for use as an easily mobile ctf. I just need to figure out the whole docker swarm thing and to have different instances instead of just a single load balanced one.
This thread has been automatically locked because it has not had recent activity after it was closed. 🔒 Please open a new issue for regressions or related bugs.