Skip to content

[Bug]: LocalStack fails on macOS/colima with socket creation error #10528

@twam

Description

@twam

Module

LocalStack

Testcontainers version

1.21.3

Using the latest Testcontainers version?

Yes

Host OS

macOS

Host Arch

ARM

Docker version

Client: Docker Engine - Community
 Version:           28.3.2
 API version:       1.47 (downgraded from 1.51)
 Go version:        go1.24.5
 Git commit:        578ccf607d
 Built:             Wed Jul  9 12:04:02 2025
 OS/Arch:           darwin/arm64
 Context:           default

Server: Docker Engine - Community
 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:39:01 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.7.24
  GitCommit:        88bf19b2105c8b17560993bee28a01ddc2f97182
 runc:
  Version:          1.2.2
  GitCommit:        v1.2.2-0-g7cb3632
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

What happened?

I'm using colima VM on macOS with vmType vz and mountType virtiofs.

Postgres and Kafka Containers work fine, but if I try to use LocalStack I get the following error:

error while creating mount source path '/Users/XXX/.colima/docker.sock': mkdir /Users/XXX/.colima/docker.sock: operation not supported

What seems different to the other containers is, that a HostConfig with binds get passed.

Relevant log output

2025-07-24 06:49:57,754 [DEBUG] [Test worker] [o.t.s.c.g.d.c.c.AbstrDockerCmd][32]: Cmd: org.testcontainers.shaded.com.github.dockerjava.core.command.CreateContainerCmdImpl@5a187cd4[aliases=<null>,argsEscaped=<null>,attachStderr=<null>,attachStdin=<null>,attachStdout=<null>,authConfig=<null>,cmd={},domainName=<null>,entrypoint={sh,-c,while [ ! -f /testcontainers_start.sh ]; do sleep 0.1; done; /testcontainers_start.sh},env={LOCALSTACK_HOST=localhost,SERVICES=s3},exposedPorts=ExposedPorts(exposedPorts=[4566/tcp]),healthcheck=<null>,hostConfig=HostConfig(binds=[/Users/XXX/.colima/docker.sock:/var/run/docker.sock:rw,z], blkioWeight=null, blkioWeightDevice=null, blkioDeviceReadBps=null, blkioDeviceWriteBps=null, blkioDeviceReadIOps=null, blkioDeviceWriteIOps=null, memorySwappiness=null, nanoCPUs=null, capAdd=null, capDrop=null, containerIDFile=null, cpuPeriod=null, cpuRealtimePeriod=null, cpuRealtimeRuntime=null, cpuShares=null, cpuQuota=null, cpusetCpus=null, cpusetMems=null, devices=null, deviceCgroupRules=null, deviceRequests=null, diskQuota=null, dns=null, dnsOptions=null, dnsSearch=null, extraHosts=[], groupAdd=null, ipcMode=null, cgroup=null, links=[], logConfig=LogConfig(type=null, config=null), lxcConf=null, memory=null, memorySwap=null, memoryReservation=null, kernelMemory=null, networkMode=null, oomKillDisable=null, init=null, autoRemove=null, oomScoreAdj=null, portBindings={4566/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;@b97bc80}, privileged=null, publishAllPorts=null, readonlyRootfs=null, restartPolicy=null, ulimits=null, cpuCount=null, cpuPercent=null, ioMaximumIOps=null, ioMaximumBandwidth=null, volumesFrom=[], mounts=null, pidMode=null, isolation=null, securityOpts=null, storageOpt=null, cgroupParent=null, volumeDriver=null, shmSize=null, pidsLimit=null, runtime=null, tmpFs=null, utSMode=null, usernsMode=null, sysctls=null, consoleSize=null, cgroupnsMode=null),hostName=<null>,image=localstack/localstack:4.6.0,ipv4Address=<null>,ipv6Address=<null>,labels={org.testcontainers=true, org.testcontainers.lang=java, org.testcontainers.version=1.21.3, org.testcontainers.sessionId=0865347a-1a12-4c16-b463-672867b52e72},macAddress=<null>,name=<null>,networkDisabled=<null>,networkingConfig=<null>,onBuild=<null>,platform=<null>,portSpecs=<null>,shell=<null>,stdInOnce=<null>,stdinOpen=<null>,stopSignal=<null>,stopTimeout=<null>,tty=<null>,user=<null>,volumes=Volumes(volumes=[]),workingDir=<null>]
2025-07-24 06:49:57,777 [DEBUG] [Test worker] [o.t.s.c.g.d.c.c.AbstrDockerCmd][32]: Cmd: d14d9702eca98c1d148c43045107127bae95158970a8fd80e94a6aab44acde7f
2025-07-24 06:49:57,871 [ERROR] [Test worker] [t.l.6.0][542]: Could not start container
com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"error while creating mount source path '/Users/XXX/.colima/docker.sock': mkdir /Users/XXX/.colima/docker.sock: operation not supported"}

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions