Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker #43

Closed
0xdevalias opened this issue Mar 19, 2017 · 7 comments
Closed

Docker #43

0xdevalias opened this issue Mar 19, 2017 · 7 comments

Comments

@0xdevalias
Copy link
Contributor

Was just wondering, if I knocked together a quick little Dockerfile and maybe a run script or two, would you be open to merging it?

@OJ
Copy link
Owner

OJ commented Mar 22, 2017

I'd be open to it, depending on the container and what it intends to do. I know a few people have their own implementations of it as well, so perhaps you'll get some commentary from them along the way.

@0xdevalias
Copy link
Contributor Author

0xdevalias commented Apr 9, 2017

Probably use FROM golang, maybe from alpine. And then I was thinking it might make sense to use the new multi-build stages coming in 17.0.5 to separate the compile/run steps, and end up with just the compiled binary:

Something akin to:

So maybe something like (untested)..

FROM golang:alpine

COPY . /gobuster
WORKDIR /gobuster

RUN go build main.go

FROM scratch

COPY --from=0 /gobuster/gobuster /gobuster

CMD ["gobuster"]

That said, the onbuild version works as an ok one liner at the moment too:

FROM golang:onbuild

@0xdevalias
Copy link
Contributor Author

Decided to hack this together today (finally). Multi-stage build, staticly linked, stripped, packed, FROM scratch:

Leaves us with a ~1.35mb docker container:

Can run like:

docker run --rm -v "/Users/foo/sec/seclists:/seclists" devalias/gobuster -w /seclists/Discovery/Web_Content/common.txt -u http://example.com/

DockerHub isn't yet running the latest docker, so multi stage automated builds are broken for now, but that should be updated within the month. For now just manually built/pushed:

Currently sitting on a branch on my fork. Was thinking of figuring out how I could have it build both alpine and scratch images automagically, and wait for automated build to land on dockerhub, though can send a PR if desired:

@OJ
Copy link
Owner

OJ commented Aug 16, 2017

Thanks mate this looks great! I'll dive into it a bit more later on. Thanks for the effort 👍

@0xdevalias
Copy link
Contributor Author

Sounds good :)

@0xdevalias
Copy link
Contributor Author

0xdevalias commented Oct 5, 2017

So I think i've decided that maintaining the dockerfile separate to the main repo will end up a better experience for updates/etc.

Created https://github.com/0xdevalias/docker-gobuster with my latest iterations. At some point will work it a bit better to provide tagged versions rather than just 'latest' (once I figure how that works)

Would be happy to have it linked up as a 'semi-official' type docker image if you'd be keen.

@firefart
Copy link
Collaborator

a dockerfile was already added to the repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants