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 build: ensure a Dockerfile exists in src directory #2319

Closed
outrunthewolf opened this issue Oct 21, 2013 · 5 comments · Fixed by #2984
Closed

docker build: ensure a Dockerfile exists in src directory #2319

outrunthewolf opened this issue Oct 21, 2013 · 5 comments · Fixed by #2984

Comments

@outrunthewolf
Copy link

Its possible for Docker to tar up entire directories when there is no Dockerfile present and send to the daemon.

For example, running this command in /home

docker build -t test .

Will tar up the entire directory and try and pipe that.

There's some concern a mistake made, could tie up a lot of system resources, fill up /tmp, or completely tie up the daemon.

fyi @SvenDowideit

@SvenDowideit
Copy link
Contributor

I think @peterbraden 's patch for #2112 could be refactored to include testing for Dockerfile (shame that pushes that test from the daemon to the cli) - avoiding the unintentional DOS / mass IO.

this still won't mitigate the risks fully, taring up the entire filesystem and tossing it over the pipe probably needs to be chunked if it were intentional

@crosbymichael
Copy link
Contributor

@outrunthewolf

Even if the CLI did check for an existing Dockerfile before uploading the build context that will not help if you place a Dockerfile in your root / and try to do a docker build.

What do you think the appropriate fix should be?

@unclejack
Copy link
Contributor

@crosbymichael Perhaps we should disallow the use of / as the source directory, even if there's a Dockerfile? We'd check if / is the source directory and error out if it i; if it's not, then we can just check if there's a Dockerfile in that directory.

What do you think?

@outrunthewolf
Copy link
Author

You could still tar up any other directory by accident with that solution.

A stupid question cos i'm not 100% clued up on everything. Why would I want to be able to specify a directory without a Docker file in it?

@unclejack
Copy link
Contributor

@outrunthewolf Those two checks (verify that we're not using / and look for a Dockerfile first) would also help avoid uploading directories without a Dockerfile.

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

Successfully merging a pull request may close this issue.

4 participants