2

I have a Dockerfile script:

FROM hseeberger/scala-sbt:8u222_1.3.4_2.13.1
RUN sbt assembly

But when I ran it, I got an error:

[error] Not a valid command: assembly
[error] Not a valid project ID: assembly
[error] Expected ':'
[error] Not a valid key: assembly
[error] assembly
[error]     

I have sbt-assembly plugin in my assembly.sbt file. Is it possible to build project with sbt assembly via docker? In normal way it works fine, when I use sbt assembly, the problem is with docker.

Other commands like sbt package works fine also.

Developus
  • 1,400
  • 2
  • 14
  • 50

1 Answers1

4

I solved this problem by copying files to repository and set WORKDIR. Now I can use sbt assembly:

FROM hseeberger/scala-sbt:graalvm-ce-19.3.0-java11_1.3.7_2.13.1 as build
COPY . /my-project
WORKDIR /my-project
RUN sbt assembly
Developus
  • 1,400
  • 2
  • 14
  • 50