Skip to content

Unexpected issue running bloop in docker and using it from outside #1188

Open
@dfarrel1

Description

@dfarrel1

I'm able to bring up a docker container and I can use bloop from within the container itself if I move my entire scala project in there, but I'd like to only serve bloop from the container, expose it on the same port and use it as my server while I develop locally.

Here's what I have:

Dockerfile:

ARG BASE_IMAGE_TAG
FROM openjdk:${BASE_IMAGE_TAG:-13.0.1-jdk-oraclelinux7}
# install bloop
RUN curl -L https://github.com/scalacenter/bloop/releases/download/v1.4.0-RC1/install.py | python
ENTRYPOINT [ "/root/.bloop/bloop", "server" ]

docker-compose.yml:

  bloop:
    image: <my-bloop-image>
    container_name: bloop-container
    ports:
      - "8212:8212"

then docker-compose up bloop

and from my local machine if I curl localhost:8212 I'm getting
curl: (52) Empty reply from server both in the case that I run my docker container and in the cast that I'm just running the bloop server locally, not in docker.

Which means to me that the port is exposed, the container is up, and bloop is behaving as similarly as I can tell from a quick smoke test.

However when running bloop about against the dockerized server I get:

Server disconnected unexpectedly: [Errno 54] Connection reset by peer

Where as bloop about against a locally running server outside of docker give me:
the expected:

bloop v1.4.0-RC1

Using Scala v2.12.8 and Zinc v1.3.0-M4+32-b1accb96
Running on Java JDK v1.8.0_232 (/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre)
  -> Supports debugging user code, Java Debug Interface (JDI) is available.
Maintained by the Scala Center (Jorge Vicente Cantero, Martin Duhem)

And running bloop about from within the same container that the server is running will give me the same thing:

bloop v1.4.0-RC1

Using Scala v2.12.8 and Zinc v1.3.0-M4+32-b1accb96
Running on Java JDK v13.0.1 (/usr/java/openjdk-13)
  -> Supports debugging user code, Java Debug Interface (JDI) is available.
Maintained by the Scala Center (Jorge Vicente Cantero, Martin Duhem)

Can someone give me some guidance about what might be causing the disconnect between my container and my local bloop implementation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA defect or misbehaviour.cli

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions