Running 'docker ps' under an Azure ACI context fails
Description
Running 'docker ps' under an Azure ACI context fails. It works for other commands where the exact container ID is needed like 'docker exec' or 'docker logs'.
Steps to reproduce the issue:
- 'docker login azure --tenant-id XXX'
- 'docker context create aci MyAciContext --subscription-id XXX --resource-group MyRg'
- 'docker ps'
Describe the results you received:
$ docker ps
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11ba877]
goroutine 1 [running]:
github.com/docker/compose-cli/aci/convert.ContainerGroupToContainer(0xc0009bee20, 0x1c, 0xc00068bc20, 0x0, 0xc00068bd40, 0xc000916410, 0xc000916420, 0xc000916430, 0xc0002467d0, 0x0, ...)
github.com/docker/compose-cli/aci/convert/convert.go:354 +0x1d7
github.com/docker/compose-cli/aci.(*aciContainerService).List(0xc0000aefc0, 0x2c07168, 0xc000927e60, 0x0, 0x0, 0x7fede777b868, 0x28, 0x413ad3, 0x28060e0)
github.com/docker/compose-cli/aci/containers.go:66 +0x3b5
github.com/docker/compose-cli/cli/cmd.runPs(0x2c07168, 0xc000927e60, 0x0, 0x0, 0x0, 0x0, 0x0)
github.com/docker/compose-cli/cli/cmd/ps.go:79 +0xfb
github.com/docker/compose-cli/cli/cmd.PsCommand.func1(0xc0001aea00, 0x3d96530, 0x0, 0x0, 0x0, 0x0)
github.com/docker/compose-cli/cli/cmd/ps.go:49 +0x6b
github.com/spf13/cobra.(*Command).execute(0xc0001aea00, 0xc00003a030, 0x0, 0x0, 0xc0001aea00, 0xc00003a030)
github.com/spf13/[email protected]/command.go:856 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc000699180, 0xc00099fe10, 0x1, 0x1)
github.com/spf13/[email protected]/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
github.com/spf13/[email protected]/command.go:895
main.main()
github.com/docker/compose-cli/cli/main.go:249 +0xaa7
Describe the results you expected: According to Deploying Docker containers on Azure I should see my Container Instances and Containers.
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker-compose --version:
docker-compose version 1.29.2, build 5becea4c
Output of docker version:
Docker version 20.10.10, build b485636
Output of docker context show:
You can also run docker context inspect context-name to give us more details but don't forget to remove sensitive content.
$ docker context show
MyAciContext
$ docker context inspect MyAciContext
[
{
"Name": "MyAciContext",
"Metadata": {
"Description": "MyRG@westeurope",
"Type": "aci"
},
"Endpoints": {
"aci": {
"Location": "westeurope",
"ResourceGroup": "MyRG",
"SubscriptionID": "XXX"
},
"docker": {
"SkipTLSVerify": false
}
},
"TLSMaterial": {},
"Storage": {
"MetadataPath": "/home/user/.docker/contexts/meta/XXX",
"TLSPath": "/home/user/.docker/contexts/tls/XXX"
}
}
]
Output of docker info:
Command "info" not available in current context (MyAciContext), you can use the "default" context to run this command
Additional environment details (AWS ECS, Azure ACI, local, etc.): Azure ACI
Nobody responded to this?
Got the same trouble today...
same issue here,
docker-compose --version:
docker-compose version 1.29.2, build 5becea4c
docker version:
Client:
Cloud integration: v1.0.22
Version: 20.10.12
API version: 1.41
Go version: go1.16.12
Git commit: e91ed57
Built: Mon Dec 13 11:44:07 2021
OS/Arch: windows/amd64
Context: aci
Experimental: true
Server: Docker Desktop 4.5.1 (74721)
Engine:
Version: 20.10.12
API version: 1.41 (minimum version 1.12)
Go version: go1.16.12
Git commit: 459d0df
Built: Mon Dec 13 11:43:56 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.12
GitCommit: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
upon further investigation this occurs when a container is using secureValue environment variables where the referenced value is not set, see:
https://github.com/docker/compose-cli/blob/main/aci/convert/convert.go#L354
@gtardif
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it had not recent activity during the stale period.