Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests.
docker pull testcontainers/testcontainers-go
docker run -d --name testcontainers-go --restart always testcontainers/testcontainers-go:latest
podman run -d --name testcontainers-go --restart always testcontainers/testcontainers-go:latest
skopeo inspect docker://docker.io/testcontainers/testcontainers-go:latest
oras pull testcontainers/testcontainers-go:latest
docker compose up -d
services:
{{ .ServiceType }}-echo:
build:
dockerfile: echoserver.Dockerfile
environment:
FOO: "Hello, World!"
ports:
- target: 8080
published: {{ .Port_0 }}
protocol: tcp