autochecker icon indicating copy to clipboard operation
autochecker copied to clipboard

Build Docker image from current directory

Open appden opened this issue 9 years ago • 2 comments

I have a rather large project directory due to lots of build products, which means all of those are copied into the temporary directory by copyApplicationToTempLocation(). At first glance it appears this only exists such that it excludes .git and node_modules directories by default. There's a TODO in there for this to be more language independent, so I think the best path forward is to encourage users to create their own .dockerignore file, perhaps suggesting to generate one by default if one does not yet exist.

The Dockerfile built from the template could be put into a temp file since Docker supports specifying alternative files to build from.

appden avatar Apr 26 '16 16:04 appden

Yeah, my initial implementation that copies all the files, was because I was not sure if I could specify a custom Dockerfile. According to https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#build-image-from-a-dockerfile we can use the dockerfile option to do this.

It feels like that would be much better and if someone wants to have a go at implementing it, go for it :)

If we remove the copyApplicationToTempLocation, caring about the .dockerignore is not necessary.

victorb avatar Apr 29 '16 12:04 victorb

@VictorBjelkholm Awesome, but in order to work better out of the box, I think it would be really beneficial to auto-create a .dockerignore that ignores the .git and node_modules directories, and perhaps even warn if one already exists that doesn't include those.

appden avatar May 03 '16 01:05 appden