Giter VIP home page Giter VIP logo

Comments (12)

Docteur-RS avatar Docteur-RS commented on June 3, 2024

Ok I found my error... Using the Dockerfile directly does NOT mount the docker socket (DOOD) resulting in the container not having access to the docker server and the above crash.

from dagda.

Docteur-RS avatar Docteur-RS commented on June 3, 2024

To connect to my own mongoDB I updated the docker-compose from :

version: '2'
services:
  dagda:
    build: .
    image: 3grander/dagda:0.8.0
    container_name: dagda
    networks:
      - mdb
    entrypoint: python dagda.py start -s 0.0.0.0 -p 5000 -m 192.168.99.100 -mp 27017
    ports:
      - "5000:5000"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /tmp:/tmp
    depends_on:
      - vulndb
  vulndb:
    image: mongo
    container_name: vulndb
    networks:
      - mdb
    ports:
      - "27017:27017"
    volumes:
      - ./db:/data/db
networks:
  mdb:
    external: false

to

version: '2'
services:
  dagda:
    build: .
    image: 3grander/dagda:0.8.0
    container_name: dagda
    networks:
      - mdb
    entrypoint: python dagda.py start -s 0.0.0.0 -p 5000 -m 192.168.99.100 -mp 27017
    ports:
      - "5000:5000"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /tmp:/tmp
networks:
  mdb:
    external: false

Now that the docker socket is mounted I don't have errors anymore :-)

BUT to interact with the container I must do the exports myself in the following manner :
docker exec -it 3e49abbfd862 /bin/sh -c "export DAGDA_HOST='192.168.99.100' && export DAGDA_PORT=5000 && python3 dagda.py docker images"

Am I using it wrong ? It feels weird to have to do the exports in the command line itself.

from dagda.

eliasgranderubio avatar eliasgranderubio commented on June 3, 2024

If you use docker-compose for running Dagda, the best option would be to use the REST API from your host.

Anyway, if you prefer running Dagda CLI within docker container, try to avoid "-c", I mean, run:

~$ docker exec -it 3e49abbfd862 /bin/sh 

When you are in this point, only must export the variables once and you could run all Dagda commands without export these variables again.

from dagda.

Docteur-RS avatar Docteur-RS commented on June 3, 2024

I get what you mean.
Unfortunatly logging into the container is not the simplest thing to accomplish when scripting the scans, getting history etc...

I find it a bit disappointing that the CLI is kind of unreachable easily when using docker-compose :-)

Thanks for your help, I guess I'll use the REST API then.

from dagda.

MssDlcrz avatar MssDlcrz commented on June 3, 2024

Hi, when I run the dagda Image in docker-compose, it automatically exists. What should be the problem?

I cloned the project, build it as docker Image, then when I try to run it as docker-comose this happens,

Screen Shot 2019-12-02 at 3 08 08 PM

from dagda.

Docteur-RS avatar Docteur-RS commented on June 3, 2024

@moisesdelacruz301997 Hi. Can you show your Dockerfile ?

from dagda.

MssDlcrz avatar MssDlcrz commented on June 3, 2024

Hi @Docteur-RS,

Sorry I forgot to attach this.

Screen Shot 2019-12-02 at 4 56 45 PM

from dagda.

Docteur-RS avatar Docteur-RS commented on June 3, 2024

@moisesdelacruz301997 My bad, I meant the docker-compose file.

from dagda.

MssDlcrz avatar MssDlcrz commented on June 3, 2024

docker-compose.yml

Screen Shot 2019-12-02 at 5 08 00 PM

from dagda.

MssDlcrz avatar MssDlcrz commented on June 3, 2024

Hi, the issue above is not happening anymore, I resolved the issue by re-cloning the project.

But now I'm having a new issue whenever I start the server.

This is the error that is displaying.

Screen Shot 2019-12-02 at 5 14 21 PM

from dagda.

MssDlcrz avatar MssDlcrz commented on June 3, 2024

Hi @Docteur-RS ,
Re-cloning the project fixed my issue here.
Thanks a lot for your effort to investigate my issue.

from dagda.

Docteur-RS avatar Docteur-RS commented on June 3, 2024

@moisesdelacruz301997 Haha no problem.
If all problems on earth could be solved by re-cloning that would be wonderfull !

from dagda.

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.