Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

docker: "build" requires 1 argument : Need to escape space in path to Dockerfile #83

Closed rlecomte closed 7 years ago

rlecomte commented 8 years ago

Hi,

I encountered an issue when try to build a docker image in my gradle project :

The command "docker build /path/to/dockerfile" doesn't work well if the path contain space => each part of the path will be take like a different argument by the docker daemon.

For example i got this error message with my project name as "multibranch demo" (if a replace space by underscore, it works)

~/workspace_devops/multibranch demo [master|✔] $ gradle clean buildDocker :clean :compileJava :processResources :classes :jar :copyDeps :buildDocker FAILED

FAILURE: Build failed with an exception.

MALPI commented 8 years ago

Encountered the same error. It would be worth to mention that in a FAQ at least.

Jeskz0rd commented 7 years ago

I'm running it on Windows 2016... having the same problem.

docker : "docker build" requires exactly 1 argument(s).

davidgfolch commented 7 years ago

Same here, my projects disk is called "TOSHIBA EXT" so the comand line created is:

docker build -t gregturn/gs-spring-boot-docker:latest /media/slks/TOSHIBA EXT/Proyectos/spring/gs-spring-boot-docker/complete/build/docker the gradle/docker plugin should escape space (and other special chars in path) like this: docker build -t gregturn/gs-spring-boot-docker:latest /media/slks/TOSHIBA\ EXT/Proyectos/spring/gs-spring-boot-docker/complete/build/docker

larryboymi commented 7 years ago

Same problem with a clients' build due to space in jenkins folder name.

bjornmagnusson commented 7 years ago

Fixed in master. Some test output:

Built from folder with space (C:\repos\git\gs-spring-boot-docker space\complete) using example from spring.io(https://spring.io/guides/gs/spring-boot-docker/)

Plugin version 1.2 FAILURE: Build failed with an exception.

Plugin version 1.3-SNAPSHOT (current master) BUILD SUCCESSFUL