adamant-kite-43734
09/13/2023, 1:26 PMrapid-eye-50641
09/13/2023, 2:29 PMflaky-laptop-40437
09/13/2023, 3:05 PMapiVersion: v1
kind: Pod
spec:
containers:
- name: golang-1-20
image: golang:1.20
imagePullPolicy: IfNotPresent
command: [ "cat" ]
tty: true
volumeMounts:
- mountPath: /var/run/docker.sock
name: socket
env:
- name: DOCKER_HOST
value: "/var/run/docker.sock"
- name: TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE
value: "/var/run/docker.sock"
- name: GOPRIVATE
value: "<http://github.com/xyz/*|github.com/xyz/*>"
volumes:
- name: socket
hostPath:
path: /Users/pedro/.docker/docker.sock
Inside the container I run the below commands, some of this tests are using go testcontainers that will try to spin up some containers and there is when I have trouble
go mod vendor -v
go test -v -tags=integration -coverprofile=coverage.out -coverpkg=./... ./...
flaky-laptop-40437
09/13/2023, 3:06 PMflaky-laptop-40437
09/14/2023, 7:41 AMapiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
name: testcontainers
spec:
containers:
- command: [ "bash", "-c", "git clone <https://github.com/ncomet/testcontainers-go> && cd testcontainers-go && go test -v ./..." ]
image: golang:1.20
name: testcontainers
flaky-laptop-40437
09/14/2023, 8:27 AMapiVersion: v1
kind: Pod
metadata:
name: testcontainers
spec:
containers:
- command:
[
"bash",
"-c",
"git clone <https://github.com/ncomet/testcontainers-go> && cd testcontainers-go && go test -v ./...",
]
image: golang:1.20
name: testcontainers
volumeMounts:
- mountPath: /var/run/docker.sock
name: socket
env:
- name: DOCKER_HOST
value: unix:///var/run/docker.sock
- name: TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE
value: /var/run/docker.sock
volumes:
- name: socket
hostPath:
path: /run/k3s/containerd/containerd.sock
With this the error is:
error: Get "<http://%2Fvar%2Frun%2Fdocker.sock/v1.24/networks>": net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x00\x00\x06\x04\x00\x00\x0 │
│ * Are you trying to connect to a TLS-enabled daemon without TLS?: failed to create container.
flaky-laptop-40437
09/14/2023, 8:54 AMapiVersion: v1
kind: Pod
metadata:
name: testcontainers
spec:
containers:
- image: docker:20.10.12-dind
name: dind
ports:
- containerPort: 2375
securityContext:
privileged: true
env:
- name: DOCKER_TLS_CERTDIR
value: ""
- command:
[
"bash",
"-c",
"git clone <https://github.com/ncomet/testcontainers-go> && cd testcontainers-go && go test -v ./...",
]
image: golang:1.20
name: testcontainers
env:
- name: DOCKER_HOST
value: <tcp://localhost:2375>
flaky-laptop-40437
09/14/2023, 1:28 PM