-
I'm trying to run an image with testcontainers that is built and loaded into the docker daemon by an external build system. At the point in time tc gets invoked, the image is already loaded into the docker daemon. To avoid polluting the image namespace of the docker daemon, I'd like to refer to the image using the 64-byte hex string of the image (e.g. However, it seems that tc (I've checked tc-java and tc-node), insists that images have a tag. So if I pass $ docker run b94d01b4929562a35cdcfe80ca0d5fca222c3fdedf224af9a079dc23157e1363:latest
Unable to find image 'b94d01b4929562a35cdcfe80ca0d5fca222c3fdedf224af9a079dc23157e1363:latest' locally
docker: Error response from daemon: invalid repository name (b94d01b4929562a35cdcfe80ca0d5fca222c3fdedf224af9a079dc23157e1363), cannot specify 64-byte hexadecimal strings.
See 'docker run --help'. tc fails with the same error message (HTTP 400 from docker daemon). Relevant if/else branch for Versioning.ANY: This lead me to dig how tc handles this when building images itself. It seems that both tc-node and tc-java generate a UUID to give the image a name: This in turn makes me suspect that this was deliberate design decision which I'm trying to understand. Any insight into this would be highly appreciated. If possible, I'd like to avoid generating arbitrary UUIDs for image identifiers since it will pollute the docker image namespace. Is there a way to do this? If this situation is accidental, would you be willing to accept a PR adding support for this? If yes, what is the process to ensure feature parity between the different language implementations? (I only care about Node, but I realize that keeping things in sync is very important). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
PR to change this on tc-node: testcontainers/testcontainers-node#663 |
Beta Was this translation helpful? Give feedback.
-
I'm having this issue randomly with testcontainers-java also. |
Beta Was this translation helpful? Give feedback.
PR to change this on tc-node: testcontainers/testcontainers-node#663