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

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

Open
adarshaj opened this issue Jun 16, 2020 · 3 comments
Open

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

adarshaj opened this issue Jun 16, 2020 · 3 comments
Labels

Comments

@adarshaj
Copy link

adarshaj commented Jun 16, 2020

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

  • What sbt-native-packager are you using
    DockerPlugin from sbt-native-packager version 1.7.3
  • What sbt version
    sbt version 1.3.4
  • What is your build system (e.g. Ubuntu, MacOS, Windows, Debian )
    Ubuntu 20.04
  • What package are you building (e.g. docker, rpm, ...)
    docker
  • What version has your build tool (find out with e.g. rpm --version)
    docker version outputs:
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b7f0
 Built:             Wed Mar 11 01:25:46 2020
 OS/Arch:           linux/amd64
 Experimental:      false

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

adarshaj added a commit to hackcave/sbt-native-packager-docker-issue-1348 that referenced this issue Jun 16, 2020
@muuki88 muuki88 added the docker label Aug 2, 2020
@muuki88
Copy link
Contributor

muuki88 commented Aug 2, 2020

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
Copy link
Contributor

muuki88 commented Aug 2, 2020

Does it work if you enable the JavaAppPackaging plugin?

@dwickern
Copy link
Collaborator

dwickern commented Jan 3, 2025

I just ran into this. What works is to put things in src/docker/opt/docker/. For example, src/docker/opt/docker/conf/application.conf will be copied to /opt/docker/conf/application.conf in the docker image.

What's the desired behavior here? To copy everything from src/docker into the root of the image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants