fabric8io / docker-maven-plugin

Maven plugin for running and creating Docker images
https://dmp.fabric8.io
Apache License 2.0
1.88k stars 642 forks source link

docker:watch fails to rebuild container #1401

Open ujibang opened 3 years ago

ujibang commented 3 years ago

Description

docker:watch fails to rebuild container

Info

Server: Docker Engine - Community Engine: Version: 19.03.13 API version: 1.40 (minimum version 1.12) Go version: go1.13.15 Git commit: 4484c46d9d Built: Wed Sep 16 17:07:04 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.3.7 GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683

* If it's a bug, how to reproduce :

```bash
$ git clone https://github.com/SoftInstigate/restheart-plugin-skeleton && cd restheart-plugin-skeleton
$ git checkout e9a251c2f7177ead0f3f7cdd5b593217218e67cc
$ mvn package docker:build docker:start docker:watch -Ddocker.showLogs=true

[INFO] DOCKER> Watching mongo:4.2 using no build and no run
[INFO] DOCKER> Watching mongo:4.2 using no build and no run
[INFO] DOCKER> Watching softinstigate/microd:1.0.0-SNAPSHOT using build and run
[INFO] DOCKER> [softinstigate/microd:1.0.0-SNAPSHOT] "restheart": Watch for rebuilding and restarting
[INFO] DOCKER> Waiting ...

To trigger the container rebuild

$ touch src/main/resources/watcher.txt 

docker:watch logs the following error message and the container softinstigate/microd is not rebuilt nor restarted.

[INFO] DOCKER> [softinstigate/microd:1.0.0-SNAPSHOT] "restheart": Assembly changed. Rebuild ...
[INFO] Copying files to /Users/uji/development/restheart-plugin-skeleton/target/docker/softinstigate/microd/1.0.0-SNAPSHOT/build/maven
[INFO] Building tar: /Users/uji/development/restheart-plugin-skeleton/target/docker/softinstigate/microd/1.0.0-SNAPSHOT/tmp/docker-build.tar
[INFO] DOCKER> [softinstigate/microd:1.0.0-SNAPSHOT] "restheart": Created docker-build.tar in 24 milliseconds
[ERROR] DOCKER> [softinstigate/microd:1.0.0-SNAPSHOT] "restheart": Error when rebuilding - org.apache.maven.plugin.MojoExecutionException: Error while copying created tar to specified buildArchive path: false
OmarTrasatti commented 3 years ago

I've got the same problem.. waiting for more updates!

ujibang commented 3 years ago

maven error with -X option

[INFO] DOCKER> [softinstigate/microd:1.0.0-SNAPSHOT] "restheart": Assembly changed. Rebuild ...
[DEBUG] All known ContainerDescriptorHandler components: [file-aggregator, metaInf-services, plexus, metaInf-spring]
[DEBUG] FileSet[] dir perms: -1 file perms: -1
[DEBUG] The archive base directory is 'null'
[DEBUG] NOT reformatting any files in /Users/uji/development/restheart-plugin-skeleton
[DEBUG] Adding file-set in: /Users/uji/development/restheart-plugin-skeleton to archive location: ./
[DEBUG] Adding exclude for assembly working-directory: target/docker/softinstigate/microd/1.0.0-SNAPSHOT/work
File-Set source directory: /Users/uji/development/restheart-plugin-skeleton
[INFO] Copying files to /Users/uji/development/restheart-plugin-skeleton/target/docker/softinstigate/microd/1.0.0-SNAPSHOT/build/maven
[INFO] Building tar: /Users/uji/development/restheart-plugin-skeleton/target/docker/softinstigate/microd/1.0.0-SNAPSHOT/tmp/docker-build.tar
[DEBUG] Dockerfile already added, skipping
[INFO] DOCKER> [softinstigate/microd:1.0.0-SNAPSHOT] "restheart": Created docker-build.tar in 34 milliseconds
[ERROR] DOCKER> [softinstigate/microd:1.0.0-SNAPSHOT] "restheart": Error when rebuilding - org.apache.maven.plugin.MojoExecutionException: Error while copying created tar to specified buildArchive path: false