0

i have created a custom image of my sbt project here is the docker file

FROM hseeberger/scala-sbt:11.0.2_2.12.8_1.2.8

MAINTAINER name <email>


RUN echo "==> fetch all sbt jars from Maven repo..."       && \
    echo "==> [CAUTION] this may take several minutes!!!"  && \
    sbt publishLocal


WORKDIR /test-commons


# Define default command.
ENTRYPOINT ["sbt publishLocal"]
CMD ["sbt publishLocal"]

then i build it

docker build .

and docker ps returning

REPOSITORY                     TAG                   IMAGE ID            CREATED             SIZE
test-commons              v1                    8adba9557f57        12 minutes ago      1.05GB

and docker run test-commons:v1 is giving

docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"sbt publishLocal\": executable file not found in $PATH": unknown.
ERRO[0007] error waiting for container: context canceled 

I am a begginer in this please guide what am i missing here

swaheed
  • 3,671
  • 10
  • 42
  • 103

1 Answers1

0

Using just CMD would be sufficient, remove the redundant ENTRYPOINT statement & try -

FROM hseeberger/scala-sbt:11.0.2_2.12.8_1.2.8

MAINTAINER name <email>


RUN echo "==> fetch all sbt jars from Maven repo..."       && \
    echo "==> [CAUTION] this may take several minutes!!!"  && \
    sbt publishLocal


WORKDIR /test-commons


CMD ["sbt", "publishLocal"]
vivekyad4v
  • 13,321
  • 4
  • 55
  • 63