sbt / sbt-native-packager

sbt Native Packager
https://sbt-native-packager.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
1.6k stars 441 forks source link

Non empty src/docker folder fails to build with docker #1348

Open adarshaj opened 4 years ago

adarshaj commented 4 years ago

Expected behaviour

sbt docker:publishLocal should work with a source code which has some files under src/docker path

Actual behaviour

sbt docker:publishLocal fails with the following error:

[info] Step 5/15 : COPY opt /opt
[error] COPY failed: stat /var/lib/docker/tmp/docker-builder390126844/opt: no such file or directory                                 
[error] java.lang.RuntimeException: Nonzero exit value: 1
[error]         at com.typesafe.sbt.packager.docker.DockerPlugin$.publishLocalDocker(DockerPlugin.scala:622)
[error]         at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$53(DockerPlugin.scala:250)
[error]         at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$53$adapted(DockerPlugin.scala:242)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error]         at sbt.Execute.work(Execute.scala:290)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]         at java.base/java.lang.Thread.run(Thread.java:834)
[error] (Docker / publishLocal) Nonzero exit value: 1

Information

Server: Docker Engine - Community Engine: Version: 19.03.8 API version: 1.40 (minimum version 1.12) Go version: go1.12.17 Git commit: afacb8b7f0 Built: Wed Mar 11 01:24:19 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.13 GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683


- What is your target system (e.g. Ubuntu 16.04, CentOS 7)
   Ubuntu 20.04

Added a simple reproduction at https://github.com/hackcave/sbt-native-packager-docker-issue-1348
muuki88 commented 4 years ago

Thanks for the test repository and the detailed bug description and sorry for the late reply @adarshaj

If you have time I'll give you all support to fix this issue 😊

muuki88 commented 4 years ago

Does it work if you enable the JavaAppPackaging plugin?