You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i let docker compose build the docker image, it works. But when i let testcontainers-go build it, it will say in the build logs:
---> Running in d121e0b7b558
stat /workdir/lambda/describedocument/cmd: directory not found
---> Removed intermediate container d121e0b7b558
e2e_test.go:21:
Error Trace: /Users/adamvanderveer/Documents/Projects/github.com/crewlinker/openai/e2e_test.go:95
/Users/adamvanderveer/Documents/Projects/github.com/crewlinker/openai/e2e_test.go:21
Error: Received unexpected error:
create container: build image: The command '/bin/sh -c CGO_ENABLED=0 go build -o /bin/describedocument ./lambda/describedocument/cmd' returned a non-zero code: 1
Test: TestSmoke
--- FAIL: TestSmoke (0.35s)
When i double check this, the directory ./lambda/describedocument is indeed empty when building it with testcontainers. IF i change my dockerignore to look like this (and change nothing else):
Testcontainers version
v0.35.0
Using the latest Testcontainers version?
Yes
Host OS
MacOS
Host arch
ARM
Go version
1.23.3
Docker version
Client: Version: 27.4.0 API version: 1.47 Go version: go1.22.10 Git commit: bde2b89 Built: Sat Dec 7 10:35:43 2024 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.37.2 (179585) Engine: Version: 27.4.0 API version: 1.47 (minimum version 1.24) Go version: go1.22.10 Git commit: 92a8393 Built: Sat Dec 7 10:38:33 2024 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.7.21 GitCommit: 472731909fa34bd7bc9c087e4c27943f9835f111 runc: Version: 1.1.13 GitCommit: v1.1.13-0-g58aa920 docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker info
What happened?
I'm trying to use the build feature to build docker images for my tests on-the-fly. For this there is a dockerginore file that looks like this:
There is a "main.go" in
lambda/describedocument/cmd/main.go
(content doesn't matter, could be simple hello world)I have a Dockerfile that looks like this:
I have a docker compose file that looks like this:
When i let docker compose build the docker image, it works. But when i let testcontainers-go build it, it will say in the build logs:
When i double check this, the directory ./lambda/describedocument is indeed empty when building it with testcontainers. IF i change my dockerignore to look like this (and change nothing else):
Test containers will build it correctly. So there is a difference between Docker and Testcontainers in how **/*.go is interpreted.
For completeness, this is how i'm testing it in Go:
Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered: