cancel
Showing results for 
Search instead for 
Did you mean: 

Why is the container not running after start?

0 Kudos
151

I am using https://sbt-native-packager.readthedocs.io/en/stable/introduction.html to build my scala application and would like the publish the application as a local docker container.

I entered the following command:

sbt docker:publishLocal  

I think, everything went fine and I've got an image generated:

docker images
REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
sapmock             0.1                 db261ab225b5        About a minute ago   664MB
<none>              <none>              0940c75d8e5a        About a minute ago   703MB
openjdk             8                   bec43387959a        10 days ago          625MB 

Why did sbt create an image <none>?

And when I run the image as a container, it stops immediately:

~/scala/sapmock$ docker run -d -p 8080:80 sapmock:0.1
91abf0e00e3a46baa78a09b9eccd3c562ae82d5b058d5e122e8927f8e7307afd

~/scala/sapmock$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                     PORTS               NAMES
91abf0e00e3a        sapmock:0.1         "/opt/docker/bin/sap…"   10 seconds ago      Exited (0) 8 seconds ago                       upbeat_brattain

~/scala/sapmock$ docker ps 
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES 

Why?

Resources can be find here: https://gitlab.com/sweetsoft/sapmock

In addition, the content of the generated docker file:

FROM openjdk:8 as stage0
WORKDIR /opt/docker
COPY opt /opt
USER root
RUN ["chmod", "-R", "u=rX,g=rX", "/opt/docker"]
RUN ["chmod", "u+x,g+x", "/opt/docker/bin/sapmock"]

FROM openjdk:8
USER root
RUN id -u demiourgos728 2> /dev/null || (( getent group 0 || groupadd -g 0 root ) && useradd --system --create-home --uid 1001 --gid 0 demiourgos728 )
WORKDIR /opt/docker
COPY --from=stage0 --chown=demiourgos728:root /opt/docker /opt/docker
EXPOSE 8080
USER 1001:0
ENTRYPOINT ["/opt/docker/bin/sapmock"]
CMD []

Accepted Solutions (0)

Answers (0)