DIND for container testing
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Adam Štrauch 2022-02-06 01:13:45 +01:00
parent d43529fbb8
commit 8924db5712
Signed by: cx
GPG Key ID: 018304FFA8988F8D
3 changed files with 16 additions and 2 deletions

View File

@ -8,6 +8,9 @@ steps:
environment: environment:
SNAPSHOTS_S3_ENDPOINT: minio:9000 SNAPSHOTS_S3_ENDPOINT: minio:9000
TEST_S3_ENDPOINT: minio:9000 TEST_S3_ENDPOINT: minio:9000
volumes:
- name: dockersock
path: /var/run
commands: commands:
- go mod tidy - go mod tidy
- make test - make test
@ -23,6 +26,16 @@ services:
- /data - /data
- --console-address - --console-address
- :9001 - :9001
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
--- ---

View File

@ -3,7 +3,7 @@ test:
go test -v apps/*.go go test -v apps/*.go
go test -v apps/drivers/*.go go test -v apps/drivers/*.go
go test -v detector/*.go go test -v detector/*.go
# go test -v docker/*.go # Doesn't work in Drone right now go test -v docker/*.go # Doesn't work in Drone right now
build: build:
#podman run --rm --privileged -ti -v ${shell pwd}:/srv docker.io/library/golang:1.14-stretch /bin/sh -c "cd /srv && go build" #podman run --rm --privileged -ti -v ${shell pwd}:/srv docker.io/library/golang:1.14-stretch /bin/sh -c "cd /srv && go build"

View File

@ -8,7 +8,8 @@ import (
func TestGetProcesses(t *testing.T) { func TestGetProcesses(t *testing.T) {
driver := Driver{ driver := Driver{
DockerSock: "unix:///run/user/1000/podman/podman.sock", //DockerSock: "unix:///run/user/1000/podman/podman.sock",
DockerSock: "unix:///var/run/docker.sock",
BindIPHTTP: "127.0.0.1", BindIPHTTP: "127.0.0.1",
BindIPSSH: "127.0.0.1", BindIPSSH: "127.0.0.1",
} }