Hi, this issue is created because #1110 was closed.
The code is here: https://github.com/modestukasai/spring-boot-testcontainers-docker
I have current docker file which should run gradlew build inside with docker testcontainers.
FROM docker as builder
USER root
RUN docker -v
RUN apk add --no-cache openjdk8
WORKDIR /app
COPY . .
RUN ./gradlew build -i
The problem is that docker is not started during build of docker image.
I have updated the base image to use docker image as base and install java8 on it.
I get the same result. Please see https://travis-ci.org/modestukasai/spring-boot-testcontainers-docker/builds/474334240
Thanks a lot!
Hi again, @modestukasai!
Sorry, I'm closing this one with the same message:
You need to have a running Docker daemon in your environment. Your example is incorrect - it does not communicate with Docker daemon.
But if you put RUN docker run hello-world, you will see that there is no docker running.
You code simply prints Docker client's version.
Hi #bsideup,
Yes, I understand it and I'm asking you for help in this case, because your tutorial in documentation does not tell anything about how to run this in docker build step.
https://www.testcontainers.org/usage/inside_docker.html
@modestukasai this is not an issue of Testcontainers project.
There is no docker daemon inside your build container (when you run docker build). Nothing to connect to.
Please ask a question in the Docker community, "How to run Docker commands during Dockerfile build".
AFAIK this is not possible Docker.
There might be other container tools that might allow this use case, but Testcontainers will only support Docker for the foreseeable future. While the use case is a very valid one (e.g. CI pipeline as part of the Docker multi-stage build), we can't support this, as long as Docker doesn't support it.
The linked docs describe how to use Testcontainers inside a running container, not during a docker build.
Thanks a lot #bsideup and #kiview. This is proper answer which I have expected :)
Most helpful comment
AFAIK this is not possible Docker.
There might be other container tools that might allow this use case, but Testcontainers will only support Docker for the foreseeable future. While the use case is a very valid one (e.g. CI pipeline as part of the Docker multi-stage build), we can't support this, as long as Docker doesn't support it.
The linked docs describe how to use Testcontainers inside a running container, not during a
docker build.