How to run a project build inside a docker container

I have created a docker container which has a maven wrapper. Uploaded this container to local regestry. Specified in Teamcity that the assembly will take place inside this container. But when I run the build, I see that the container has loaded and the build has started on the server with the agent installed, not inside the container.

I planned to do it like this:
1. The container is downloaded and launched.
2. The project is copied into it
3. Inside it is assembled
4. Artifact is copied
5. The container is removed

Can it be done and how?
0

Please sign in to leave a comment.