You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sbt docker:publishLocal publishes a docker image without errors
Actual behaviour
sbt docker:publishLocal produces an error with the following variation
of src/sbt-test/docker/file-permission/changes/strategy-none.sbt:
import com.typesafe.sbt.packager.docker._
dockerPermissionStrategy := DockerPermissionStrategy.None
dockerBaseImage := "fabric8/java-centos-openjdk8-jdk"
daemonGroupGid in Docker := Some("5000")
daemonGroup in Docker := "sbt"
The generated Dockerfile is:
FROM fabric8/java-centos-openjdk8-jdk
USER root
RUN id -u demiourgos728 2> /dev/null || useradd --system --create-home --uid 1001 --gid 5000 demiourgos728
WORKDIR /opt/docker
COPY opt /opt
USER 1001
ENTRYPOINT ["/opt/docker/bin/file-permission-test"]
CMD []
Building this image fails:
sbt:file-permission-test> docker:publishLocal
[info] Wrote /opt/local/imce/github.sbt/sbt-native-packager/src/sbt-test/docker/file-permission/target/scala-2.12/file-permission-test_2.12-0.1.0.pom
[info] Main Scala API documentation to /opt/local/imce/github.sbt/sbt-native-packager/src/sbt-test/docker/file-permission/target/scala-2.12/api...
model contains 3 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /opt/local/imce/github.sbt/sbt-native-packager/src/sbt-test/docker/file-permission/target/scala-2.12/file-permission-test_2.12-0.1.0-javadoc.jar ...
[info] Done packaging.
[warn] [1] There are no exposed ports for your docker image
[warn] Configure the `dockerExposedPorts` or `dockerExposedUdpPorts` setting. E.g.
[warn]
[warn] // standard tcp ports
[warn] dockerExposedPorts ++= Seq(9000, 9001)
[warn]
[warn] // for udp ports
[warn] dockerExposedUdpPorts += 4444
[warn]
[success] All package validations passed
[info] Sending build context to Docker daemon 5.302MB
[info] Step 1/8 : FROM fabric8/java-centos-openjdk8-jdk
[info] ---> 72d5b402f7da
[info] Step 2/8 : USER root
[info] ---> Using cache
[info] ---> 43d1a14c483e
[info] Step 3/8 : RUN id -u demiourgos728 2> /dev/null || useradd --system --create-home --uid 1001 --gid 5000 demiourgos728
[info] ---> Running in d44d871df1fd
[info] useradd: group '5000' does not exist
[info] Removing intermediate container d44d871df1fd
[error] The command '/bin/sh -c id -u demiourgos728 2> /dev/null || useradd --system --create-home --uid 1001 --gid 5000 demiourgos728' returned a non-zero code: 6
[error] java.lang.RuntimeException: Nonzero exit value: 6
[error] at com.typesafe.sbt.packager.docker.DockerPlugin$.publishLocalDocker(DockerPlugin.scala:483)
[error] at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$33(DockerPlugin.scala:187)
[error] at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$33$adapted(DockerPlugin.scala:185)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:278)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[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.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (Docker / publishLocal) Nonzero exit value: 6
[error] Total time: 2 s, completed May 1, 2019 8:42:40 AM
sbt:file-permission-test>
Information
What sbt-native-packager are you using
1.3.20+2-6dced638
What sbt version
1.2.8
What is your build system (e.g. Ubuntu, MacOS, Windows, Debian )
Ubuntu
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 18.09.2, build 6247962
What is your target system (e.g. Ubuntu 16.04, CentOS 7)
fabric8/java-centos-openjdk8-jdk
The text was updated successfully, but these errors were encountered:
Expected behaviour
sbt docker:publishLocal
publishes a docker image without errorsActual behaviour
sbt docker:publishLocal
produces an error with the following variationof
src/sbt-test/docker/file-permission/changes/strategy-none.sbt
:The generated
Dockerfile
is:Building this image fails:
Information
1.3.20+2-6dced638
1.2.8
Ubuntu
docker
rpm --version
)Docker version 18.09.2, build 6247962
fabric8/java-centos-openjdk8-jdk
The text was updated successfully, but these errors were encountered: