Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

317
Visualizações
Docker Binding parse exception with testcontainers

I would like to run some integrational tests which would include setting up a complete environment with org.testcontainers Docker Compose Module. I am new to Windows and Docker testing, same with the testcontainers.

Using versions:

  • Docker desktop community: 2.5.0.0
  • org.testcontainers:testcontainers:1.15.0
  • org.springframework.boot 2.3.4.

My code looks like the following:

@ClassRule
public static DockerComposeContainer environment = new DockerComposeContainer(
                    new File("C:\\dev\\myproject\\myapp\\docker-compose\\docker-compose.env.yml"),
                    new File("C:\\dev\\myproject\\myapp\\docker-compose\\docker-compose.yml"))
                    .withExposedService("myservice_1", 9999)
                    .withLocalCompose(true);

My compose files looks something likes this.

services:
  myservice:
    image: myapp/myservice:latest
    hostname: myservice
    volumes:
    - ../volumeDir:/app/volumeDir
    - ../config:/app/config
    expose:
    - 9999
    ports:
    - 9999:9999
    command: -Dspring.liquibase.enabled=true
    networks:
    - internet

It looks like some Binding error, the most significant part of the stacktrace:

>     java.lang.RuntimeException: java.lang.RuntimeException: org.testcontainers.shaded.com.fasterxml.jackson.databind.exc.ValueInstantiationException:
> Cannot construct instance of `com.github.dockerjava.api.model.Binds`,
> problem: Error parsing Bind
> 'C:\dev\myproject\myapp\volumeDir:/app/volumeDir:rw'
>      at [Source: (org.testcontainers.shaded.okio.RealBufferedSource$1); line: 1,
> column: 1369] (through reference chain:
> com.github.dockerjava.api.command.InspectContainerResponse["HostConfig"]->com.github.dockerjava.api.model.HostConfig["Binds"])
>       at org.rnorth.ducttape.timeouts.Timeouts.callFuture(Timeouts.java:68)
>       at org.rnorth.ducttape.timeouts.Timeouts.doWithTimeout(Timeouts.java:60)
>       at org.testcontainers.containers.wait.strategy.WaitAllStrategy.waitUntilReady(WaitAllStrategy.java:53)
>     ...

I have tried to change the path to absolute without any difference. Do you have any ideas what can make this bind unparseable?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This error is due to a current issue with Testcontainers and the recent Docker for Windows version. They are already aware of it and a fix seems close to being merged.

UPDATE: Version 1.15.1 is now available that fixes this bug.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda