Closed willitrace closed 1 year ago
Hi @willitrace,
I think this is not a question related to this project, but rather to the Docker project. So I will try to answer it briefly, but for more information ask there.
The simplest approach is to split the build of the image into two steps. In the first, just run the tests and in the second, build the image without running tests. This is my preferred solution.
The second approach is to use the dind
image. In that case, the dind
container exposes a url with the docker api, which you can then reference when building the image (the docker build command supports this option). There are of course some basic prerequisites, such as a shared network between those containers and setting the Testcontainers' DOCKER_HOST
variable to refer to the Docker API exposed on the dind
container. But there may be many more things to deal with, so this approach is much more tricky.
I have a valid configuration on my SpringBootTests that is successfully running on embedded PostgreSQL database. Also, running the tests through the GitHub Actions works fine, no issues.
I am using the Docker provider.
However, when I would like to build an image, I am getting the following error:
This is my
Dockerfile
content:I am not sure, but is there something special that should be configured to make the
docker build
work as expected? I was looking into Troubleshooting section without any luck to fix it. There is mentioned that the Docker provider should work inside the Docker container, however, I am not usingdocker run
butdocker build
and I cannot add volume with the socket.Support during the build would be very good!